From c02565eaa898ad17a5cd788d56c424d952e4b67e Mon Sep 17 00:00:00 2001 From: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com> Date: Tue, 16 Sep 2025 17:39:03 -0700 Subject: [PATCH] Enforce `node:` schema for builtins, import extensions --- .eslintignore | 1 + .eslintrc.js | 8 + .gitignore | 1 + .prettierignore | 1 + .storybook/main.ts | 37 +- app/EmojiService.ts | 6 +- app/OptionalResourceService.ts | 12 +- app/PreventDisplaySleepService.ts | 2 +- app/SystemTrayService.ts | 4 +- app/SystemTraySettingCache.ts | 10 +- app/WindowsNotifications.ts | 8 +- app/attachment_channel.ts | 36 +- app/attachments.ts | 18 +- app/base_config.ts | 6 +- app/config.ts | 6 +- app/crashReports.ts | 14 +- app/dns-fallback.ts | 12 +- app/ephemeral_config.ts | 4 +- app/global_errors.ts | 10 +- app/locale.ts | 17 +- app/main.ts | 144 ++--- app/menu.ts | 4 +- app/permissions.ts | 4 +- app/protocol_filter.ts | 8 +- app/spell_check.ts | 14 +- app/sql_channel.ts | 6 +- app/startup_config.ts | 4 +- app/updateDefaultSession.ts | 8 +- app/user_config.ts | 10 +- build/intl-linter/linter.ts | 26 +- build/intl-linter/rules/icuPrefix.ts | 2 +- build/intl-linter/rules/noLegacyVariables.ts | 2 +- build/intl-linter/rules/noNestedChoice.ts | 4 +- build/intl-linter/rules/noOffset.ts | 2 +- build/intl-linter/rules/noOneChoice.ts | 2 +- build/intl-linter/rules/noOrdinal.ts | 2 +- build/intl-linter/rules/onePlural.ts | 2 +- build/intl-linter/rules/pluralPound.ts | 2 +- build/intl-linter/rules/wrapEmoji.ts | 2 +- build/intl-linter/utils/rule.ts | 4 +- package.json | 4 +- pnpm-lock.yaml | 576 +++++++++++++++--- scripts/esbuild.js | 38 +- scripts/generate-acknowledgments.js | 6 +- scripts/prepare_adhoc_build.js | 6 +- scripts/prepare_alpha_build.js | 4 +- scripts/prepare_axolotl_build.js | 4 +- scripts/prepare_beta_build.js | 4 +- scripts/prepare_staging_build.js | 4 +- scripts/prepare_tagged_version.js | 6 +- ts/AttachmentCrypto.ts | 55 +- ts/Bytes.ts | 2 +- ts/CI.ts | 28 +- ts/CI/benchmarkConversationOpen.ts | 28 +- ts/ConversationController.ts | 64 +- ts/Crypto.ts | 22 +- ts/Curve.ts | 8 +- ts/IdleDetector.ts | 6 +- ts/LibSignalStores.ts | 10 +- ts/RemoteConfig.ts | 20 +- ts/SignalProtocolStore.ts | 50 +- ts/Timers.ts | 2 +- ts/axo/AriaClickable.stories.tsx | 6 +- ts/axo/AriaClickable.tsx | 4 +- ts/axo/AxoButton.stories.tsx | 4 +- ts/axo/AxoButton.tsx | 8 +- ts/axo/AxoCheckbox.stories.tsx | 4 +- ts/axo/AxoCheckbox.tsx | 4 +- ts/axo/AxoContextMenu.stories.tsx | 4 +- ts/axo/AxoContextMenu.tsx | 6 +- ts/axo/AxoDropdownMenu.stories.tsx | 6 +- ts/axo/AxoDropdownMenu.tsx | 6 +- ts/axo/AxoSelect.stories.tsx | 4 +- ts/axo/AxoSelect.tsx | 8 +- ts/axo/AxoSwitch.stories.tsx | 4 +- ts/axo/AxoSwitch.tsx | 4 +- ts/axo/AxoSymbol.stories.tsx | 10 +- ts/axo/AxoSymbol.tsx | 4 +- ts/axo/_internal/AxoBaseMenu.tsx | 4 +- ts/background.ts | 295 ++++----- ts/badges/BadgeCategory.ts | 2 +- ts/badges/BadgeImageTheme.ts | 2 +- ts/badges/badgeImageFileDownloader.ts | 10 +- ts/badges/getBadgeImageFileLocalPath.ts | 4 +- ts/badges/isBadgeImageFileUrlValid.ts | 2 +- ts/badges/isBadgeVisible.ts | 2 +- ts/badges/parseBadgesFromServer.ts | 14 +- ts/badges/types.ts | 4 +- ts/calling/VideoSupport.ts | 2 +- ts/calling/useGetCallingFrameBuffer.ts | 2 +- ts/challenge.ts | 25 +- ts/components/About.stories.tsx | 6 +- ts/components/About.tsx | 4 +- .../AddGroupMemberErrorDialog.stories.tsx | 4 +- ts/components/AddGroupMemberErrorDialog.tsx | 6 +- .../AddUserToAnotherGroupModal.stories.tsx | 6 +- ts/components/AddUserToAnotherGroupModal.tsx | 28 +- ts/components/Alert.stories.tsx | 4 +- ts/components/Alert.tsx | 8 +- ts/components/AnimatedEmojiGalore.stories.tsx | 4 +- ts/components/AnimatedEmojiGalore.tsx | 8 +- .../AnnouncementsOnlyGroupBanner.tsx | 10 +- ts/components/App.tsx | 16 +- ts/components/AutoSizeInput.stories.tsx | 4 +- ts/components/AutoSizeInput.tsx | 2 +- ts/components/AutoSizeTextArea.tsx | 6 +- ts/components/Avatar.stories.tsx | 14 +- ts/components/Avatar.tsx | 28 +- ts/components/AvatarColorPicker.stories.tsx | 6 +- ts/components/AvatarColorPicker.tsx | 8 +- ts/components/AvatarEditor.stories.tsx | 10 +- ts/components/AvatarEditor.tsx | 28 +- ts/components/AvatarIconEditor.stories.tsx | 10 +- ts/components/AvatarIconEditor.tsx | 14 +- ts/components/AvatarLightbox.stories.tsx | 8 +- ts/components/AvatarLightbox.tsx | 8 +- ts/components/AvatarModalButtons.stories.tsx | 4 +- ts/components/AvatarModalButtons.tsx | 8 +- ts/components/AvatarPreview.stories.tsx | 6 +- ts/components/AvatarPreview.tsx | 16 +- ts/components/AvatarSpacer.tsx | 2 +- ts/components/AvatarTextEditor.stories.tsx | 6 +- ts/components/AvatarTextEditor.tsx | 20 +- ts/components/AvatarUploadButton.stories.tsx | 4 +- ts/components/AvatarUploadButton.tsx | 4 +- .../BackfillFailureModal.stories.tsx | 6 +- ts/components/BackfillFailureModal.tsx | 8 +- ...pMediaDownloadCancelConfirmationDialog.tsx | 6 +- .../BackupMediaDownloadProgress.stories.tsx | 6 +- ts/components/BackupMediaDownloadProgress.tsx | 14 +- .../BackupMediaDownloadProgressSettings.tsx | 12 +- ts/components/BadgeCarouselIndex.tsx | 2 +- ts/components/BadgeDescription.stories.tsx | 4 +- ts/components/BadgeDescription.tsx | 2 +- ts/components/BadgeDialog.stories.tsx | 10 +- ts/components/BadgeDialog.tsx | 20 +- ts/components/BadgeImage.tsx | 8 +- .../BadgeSustainerInstructionsDialog.tsx | 4 +- ts/components/BetterAvatar.stories.tsx | 10 +- ts/components/BetterAvatar.tsx | 10 +- ts/components/BetterAvatarBubble.stories.tsx | 6 +- ts/components/BetterAvatarBubble.tsx | 4 +- ts/components/BrandedQRCode.stories.tsx | 4 +- ts/components/Button.stories.tsx | 4 +- ts/components/Button.tsx | 6 +- .../CallLinkAddNameModal.stories.tsx | 8 +- ts/components/CallLinkAddNameModal.tsx | 14 +- ts/components/CallLinkDetails.stories.tsx | 10 +- ts/components/CallLinkDetails.tsx | 38 +- ts/components/CallLinkEditModal.stories.tsx | 8 +- ts/components/CallLinkEditModal.tsx | 19 +- ...allLinkPendingParticipantModal.stories.tsx | 8 +- .../CallLinkPendingParticipantModal.tsx | 22 +- ts/components/CallLinkRestrictionsSelect.tsx | 6 +- ts/components/CallManager.stories.tsx | 28 +- ts/components/CallManager.tsx | 56 +- .../CallNeedPermissionScreen.stories.tsx | 8 +- ts/components/CallNeedPermissionScreen.tsx | 12 +- ts/components/CallParticipantCount.tsx | 4 +- ts/components/CallReactionBurst.tsx | 4 +- ts/components/CallReactionBurstEmoji.tsx | 4 +- ts/components/CallScreen.stories.tsx | 32 +- ts/components/CallScreen.tsx | 90 +-- .../CallingAdhocCallInfo.stories.tsx | 16 +- ts/components/CallingAdhocCallInfo.tsx | 32 +- .../CallingAudioIndicator.stories.tsx | 8 +- ts/components/CallingAudioIndicator.tsx | 4 +- ts/components/CallingButton.stories.tsx | 6 +- ts/components/CallingButton.tsx | 8 +- .../CallingDeviceSelection.stories.tsx | 4 +- ts/components/CallingDeviceSelection.tsx | 14 +- ts/components/CallingHeader.stories.tsx | 6 +- ts/components/CallingHeader.tsx | 10 +- ts/components/CallingLobby.stories.tsx | 18 +- ts/components/CallingLobby.tsx | 38 +- ts/components/CallingLobbyJoinButton.tsx | 6 +- .../CallingParticipantsList.stories.tsx | 8 +- ts/components/CallingParticipantsList.tsx | 18 +- .../CallingPendingParticipants.stories.tsx | 6 +- ts/components/CallingPendingParticipants.tsx | 30 +- ts/components/CallingPip.stories.tsx | 24 +- ts/components/CallingPip.tsx | 33 +- ts/components/CallingPipRemoteVideo.tsx | 38 +- ts/components/CallingPreCallInfo.stories.tsx | 16 +- ts/components/CallingPreCallInfo.tsx | 14 +- .../CallingRaisedHandsList.stories.tsx | 10 +- ts/components/CallingRaisedHandsList.tsx | 22 +- ...CallingScreenSharingController.stories.tsx | 6 +- .../CallingScreenSharingController.tsx | 6 +- ...ngSelectPresentingSourcesModal.stories.tsx | 4 +- .../CallingSelectPresentingSourcesModal.tsx | 12 +- ts/components/CallingToast.tsx | 10 +- ts/components/CallingToastManager.tsx | 25 +- ts/components/CallsList.tsx | 64 +- ts/components/CallsNewCallButton.tsx | 28 +- ts/components/CallsTab.tsx | 32 +- ts/components/CaptchaDialog.stories.tsx | 6 +- ts/components/CaptchaDialog.tsx | 8 +- ts/components/ChatColorPicker.stories.tsx | 6 +- ts/components/ChatColorPicker.tsx | 25 +- ts/components/ChatsTab.stories.tsx | 6 +- ts/components/ChatsTab.tsx | 10 +- ts/components/Checkbox.stories.tsx | 4 +- ts/components/Checkbox.tsx | 2 +- ts/components/CircleCheckbox.stories.tsx | 4 +- ts/components/CircleCheckbox.tsx | 4 +- ts/components/ClearingData.stories.tsx | 4 +- ts/components/ClearingData.tsx | 8 +- ts/components/CollidingAvatars.stories.tsx | 8 +- ts/components/CollidingAvatars.tsx | 6 +- ts/components/CompositionArea.stories.tsx | 22 +- ts/components/CompositionArea.tsx | 122 ++-- ts/components/CompositionInput.stories.tsx | 12 +- ts/components/CompositionInput.tsx | 81 +-- .../CompositionRecording.stories.tsx | 4 +- ts/components/CompositionRecording.tsx | 22 +- .../CompositionRecordingDraft.stories.tsx | 4 +- ts/components/CompositionRecordingDraft.tsx | 16 +- ts/components/CompositionTextArea.tsx | 32 +- ts/components/CompositionUpload.tsx | 8 +- .../ConfirmDiscardDialog.stories.tsx | 4 +- ts/components/ConfirmDiscardDialog.tsx | 4 +- ts/components/ConfirmLeaveCallModal.tsx | 6 +- ts/components/ConfirmationDialog.stories.tsx | 4 +- ts/components/ConfirmationDialog.tsx | 14 +- ts/components/ContactPill.tsx | 8 +- ts/components/ContactPills.stories.tsx | 10 +- ts/components/ContactPills.tsx | 4 +- ts/components/ContextMenu.stories.tsx | 4 +- ts/components/ContextMenu.tsx | 10 +- ts/components/ConversationList.stories.tsx | 20 +- ts/components/ConversationList.tsx | 54 +- ts/components/CountryCodeSelect.stories.tsx | 6 +- ts/components/CountryCodeSelect.tsx | 8 +- ts/components/CrashReportDialog.stories.tsx | 6 +- ts/components/CrashReportDialog.tsx | 8 +- .../CriticalIdlePrimaryDeviceDialog.tsx | 8 +- ...CriticalIdlePrimaryDeviceModal.stories.tsx | 2 +- .../CriticalIdlePrimaryDeviceModal.tsx | 10 +- ts/components/CustomColorEditor.stories.tsx | 4 +- ts/components/CustomColorEditor.tsx | 18 +- ...omizingPreferredReactionsModal.stories.tsx | 8 +- .../CustomizingPreferredReactionsModal.tsx | 26 +- ts/components/DebugLogErrorModal.stories.tsx | 4 +- ts/components/DebugLogErrorModal.tsx | 6 +- ts/components/DebugLogWindow.stories.tsx | 6 +- ts/components/DebugLogWindow.tsx | 24 +- ts/components/DeleteMessagesModal.stories.tsx | 4 +- ts/components/DeleteMessagesModal.tsx | 10 +- ts/components/DialogExpiredBuild.stories.tsx | 8 +- ts/components/DialogExpiredBuild.tsx | 8 +- ts/components/DialogNetworkStatus.stories.tsx | 10 +- ts/components/DialogNetworkStatus.tsx | 14 +- ts/components/DialogRelink.stories.tsx | 8 +- ts/components/DialogRelink.tsx | 6 +- ts/components/DialogUpdate.stories.tsx | 12 +- ts/components/DialogUpdate.tsx | 21 +- ts/components/DirectCallRemoteParticipant.tsx | 12 +- .../DisappearingTimeDialog.stories.tsx | 6 +- ts/components/DisappearingTimeDialog.tsx | 10 +- .../DisappearingTimerSelect.stories.tsx | 6 +- ts/components/DisappearingTimerSelect.tsx | 12 +- ts/components/DonationErrorModal.stories.tsx | 6 +- ts/components/DonationErrorModal.tsx | 12 +- .../DonationInterruptedModal.stories.tsx | 4 +- ts/components/DonationInterruptedModal.tsx | 6 +- .../DonationPrivacyInformationModal.tsx | 10 +- .../DonationProgressModal.stories.tsx | 4 +- ts/components/DonationProgressModal.tsx | 8 +- .../DonationStillProcessingModal.stories.tsx | 4 +- .../DonationStillProcessingModal.tsx | 6 +- ts/components/DonationThanksModal.stories.tsx | 6 +- ts/components/DonationThanksModal.tsx | 14 +- .../DonationVerificationModal.stories.tsx | 6 +- ts/components/DonationVerificationModal.tsx | 8 +- ts/components/DonationsErrorBoundary.tsx | 4 +- .../DraftGifMessageSendModal.stories.tsx | 18 +- ts/components/DraftGifMessageSendModal.tsx | 22 +- ts/components/EditHistoryMessagesModal.tsx | 24 +- .../EditNicknameAndNoteModal.stories.tsx | 8 +- ts/components/EditNicknameAndNoteModal.tsx | 18 +- ts/components/ErrorBoundary.tsx | 6 +- ts/components/ErrorModal.stories.tsx | 6 +- ts/components/ErrorModal.tsx | 6 +- ts/components/FileThumbnail.stories.tsx | 4 +- ts/components/FileThumbnail.tsx | 6 +- .../ForwardMessagesModal.stories.tsx | 18 +- ts/components/ForwardMessagesModal.tsx | 56 +- ts/components/GlobalModalContainer.tsx | 30 +- ts/components/GradientDial.tsx | 4 +- .../GroupCallOverflowArea.stories.tsx | 16 +- ts/components/GroupCallOverflowArea.tsx | 8 +- .../GroupCallRemoteParticipant.stories.tsx | 14 +- ts/components/GroupCallRemoteParticipant.tsx | 32 +- ts/components/GroupCallRemoteParticipants.tsx | 36 +- .../GroupDescriptionInput.stories.tsx | 4 +- ts/components/GroupDescriptionInput.tsx | 4 +- ts/components/GroupDescriptionText.tsx | 8 +- ts/components/GroupDialog.tsx | 14 +- ts/components/GroupMembersNames.tsx | 8 +- ts/components/GroupTitleInput.stories.tsx | 4 +- ts/components/GroupTitleInput.tsx | 4 +- .../GroupV1MigrationDialog.stories.tsx | 10 +- ts/components/GroupV1MigrationDialog.tsx | 12 +- ts/components/GroupV2JoinDialog.stories.tsx | 4 +- ts/components/GroupV2JoinDialog.tsx | 12 +- ts/components/I18n.stories.tsx | 6 +- ts/components/I18n.tsx | 4 +- ts/components/IdenticonSVG.stories.tsx | 4 +- ts/components/ImageOrBlurhash.stories.tsx | 4 +- ts/components/ImageOrBlurhash.tsx | 2 +- ts/components/InContactsIcon.stories.tsx | 4 +- ts/components/InContactsIcon.tsx | 4 +- ts/components/Inbox.stories.tsx | 6 +- ts/components/Inbox.tsx | 8 +- ts/components/IncomingCallBar.stories.tsx | 8 +- ts/components/IncomingCallBar.tsx | 31 +- ts/components/Input.stories.tsx | 4 +- ts/components/Input.tsx | 10 +- ts/components/InstallScreen.tsx | 12 +- ts/components/LeftPane.stories.tsx | 48 +- ts/components/LeftPane.tsx | 88 +-- ts/components/LeftPaneBanner.stories.tsx | 2 +- ts/components/LeftPaneDialog.stories.tsx | 6 +- ts/components/LeftPaneDialog.tsx | 4 +- ts/components/LeftPaneSearchInput.tsx | 14 +- ts/components/Lightbox.stories.tsx | 10 +- ts/components/Lightbox.tsx | 46 +- ts/components/ListTile.stories.tsx | 8 +- ts/components/ListTile.tsx | 4 +- ts/components/ListView.tsx | 2 +- .../LocalDeleteWarningModal.stories.tsx | 4 +- ts/components/LocalDeleteWarningModal.tsx | 8 +- .../LowDiskSpaceBackupImportModal.stories.tsx | 4 +- .../LowDiskSpaceBackupImportModal.tsx | 8 +- ts/components/MediaEditor.stories.tsx | 8 +- ts/components/MediaEditor.tsx | 95 +-- .../MediaPermissionsModal.stories.tsx | 6 +- ts/components/MediaPermissionsModal.tsx | 8 +- .../MediaQualitySelector.stories.tsx | 4 +- ts/components/MediaQualitySelector.tsx | 6 +- ts/components/MiniPlayer.stories.tsx | 4 +- ts/components/MiniPlayer.tsx | 10 +- ts/components/Modal.stories.tsx | 6 +- ts/components/Modal.tsx | 18 +- ts/components/ModalContainer.tsx | 2 +- ts/components/ModalHost.tsx | 18 +- ts/components/MyStories.stories.tsx | 14 +- ts/components/MyStories.tsx | 32 +- ts/components/MyStoryButton.stories.tsx | 12 +- ts/components/MyStoryButton.tsx | 22 +- ts/components/NavSidebar.tsx | 10 +- ts/components/NavTabs.stories.tsx | 10 +- ts/components/NavTabs.tsx | 20 +- .../NeedsScreenRecordingPermissionsModal.tsx | 8 +- ...atedGroupInvitedContactsDialog.stories.tsx | 10 +- ...NewlyCreatedGroupInvitedContactsDialog.tsx | 14 +- ts/components/NotePreviewModal.stories.tsx | 6 +- ts/components/NotePreviewModal.tsx | 14 +- .../OutgoingGiftBadgeModal.stories.tsx | 6 +- ts/components/OutgoingGiftBadgeModal.tsx | 10 +- ts/components/PermissionsPopup.tsx | 6 +- ts/components/PlaybackButton.stories.tsx | 10 +- ts/components/PlaybackButton.tsx | 6 +- ts/components/PlaybackRateButton.tsx | 4 +- ts/components/Preferences.stories.tsx | 52 +- ts/components/Preferences.tsx | 103 ++-- ts/components/PreferencesBackups.tsx | 28 +- ts/components/PreferencesDonateFlow.tsx | 50 +- ts/components/PreferencesDonations.tsx | 66 +- ts/components/PreferencesInternal.tsx | 30 +- ts/components/PreferencesLocalBackups.tsx | 26 +- ts/components/PreferencesUtil.tsx | 2 +- ts/components/ProfileEditor.stories.tsx | 16 +- ts/components/ProfileEditor.tsx | 80 +-- ts/components/ProfileMovedModal.stories.tsx | 6 +- ts/components/ProfileMovedModal.tsx | 8 +- ts/components/Profiler.tsx | 2 +- ts/components/ProgressBar.stories.tsx | 4 +- ts/components/ProgressDialog.stories.tsx | 4 +- ts/components/ProgressDialog.tsx | 4 +- ts/components/ProgressModal.stories.tsx | 4 +- ts/components/ProgressModal.tsx | 4 +- ts/components/QrCode.stories.tsx | 4 +- ts/components/QrCode.tsx | 2 +- ts/components/ReactionPickerPicker.tsx | 8 +- ts/components/RecordingComposer.tsx | 4 +- .../SafetyNumberChangeDialog.stories.tsx | 14 +- ts/components/SafetyNumberChangeDialog.tsx | 36 +- ts/components/SafetyNumberModal.tsx | 10 +- .../SafetyNumberNotReady.stories.tsx | 4 +- ts/components/SafetyNumberNotReady.tsx | 12 +- ts/components/SafetyNumberViewer.stories.tsx | 6 +- ts/components/SafetyNumberViewer.tsx | 16 +- ts/components/SafetyTipsModal.stories.tsx | 6 +- ts/components/SafetyTipsModal.tsx | 8 +- ts/components/SampleMessageBubbles.tsx | 6 +- ts/components/SearchInput.tsx | 4 +- ts/components/Select.stories.tsx | 4 +- ts/components/SendStoryModal.stories.tsx | 12 +- ts/components/SendStoryModal.tsx | 60 +- ts/components/ServerAlerts.tsx | 12 +- ts/components/SharedGroupNames.tsx | 6 +- ts/components/ShortcutGuide.stories.tsx | 4 +- ts/components/ShortcutGuide.tsx | 4 +- ts/components/ShortcutGuideModal.tsx | 4 +- .../SignalConnectionsModal.stories.tsx | 4 +- ts/components/SignalConnectionsModal.tsx | 6 +- ts/components/Slider.stories.tsx | 4 +- ts/components/Slider.tsx | 4 +- ts/components/Spinner.stories.tsx | 4 +- ts/components/Spinner.tsx | 2 +- ts/components/SpinnerV2.stories.tsx | 8 +- ts/components/SpinnerV2.tsx | 4 +- .../StandaloneRegistration.stories.tsx | 8 +- ts/components/StandaloneRegistration.tsx | 8 +- ts/components/StoriesAddStoryButton.tsx | 12 +- ts/components/StoriesPane.tsx | 22 +- .../StoriesSettingsModal.stories.tsx | 8 +- ts/components/StoriesSettingsModal.tsx | 60 +- ts/components/StoriesTab.stories.tsx | 10 +- ts/components/StoriesTab.tsx | 28 +- ts/components/StoryCreator.stories.tsx | 12 +- ts/components/StoryCreator.tsx | 34 +- ts/components/StoryDetailsModal.stories.tsx | 8 +- ts/components/StoryDetailsModal.tsx | 38 +- ts/components/StoryDistributionListName.tsx | 8 +- ts/components/StoryImage.stories.tsx | 11 +- ts/components/StoryImage.tsx | 22 +- ts/components/StoryLinkPreview.stories.tsx | 8 +- ts/components/StoryLinkPreview.tsx | 10 +- ts/components/StoryListItem.stories.tsx | 11 +- ts/components/StoryListItem.tsx | 26 +- ts/components/StoryViewer.stories.tsx | 22 +- ts/components/StoryViewer.tsx | 82 +-- .../StoryViewsNRepliesModal.stories.tsx | 14 +- ts/components/StoryViewsNRepliesModal.tsx | 64 +- ts/components/Tabs.tsx | 4 +- .../TapToViewNotAvailableModal.stories.tsx | 6 +- ts/components/TapToViewNotAvailableModal.tsx | 6 +- ts/components/TextAttachment.stories.tsx | 4 +- ts/components/TextAttachment.tsx | 26 +- ts/components/TextStoryCreator.tsx | 54 +- ts/components/Time.tsx | 2 +- ts/components/Toast.stories.tsx | 6 +- ts/components/Toast.tsx | 4 +- ts/components/ToastManager.stories.tsx | 14 +- ts/components/ToastManager.tsx | 26 +- ts/components/Tooltip.stories.tsx | 6 +- ts/components/Tooltip.tsx | 10 +- ts/components/UnsupportedOSDialog.stories.tsx | 10 +- ts/components/UnsupportedOSDialog.tsx | 12 +- ts/components/UserText.tsx | 4 +- ts/components/UsernameEditor.stories.tsx | 8 +- ts/components/UsernameEditor.tsx | 34 +- ts/components/UsernameLinkEditor.stories.tsx | 10 +- ts/components/UsernameLinkEditor.tsx | 32 +- ts/components/UsernameMegaphone.stories.tsx | 6 +- ts/components/UsernameMegaphone.tsx | 6 +- .../UsernameOnboardingModal.stories.tsx | 4 +- ts/components/UsernameOnboardingModal.tsx | 6 +- ts/components/VoiceNotesPlaybackContext.tsx | 22 +- .../WarningIdlePrimaryDeviceDialog.tsx | 8 +- ts/components/WhatsNewLink.tsx | 4 +- ts/components/WhatsNewModal.stories.tsx | 4 +- ts/components/WhatsNewModal.tsx | 8 +- ts/components/conversation/About.tsx | 2 +- .../AboutContactModal.stories.tsx | 8 +- .../conversation/AboutContactModal.tsx | 22 +- .../conversation/AddNewLines.stories.tsx | 4 +- ts/components/conversation/AddNewLines.tsx | 2 +- ts/components/conversation/AtMention.tsx | 2 +- .../conversation/AtMentionify.stories.tsx | 6 +- ts/components/conversation/AtMentionify.tsx | 4 +- .../AttachmentDetailPill.stories.tsx | 9 +- .../conversation/AttachmentDetailPill.tsx | 10 +- .../conversation/AttachmentList.stories.tsx | 10 +- ts/components/conversation/AttachmentList.tsx | 12 +- .../AttachmentStatusIcon.stories.tsx | 6 +- .../conversation/AttachmentStatusIcon.tsx | 6 +- ts/components/conversation/AudioCapture.tsx | 10 +- .../CallingNotification.stories.tsx | 12 +- .../conversation/CallingNotification.tsx | 34 +- .../ChangeNumberNotification.stories.tsx | 6 +- .../conversation/ChangeNumberNotification.tsx | 12 +- .../ChatSessionRefreshedDialog.stories.tsx | 4 +- .../ChatSessionRefreshedDialog.tsx | 8 +- ...atSessionRefreshedNotification.stories.tsx | 4 +- .../ChatSessionRefreshedNotification.tsx | 10 +- .../conversation/ContactDetail.stories.tsx | 10 +- ts/components/conversation/ContactDetail.tsx | 10 +- .../conversation/ContactModal.stories.tsx | 14 +- ts/components/conversation/ContactModal.tsx | 42 +- .../conversation/ContactName.stories.tsx | 6 +- ts/components/conversation/ContactName.tsx | 10 +- .../ContactSpoofingReviewDialog.stories.tsx | 10 +- .../ContactSpoofingReviewDialog.tsx | 24 +- ...tactSpoofingReviewDialogPerson.stories.tsx | 8 +- .../ContactSpoofingReviewDialogPerson.tsx | 18 +- .../ConversationHeader.stories.tsx | 16 +- .../conversation/ConversationHeader.tsx | 46 +- .../conversation/ConversationHero.stories.tsx | 14 +- .../conversation/ConversationHero.tsx | 30 +- .../ConversationMergeNotification.stories.tsx | 4 +- .../ConversationMergeNotification.tsx | 14 +- .../conversation/ConversationView.tsx | 6 +- .../DeliveryIssueDialog.stories.tsx | 6 +- .../conversation/DeliveryIssueDialog.tsx | 16 +- .../DeliveryIssueNotification.stories.tsx | 6 +- .../DeliveryIssueNotification.tsx | 14 +- .../conversation/DonationsOfflineTooltip.tsx | 6 +- .../conversation/EmbeddedContact.tsx | 6 +- .../conversation/Emojify.stories.tsx | 4 +- ts/components/conversation/Emojify.tsx | 14 +- .../conversation/ErrorBoundary.stories.tsx | 4 +- ts/components/conversation/ErrorBoundary.tsx | 6 +- .../conversation/ExpireTimer.stories.tsx | 4 +- ts/components/conversation/ExpireTimer.tsx | 2 +- ts/components/conversation/GIF.tsx | 20 +- .../conversation/GroupDescription.stories.tsx | 4 +- .../conversation/GroupDescription.tsx | 6 +- .../GroupNotification.stories.tsx | 6 +- .../conversation/GroupNotification.tsx | 12 +- .../GroupV1DisabledActions.stories.tsx | 4 +- .../conversation/GroupV1DisabledActions.tsx | 4 +- .../conversation/GroupV1Migration.stories.tsx | 8 +- .../conversation/GroupV1Migration.tsx | 18 +- .../conversation/GroupV2Change.stories.tsx | 14 +- ts/components/conversation/GroupV2Change.tsx | 27 +- .../GroupV2PendingApprovalActions.stories.tsx | 4 +- .../GroupV2PendingApprovalActions.tsx | 4 +- ts/components/conversation/Image.stories.tsx | 14 +- ts/components/conversation/Image.tsx | 12 +- .../conversation/ImageGrid.stories.tsx | 27 +- ts/components/conversation/ImageGrid.tsx | 10 +- .../conversation/InAnotherCallTooltip.tsx | 6 +- .../InlineNotificationWrapper.tsx | 2 +- .../JoinedSignalNotification.stories.tsx | 4 +- .../conversation/JoinedSignalNotification.tsx | 8 +- .../LastSeenIndicator.stories.tsx | 4 +- .../conversation/LastSeenIndicator.tsx | 2 +- .../conversation/LinkPreviewDate.tsx | 2 +- .../conversation/Linkify.stories.tsx | 4 +- ts/components/conversation/Linkify.tsx | 8 +- ...MandatoryProfileSharingActions.stories.tsx | 6 +- .../MandatoryProfileSharingActions.tsx | 12 +- ts/components/conversation/Message.tsx | 120 ++-- ts/components/conversation/MessageAudio.tsx | 32 +- .../conversation/MessageBody.stories.tsx | 10 +- ts/components/conversation/MessageBody.tsx | 22 +- .../MessageBodyReadMore.stories.tsx | 12 +- .../conversation/MessageBodyReadMore.tsx | 8 +- .../conversation/MessageContextMenu.tsx | 4 +- .../conversation/MessageDetail.stories.tsx | 18 +- ts/components/conversation/MessageDetail.tsx | 42 +- .../conversation/MessageMetadata.tsx | 24 +- .../MessageRequestActions.stories.tsx | 4 +- .../conversation/MessageRequestActions.tsx | 14 +- .../MessageRequestActionsConfirmation.tsx | 10 +- .../MessageRequestResponseNotification.tsx | 12 +- .../conversation/MessageTextRenderer.tsx | 18 +- .../conversation/MessageTimestamp.stories.tsx | 4 +- .../conversation/MessageTimestamp.tsx | 8 +- .../conversation/PaymentEventNotification.tsx | 12 +- ...oneNumberDiscoveryNotification.stories.tsx | 4 +- .../PhoneNumberDiscoveryNotification.tsx | 8 +- .../ProfileChangeNotification.stories.tsx | 6 +- .../ProfileChangeNotification.tsx | 14 +- .../ProfileNameWarningModal.stories.tsx | 8 +- .../conversation/ProfileNameWarningModal.tsx | 4 +- ts/components/conversation/Quote.stories.tsx | 26 +- ts/components/conversation/Quote.tsx | 34 +- .../conversation/ReactionPicker.stories.tsx | 10 +- ts/components/conversation/ReactionPicker.tsx | 20 +- .../conversation/ReactionViewer.stories.tsx | 8 +- ts/components/conversation/ReactionViewer.tsx | 28 +- .../RemoveGroupMemberConfirmationDialog.tsx | 12 +- .../ResetSessionNotification.stories.tsx | 4 +- .../conversation/ResetSessionNotification.tsx | 4 +- .../SafetyNumberNotification.stories.tsx | 4 +- .../conversation/SafetyNumberNotification.tsx | 10 +- .../conversation/ScrollDownButton.stories.tsx | 7 +- .../conversation/ScrollDownButton.tsx | 4 +- .../conversation/SelectModeActions.tsx | 6 +- .../SignalConversationMuteToggle.tsx | 2 +- .../StagedGenericAttachment.stories.tsx | 8 +- .../conversation/StagedGenericAttachment.tsx | 6 +- .../StagedLinkPreview.stories.tsx | 8 +- .../conversation/StagedLinkPreview.tsx | 20 +- .../StagedPlaceholderAttachment.stories.tsx | 4 +- .../StagedPlaceholderAttachment.tsx | 2 +- .../conversation/SystemMessage.stories.tsx | 4 +- .../conversation/Timeline.stories.tsx | 34 +- ts/components/conversation/Timeline.tsx | 51 +- .../conversation/TimelineDateHeader.tsx | 8 +- .../TimelineFloatingHeader.stories.tsx | 4 +- .../conversation/TimelineFloatingHeader.tsx | 8 +- .../conversation/TimelineItem.stories.tsx | 26 +- ts/components/conversation/TimelineItem.tsx | 90 +-- .../conversation/TimelineMessage.stories.tsx | 46 +- .../conversation/TimelineMessage.tsx | 40 +- .../conversation/TimelineWarning.tsx | 2 +- .../TimerNotification.stories.tsx | 6 +- .../conversation/TimerNotification.tsx | 14 +- .../TitleTransitionNotification.stories.tsx | 4 +- .../TitleTransitionNotification.tsx | 8 +- .../conversation/TypingAnimation.stories.tsx | 4 +- .../conversation/TypingAnimation.tsx | 2 +- .../conversation/TypingBubble.stories.tsx | 12 +- ts/components/conversation/TypingBubble.tsx | 14 +- .../UniversalTimerNotification.stories.tsx | 6 +- .../UniversalTimerNotification.tsx | 8 +- .../UnsupportedMessage.stories.tsx | 4 +- .../conversation/UnsupportedMessage.tsx | 12 +- .../VerificationNotification.stories.tsx | 4 +- .../conversation/VerificationNotification.tsx | 10 +- ts/components/conversation/Waveform.tsx | 2 +- .../conversation/WaveformScrubber.tsx | 10 +- ts/components/conversation/contactUtil.tsx | 12 +- .../AddGroupMembersModal.stories.tsx | 22 +- .../AddGroupMembersModal.tsx | 14 +- .../ChooseGroupMembersModal.tsx | 48 +- .../ConfirmAdditionsModal.tsx | 20 +- .../CallHistoryGroupPanelSection.tsx | 16 +- .../ConversationDetails.stories.tsx | 22 +- .../ConversationDetails.tsx | 79 +-- .../ConversationDetailsActions.stories.tsx | 4 +- .../ConversationDetailsActions.tsx | 15 +- .../ConversationDetailsGroups.tsx | 15 +- .../ConversationDetailsHeader.stories.tsx | 12 +- .../ConversationDetailsHeader.tsx | 24 +- .../ConversationDetailsIcon.stories.tsx | 7 +- .../ConversationDetailsIcon.tsx | 4 +- ...versationDetailsMembershipList.stories.tsx | 8 +- .../ConversationDetailsMembershipList.tsx | 19 +- .../ConversationNotificationsModal.tsx | 12 +- ...versationNotificationsSettings.stories.tsx | 4 +- .../ConversationNotificationsSettings.tsx | 21 +- ...ditConversationAttributesModal.stories.tsx | 4 +- .../EditConversationAttributesModal.tsx | 24 +- .../GroupLinkManagement.stories.tsx | 10 +- .../GroupLinkManagement.tsx | 25 +- .../GroupV2Permissions.stories.tsx | 8 +- .../GroupV2Permissions.tsx | 14 +- .../conversation-details/PanelRow.stories.tsx | 9 +- .../conversation-details/PanelRow.tsx | 2 +- .../PanelSection.stories.tsx | 6 +- .../conversation-details/PanelSection.tsx | 2 +- .../PendingInvites.stories.tsx | 16 +- .../conversation-details/PendingInvites.tsx | 27 +- .../AttachmentSection.stories.tsx | 10 +- .../media-gallery/AttachmentSection.tsx | 14 +- .../DocumentListItem.stories.tsx | 9 +- .../media-gallery/DocumentListItem.tsx | 8 +- .../media-gallery/EmptyState.stories.tsx | 4 +- .../media-gallery/MediaGallery.stories.tsx | 6 +- .../media-gallery/MediaGallery.tsx | 22 +- .../media-gallery/MediaGridItem.stories.tsx | 12 +- .../media-gallery/MediaGridItem.tsx | 20 +- .../media-gallery/groupMediaItemsByDate.ts | 4 +- .../media-gallery/types/ItemClickEvent.ts | 2 +- .../conversation/media-gallery/utils/mocks.ts | 8 +- .../BaseConversationListItem.tsx | 20 +- .../conversationList/ComposeStepButton.tsx | 2 +- .../conversationList/ContactCheckbox.tsx | 16 +- .../conversationList/ContactListItem.tsx | 28 +- .../conversationList/ConversationListItem.tsx | 18 +- .../conversationList/GroupListItem.tsx | 12 +- .../MessageSearchResult.stories.tsx | 16 +- .../conversationList/MessageSearchResult.tsx | 18 +- .../conversationList/PhoneNumberCheckbox.tsx | 22 +- .../conversationList/StartNewConversation.tsx | 20 +- .../conversationList/UsernameCheckbox.tsx | 14 +- .../UsernameSearchResultListItem.tsx | 14 +- ts/components/emoji/EmojiButton.stories.tsx | 6 +- ts/components/emoji/EmojiButton.tsx | 18 +- ts/components/emoji/EmojiPicker.stories.tsx | 6 +- ts/components/emoji/EmojiPicker.tsx | 16 +- ts/components/emoji/lib.ts | 6 +- ts/components/fun/FunButton.tsx | 8 +- ts/components/fun/FunEmoji.stories.tsx | 8 +- ts/components/fun/FunEmoji.tsx | 4 +- .../fun/FunEmojiLocalizationProvider.tsx | 20 +- ts/components/fun/FunEmojiPicker.stories.tsx | 16 +- ts/components/fun/FunEmojiPicker.tsx | 14 +- ts/components/fun/FunGif.stories.tsx | 4 +- ts/components/fun/FunGif.tsx | 16 +- ts/components/fun/FunPicker.stories.tsx | 14 +- ts/components/fun/FunPicker.tsx | 29 +- ts/components/fun/FunProvider.tsx | 26 +- ts/components/fun/FunSkinTones.tsx | 10 +- ts/components/fun/FunSticker.stories.tsx | 2 +- ts/components/fun/FunSticker.tsx | 4 +- .../fun/FunStickerPicker.stories.tsx | 16 +- ts/components/fun/FunStickerPicker.tsx | 14 +- ts/components/fun/base/FunErrorBoundary.tsx | 8 +- ts/components/fun/base/FunGrid.tsx | 2 +- ts/components/fun/base/FunImage.tsx | 6 +- ts/components/fun/base/FunItem.tsx | 2 +- ts/components/fun/base/FunLightbox.tsx | 2 +- ts/components/fun/base/FunPopover.tsx | 2 +- ts/components/fun/base/FunResults.tsx | 2 +- ts/components/fun/base/FunScroller.tsx | 4 +- ts/components/fun/base/FunSearch.tsx | 4 +- ts/components/fun/base/FunSubNav.tsx | 12 +- ts/components/fun/base/FunTabs.tsx | 2 +- ts/components/fun/base/FunTooltip.tsx | 2 +- ts/components/fun/constants.tsx | 4 +- ts/components/fun/data/emojis.ts | 10 +- ts/components/fun/data/gifs.ts | 8 +- ts/components/fun/data/infinite.ts | 8 +- ts/components/fun/data/segments.ts | 2 +- ts/components/fun/data/tenor.ts | 6 +- ts/components/fun/isFunPickerEnabled.tsx | 2 +- ts/components/fun/keyboard/FunKeyboard.tsx | 2 +- .../fun/keyboard/GridKeyboardDelegate.tsx | 6 +- .../keyboard/WaterfallKeyboardDelegate.tsx | 4 +- ts/components/fun/mocks.tsx | 8 +- ts/components/fun/panels/FunPanelEmojis.tsx | 50 +- ts/components/fun/panels/FunPanelGifs.tsx | 57 +- ts/components/fun/panels/FunPanelStickers.tsx | 50 +- ts/components/fun/useFunEmojiLocalizer.tsx | 10 +- ts/components/fun/useFunEmojiSearch.tsx | 8 +- .../fun/virtual/useFunVirtualGrid.tsx | 6 +- .../InstallScreenBackupImportStep.stories.tsx | 10 +- .../InstallScreenBackupImportStep.tsx | 26 +- .../InstallScreenErrorStep.stories.tsx | 6 +- .../installScreen/InstallScreenErrorStep.tsx | 16 +- .../InstallScreenLinkInProgress.stories.tsx | 4 +- .../InstallScreenLinkInProgressStep.tsx | 8 +- ...tallScreenQrCodeNotScannedStep.stories.tsx | 12 +- .../InstallScreenQrCodeNotScannedStep.tsx | 30 +- .../InstallScreenUpdateDialog.tsx | 24 +- .../leftPane/LeftPaneArchiveHelper.tsx | 24 +- .../LeftPaneChooseGroupMembersHelper.tsx | 30 +- .../leftPane/LeftPaneComposeHelper.tsx | 24 +- .../LeftPaneFindByPhoneNumberHelper.tsx | 32 +- .../leftPane/LeftPaneFindByUsernameHelper.tsx | 24 +- ts/components/leftPane/LeftPaneHelper.tsx | 12 +- .../leftPane/LeftPaneInboxHelper.tsx | 22 +- .../leftPane/LeftPaneSearchHelper.tsx | 24 +- .../LeftPaneSetGroupMetadataHelper.tsx | 32 +- .../leftPane/getConversationInDirection.ts | 8 +- .../leftPane/handleKeydownForSearch.ts | 2 +- .../PreferencesChatFoldersPage.tsx | 20 +- .../PreferencesEditChatFoldersPage.tsx | 40 +- ...rencesEditChatFoldersSelectChatsDialog.tsx | 28 +- .../donations/DonateInputAmount.tsx | 6 +- .../donations/DonateInputCardCvc.stories.tsx | 6 +- .../donations/DonateInputCardCvc.tsx | 8 +- .../donations/DonateInputCardExp.stories.tsx | 6 +- .../donations/DonateInputCardExp.tsx | 8 +- .../DonateInputCardNumber.stories.tsx | 6 +- .../donations/DonateInputCardNumber.tsx | 11 +- .../stickers/StickerButton.stories.tsx | 6 +- ts/components/stickers/StickerButton.tsx | 25 +- .../stickers/StickerManager.stories.tsx | 6 +- ts/components/stickers/StickerManager.tsx | 10 +- .../stickers/StickerManagerPackRow.tsx | 10 +- .../stickers/StickerPackInstallButton.tsx | 2 +- .../stickers/StickerPicker.stories.tsx | 6 +- ts/components/stickers/StickerPicker.tsx | 13 +- .../stickers/StickerPreviewModal.stories.tsx | 6 +- .../stickers/StickerPreviewModal.tsx | 16 +- ts/components/stickers/lib.ts | 2 +- ts/components/stickers/mocks.ts | 5 +- ts/context/Bytes.ts | 3 + ts/context/Crypto.ts | 12 +- ts/context/Timers.ts | 2 +- ts/context/activeWindowService.ts | 2 +- ts/context/config.ts | 2 +- ts/context/createNativeThemeListener.ts | 4 +- ts/context/environment.ts | 4 +- ts/context/i18n.ts | 8 +- ts/context/waitForSettingsChange.ts | 2 +- .../isConversationTooBigToRing.ts | 6 +- ts/environment.ts | 4 +- ts/groupChange.ts | 16 +- ts/groups.ts | 90 +-- ts/groups/joinViaLink.ts | 44 +- ts/groups/limits.ts | 6 +- ts/groups/util.ts | 2 +- .../useActivateSpeakerViewOnPresenting.ts | 4 +- ts/hooks/useAnimated.tsx | 2 +- ts/hooks/useComputePeaks.ts | 4 +- ts/hooks/useConfirmDiscard.tsx | 10 +- ts/hooks/useInputMask.tsx | 5 +- ts/hooks/useIntersectionObserver.ts | 2 +- ts/hooks/useKeyboardShortcuts.tsx | 10 +- ts/hooks/useMinimalConversation.ts | 2 +- ts/hooks/useNowThatUpdatesEveryMinute.ts | 24 +- ts/hooks/useProxySelector.ts | 2 +- ts/hooks/useRefMerger.ts | 2 +- ts/hooks/useRetryStorySend.tsx | 8 +- ts/hooks/useScrollLock.tsx | 2 +- ts/hooks/useSizeObserver.tsx | 2 +- ts/hooks/useTabs.tsx | 4 +- ts/hooks/useTheme.ts | 2 +- ts/indexeddb.ts | 2 +- ts/jobs/AttachmentBackupManager.ts | 53 +- ts/jobs/AttachmentDownloadManager.ts | 64 +- ts/jobs/AttachmentLocalBackupManager.ts | 29 +- ts/jobs/CallLinkFinalizeDeleteManager.ts | 8 +- ts/jobs/Job.ts | 2 +- ts/jobs/JobError.ts | 2 +- ts/jobs/JobLogger.ts | 4 +- ts/jobs/JobManager.ts | 18 +- ts/jobs/JobQueue.ts | 22 +- ts/jobs/JobQueueDatabaseStore.ts | 12 +- ts/jobs/callLinkRefreshJobQueue.ts | 34 +- ts/jobs/conversationJobQueue.ts | 82 +-- ts/jobs/deleteDownloadsJobQueue.ts | 18 +- ts/jobs/formatJobForInsert.ts | 2 +- ts/jobs/groupAvatarJobQueue.ts | 16 +- ts/jobs/helpers/addReportSpamJob.ts | 12 +- ts/jobs/helpers/areAllErrorsUnregistered.ts | 6 +- ts/jobs/helpers/attachmentBackfill.ts | 50 +- ts/jobs/helpers/commonShouldJobContinue.ts | 10 +- .../helpers/findRetryAfterTimeFromError.ts | 6 +- ts/jobs/helpers/getHttpErrorCode.ts | 4 +- .../getUntrustedConversationServiceIds.ts | 6 +- ts/jobs/helpers/getValidRecipients.ts | 6 +- .../helpers/handleCommonJobRequestError.ts | 6 +- ts/jobs/helpers/handleMultipleSendErrors.ts | 14 +- ts/jobs/helpers/sendCallingMessage.ts | 26 +- ts/jobs/helpers/sendDeleteForEveryone.ts | 46 +- ts/jobs/helpers/sendDeleteStoryForEveryone.ts | 41 +- .../sendDirectExpirationTimerUpdate.ts | 27 +- ts/jobs/helpers/sendGroupCallUpdate.ts | 18 +- ts/jobs/helpers/sendGroupUpdate.ts | 26 +- ts/jobs/helpers/sendNormalMessage.ts | 74 +-- ts/jobs/helpers/sendNullMessage.ts | 22 +- ts/jobs/helpers/sendProfileKey.ts | 28 +- ts/jobs/helpers/sendReaction.ts | 58 +- ts/jobs/helpers/sendReceipts.ts | 8 +- ts/jobs/helpers/sendResendRequest.ts | 28 +- ts/jobs/helpers/sendSavedProto.ts | 20 +- ts/jobs/helpers/sendSenderKeyDistribution.ts | 18 +- ts/jobs/helpers/sendStory.ts | 52 +- ts/jobs/helpers/shouldSendToConversation.ts | 12 +- .../sleepForRateLimitRetryAfterTime.ts | 6 +- ts/jobs/helpers/syncHelpers.ts | 26 +- ts/jobs/initializeAllJobQueues.ts | 28 +- ts/jobs/readSyncJobQueue.ts | 20 +- ts/jobs/removeStorageKeyJobQueue.ts | 8 +- ts/jobs/reportSpamJobQueue.ts | 30 +- ts/jobs/singleProtoJobQueue.ts | 36 +- ts/jobs/viewOnceOpenJobQueue.ts | 20 +- ts/jobs/viewSyncJobQueue.ts | 20 +- ts/linkPreviews/linkPreviewFetch.ts | 10 +- .../shouldUseFullSizeLinkPreviewImage.ts | 4 +- ts/logging/debuglogs.ts | 10 +- ts/logging/log.ts | 8 +- ts/logging/main_process_logging.ts | 16 +- ts/logging/set_up_renderer_logging.ts | 10 +- ts/logging/shared.ts | 6 +- ts/logging/uploadDebugLog.ts | 12 +- ts/main/NativeThemeNotifier.ts | 2 +- ts/main/challengeMain.ts | 8 +- ts/main/settingsChannel.ts | 14 +- .../MediaEditorFabricAnalogTimeSticker.ts | 8 +- ts/mediaEditor/MediaEditorFabricCropRect.ts | 2 +- .../MediaEditorFabricDigitalTimeSticker.ts | 6 +- ts/mediaEditor/MediaEditorFabricIText.ts | 2 +- .../MediaEditorFabricPencilBrush.ts | 2 +- ts/mediaEditor/MediaEditorFabricSticker.ts | 4 +- ts/mediaEditor/useFabricHistory.ts | 18 +- ts/mediaEditor/util/color.ts | 2 +- ts/mediaEditor/util/getTextStyleAttributes.ts | 8 +- ts/messageModifiers/AttachmentDownloads.ts | 14 +- ts/messageModifiers/Deletes.ts | 18 +- ts/messageModifiers/DeletesForMe.ts | 18 +- ts/messageModifiers/Edits.ts | 20 +- ts/messageModifiers/MessageReceipts.ts | 40 +- ts/messageModifiers/MessageRequests.ts | 14 +- ts/messageModifiers/Reactions.ts | 50 +- ts/messageModifiers/ReadSyncs.ts | 32 +- ts/messageModifiers/ViewOnceOpenSyncs.ts | 16 +- ts/messageModifiers/ViewSyncs.ts | 30 +- ts/messages/MessageSendState.ts | 2 +- ts/messages/copyQuote.ts | 24 +- ts/messages/getMessageById.ts | 10 +- ts/messages/getMessagesById.ts | 10 +- ts/messages/handleDataMessage.ts | 78 +-- ts/messages/helpers.ts | 18 +- ts/messages/maybeNotify.ts | 28 +- ts/messages/migrateLegacyReadStatus.ts | 4 +- ts/messages/migrateLegacySendAttributes.ts | 15 +- ts/messages/migrateMessageData.ts | 18 +- ts/messages/saveAndNotify.ts | 20 +- ts/messages/send.ts | 40 +- ts/model-types.d.ts | 57 +- ts/models/conversations.ts | 238 ++++---- ts/models/messages.ts | 6 +- ts/protobuf/index.ts | 4 +- .../auto-substitute-ascii-emojis/index.tsx | 8 +- ts/quill/emoji/blot.tsx | 6 +- ts/quill/emoji/completion.tsx | 18 +- ts/quill/emoji/index.tsx | 4 +- ts/quill/emoji/matchers.ts | 6 +- ts/quill/formatting/matchers.ts | 4 +- ts/quill/formatting/menu.tsx | 8 +- ts/quill/memberRepository.ts | 12 +- ts/quill/mentions/blot.tsx | 10 +- ts/quill/mentions/completion.tsx | 18 +- ts/quill/mentions/matchers.ts | 8 +- ts/quill/signal-clipboard/index.ts | 6 +- ts/quill/signal-clipboard/util.ts | 2 +- ts/quill/util.ts | 16 +- ts/reactions/enqueueReactionForSend.ts | 32 +- ts/reactions/isValidReactionEmoji.ts | 4 +- ts/reactions/preferredReactionEmoji.ts | 10 +- ts/reactions/util.ts | 4 +- ts/routineProfileRefresh.ts | 24 +- ts/scripts/after-all-artifact-build.ts | 2 +- ts/scripts/after-pack.ts | 6 +- ts/scripts/after-sign.ts | 2 +- ts/scripts/artifact-build-completed.ts | 12 +- ts/scripts/build-localized-display-names.ts | 6 +- ts/scripts/check-upgradeable-deps.ts | 4 +- ts/scripts/compile-stories-icu-lookup.ts | 2 +- ts/scripts/copy-language-packs.ts | 2 +- ts/scripts/copy.ts | 4 +- ts/scripts/fuse-electron.ts | 2 +- ts/scripts/gen-locales-config.ts | 4 +- ts/scripts/gen-nsis-script.ts | 6 +- ts/scripts/generate-compact-locales.ts | 2 +- ts/scripts/generate-dns-fallback.ts | 10 +- ts/scripts/generate-fixtures.ts | 8 +- ts/scripts/generate-icu-types.ts | 14 +- ts/scripts/generate-preload-cache.ts | 4 +- ts/scripts/generate-tray-icons.ts | 2 +- ts/scripts/get-emoji-locales.ts | 6 +- ts/scripts/get-expire-time.ts | 10 +- ts/scripts/get-jumbomoji.ts | 6 +- ts/scripts/get-strings.ts | 2 +- ts/scripts/mark-unused-strings-deleted.ts | 2 +- ts/scripts/notarize.ts | 2 +- ts/scripts/prune-macos-release.ts | 2 +- ts/scripts/push-strings.ts | 2 +- ts/scripts/remove-strings.ts | 10 +- ts/scripts/sign-macos.ts | 2 +- ts/scripts/sign-windows.ts | 2 +- ts/scripts/symbolicate-crash-report.ts | 10 +- ts/scripts/test-electron.ts | 8 +- ts/scripts/test-release.ts | 4 +- ts/scripts/update-gha.ts | 4 +- ts/services/ActiveWindowService.ts | 2 +- ts/services/BeforeNavigate.ts | 8 +- ts/services/LinkPreview.ts | 48 +- ts/services/MessageCache.ts | 24 +- ts/services/MessageUpdater.ts | 30 +- ts/services/ZoomFactorService.ts | 4 +- ts/services/addGlobalKeyboardShortcuts.ts | 18 +- ts/services/allLoaders.ts | 34 +- ts/services/areWeASubscriber.ts | 8 +- ts/services/audioRecorder.ts | 8 +- ts/services/backups/api.ts | 16 +- ts/services/backups/constants.ts | 4 +- ts/services/backups/credentials.ts | 35 +- ts/services/backups/crypto.ts | 6 +- ts/services/backups/errors.ts | 2 +- ts/services/backups/export.ts | 137 +++-- ts/services/backups/import.ts | 156 ++--- ts/services/backups/index.ts | 100 +-- ts/services/backups/types.ts | 4 +- ts/services/backups/util/filePointers.ts | 32 +- ts/services/backups/util/localBackup.ts | 32 +- ts/services/backups/util/mediaId.ts | 8 +- ts/services/backups/validator.ts | 6 +- ts/services/badgeLoader.ts | 10 +- ts/services/buildExpiration.ts | 6 +- ts/services/callHistoryLoader.ts | 6 +- ts/services/callLinksLoader.ts | 6 +- ts/services/calling.ts | 105 ++-- ts/services/chatFoldersLoader.ts | 6 +- ts/services/contactSync.ts | 38 +- ts/services/distributionListLoader.ts | 8 +- ts/services/donations.ts | 38 +- ts/services/donationsLoader.ts | 10 +- .../expiring/chatFolderCleanupService.ts | 8 +- .../createExpiringEntityCleanupService.ts | 14 +- ts/services/expiringMessagesDeletion.ts | 18 +- ts/services/gifsLoader.ts | 8 +- ts/services/globalMessageAudio.ts | 2 +- ts/services/groupCredentialFetcher.ts | 22 +- ts/services/keyboardLayout.ts | 2 +- ts/services/messageStateCleanup.ts | 6 +- ts/services/networkObserver.ts | 12 +- ts/services/notificationProfilesService.ts | 18 +- ts/services/notifications.ts | 24 +- ts/services/ourProfileKey.ts | 6 +- ts/services/profiles.ts | 56 +- ts/services/releaseNotesFetcher.ts | 42 +- ts/services/senderCertificate.ts | 22 +- ts/services/singleServePromise.ts | 2 +- ts/services/storage.ts | 76 +-- ts/services/storageRecordOps.ts | 100 +-- ts/services/storyLoader.ts | 26 +- .../tapToViewMessagesDeletionService.ts | 22 +- ts/services/updateListener.ts | 4 +- ts/services/userLoader.ts | 10 +- ts/services/username.ts | 28 +- ts/services/usernameIntegrity.ts | 32 +- ts/services/writeProfile.ts | 28 +- ts/setAppLoadingScreenMessage.ts | 2 +- ts/shims/deleteAllData.ts | 8 +- ts/shims/dispatchItemsMiddleware.ts | 2 +- ts/shims/events.ts | 6 +- ts/shims/getUserTheme.ts | 4 +- ts/shims/renderClearingDataView.tsx | 10 +- ts/shims/storage.ts | 2 +- ts/shims/textsecure.ts | 8 +- ts/shims/themeChanged.ts | 2 +- ts/signal.ts | 63 +- ts/sql/Client.ts | 48 +- ts/sql/Interface.ts | 63 +- ts/sql/Server.ts | 107 ++-- ts/sql/channels.ts | 8 +- ts/sql/cleanDataForIpc.ts | 4 +- ts/sql/hydration.ts | 22 +- ts/sql/main.ts | 18 +- ts/sql/mainWorker.ts | 12 +- ...-unread-call-history-messages-as-unseen.ts | 8 +- ts/sql/migrations/1010-call-links-table.ts | 2 +- ts/sql/migrations/1020-self-merges.ts | 8 +- ts/sql/migrations/1030-unblock-event.ts | 2 +- .../1040-undownloaded-backed-up-media.ts | 16 +- .../1050-group-send-endorsements.ts | 2 +- ...-mark-call-history-read-in-conversation.ts | 2 +- .../1160-optimize-calls-unread-count.ts | 4 +- .../1170-update-call-history-unread-index.ts | 2 +- .../1180-add-attachment-download-source.ts | 2 +- ts/sql/migrations/1220-blob-sessions.ts | 12 +- .../1240-defunct-call-links-table.ts | 2 +- ts/sql/migrations/1260-sync-tasks-rowid.ts | 2 +- ts/sql/migrations/1270-normalize-messages.ts | 2 +- ts/sql/migrations/1280-blob-unprocessed.ts | 12 +- .../1290-int-unprocessed-source-device.ts | 4 +- ts/sql/migrations/1300-sticker-pack-refs.ts | 4 +- ts/sql/migrations/1310-muted-fixup.ts | 6 +- .../1320-unprocessed-received-at-date.ts | 4 +- .../migrations/1330-sync-tasks-type-index.ts | 2 +- ts/sql/migrations/1340-recent-gifs.ts | 2 +- .../migrations/1350-notification-profiles.ts | 2 +- ts/sql/migrations/1360-attachments.ts | 2 +- .../1370-message-attachment-indexes.ts | 2 +- ts/sql/migrations/1380-donation-receipts.ts | 2 +- .../1390-attachment-download-keys.ts | 2 +- ts/sql/migrations/1400-simplify-receipts.ts | 2 +- ts/sql/migrations/1410-remove-wallpaper.ts | 2 +- ts/sql/migrations/1420-backup-downloads.ts | 2 +- ts/sql/migrations/1430-call-links-epoch-id.ts | 2 +- ts/sql/migrations/1440-chat-folders.ts | 4 +- ts/sql/migrations/1450-all-media.ts | 2 +- ts/sql/migrations/1460-attachment-duration.ts | 2 +- ts/sql/migrations/41-uuid-keys.ts | 10 +- ts/sql/migrations/42-stale-reactions.ts | 6 +- ts/sql/migrations/43-gv2-uuid.ts | 14 +- ts/sql/migrations/47-further-optimize.ts | 6 +- .../51-centralize-conversation-jobs.ts | 8 +- ts/sql/migrations/53-gv2-banned-members.ts | 4 +- ts/sql/migrations/55-report-message-aci.ts | 10 +- ts/sql/migrations/56-add-unseen-to-message.ts | 4 +- ts/sql/migrations/58-update-unread.ts | 4 +- ts/sql/migrations/78-merge-receipt-jobs.ts | 8 +- ts/sql/migrations/87-cleanup.ts | 6 +- ts/sql/migrations/88-service-ids.ts | 12 +- ts/sql/migrations/89-call-history.ts | 24 +- .../90-delete-story-reply-screenshot.ts | 4 +- ts/sql/migrations/91-clean-keys.ts | 10 +- ts/sql/migrations/920-clean-more-keys.ts | 12 +- ts/sql/migrations/960-untag-pni.ts | 10 +- ts/sql/migrations/index.ts | 220 +++---- ts/sql/server/callLinks.ts | 23 +- ts/sql/server/chatFolders.ts | 6 +- ts/sql/server/donationReceipts.ts | 6 +- ts/sql/server/groupSendEndorsements.ts | 14 +- ts/sql/server/messageAttachments.ts | 8 +- ts/sql/sqlLogger.ts | 8 +- ts/sql/util.ts | 4 +- ts/state/actions.ts | 70 +-- ts/state/createStore.ts | 14 +- ts/state/ducks/accounts.ts | 16 +- ts/state/ducks/app.ts | 12 +- ts/state/ducks/audioPlayer.ts | 22 +- ts/state/ducks/audioRecorder.ts | 24 +- ts/state/ducks/badges.ts | 14 +- ts/state/ducks/callHistory.ts | 38 +- ts/state/ducks/calling.ts | 107 ++-- ts/state/ducks/callingHelpers.ts | 10 +- ts/state/ducks/chatFolders.ts | 22 +- ts/state/ducks/composer.ts | 108 ++-- ts/state/ducks/conversations.ts | 226 +++---- ts/state/ducks/crashReports.ts | 18 +- ts/state/ducks/donations.ts | 38 +- ts/state/ducks/emojis.ts | 8 +- ts/state/ducks/gifs.ts | 6 +- ts/state/ducks/globalModals.ts | 78 +-- ts/state/ducks/installer.ts | 30 +- ts/state/ducks/items.ts | 24 +- ts/state/ducks/lightbox.ts | 50 +- ts/state/ducks/linkPreviews.ts | 24 +- ts/state/ducks/mediaGallery.ts | 24 +- ts/state/ducks/nav.ts | 12 +- ts/state/ducks/network.ts | 10 +- ts/state/ducks/notificationProfiles.ts | 12 +- ts/state/ducks/preferredReactions.ts | 22 +- ts/state/ducks/safetyNumber.ts | 18 +- ts/state/ducks/search.ts | 42 +- ts/state/ducks/stickers.ts | 29 +- ts/state/ducks/stories.ts | 113 ++-- ts/state/ducks/storyDistributionLists.ts | 26 +- ts/state/ducks/toast.ts | 8 +- ts/state/ducks/updates.ts | 12 +- ts/state/ducks/user.ts | 20 +- ts/state/ducks/username.ts | 36 +- ts/state/getInitialState.ts | 92 +-- ts/state/initializeRedux.ts | 34 +- ts/state/reducer.ts | 70 +-- ts/state/reinitializeRedux.ts | 10 +- ts/state/roots/createApp.tsx | 4 +- ts/state/roots/createGroupV2JoinModal.tsx | 8 +- ts/state/roots/createSafetyNumberViewer.tsx | 4 +- ts/state/selectors/accounts.ts | 6 +- ts/state/selectors/app.ts | 4 +- ts/state/selectors/audioPlayer.ts | 30 +- ts/state/selectors/audioRecorder.ts | 4 +- ts/state/selectors/badges.ts | 12 +- ts/state/selectors/callHistory.ts | 8 +- ts/state/selectors/calling.ts | 18 +- ts/state/selectors/chatFolders.ts | 4 +- ts/state/selectors/composer.ts | 6 +- ts/state/selectors/conversations-extra.ts | 18 +- ts/state/selectors/conversations.ts | 70 +-- ts/state/selectors/crashReports.ts | 4 +- ts/state/selectors/emojis.ts | 4 +- ts/state/selectors/expiration.ts | 10 +- ts/state/selectors/gifs.ts | 4 +- ts/state/selectors/globalModals.ts | 6 +- ts/state/selectors/inbox.ts | 2 +- ts/state/selectors/installer.ts | 4 +- ts/state/selectors/items.ts | 30 +- ts/state/selectors/lightbox.ts | 6 +- ts/state/selectors/linkPreviews.ts | 4 +- ts/state/selectors/mediaGallery.ts | 4 +- ts/state/selectors/message.ts | 144 ++--- ts/state/selectors/nav.ts | 14 +- ts/state/selectors/network.ts | 6 +- ts/state/selectors/notificationProfiles.ts | 8 +- ts/state/selectors/preferredReactions.ts | 4 +- ts/state/selectors/safetyNumber.ts | 4 +- ts/state/selectors/search.ts | 24 +- ts/state/selectors/stickers.ts | 10 +- ts/state/selectors/stories.ts | 40 +- ts/state/selectors/stories2.ts | 10 +- ts/state/selectors/storyDistributionLists.ts | 10 +- ts/state/selectors/timeline.ts | 20 +- ts/state/selectors/toast.ts | 4 +- ts/state/selectors/updates.ts | 6 +- ts/state/selectors/user.ts | 16 +- ts/state/selectors/username.ts | 8 +- ts/state/smart/AboutContactModal.tsx | 20 +- ts/state/smart/AddUserToAnotherGroupModal.tsx | 12 +- ts/state/smart/AllMedia.tsx | 12 +- ts/state/smart/App.tsx | 44 +- ts/state/smart/CallLinkAddNameModal.tsx | 18 +- ts/state/smart/CallLinkDetails.tsx | 18 +- ts/state/smart/CallLinkEditModal.tsx | 27 +- .../smart/CallLinkPendingParticipantModal.tsx | 16 +- ts/state/smart/CallManager.tsx | 58 +- ts/state/smart/CallingDeviceSelection.tsx | 8 +- ts/state/smart/CallsTab.tsx | 46 +- ts/state/smart/CaptchaDialog.tsx | 10 +- ts/state/smart/ChatColorPicker.tsx | 14 +- ts/state/smart/ChatsTab.tsx | 42 +- ts/state/smart/ChooseGroupMembersModal.tsx | 14 +- ts/state/smart/CollidingAvatars.tsx | 6 +- ts/state/smart/CompositionArea.tsx | 70 +-- ts/state/smart/CompositionRecording.tsx | 12 +- ts/state/smart/CompositionRecordingDraft.tsx | 14 +- ts/state/smart/CompositionTextArea.tsx | 22 +- ts/state/smart/ConfirmAdditionsModal.tsx | 10 +- ts/state/smart/ConfirmLeaveCallModal.tsx | 10 +- ts/state/smart/ContactDetail.tsx | 14 +- ts/state/smart/ContactModal.tsx | 26 +- ts/state/smart/ContactName.tsx | 8 +- .../smart/ContactSpoofingReviewDialog.tsx | 26 +- ts/state/smart/ConversationDetails.tsx | 50 +- ts/state/smart/ConversationHeader.tsx | 60 +- .../ConversationNotificationsSettings.tsx | 10 +- ts/state/smart/ConversationPanel.tsx | 44 +- ts/state/smart/ConversationView.tsx | 18 +- ts/state/smart/CrashReportDialog.tsx | 8 +- .../CustomizingPreferredReactionsModal.tsx | 16 +- ts/state/smart/DeleteMessagesModal.tsx | 26 +- ts/state/smart/DraftGifMessageSendModal.tsx | 40 +- ts/state/smart/EditHistoryMessagesModal.tsx | 20 +- ts/state/smart/EditNicknameAndNoteModal.tsx | 16 +- ts/state/smart/EmojiPicker.tsx | 14 +- ts/state/smart/ForwardMessagesModal.tsx | 42 +- ts/state/smart/FunProvider.tsx | 38 +- ts/state/smart/GV1Members.tsx | 14 +- ts/state/smart/GlobalModalContainer.tsx | 58 +- ts/state/smart/GroupLinkManagement.tsx | 8 +- ts/state/smart/GroupV1MigrationDialog.tsx | 16 +- ts/state/smart/GroupV2JoinDialog.tsx | 8 +- ts/state/smart/GroupV2Permissions.tsx | 8 +- ts/state/smart/HeroRow.tsx | 24 +- ts/state/smart/Inbox.tsx | 30 +- ts/state/smart/InstallScreen.tsx | 30 +- ts/state/smart/LeftPane.tsx | 89 +-- ts/state/smart/Lightbox.tsx | 16 +- ts/state/smart/MessageAudio.tsx | 18 +- ts/state/smart/MessageDetail.tsx | 26 +- .../MessageRequestActionsConfirmation.tsx | 18 +- ts/state/smart/MessageSearchResult.tsx | 12 +- ts/state/smart/MiniPlayer.tsx | 10 +- ts/state/smart/NavTabs.tsx | 26 +- ts/state/smart/NetworkStatus.tsx | 10 +- ts/state/smart/NotePreviewModal.tsx | 12 +- ts/state/smart/PendingInvites.tsx | 16 +- ts/state/smart/Preferences.tsx | 123 ++-- ts/state/smart/PreferencesChatFoldersPage.tsx | 12 +- ts/state/smart/PreferencesDonations.tsx | 44 +- .../smart/PreferencesEditChatFolderPage.tsx | 18 +- ts/state/smart/ProfileEditor.tsx | 34 +- ts/state/smart/ProfileNameWarningModal.tsx | 8 +- ts/state/smart/ReactionPicker.tsx | 12 +- ts/state/smart/RelinkDialog.tsx | 8 +- ts/state/smart/SafetyNumberModal.tsx | 12 +- ts/state/smart/SafetyNumberViewer.tsx | 12 +- ts/state/smart/SendAnywayDialog.tsx | 22 +- ts/state/smart/ShortcutGuideModal.tsx | 10 +- ts/state/smart/StickerManager.tsx | 10 +- ts/state/smart/StickerPreviewModal.tsx | 10 +- ts/state/smart/StoriesSettingsModal.tsx | 20 +- ts/state/smart/StoriesTab.tsx | 44 +- ts/state/smart/StoryCreator.tsx | 50 +- ts/state/smart/StoryViewer.tsx | 50 +- ts/state/smart/Timeline.tsx | 49 +- ts/state/smart/TimelineItem.tsx | 42 +- ts/state/smart/ToastManager.tsx | 47 +- ts/state/smart/TypingBubble.tsx | 12 +- ts/state/smart/UniversalTimerNotification.tsx | 6 +- ts/state/smart/UnsupportedOSDialog.tsx | 10 +- ts/state/smart/UpdateDialog.tsx | 12 +- ts/state/smart/UsernameEditor.tsx | 16 +- ts/state/smart/UsernameOnboardingModal.tsx | 12 +- ts/state/smart/VoiceNotesPlaybackProvider.tsx | 28 +- ts/state/smart/Waveform.tsx | 8 +- ts/state/smart/renderAudioAttachment.tsx | 6 +- ts/state/smart/renderEmojiPicker.tsx | 4 +- ts/state/smart/renderReactionPicker.tsx | 2 +- ts/state/types.ts | 68 +-- ts/test-electron/ContactsParser_test.ts | 37 +- .../ConversationController_test.ts | 16 +- ts/test-electron/Crypto_test.ts | 26 +- ts/test-electron/Curve_test.ts | 6 +- ts/test-electron/MessageReceipts_test.ts | 14 +- ts/test-electron/MessageReceiver_test.ts | 18 +- ts/test-electron/SignalProtocolStore_test.ts | 30 +- ts/test-electron/WebsocketResources_test.ts | 8 +- ts/test-electron/background_test.ts | 4 +- ts/test-electron/backup/attachments_test.ts | 34 +- .../backup_groupv2_notifications_test.ts | 26 +- ts/test-electron/backup/bubble_test.ts | 36 +- ts/test-electron/backup/calling_test.ts | 36 +- ts/test-electron/backup/conversations_test.ts | 20 +- ts/test-electron/backup/filePointer_test.ts | 24 +- ts/test-electron/backup/helpers.ts | 26 +- ts/test-electron/backup/integration_test.ts | 10 +- ts/test-electron/backup/non_bubble_test.ts | 30 +- .../cleanupOrphanedAttachments_test.ts | 14 +- ts/test-electron/components/Avatar_test.tsx | 2 +- ts/test-electron/context/Crypto_test.ts | 4 +- .../context/createNativeThemeListener_test.ts | 10 +- .../linkPreviews/linkPreviewFetch_test.ts | 10 +- ts/test-electron/models/conversations_test.ts | 14 +- ts/test-electron/models/messages_test.ts | 36 +- .../normalizedAttachments_test.ts | 20 +- .../quill/emoji/completion_test.tsx | 12 +- .../quill/memberRepository_test.ts | 10 +- .../quill/mentions/completion_test.tsx | 19 +- .../quill/mentions/matchers_test.ts | 12 +- ts/test-electron/quill/util_test.ts | 6 +- .../routineProfileRefresh_test.ts | 12 +- ts/test-electron/scrollUtil_test.ts | 2 +- .../services/ActiveWindowService_test.ts | 4 +- .../services/AttachmentBackupManager_test.ts | 24 +- .../AttachmentDownloadManager_test.ts | 33 +- .../services/MessageCache_test.ts | 10 +- .../services/ReleaseNotesFetcher_test.ts | 16 +- .../services/areWeASubscriber_test.ts | 4 +- ts/test-electron/services/profiles_test.ts | 12 +- .../services/senderCertificate_test.ts | 10 +- .../attachment_download_backup_stats_test.ts | 12 +- ts/test-electron/sql/callLinks_test.ts | 4 +- .../sql/conversationSummary_test.ts | 10 +- ts/test-electron/sql/donationReceipts_test.ts | 4 +- ts/test-electron/sql/fullTextSearch_test.ts | 8 +- .../sql/getCallHistoryGroups_test.ts | 16 +- .../sql/getCallHistoryMessageByCallId_test.ts | 8 +- .../sql/getMessagesBetween_test.ts | 8 +- .../getNearbyMessageFromDeletedSet_test.ts | 8 +- ...RecentStaleRingsAndMarkOlderMissed_test.ts | 10 +- .../sql/getRecentStoryReplies_test.ts | 8 +- ts/test-electron/sql/markRead_test.ts | 16 +- .../sql/notificationProfiles_test.ts | 8 +- .../sql/removeAllConfiguration_test.ts | 2 +- ts/test-electron/sql/sendLog_test.ts | 8 +- ts/test-electron/sql/stories_test.ts | 8 +- .../sql/storyDistribution_test.ts | 8 +- ts/test-electron/sql/storyReads_test.ts | 6 +- ts/test-electron/sql/timelineFetches_test.ts | 10 +- ts/test-electron/sql/utils_test.ts | 2 +- ts/test-electron/state/ducks/calling_test.ts | 36 +- .../state/ducks/conversations_test.ts | 42 +- ts/test-electron/state/ducks/stories_test.ts | 34 +- ts/test-electron/state/ducks/username_test.ts | 16 +- .../state/selectors/audioPlayer_test.ts | 12 +- .../state/selectors/calling_test.ts | 20 +- .../selectors/conversations-extra_test.ts | 32 +- .../state/selectors/messages_test.ts | 10 +- .../textsecure/AccountManager_test.ts | 14 +- .../textsecure/KeyChangeListener_test.ts | 20 +- ts/test-electron/textsecure/WebAPI_test.ts | 2 +- .../textsecure/generate_keys_test.ts | 17 +- .../updateConversationsWithUuidLookup_test.ts | 14 +- ts/test-electron/util/Username_test.ts | 2 +- ts/test-electron/util/canvasToBlob_test.ts | 6 +- ts/test-electron/util/canvasToBytes_test.ts | 6 +- .../util/downloadAttachment_test.ts | 28 +- .../util/encryptProfileData_test.ts | 10 +- .../util/imagePathToBytes_test.ts | 4 +- .../util/isWindowDragElement_test.ts | 2 +- .../util/migrateMessageData_test.ts | 12 +- ts/test-electron/util/reactions_test.ts | 16 +- .../util/scaleImageToLevel_test.ts | 4 +- ts/test-electron/util/sendToGroup_test.ts | 8 +- ts/test-electron/util/waitForOnline_test.ts | 4 +- ts/test-electron/windows/attachments_test.ts | 12 +- ts/test-helpers/FakeLeftPaneContainer.tsx | 2 +- ts/test-helpers/RemoteConfigStub.ts | 4 +- ts/test-helpers/attachmentDownloads.ts | 6 +- ts/test-helpers/createCallParticipant.ts | 8 +- ts/test-helpers/defaultComposerStates.ts | 6 +- ts/test-helpers/expireTimers.ts | 4 +- ts/test-helpers/fakeAttachment.ts | 4 +- ts/test-helpers/fakeCallLink.ts | 8 +- .../fakeLookupConversationWithoutServiceId.ts | 12 +- ts/test-helpers/generateBackup.ts | 18 +- ts/test-helpers/getDefaultConversation.ts | 16 +- ts/test-helpers/getFakeBadge.ts | 8 +- ts/test-helpers/getFakeCallHistoryGroup.ts | 6 +- ts/test-helpers/getFakeDistributionLists.ts | 12 +- ts/test-helpers/getFakeStory.tsx | 14 +- ts/test-helpers/getRandomColor.ts | 4 +- ts/test-helpers/getStickerPacks.ts | 2 +- ts/test-mock/backups/backups_test.ts | 31 +- ts/test-mock/benchmarks/backup_bench.ts | 6 +- .../benchmarks/call_history_search_bench.ts | 10 +- ts/test-mock/benchmarks/convo_open_bench.ts | 8 +- ts/test-mock/benchmarks/fixtures.ts | 4 +- ts/test-mock/benchmarks/group_send_bench.ts | 12 +- ts/test-mock/benchmarks/send_bench.ts | 8 +- ts/test-mock/benchmarks/startup_bench.ts | 4 +- ts/test-mock/benchmarks/storage_sync_bench.ts | 2 +- ts/test-mock/bootstrap.ts | 30 +- ts/test-mock/calling/callLinkAdmin_test.ts | 8 +- .../calling/callMessages_test.docker.ts | 8 +- ts/test-mock/calling/helpers.ts | 2 +- ts/test-mock/helpers.ts | 4 +- ts/test-mock/messaging/attachments_test.ts | 18 +- ts/test-mock/messaging/backfill_test.ts | 12 +- ts/test-mock/messaging/edit_test.ts | 24 +- .../messaging/expire_timer_version_test.ts | 12 +- ts/test-mock/messaging/lightbox_test.ts | 14 +- ts/test-mock/messaging/reaction_test.ts | 10 +- ts/test-mock/messaging/readSync_test.ts | 6 +- ts/test-mock/messaging/relink_test.ts | 8 +- ts/test-mock/messaging/retries_test.ts | 8 +- ts/test-mock/messaging/safety_number_test.ts | 12 +- ts/test-mock/messaging/sendSync_test.ts | 6 +- ts/test-mock/messaging/sender_key_test.ts | 6 +- ts/test-mock/messaging/stories_test.ts | 12 +- ts/test-mock/messaging/twoClients_test.ts | 8 +- .../messaging/unknown_contact_test.ts | 10 +- ts/test-mock/messaging/unprocessed_test.ts | 6 +- ts/test-mock/network/serverAlerts_test.ts | 8 +- ts/test-mock/playwright.ts | 14 +- ts/test-mock/pnp/accept_gv2_invite_test.ts | 10 +- ts/test-mock/pnp/calling_test.ts | 8 +- ts/test-mock/pnp/change_number_test.ts | 6 +- ts/test-mock/pnp/merge_test.ts | 14 +- ts/test-mock/pnp/phone_discovery_test.ts | 12 +- ts/test-mock/pnp/pni_change_test.ts | 12 +- ts/test-mock/pnp/pni_signature_test.ts | 16 +- ts/test-mock/pnp/pni_unlink_test.ts | 8 +- ts/test-mock/pnp/send_gv2_invite_test.ts | 10 +- ts/test-mock/pnp/username_test.ts | 14 +- ts/test-mock/rate-limit/story_test.ts | 10 +- ts/test-mock/rate-limit/viewed_test.ts | 10 +- .../release-notes/release_notes_test.ts | 10 +- ts/test-mock/routing/routing_test.ts | 10 +- ts/test-mock/settings/language_test.ts | 8 +- ts/test-mock/settings/settings_test.ts | 6 +- ts/test-mock/setup-ci.ts | 2 +- ts/test-mock/storage/archive_test.ts | 6 +- ts/test-mock/storage/call_links_test.ts | 12 +- ts/test-mock/storage/chat_folder_test.ts | 10 +- ts/test-mock/storage/conflict_test.ts | 8 +- ts/test-mock/storage/drop_test.ts | 6 +- ts/test-mock/storage/fixtures.ts | 18 +- ts/test-mock/storage/max_read_keys_test.ts | 12 +- ts/test-mock/storage/message_request_test.ts | 8 +- ts/test-mock/storage/pin_unpin_test.ts | 6 +- ts/test-mock/storage/sticker_test.ts | 6 +- ts/test-node/AsyncQueue_test.ts | 2 +- ts/test-node/RemoteConfig_test.ts | 8 +- ts/test-node/TaskWithTimeout_test.ts | 6 +- .../app/PreventDisplaySleepService_test.ts | 2 +- ts/test-node/app/SystemTrayService_test.ts | 8 +- .../app/SystemTraySettingCache_test.ts | 6 +- ts/test-node/app/base_config_test.ts | 10 +- ts/test-node/app/locale_test.ts | 6 +- ts/test-node/app/menu_test.ts | 12 +- ts/test-node/app/protocol_filter_test.ts | 2 +- ts/test-node/app/renderWindowsToast_test.tsx | 4 +- ts/test-node/app/spell_check_test.ts | 2 +- ts/test-node/app/updateDefaultSession_test.ts | 2 +- .../badges/getBadgeImageFileLocalPath_test.ts | 6 +- .../badges/isBadgeImageFileUrlValid_test.ts | 2 +- ts/test-node/badges/isBadgeVisible_test.ts | 6 +- .../badges/parseBadgesFromServer_test.ts | 6 +- .../calling/findBestMatchingDevice_test.ts | 2 +- ts/test-node/challenge_test.ts | 6 +- ts/test-node/components/fun/emojis_test.ts | 2 +- ts/test-node/components/fun/segments_test.ts | 2 +- .../leftPane/LeftPaneArchiveHelper_test.ts | 10 +- .../LeftPaneChooseGroupMembersHelper_test.ts | 11 +- .../leftPane/LeftPaneComposeHelper_test.ts | 11 +- .../leftPane/LeftPaneInboxHelper_test.tsx | 13 +- .../leftPane/LeftPaneSearchHelper_test.ts | 9 +- .../LeftPaneSetGroupMetadataHelper_test.ts | 11 +- .../getConversationInDirection_test.ts | 8 +- .../media-gallery/groupMediaItemsByDate.ts | 8 +- .../isConversationTooBigToRing_test.ts | 6 +- ts/test-node/environment_test.ts | 2 +- ts/test-node/groups/add_banned_member_test.ts | 11 +- ts/test-node/groups/limits_test.ts | 4 +- ts/test-node/groups/message_merge_test.ts | 4 +- ts/test-node/jobs/JobError_test.ts | 2 +- ts/test-node/jobs/JobLogger_test.ts | 2 +- .../jobs/JobQueueDatabaseStore_test.ts | 4 +- ts/test-node/jobs/JobQueue_test.ts | 22 +- ts/test-node/jobs/Job_test.ts | 2 +- ts/test-node/jobs/TestJobQueueStore.ts | 8 +- ts/test-node/jobs/formatJobForInsert_test.ts | 2 +- .../jobs/helpers/InMemoryQueues_test.ts | 2 +- .../jobs/helpers/addReportSpamJob_test.ts | 8 +- .../findRetryAfterTimeFromError_test.ts | 6 +- .../jobs/helpers/getHttpErrorCode_test.ts | 2 +- .../helpers/handleMultipleSendErrors_test.ts | 9 +- .../sleepForRateLimitRetryAfterTime_test.ts | 8 +- ts/test-node/jobs/helpers/syncHelpers_test.ts | 4 +- .../isLinkPreviewDateValid_test.ts | 2 +- .../shouldUseFullSizeLinkPreviewImage_test.ts | 6 +- .../logging/formatCountForLogging_test.ts | 2 +- ts/test-node/logging/uploadDebugLogs_test.ts | 10 +- ts/test-node/logging_test.ts | 8 +- .../messages/MessageReadStatus_test.ts | 2 +- .../messages/MessageSendState_test.ts | 4 +- .../messages/migrateLegacyReadStatus_test.ts | 4 +- .../migrateLegacySendAttributes_test.ts | 8 +- ts/test-node/processDataMessage_test.ts | 14 +- ts/test-node/processSyncMessage_test.ts | 4 +- .../reactions/isValidReactionEmoji_test.ts | 2 +- .../reactions/preferredReactionEmoji_test.ts | 4 +- ts/test-node/reactions/util_test.ts | 6 +- ts/test-node/services/donations_test.ts | 2 +- ...createExpiringEntityCleanupService_test.ts | 4 +- ts/test-node/services/ourProfileKey_test.ts | 6 +- ts/test-node/sql/cleanDataForIpc_test.ts | 2 +- ts/test-node/sql/cleanMessageData_test.ts | 4 +- ts/test-node/sql/helpers.ts | 8 +- ...incrementMessagesMigrationAttempts_test.ts | 6 +- .../sql/migrateConversationMessages_test.ts | 6 +- ts/test-node/sql/migration_1000_test.ts | 10 +- ts/test-node/sql/migration_1020_test.ts | 11 +- ts/test-node/sql/migration_1030_test.ts | 8 +- ts/test-node/sql/migration_1040_test.ts | 12 +- ts/test-node/sql/migration_1060_test.ts | 20 +- ts/test-node/sql/migration_1080_test.ts | 14 +- ts/test-node/sql/migration_1090_test.ts | 6 +- ts/test-node/sql/migration_1100_test.ts | 12 +- ts/test-node/sql/migration_1120_test.ts | 6 +- ts/test-node/sql/migration_1130_test.ts | 6 +- ts/test-node/sql/migration_1180_test.ts | 10 +- ts/test-node/sql/migration_1200_test.ts | 13 +- ts/test-node/sql/migration_1220_test.ts | 13 +- ts/test-node/sql/migration_1280_test.ts | 13 +- ts/test-node/sql/migration_1290_test.ts | 9 +- ts/test-node/sql/migration_1310_test.ts | 9 +- ts/test-node/sql/migration_1330_test.ts | 10 +- ts/test-node/sql/migration_1350_test.ts | 6 +- ts/test-node/sql/migration_1360_test.ts | 6 +- ts/test-node/sql/migration_1380_test.ts | 6 +- ts/test-node/sql/migration_1410_test.ts | 11 +- ts/test-node/sql/migration_1420_test.ts | 13 +- ts/test-node/sql/migration_87_test.ts | 10 +- ts/test-node/sql/migration_88_test.ts | 9 +- ts/test-node/sql/migration_89_test.ts | 18 +- ts/test-node/sql/migration_90_test.ts | 6 +- ts/test-node/sql/migration_91_test.ts | 15 +- ts/test-node/sql/migration_920_test.ts | 10 +- ts/test-node/sql/migration_960_test.ts | 9 +- ts/test-node/sql/migration_990_test.ts | 9 +- ts/test-node/sql/migrations_test.ts | 22 +- ts/test-node/state/ducks/audioPlayer_test.ts | 17 +- ts/test-node/state/ducks/badges_test.ts | 10 +- ts/test-node/state/ducks/composer_test.ts | 14 +- ts/test-node/state/ducks/donations_test.ts | 18 +- ts/test-node/state/ducks/globalModals_test.ts | 2 +- ts/test-node/state/ducks/linkPreviews_test.ts | 4 +- ts/test-node/state/ducks/network_test.ts | 6 +- .../state/ducks/preferredReactions_test.ts | 12 +- .../state/selectors/conversations_test.ts | 24 +- ts/test-node/state/selectors/items_test.ts | 8 +- .../selectors/preferredReactions_test.ts | 10 +- ts/test-node/state/selectors/search_test.ts | 26 +- ts/test-node/state/selectors/user_test.ts | 8 +- ts/test-node/types/Attachment_test.ts | 16 +- ts/test-node/types/Avatar_test.ts | 2 +- ts/test-node/types/BodyRange_test.ts | 6 +- ts/test-node/types/DonationsCardForm_test.ts | 6 +- ts/test-node/types/EmbeddedContact_test.ts | 14 +- ts/test-node/types/LinkPreview_test.ts | 2 +- ts/test-node/types/MIME_test.ts | 2 +- ts/test-node/types/Message2_test.ts | 16 +- .../types/NotificationProfile_test.ts | 8 +- ts/test-node/types/PhoneNumber_test.ts | 2 +- ts/test-node/types/SchemaVersion_test.ts | 2 +- ts/test-node/types/Settings_test.ts | 8 +- ts/test-node/types/Stickers_test.ts | 2 +- .../types/StoryDistributionId_test.ts | 4 +- ts/test-node/types/SystemTraySetting_test.ts | 2 +- ts/test-node/types/errors_test.ts | 4 +- ts/test-node/types/setupI18n_test.ts | 4 +- ts/test-node/updater/common_test.ts | 8 +- ts/test-node/updater/curve_test.ts | 2 +- ts/test-node/updater/differential_test.ts | 16 +- ts/test-node/updater/signature_test.ts | 12 +- ts/test-node/updater/util_test.ts | 6 +- ts/test-node/util/AbortableProcess_test.ts | 2 +- ts/test-node/util/BackOff_test.ts | 2 +- ts/test-node/util/Bytes_test.ts | 2 +- ts/test-node/util/DelimitedStream_test.ts | 6 +- ts/test-node/util/LatestQueue_test.ts | 2 +- ts/test-node/util/appendMacStream_test.ts | 6 +- .../util/areObjectEntriesEqual_test.ts | 2 +- .../util/arePinnedConversationsEqual_test.ts | 4 +- ts/test-node/util/assert_test.ts | 2 +- .../assignWithNoUnnecessaryAllocation_test.ts | 2 +- ts/test-node/util/asyncIterables_test.ts | 4 +- ts/test-node/util/awaitObject_test.ts | 2 +- ts/test-node/util/batcher_test.ts | 4 +- ...kSendUntilConversationsAreVerified_test.ts | 10 +- ts/test-node/util/callDisposition_test.ts | 6 +- ts/test-node/util/callLinks_test.ts | 4 +- .../util/callingGetParticipantName_test.ts | 2 +- .../util/callingMessageToProto_test.ts | 4 +- ts/test-node/util/callingNotification_test.ts | 12 +- ts/test-node/util/characters_test.ts | 2 +- .../util/clearTimeoutIfNecessary_test.ts | 2 +- ts/test-node/util/combineNames_test.ts | 2 +- ts/test-node/util/countUnreadStats_test.ts | 2 +- ts/test-node/util/createSupportUrl_test.ts | 2 +- ts/test-node/util/currency_test.ts | 2 +- ts/test-node/util/deconstructLookup_test.ts | 2 +- ts/test-node/util/diffArraysAsSets_test.ts | 2 +- ts/test-node/util/dropNull_test.ts | 2 +- ts/test-node/util/emoji_test.ts | 2 +- ts/test-node/util/enum_test.ts | 2 +- ts/test-node/util/expirationTimer_test.ts | 8 +- ts/test-node/util/explodePromise_test.ts | 2 +- ts/test-node/util/exponentialBackoff_test.ts | 4 +- .../util/filterAndSortConversations_test.ts | 6 +- ts/test-node/util/finalStream_test.ts | 2 +- ts/test-node/util/formatTimestamp_test.ts | 4 +- .../util/generateConfigMatrix_test.ts | 2 +- ts/test-node/util/getAvatarData_test.ts | 4 +- ts/test-node/util/getClassNamesFor_test.ts | 2 +- ts/test-node/util/getCustomColorStyle.ts | 2 +- .../util/getFontNameByTextScript_test.ts | 4 +- ts/test-node/util/getGroupMemberships_test.ts | 12 +- ts/test-node/util/getHSL_test.ts | 2 +- ts/test-node/util/getInitials_test.ts | 2 +- ts/test-node/util/getMuteOptions_test.ts | 4 +- ts/test-node/util/getMutedUntilText_test.ts | 4 +- ts/test-node/util/getOwn_test.ts | 2 +- .../util/getStreamWithTimeout_test.ts | 6 +- ts/test-node/util/getUserAgent_test.ts | 2 +- .../util/graphemeAndLinkAwareSlice.ts | 2 +- ts/test-node/util/grapheme_test.ts | 2 +- ts/test-node/util/groupBy_test.ts | 2 +- .../util/groupMemberNameCollisions_test.ts | 4 +- .../util/groupSendEndorsements_test.ts | 4 +- ts/test-node/util/hslToRGB_test.ts | 2 +- ts/test-node/util/isConversationMuted_test.ts | 2 +- .../util/isConversationNameKnown_test.ts | 2 +- .../util/isConversationSMSOnly_test.ts | 4 +- .../util/isConversationUnread_test.ts | 2 +- .../util/isConversationUnregistered_test.ts | 6 +- ts/test-node/util/isFileDangerous_test.ts | 2 +- ts/test-node/util/isInSystemContacts_test.ts | 2 +- ts/test-node/util/isMessageUnread_test.ts | 4 +- ts/test-node/util/isNormalNumber_test.ts | 2 +- ts/test-node/util/isNotNil_test.ts | 2 +- ts/test-node/util/isPathInside_test.ts | 2 +- ts/test-node/util/isRecord_test.ts | 2 +- ts/test-node/util/isSorted_test.ts | 2 +- ts/test-node/util/isValidE164_test.ts | 2 +- ts/test-node/util/isValidUuid.ts | 2 +- ts/test-node/util/iterables_test.ts | 2 +- ts/test-node/util/libphonenumberUtil_test.ts | 2 +- ts/test-node/util/logPadding_test.ts | 4 +- ts/test-node/util/makeLookup_test.ts | 2 +- ts/test-node/util/mapEmplace_test.ts | 4 +- ts/test-node/util/mapObjectWithSpec_test.ts | 2 +- ts/test-node/util/mapUtil_test.ts | 2 +- ts/test-node/util/messageFailures.ts | 18 +- ts/test-node/util/normalizeDeviceName_test.ts | 2 +- ts/test-node/util/parseIntOrThrow_test.ts | 2 +- .../util/parseIntWithFallback_test.ts | 2 +- ts/test-node/util/parseRetryAfter_test.ts | 4 +- ts/test-node/util/prependStream_test.ts | 2 +- ts/test-node/util/privacy_test.ts | 4 +- .../util/queueAttachmentDownloads_test.ts | 12 +- ts/test-node/util/reallyJsonStringify_test.ts | 2 +- ts/test-node/util/replaceIndex_test.ts | 2 +- .../util/resolveCanonicalLocales_test.ts | 2 +- ts/test-node/util/retryPlaceholders_test.ts | 6 +- ts/test-node/util/rgbToHSL_test.ts | 2 +- .../nonRenderedRemoteParticipant_test.ts | 2 +- .../normalizeGroupCallTimestamp_test.ts | 2 +- ts/test-node/util/schemas_test.ts | 2 +- .../util/searchConversationTitles_test.ts | 4 +- ts/test-node/util/search_test.ts | 2 +- ts/test-node/util/serverAlerts_test.ts | 4 +- ts/test-node/util/sessionTranslation_test.ts | 6 +- ts/test-node/util/setUtil_test.ts | 2 +- ts/test-node/util/signalRoutes_test.ts | 4 +- ts/test-node/util/sleep_test.ts | 2 +- ts/test-node/util/sniffImageMimeType_test.ts | 8 +- ts/test-node/util/sortByTitle_test.ts | 2 +- ts/test-node/util/splitText_test.ts | 4 +- .../util/startTimeTravelDetector_test.ts | 2 +- ts/test-node/util/theme_test.ts | 2 +- ts/test-node/util/timelineUtil_test.ts | 8 +- ts/test-node/util/timestampLongUtils_test.ts | 4 +- ts/test-node/util/timestamp_test.ts | 6 +- ts/test-node/util/toWebStream_test.ts | 2 +- .../util/toggleMaximizedBrowserWindow_test.ts | 2 +- ts/test-node/util/unicodeBidi_test.ts | 2 +- ts/test-node/util/unicodeSlice_test.ts | 4 +- ts/test-node/util/uploads/helpers.ts | 10 +- ts/test-node/util/uploads/tusProtocol_test.ts | 6 +- ts/test-node/util/url_test.ts | 4 +- ts/test-node/util/userLanguages_test.ts | 2 +- ts/test-node/util/version_test.ts | 2 +- ts/test-node/util/waitBatcher_test.ts | 6 +- ts/test-node/util/waitForAll.ts | 2 +- ts/test-node/util/webSafeBase64_test.ts | 5 +- .../util/windowsZoneIdentifier_test.ts | 8 +- .../util/wrapEventEmitterOnce_test.ts | 4 +- ts/textsecure/AccountManager.ts | 62 +- ts/textsecure/ContactsParser.ts | 28 +- ts/textsecure/Errors.ts | 8 +- ts/textsecure/KeyChangeListener.ts | 4 +- ts/textsecure/MessageReceiver.ts | 108 ++-- ts/textsecure/OutgoingMessage.ts | 30 +- ts/textsecure/Provisioner.ts | 38 +- ts/textsecure/ProvisioningCipher.ts | 22 +- ts/textsecure/SendMessage.ts | 91 +-- ts/textsecure/SocketManager.ts | 46 +- ts/textsecure/Storage.ts | 14 +- ts/textsecure/TaskWithTimeout.ts | 10 +- ts/textsecure/Types.d.ts | 24 +- ts/textsecure/UpdateKeysListener.ts | 14 +- ts/textsecure/Utils.ts | 2 +- ts/textsecure/WebAPI.ts | 113 ++-- ts/textsecure/WebSocket.ts | 24 +- ts/textsecure/WebsocketResources.ts | 36 +- ts/textsecure/cds/CDSBase.ts | 12 +- ts/textsecure/cds/CDSI.ts | 10 +- ts/textsecure/cds/CDSISocket.ts | 8 +- ts/textsecure/cds/CDSSocketBase.ts | 24 +- ts/textsecure/cds/Types.d.ts | 2 +- ts/textsecure/downloadAttachment.ts | 46 +- ts/textsecure/getKeysForServiceId.ts | 22 +- ts/textsecure/index.ts | 16 +- ts/textsecure/messageReceiverEvents.ts | 14 +- ts/textsecure/preconnect.ts | 16 +- ts/textsecure/processDataMessage.ts | 36 +- ts/textsecure/processSyncMessage.ts | 8 +- ts/textsecure/storage/Blocked.ts | 10 +- ts/textsecure/storage/User.ts | 16 +- ts/textsecure/syncRequests.ts | 8 +- ts/types/Address.ts | 2 +- ts/types/Attachment.ts | 40 +- ts/types/AttachmentBackup.ts | 4 +- ts/types/AttachmentDownload.ts | 8 +- ts/types/AttachmentSize.ts | 6 +- ts/types/Avatar.ts | 6 +- ts/types/BodyRange.ts | 18 +- ts/types/CallDisposition.ts | 12 +- ts/types/CallLink.ts | 10 +- ts/types/Calling.ts | 8 +- ts/types/ChatFolder.ts | 12 +- ts/types/Conversation.ts | 10 +- ts/types/Crypto.ts | 2 +- ts/types/DonationsCardForm.ts | 4 +- ts/types/EmbeddedContact.ts | 20 +- ts/types/ErrorWithToast.ts | 2 +- ts/types/ForwardDraft.ts | 8 +- ts/types/GroupSendEndorsements.ts | 6 +- ts/types/I18N.ts | 4 +- ts/types/LinkPreview.ts | 15 +- ts/types/MediaItem.ts | 4 +- ts/types/Message.ts | 6 +- ts/types/Message2.ts | 38 +- ts/types/NotificationProfile-node.ts | 12 +- ts/types/NotificationProfile.ts | 6 +- ts/types/Panels.ts | 2 +- ts/types/PhoneNumber.ts | 6 +- ts/types/PreferencesBackupPage.ts | 2 +- ts/types/QualifiedAddress.ts | 10 +- ts/types/Reactions.ts | 2 +- ts/types/Receipt.ts | 2 +- ts/types/RendererConfig.ts | 8 +- ts/types/ServiceId.ts | 8 +- ts/types/Settings.ts | 6 +- ts/types/SignalConversation.ts | 2 +- ts/types/Stickers.ts | 47 +- ts/types/Storage.d.ts | 26 +- ts/types/StorageUIKeys.ts | 2 +- ts/types/Stories.ts | 20 +- ts/types/StoryDistributionId.ts | 6 +- ts/types/SystemTraySetting.ts | 2 +- ts/types/Util.ts | 8 +- ts/types/VisualAttachment.ts | 20 +- ts/types/backups.ts | 2 +- ts/types/errors.ts | 2 +- ts/types/message/LinkPreviews.ts | 2 +- ts/updateConversationsWithUuidLookup.ts | 12 +- ts/updater/common.ts | 42 +- ts/updater/differential.ts | 24 +- ts/updater/generateKeyPair.ts | 8 +- ts/updater/generateSignature.ts | 10 +- ts/updater/got.ts | 10 +- ts/updater/index.ts | 8 +- ts/updater/linux.ts | 10 +- ts/updater/macos.ts | 14 +- ts/updater/signature.ts | 10 +- ts/updater/util.ts | 18 +- ts/updater/windows.ts | 10 +- ts/util/AbortableProcess.ts | 2 +- ts/util/DelimitedStream.ts | 4 +- ts/util/GoogleChrome.ts | 2 +- ts/util/JobQueue.ts | 2 +- ts/util/LatestQueue.ts | 2 +- ts/util/ServiceId.ts | 12 +- ts/util/Sound.ts | 4 +- ts/util/StartupQueue.ts | 4 +- ts/util/Username.ts | 4 +- ts/util/appendMacStream.ts | 8 +- ts/util/arePinnedConversationsEqual.ts | 6 +- ts/util/areWeAdmin.ts | 6 +- ts/util/arrayBufferToObjectURL.ts | 2 +- ts/util/assert.ts | 6 +- ts/util/attachmentDownloadQueue.ts | 20 +- ts/util/attachmentPath.ts | 4 +- ts/util/attachments.ts | 16 +- .../markAttachmentAsPermanentlyErrored.ts | 2 +- .../attachments/migrateDataToFilesystem.ts | 4 +- ts/util/avatarDataToBytes.ts | 12 +- ts/util/avatarTextSizeCalculator.ts | 2 +- ts/util/avatarUtils.ts | 10 +- ts/util/backupMediaDownload.ts | 6 +- ts/util/backupSubscriptionData.ts | 10 +- ts/util/batcher.ts | 12 +- .../blockSendUntilConversationsAreVerified.ts | 14 +- ts/util/buildExpiration.ts | 10 +- ts/util/callDisposition.ts | 64 +- ts/util/callLinks.ts | 15 +- ts/util/callLinksRingrtc.ts | 32 +- ts/util/callingGetParticipantName.ts | 2 +- ts/util/callingIsReconnecting.ts | 8 +- ts/util/callingMessageToProto.ts | 8 +- ts/util/callingNotification.ts | 20 +- ts/util/callingTones.ts | 4 +- ts/util/canAddNewMembers.ts | 8 +- ts/util/canBeAnnouncementGroup.ts | 4 +- ts/util/canChangeTimer.ts | 8 +- ts/util/canConversationBeUnarchived.ts | 4 +- ts/util/canEditGroupInfo.ts | 8 +- ts/util/canEditMessage.ts | 10 +- ts/util/canvasToBlob.ts | 2 +- ts/util/canvasToBytes.ts | 4 +- ts/util/checkFirstEnvelope.ts | 14 +- ts/util/checkOurPniIdentityKey.ts | 6 +- ts/util/cleanup.ts | 36 +- ts/util/clearConversationDraftAttachments.ts | 8 +- ts/util/computeBlurHashUrl.ts | 2 +- ts/util/consoleLogger.ts | 2 +- ts/util/copyDataMessageIntoMessage.ts | 4 +- ts/util/copyLinksWithToast.ts | 2 +- ts/util/countUnreadStats.ts | 4 +- ts/util/createAvatarData.ts | 2 +- ts/util/createHTTPSAgent.ts | 30 +- ts/util/createIPCEvents.ts | 36 +- ts/util/createIdenticon.tsx | 8 +- ts/util/createProxyAgent.ts | 20 +- ts/util/currency.ts | 8 +- ts/util/decipherWithAesKey.ts | 4 +- ts/util/deconstructLookup.ts | 4 +- ts/util/deleteAllLogs.ts | 4 +- ts/util/deleteAllMyStories.ts | 2 +- ts/util/deleteDraftAttachment.ts | 2 +- ts/util/deleteForEveryone.ts | 20 +- ts/util/deleteForMe.ts | 20 +- ts/util/deleteGroupStoryReplyForEveryone.ts | 8 +- ts/util/deleteStoryForEveryone.ts | 34 +- ts/util/denyPendingApprovalRequest.ts | 12 +- ts/util/deprecated.ts | 4 +- ts/util/desktopCapturer.ts | 22 +- ts/util/distributionListToSendTarget.ts | 12 +- ts/util/dns.ts | 10 +- ts/util/donations.ts | 14 +- ts/util/doubleCheckMissingQuoteReference.ts | 18 +- ts/util/downloadAttachment.ts | 20 +- ts/util/downloadAttachmentFromLocalBackup.ts | 6 +- ts/util/downloadOnboardingStory.ts | 20 +- ts/util/durations/duration-in-seconds.ts | 2 +- ts/util/durations/index.ts | 4 +- ts/util/editHelpers.ts | 6 +- ts/util/emoji.ts | 4 +- ts/util/encryptConversationAttachments.ts | 16 +- ts/util/encryptLegacyAttachment.ts | 12 +- ts/util/encryptProfileData.ts | 19 +- ts/util/expirationTimer.ts | 4 +- ts/util/exponentialBackoff.ts | 4 +- ts/util/filterAndSortConversations.ts | 16 +- ts/util/filterCallLinks.ts | 6 +- .../findAndDeleteOnboardingStoryIfExists.ts | 12 +- ts/util/findAndFormatContact.ts | 6 +- ts/util/findStoryMessage.ts | 12 +- ts/util/formatTimestamp.ts | 4 +- ts/util/fuse.ts | 2 +- ts/util/generateDonationReceipt.ts | 12 +- ts/util/generateMessageId.ts | 2 +- ts/util/getAboutText.ts | 2 +- ts/util/getAccessControlOptions.ts | 4 +- ts/util/getAddedByForOurPendingInvitation.ts | 2 +- ts/util/getAppErrorIcon.ts | 2 +- ts/util/getAvatarData.ts | 8 +- ts/util/getBasicAuth.ts | 2 +- ts/util/getColorForCallLink.ts | 2 +- ts/util/getConversation.ts | 58 +- ts/util/getConversationColorAttributes.ts | 4 +- ts/util/getConversationMembers.ts | 6 +- ts/util/getConversationTitleForPanelType.ts | 6 +- ts/util/getCountryData.ts | 2 +- ts/util/getCustomColorStyle.ts | 8 +- ts/util/getDraftPreview.ts | 12 +- ts/util/getE164.ts | 6 +- ts/util/getFontNameByTextScript.ts | 4 +- ts/util/getGroupMemberships.ts | 10 +- ts/util/getICUMessageParams.ts | 2 +- ts/util/getLastMessage.ts | 12 +- ts/util/getLocalAttachmentUrl.ts | 4 +- ts/util/getMacAndUpdateHmac.ts | 2 +- ts/util/getMessageAuthorText.ts | 6 +- ts/util/getMessageConversation.ts | 4 +- ts/util/getMessageQueueTime.ts | 6 +- ts/util/getMessageSentTimestamp.ts | 6 +- ts/util/getMessageSentTimestampSet.ts | 2 +- ts/util/getMessageTimestamp.ts | 2 +- ts/util/getMuteOptions.ts | 8 +- ts/util/getMutedUntilText.ts | 4 +- ts/util/getNotificationDataForMessage.ts | 54 +- ts/util/getNotificationTextForMessage.ts | 12 +- ts/util/getProfile.ts | 6 +- ts/util/getQuoteBodyText.ts | 4 +- ts/util/getRecipientConversationIds.ts | 6 +- ts/util/getRecipients.ts | 12 +- ts/util/getRecipientsByConversation.ts | 10 +- ts/util/getSendOptions.ts | 24 +- ts/util/getSendTarget.ts | 4 +- ts/util/getSenderIdentifier.ts | 2 +- ts/util/getServiceIdsForE164s.ts | 12 +- ts/util/getSignalConnections.ts | 16 +- ts/util/getStoryBackground.ts | 5 +- ts/util/getStoryDuration.ts | 12 +- ts/util/getStoryReplyText.ts | 6 +- ts/util/getStreamWithTimeout.ts | 10 +- ts/util/getStringForConversationMerge.ts | 2 +- ts/util/getStringForPhoneNumberDiscovery.ts | 2 +- ts/util/getStringForProfileChange.ts | 2 +- ts/util/getThemeType.ts | 4 +- ts/util/getTitle.ts | 10 +- ts/util/getUserAgent.ts | 4 +- ts/util/grapheme.ts | 2 +- ts/util/groupAndOrderReactions.ts | 8 +- ts/util/groupMemberNameCollisions.ts | 10 +- ts/util/groupMembershipUtils.ts | 8 +- ts/util/groupSendEndorsements.ts | 44 +- ts/util/handleEditMessage.ts | 38 +- ts/util/handleImageAttachment.ts | 16 +- ts/util/handleMessageSend.ts | 14 +- ts/util/handleOutsideClick.ts | 2 +- ts/util/handleRetry.ts | 48 +- ts/util/handleServerAlerts.ts | 12 +- ts/util/handleVideoAttachment.ts | 8 +- ts/util/hasAttachmentDownloads.ts | 4 +- ts/util/hasDraft.ts | 2 +- ts/util/hasDraftAttachments.ts | 2 +- ts/util/hydrateStoryContext.ts | 24 +- ts/util/idForLogging.ts | 10 +- ts/util/imagePathToBytes.ts | 2 +- ts/util/incrementMessageCounter.ts | 8 +- ts/util/isAciString.ts | 4 +- ts/util/isBackupEnabled.ts | 8 +- ts/util/isBlocked.ts | 4 +- ts/util/isCallSafe.ts | 10 +- ts/util/isConversationAccepted.ts | 10 +- ts/util/isConversationMuted.ts | 2 +- ts/util/isConversationNameKnown.ts | 4 +- ts/util/isConversationSMSOnly.ts | 2 +- ts/util/isConversationUnregistered.ts | 8 +- ts/util/isGroupInStoryMode.ts | 6 +- ts/util/isGroupOrAdhocCall.ts | 6 +- ts/util/isLinkAndSyncEnabled.ts | 2 +- ts/util/isLocalBackupsEnabled.ts | 8 +- ts/util/isMessageEmpty.ts | 6 +- ts/util/isMessageNoteToSelf.ts | 2 +- ts/util/isMessageUnread.ts | 4 +- ts/util/isPQRatchetEnabled.ts | 2 +- ts/util/isPathInside.ts | 2 +- ts/util/isProtoBinaryEncodingEnabled.ts | 2 +- ts/util/isSafetyNumberNotAvailable.ts | 4 +- ts/util/isSameAvatarData.ts | 2 +- ts/util/isSettingsInternalEnabled.ts | 4 +- ts/util/isSignalConversation.ts | 4 +- ts/util/isStagingServer.ts | 4 +- ts/util/isTooOldToModifyMessage.ts | 4 +- ts/util/isValidTapToView.ts | 4 +- ts/util/isVideoGoodForStories.ts | 6 +- ts/util/iterables.ts | 2 +- ts/util/keyboard.ts | 2 +- ts/util/leftPaneWidth.ts | 4 +- ts/util/libphonenumberUtil.ts | 2 +- ts/util/lint/analyze_exceptions.ts | 6 +- ts/util/lint/license_comments.ts | 12 +- ts/util/lint/linter.ts | 10 +- ts/util/lint/sort_exceptions.ts | 6 +- ts/util/lint/util.ts | 2 +- ts/util/loadImage.ts | 2 +- ts/util/loadRecentEmojis.ts | 2 +- ts/util/logPadding.ts | 4 +- ts/util/longAttachment.ts | 2 +- ts/util/longRunningTaskWrapper.tsx | 14 +- ts/util/lookupConversationWithoutServiceId.ts | 18 +- ts/util/makeQuote.ts | 30 +- ts/util/mapUtil.ts | 2 +- ts/util/markConversationRead.ts | 42 +- ts/util/markOnboardingStoryAsRead.ts | 16 +- ts/util/maybeForwardMessages.ts | 34 +- ts/util/messageBatcher.ts | 12 +- ts/util/migrateColor.ts | 8 +- ts/util/missingCaseError.ts | 2 +- ts/util/modifyTargetMessage.ts | 63 +- ts/util/nicknames.ts | 4 +- ts/util/normalizeAci.ts | 10 +- ts/util/numbers.ts | 2 +- ts/util/onCallEventSync.ts | 8 +- ts/util/onCallLinkUpdateSync.ts | 16 +- ts/util/onCallLogEventSync.ts | 16 +- ts/util/onDeviceNameChangeSync.ts | 14 +- ts/util/onStoryRecipientUpdate.ts | 26 +- ts/util/openLinkInWebBrowser.ts | 2 +- ts/util/os/osMain.ts | 4 +- ts/util/os/osPreload.ts | 4 +- ts/util/os/promptOSAuthMain.ts | 8 +- ts/util/parseIntWithFallback.ts | 2 +- ts/util/parseRetryAfter.ts | 4 +- ts/util/pemToDer.ts | 2 +- ts/util/phoneNumberDiscoverability.ts | 2 +- ts/util/phoneNumberSharingMode.ts | 8 +- ts/util/preload.ts | 10 +- ts/util/prependStream.ts | 4 +- ts/util/privacy.ts | 6 +- ts/util/processAttachment.ts | 24 +- ts/util/processImageFile.ts | 2 +- ts/util/promptOSAuth.ts | 2 +- ts/util/queueAttachmentDownloads.ts | 52 +- ts/util/randomBlurHash.ts | 2 +- ts/util/removePendingMember.ts | 14 +- ts/util/resolveAttachmentDraftData.ts | 4 +- ts/util/resolveDraftAttachmentOnDisk.ts | 8 +- ts/util/resolveStorySendStatus.ts | 8 +- ts/util/retryPlaceholders.ts | 6 +- .../ringrtc/nonRenderedRemoteParticipant.ts | 2 +- ts/util/rotatingPinoDest.ts | 6 +- ts/util/safetyNumber.ts | 12 +- ts/util/scaleImageToLevel.ts | 10 +- ts/util/searchConversationTitles.ts | 4 +- ts/util/sendCallLinkUpdateSync.ts | 18 +- ts/util/sendDeleteForEveryoneMessage.ts | 26 +- ts/util/sendEditedMessage.ts | 50 +- ts/util/sendReceipts.ts | 22 +- ts/util/sendStoryMessage.ts | 46 +- ts/util/sendToGroup.ts | 70 +-- ts/util/sessionTranslation.ts | 6 +- ts/util/setUtil.ts | 2 +- ts/util/setupI18n.tsx | 14 +- ts/util/setupI18nMain.ts | 14 +- ts/util/shouldDownloadStory.ts | 6 +- ts/util/shouldNeverBeCalled.ts | 2 +- ts/util/shouldRespondWithProfileKey.ts | 4 +- ts/util/shouldShowInvalidMessageToast.ts | 12 +- ts/util/shouldStoryReplyNotifyUser.ts | 12 +- ts/util/showConfirmationDialog.tsx | 6 +- ts/util/showDownloadFailedToast.ts | 6 +- ts/util/signalRoutes.ts | 11 +- ts/util/sleeper.ts | 4 +- ts/util/smartling.ts | 2 +- ts/util/sniffImageMimeType.ts | 4 +- ts/util/startConversation.ts | 4 +- ts/util/subscriptionConfiguration.ts | 8 +- ts/util/syncIdentifiers.ts | 26 +- ts/util/syncTasks.ts | 25 +- ts/util/theme.ts | 4 +- ts/util/timeAndLogIfTooLong.ts | 2 +- ts/util/timelineUtil.ts | 18 +- ts/util/timeout.ts | 2 +- ts/util/timestamp.ts | 6 +- ts/util/timestampLongUtils.ts | 2 +- ts/util/trimPadding.ts | 2 +- ts/util/unicodeBidi.ts | 2 +- ts/util/universalExpireTimer.ts | 4 +- ts/util/updateBackupMediaDownloadProgress.ts | 2 +- ts/util/uploadAttachment.ts | 26 +- ts/util/uploads/tusProtocol.ts | 10 +- ts/util/uploads/uploads.ts | 6 +- ts/util/uuidToBytes.ts | 6 +- ts/util/validateConversation.ts | 6 +- ts/util/verifyStoryListMembers.ts | 10 +- ts/util/waitBatcher.ts | 14 +- ts/util/waitForAll.ts | 2 +- ts/util/waitForOnline.ts | 2 +- ts/util/whatTypeOfConversation.ts | 8 +- ts/util/windowsZoneIdentifier.ts | 4 +- ts/util/wrapEventEmitterOnce.ts | 4 +- ts/util/wrapWithSyncMessageSend.ts | 18 +- ts/util/writeDraftAttachment.ts | 14 +- ts/util/zkgroup.ts | 14 +- ts/window.d.ts | 82 +-- ts/windows/about/app.tsx | 10 +- ts/windows/about/preload.ts | 6 +- ts/windows/calling-tools/preload.ts | 2 +- ts/windows/calling-tools/webrtc_internals.ts | 1 - ts/windows/context.ts | 28 +- ts/windows/debuglog/app.tsx | 10 +- ts/windows/debuglog/preload.ts | 2 +- ts/windows/loading/preload.ts | 4 +- ts/windows/loading/start.ts | 2 +- ts/windows/main/attachments.ts | 20 +- ts/windows/main/phase0-devtools.ts | 3 +- ts/windows/main/phase1-ipc.ts | 48 +- ts/windows/main/phase2-dependencies.ts | 16 +- ts/windows/main/phase3-post-signal.ts | 8 +- ts/windows/main/phase4-test.ts | 4 +- ts/windows/main/preload.ts | 4 +- ts/windows/main/preload_test.ts | 12 +- ts/windows/main/start.ts | 32 +- ts/windows/minimalContext.ts | 29 +- ts/windows/permissions/app.tsx | 10 +- ts/windows/permissions/preload.ts | 6 +- ts/windows/preload.ts | 2 +- ts/windows/sandboxedInit.ts | 4 +- ts/windows/screenShare/app.tsx | 14 +- ts/windows/screenShare/preload.ts | 4 +- ts/workers/heicConverterMain.ts | 4 +- ts/workers/heicConverterWorker.ts | 4 +- 2096 files changed, 14955 insertions(+), 14023 deletions(-) diff --git a/.eslintignore b/.eslintignore index 3e4e5a3b4a3..9833089e1e3 100644 --- a/.eslintignore +++ b/.eslintignore @@ -23,6 +23,7 @@ js/WebAudioRecorderMp3.js js/calling-tools/** # TypeScript generated files +build/**/*.js app/**/*.js ts/**/*.js diff --git a/.eslintrc.js b/.eslintrc.js index 66d145e08e4..cec6acf3a64 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -100,6 +100,14 @@ const rules = { // We prefer named exports 'import/prefer-default-export': 'off', + 'import/enforce-node-protocol-usage': ['error', 'always'], + 'import/extensions': [ + 'error', + 'ignorePackages', + { + checkTypeImports: true, + }, + ], // Prefer functional components with default params 'react/require-default-props': 'off', diff --git a/.gitignore b/.gitignore index f4d3becb92e..02aaef518f8 100644 --- a/.gitignore +++ b/.gitignore @@ -36,6 +36,7 @@ ts/sql/mainWorker.bundle.js.LICENSE.txt build/ICUMessageParams.d.ts # React / TypeScript +build/**/*.js app/*.js ts/**/*.js ts/protobuf/*.d.ts diff --git a/.prettierignore b/.prettierignore index 20e1689d1c9..09d1f9579cd 100644 --- a/.prettierignore +++ b/.prettierignore @@ -2,6 +2,7 @@ # supports `.gitignore`: https://github.com/prettier/prettier/issues/2294 # Generated files +build/**/*.js app/**/*.js config/local-*.json config/local.json diff --git a/.storybook/main.ts b/.storybook/main.ts index 2457014b748..7456cfaefc6 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -51,7 +51,9 @@ const config: StorybookConfig = { type: 'filesystem', }; - config.resolve!.extensions = ['.tsx', '.ts', '...']; + config.resolve!.extensionAlias = { + '.js': ['.tsx', '.ts', '.js'], + }; config.module!.rules!.unshift({ test: /\.scss$/, @@ -88,33 +90,12 @@ const config: StorybookConfig = { config.node = { global: true }; - config.externals = { - net: 'commonjs net', - vm: 'commonjs vm', - fs: 'commonjs fs', - async_hooks: 'commonjs async_hooks', - module: 'commonjs module', - stream: 'commonjs stream', - tls: 'commonjs tls', - dns: 'commonjs dns', - http: 'commonjs http', - https: 'commonjs https', - os: 'commonjs os', - constants: 'commonjs constants', - zlib: 'commonjs zlib', - '@signalapp/libsignal-client': 'commonjs @signalapp/libsignal-client', - '@signalapp/libsignal-client/zkgroup': - 'commonjs @signalapp/libsignal-client/zkgroup', - '@signalapp/ringrtc': 'commonjs @signalapp/ringrtc', - '@signalapp/better-sqlite3': 'commonjs @signalapp/better-sqlite3', - electron: 'commonjs electron', - 'fs-xattr': 'commonjs fs-xattr', - fsevents: 'commonjs fsevents', - 'mac-screen-capture-permissions': - 'commonjs mac-screen-capture-permissions', - sass: 'commonjs sass', - bufferutil: 'commonjs bufferutil', - 'utf-8-validate': 'commonjs utf-8-validate', + config.externals = ({ request }, callback) => { + if (/^node:/.test(request) && request !== 'node:buffer') { + // Keep Node.js imports unchanged + return callback(null, 'commonjs ' + request); + } + callback(); }; config.plugins!.push( diff --git a/app/EmojiService.ts b/app/EmojiService.ts index 879efb090f7..89c835ad4c6 100644 --- a/app/EmojiService.ts +++ b/app/EmojiService.ts @@ -7,9 +7,9 @@ import * as z from 'zod'; import { protocol } from 'electron'; import { LRUCache } from 'lru-cache'; -import type { OptionalResourceService } from './OptionalResourceService'; -import { SignalService as Proto } from '../ts/protobuf'; -import { parseUnknown } from '../ts/util/schemas'; +import type { OptionalResourceService } from './OptionalResourceService.js'; +import { SignalService as Proto } from '../ts/protobuf/index.js'; +import { parseUnknown } from '../ts/util/schemas.js'; const MANIFEST_PATH = join(__dirname, '..', 'build', 'jumbomoji.json'); diff --git a/app/OptionalResourceService.ts b/app/OptionalResourceService.ts index 24c422e9d85..8709821f726 100644 --- a/app/OptionalResourceService.ts +++ b/app/OptionalResourceService.ts @@ -12,12 +12,12 @@ import PQueue from 'p-queue'; import type { OptionalResourceType, OptionalResourcesDictType, -} from '../ts/types/OptionalResource'; -import { OptionalResourcesDictSchema } from '../ts/types/OptionalResource'; -import { createLogger } from '../ts/logging/log'; -import { getGotOptions } from '../ts/updater/got'; -import { drop } from '../ts/util/drop'; -import { parseUnknown } from '../ts/util/schemas'; +} from '../ts/types/OptionalResource.js'; +import { OptionalResourcesDictSchema } from '../ts/types/OptionalResource.js'; +import { createLogger } from '../ts/logging/log.js'; +import { getGotOptions } from '../ts/updater/got.js'; +import { drop } from '../ts/util/drop.js'; +import { parseUnknown } from '../ts/util/schemas.js'; const log = createLogger('OptionalResourceService'); diff --git a/app/PreventDisplaySleepService.ts b/app/PreventDisplaySleepService.ts index 9996d109f06..dbc0654170a 100644 --- a/app/PreventDisplaySleepService.ts +++ b/app/PreventDisplaySleepService.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { PowerSaveBlocker } from 'electron'; -import { createLogger } from '../ts/logging/log'; +import { createLogger } from '../ts/logging/log.js'; const log = createLogger('PreventDisplaySleepService'); diff --git a/app/SystemTrayService.ts b/app/SystemTrayService.ts index 1a36d935391..45bae0e9dbe 100644 --- a/app/SystemTrayService.ts +++ b/app/SystemTrayService.ts @@ -6,8 +6,8 @@ import { Menu, Tray, app, nativeImage, nativeTheme, screen } from 'electron'; import os from 'node:os'; import { join } from 'node:path'; import { readFileSync } from 'node:fs'; -import { createLogger } from '../ts/logging/log'; -import type { LocalizerType } from '../ts/types/I18N'; +import { createLogger } from '../ts/logging/log.js'; +import type { LocalizerType } from '../ts/types/I18N.js'; const log = createLogger('SystemTrayService'); diff --git a/app/SystemTraySettingCache.ts b/app/SystemTraySettingCache.ts index 7f108c58855..c0d7a6b21ad 100644 --- a/app/SystemTraySettingCache.ts +++ b/app/SystemTraySettingCache.ts @@ -1,14 +1,14 @@ // Copyright 2017 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../ts/logging/log'; -import OS from '../ts/util/os/osMain'; +import { createLogger } from '../ts/logging/log.js'; +import OS from '../ts/util/os/osMain.js'; import { parseSystemTraySetting, SystemTraySetting, -} from '../ts/types/SystemTraySetting'; -import { isSystemTraySupported } from '../ts/types/Settings'; -import type { ConfigType } from './base_config'; +} from '../ts/types/SystemTraySetting.js'; +import { isSystemTraySupported } from '../ts/types/Settings.js'; +import type { ConfigType } from './base_config.js'; const log = createLogger('SystemTraySettingCache'); diff --git a/app/WindowsNotifications.ts b/app/WindowsNotifications.ts index 5a780b68437..0fa9e759def 100644 --- a/app/WindowsNotifications.ts +++ b/app/WindowsNotifications.ts @@ -9,10 +9,10 @@ import { sendDummyKeystroke, } from '@indutny/simple-windows-notifications'; -import { createLogger } from '../ts/logging/log'; -import { AUMID } from './startup_config'; -import type { WindowsNotificationData } from '../ts/services/notifications'; -import { renderWindowsToast } from './renderWindowsToast'; +import { createLogger } from '../ts/logging/log.js'; +import { AUMID } from './startup_config.js'; +import type { WindowsNotificationData } from '../ts/services/notifications.js'; +import { renderWindowsToast } from './renderWindowsToast.js'; const log = createLogger('WindowsNotifications'); diff --git a/app/attachment_channel.ts b/app/attachment_channel.ts index 50ac161c0b6..9bc651cdbd9 100644 --- a/app/attachment_channel.ts +++ b/app/attachment_channel.ts @@ -22,30 +22,30 @@ import { isNumber } from 'lodash'; import { type DecryptAttachmentToSinkOptionsType, decryptAttachmentV2ToSink, -} from '../ts/AttachmentCrypto'; -import * as Bytes from '../ts/Bytes'; -import type { MessageAttachmentsCursorType } from '../ts/sql/Interface'; -import type { MainSQL } from '../ts/sql/main'; +} from '../ts/AttachmentCrypto.js'; +import * as Bytes from '../ts/Bytes.js'; +import type { MessageAttachmentsCursorType } from '../ts/sql/Interface.js'; +import type { MainSQL } from '../ts/sql/main.js'; import { APPLICATION_OCTET_STREAM, MIMETypeToString, stringToMIMEType, -} from '../ts/types/MIME'; -import * as Errors from '../ts/types/errors'; +} from '../ts/types/MIME.js'; +import * as Errors from '../ts/types/errors.js'; import { isImageTypeSupported, isVideoTypeSupported, -} from '../ts/util/GoogleChrome'; -import { strictAssert } from '../ts/util/assert'; -import { drop } from '../ts/util/drop'; -import { SECOND } from '../ts/util/durations'; -import { isPathInside } from '../ts/util/isPathInside'; -import { missingCaseError } from '../ts/util/missingCaseError'; -import { safeParseInteger } from '../ts/util/numbers'; -import { parseLoose } from '../ts/util/schemas'; -import { sleep } from '../ts/util/sleep'; -import { toWebStream } from '../ts/util/toWebStream'; -import { createLogger } from '../ts/logging/log'; +} from '../ts/util/GoogleChrome.js'; +import { strictAssert } from '../ts/util/assert.js'; +import { drop } from '../ts/util/drop.js'; +import { SECOND } from '../ts/util/durations/index.js'; +import { isPathInside } from '../ts/util/isPathInside.js'; +import { missingCaseError } from '../ts/util/missingCaseError.js'; +import { safeParseInteger } from '../ts/util/numbers.js'; +import { parseLoose } from '../ts/util/schemas.js'; +import { sleep } from '../ts/util/sleep.js'; +import { toWebStream } from '../ts/util/toWebStream.js'; +import { createLogger } from '../ts/logging/log.js'; import { deleteAll as deleteAllAttachments, deleteAllBadges, @@ -63,7 +63,7 @@ import { getPath, getStickersPath, getTempPath, -} from './attachments'; +} from './attachments.js'; const log = createLogger('attachment_channel'); diff --git a/app/attachments.ts b/app/attachments.ts index 749add7d9fa..8c0be8a886e 100644 --- a/app/attachments.ts +++ b/app/attachments.ts @@ -3,24 +3,24 @@ import { PassThrough } from 'node:stream'; import { stat } from 'node:fs/promises'; -import { join, relative, normalize } from 'path'; +import { join, relative, normalize } from 'node:path'; import pMap from 'p-map'; import fastGlob from 'fast-glob'; import fse from 'fs-extra'; import { map, isString } from 'lodash'; import normalizePath from 'normalize-path'; -import { isPathInside } from '../ts/util/isPathInside'; -import { DAY } from '../ts/util/durations'; -import { isOlderThan } from '../ts/util/timestamp'; -import { isNotNil } from '../ts/util/isNotNil'; +import { isPathInside } from '../ts/util/isPathInside.js'; +import { DAY } from '../ts/util/durations/index.js'; +import { isOlderThan } from '../ts/util/timestamp.js'; +import { isNotNil } from '../ts/util/isNotNil.js'; import { generateKeys, decryptAttachmentV2ToSink, encryptAttachmentV2ToDisk, -} from '../ts/AttachmentCrypto'; -import type { LocalAttachmentV2Type } from '../ts/types/Attachment'; -import * as Errors from '../ts/types/errors'; -import { createLogger } from '../ts/logging/log'; +} from '../ts/AttachmentCrypto.js'; +import type { LocalAttachmentV2Type } from '../ts/types/Attachment.js'; +import * as Errors from '../ts/types/errors.js'; +import { createLogger } from '../ts/logging/log.js'; const log = createLogger('attachments'); diff --git a/app/base_config.ts b/app/base_config.ts index 152c64f6946..23694b29705 100644 --- a/app/base_config.ts +++ b/app/base_config.ts @@ -1,13 +1,13 @@ // Copyright 2018 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { readFileSync, unlinkSync } from 'fs'; +import { readFileSync, unlinkSync } from 'node:fs'; import { sync as writeFileSync } from 'write-file-atomic'; import { get } from 'lodash'; import { set } from 'lodash/fp'; -import { strictAssert } from '../ts/util/assert'; -import { createLogger } from '../ts/logging/log'; +import { strictAssert } from '../ts/util/assert.js'; +import { createLogger } from '../ts/logging/log.js'; const log = createLogger('base_config'); diff --git a/app/config.ts b/app/config.ts index 33095427643..0fed5503cc6 100644 --- a/app/config.ts +++ b/app/config.ts @@ -1,7 +1,7 @@ // Copyright 2017 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { join, basename } from 'path'; +import { join, basename } from 'node:path'; import { app } from 'electron'; import type { IConfig } from 'config'; @@ -11,8 +11,8 @@ import { getEnvironment, setEnvironment, parseEnvironment, -} from '../ts/environment'; -import { createLogger } from '../ts/logging/log'; +} from '../ts/environment.js'; +import { createLogger } from '../ts/logging/log.js'; const log = createLogger('config'); diff --git a/app/crashReports.ts b/app/crashReports.ts index 55103c21a51..573dbec71c2 100644 --- a/app/crashReports.ts +++ b/app/crashReports.ts @@ -3,16 +3,16 @@ import { app, crashReporter, ipcMain as ipc } from 'electron'; import { realpath, readdir, readFile, unlink, stat } from 'fs-extra'; -import { basename, join } from 'path'; +import { basename, join } from 'node:path'; import { toJSONString as dumpToJSONString } from '@signalapp/libsignal-client/dist/Minidump'; import z from 'zod'; -import type { LoggerType } from '../ts/types/Logging'; -import * as Errors from '../ts/types/errors'; -import { isProduction } from '../ts/util/version'; -import { isNotNil } from '../ts/util/isNotNil'; -import OS from '../ts/util/os/osMain'; -import { parseUnknown } from '../ts/util/schemas'; +import type { LoggerType } from '../ts/types/Logging.js'; +import * as Errors from '../ts/types/errors.js'; +import { isProduction } from '../ts/util/version.js'; +import { isNotNil } from '../ts/util/isNotNil.js'; +import OS from '../ts/util/os/osMain.js'; +import { parseUnknown } from '../ts/util/schemas.js'; // See https://github.com/rust-minidump/rust-minidump/blob/main/minidump-processor/json-schema.md const dumpString = z.string().or(z.null()).optional(); diff --git a/app/dns-fallback.ts b/app/dns-fallback.ts index 0e8119afd98..fdb2a773f2a 100644 --- a/app/dns-fallback.ts +++ b/app/dns-fallback.ts @@ -1,12 +1,12 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { join } from 'path'; -import { readFile } from 'fs/promises'; -import { DNSFallbackSchema } from '../ts/types/DNSFallback'; -import type { DNSFallbackType } from '../ts/types/DNSFallback'; -import { parseUnknown } from '../ts/util/schemas'; -import { createLogger } from '../ts/logging/log'; +import { join } from 'node:path'; +import { readFile } from 'node:fs/promises'; +import { DNSFallbackSchema } from '../ts/types/DNSFallback.js'; +import type { DNSFallbackType } from '../ts/types/DNSFallback.js'; +import { parseUnknown } from '../ts/util/schemas.js'; +import { createLogger } from '../ts/logging/log.js'; const log = createLogger('dns-fallback'); diff --git a/app/ephemeral_config.ts b/app/ephemeral_config.ts index 3ed1b792ded..a504b7ee204 100644 --- a/app/ephemeral_config.ts +++ b/app/ephemeral_config.ts @@ -1,11 +1,11 @@ // Copyright 2018 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { join } from 'path'; +import { join } from 'node:path'; import { app } from 'electron'; -import { start } from './base_config'; +import { start } from './base_config.js'; const userDataPath = app.getPath('userData'); const targetPath = join(userDataPath, 'ephemeral.json'); diff --git a/app/global_errors.ts b/app/global_errors.ts index 8615f575d63..4a39f108615 100644 --- a/app/global_errors.ts +++ b/app/global_errors.ts @@ -4,11 +4,11 @@ import { app, dialog, clipboard } from 'electron'; import os from 'node:os'; -import * as Errors from '../ts/types/errors'; -import { redactAll } from '../ts/util/privacy'; -import { createLogger } from '../ts/logging/log'; -import { reallyJsonStringify } from '../ts/util/reallyJsonStringify'; -import type { LocaleType } from './locale'; +import * as Errors from '../ts/types/errors.js'; +import { redactAll } from '../ts/util/privacy.js'; +import { createLogger } from '../ts/logging/log.js'; +import { reallyJsonStringify } from '../ts/util/reallyJsonStringify.js'; +import type { LocaleType } from './locale.js'; const log = createLogger('global_errors'); diff --git a/app/locale.ts b/app/locale.ts index a63eef4079d..3f0eab454cc 100644 --- a/app/locale.ts +++ b/app/locale.ts @@ -7,14 +7,17 @@ import { app } from 'electron'; import { merge } from 'lodash'; import * as LocaleMatcher from '@formatjs/intl-localematcher'; import { z } from 'zod'; -import { setupI18n } from '../ts/util/setupI18nMain'; -import { shouldNeverBeCalled } from '../ts/util/shouldNeverBeCalled'; +import { setupI18n } from '../ts/util/setupI18nMain.js'; +import { shouldNeverBeCalled } from '../ts/util/shouldNeverBeCalled.js'; -import type { LoggerType } from '../ts/types/Logging'; -import type { HourCyclePreference, LocaleMessagesType } from '../ts/types/I18N'; -import type { LocalizerType } from '../ts/types/Util'; -import * as Errors from '../ts/types/errors'; -import { parseUnknown } from '../ts/util/schemas'; +import type { LoggerType } from '../ts/types/Logging.js'; +import type { + HourCyclePreference, + LocaleMessagesType, +} from '../ts/types/I18N.js'; +import type { LocalizerType } from '../ts/types/Util.js'; +import * as Errors from '../ts/types/errors.js'; +import { parseUnknown } from '../ts/util/schemas.js'; type CompactLocaleMessagesType = ReadonlyArray; type CompactLocaleKeysType = ReadonlyArray; diff --git a/app/main.ts b/app/main.ts index bcd1bf73989..8c6ce889c57 100644 --- a/app/main.ts +++ b/app/main.ts @@ -1,11 +1,11 @@ // Copyright 2017 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { join, normalize, extname, dirname, basename } from 'path'; -import { pathToFileURL } from 'url'; -import * as os from 'os'; +import { join, normalize, extname, dirname, basename } from 'node:path'; +import { pathToFileURL } from 'node:url'; +import * as os from 'node:os'; import { chmod, realpath, writeFile } from 'fs-extra'; -import { randomBytes } from 'crypto'; +import { randomBytes } from 'node:crypto'; import { createParser } from 'dashdash'; import fastGlob from 'fast-glob'; @@ -33,98 +33,98 @@ import type { MenuItemConstructorOptions, Settings } from 'electron'; import { z } from 'zod'; import packageJson from '../package.json'; -import * as GlobalErrors from './global_errors'; -import { setup as setupCrashReports } from './crashReports'; -import { setup as setupSpellChecker } from './spell_check'; -import { getDNSFallback } from './dns-fallback'; -import { redactAll, addSensitivePath } from '../ts/util/privacy'; -import { createSupportUrl } from '../ts/util/createSupportUrl'; -import { missingCaseError } from '../ts/util/missingCaseError'; -import { strictAssert } from '../ts/util/assert'; -import { drop } from '../ts/util/drop'; -import type { ThemeSettingType } from '../ts/types/StorageUIKeys'; -import { ThemeType } from '../ts/types/Util'; -import * as Errors from '../ts/types/errors'; -import { resolveCanonicalLocales } from '../ts/util/resolveCanonicalLocales'; -import { createLogger } from '../ts/logging/log'; -import * as debugLog from '../ts/logging/debuglogs'; -import * as uploadDebugLog from '../ts/logging/uploadDebugLog'; -import { explodePromise } from '../ts/util/explodePromise'; +import * as GlobalErrors from './global_errors.js'; +import { setup as setupCrashReports } from './crashReports.js'; +import { setup as setupSpellChecker } from './spell_check.js'; +import { getDNSFallback } from './dns-fallback.js'; +import { redactAll, addSensitivePath } from '../ts/util/privacy.js'; +import { createSupportUrl } from '../ts/util/createSupportUrl.js'; +import { missingCaseError } from '../ts/util/missingCaseError.js'; +import { strictAssert } from '../ts/util/assert.js'; +import { drop } from '../ts/util/drop.js'; +import type { ThemeSettingType } from '../ts/types/StorageUIKeys.js'; +import { ThemeType } from '../ts/types/Util.js'; +import * as Errors from '../ts/types/errors.js'; +import { resolveCanonicalLocales } from '../ts/util/resolveCanonicalLocales.js'; +import { createLogger } from '../ts/logging/log.js'; +import * as debugLog from '../ts/logging/debuglogs.js'; +import * as uploadDebugLog from '../ts/logging/uploadDebugLog.js'; +import { explodePromise } from '../ts/util/explodePromise.js'; -import './startup_config'; +import './startup_config.js'; -import type { RendererConfigType } from '../ts/types/RendererConfig'; +import type { RendererConfigType } from '../ts/types/RendererConfig.js'; import { directoryConfigSchema, rendererConfigSchema, -} from '../ts/types/RendererConfig'; -import config from './config'; +} from '../ts/types/RendererConfig.js'; +import config from './config.js'; import { Environment, getEnvironment, isTestEnvironment, -} from '../ts/environment'; +} from '../ts/environment.js'; // Very important to put before the single instance check, since it is based on the // userData directory. (see requestSingleInstanceLock below) -import * as userConfig from './user_config'; +import * as userConfig from './user_config.js'; // We generally want to pull in our own modules after this point, after the user // data directory has been set. -import * as attachments from './attachments'; -import * as attachmentChannel from './attachment_channel'; -import * as bounce from '../ts/services/bounce'; -import * as updater from '../ts/updater/index'; -import { updateDefaultSession } from './updateDefaultSession'; -import { PreventDisplaySleepService } from './PreventDisplaySleepService'; -import { SystemTrayService, focusAndForceToTop } from './SystemTrayService'; -import { SystemTraySettingCache } from './SystemTraySettingCache'; -import { OptionalResourceService } from './OptionalResourceService'; -import { EmojiService } from './EmojiService'; +import * as attachments from './attachments.js'; +import * as attachmentChannel from './attachment_channel.js'; +import * as bounce from '../ts/services/bounce.js'; +import * as updater from '../ts/updater/index.js'; +import { updateDefaultSession } from './updateDefaultSession.js'; +import { PreventDisplaySleepService } from './PreventDisplaySleepService.js'; +import { SystemTrayService, focusAndForceToTop } from './SystemTrayService.js'; +import { SystemTraySettingCache } from './SystemTraySettingCache.js'; +import { OptionalResourceService } from './OptionalResourceService.js'; +import { EmojiService } from './EmojiService.js'; import { SystemTraySetting, shouldMinimizeToSystemTray, parseSystemTraySetting, -} from '../ts/types/SystemTraySetting'; +} from '../ts/types/SystemTraySetting.js'; import { getDefaultSystemTraySetting, isSystemTraySupported, isContentProtectionEnabledByDefault, -} from '../ts/types/Settings'; -import * as ephemeralConfig from './ephemeral_config'; -import * as mainProcessLogging from '../ts/logging/main_process_logging'; -import { MainSQL } from '../ts/sql/main'; -import * as sqlChannels from './sql_channel'; -import * as windowState from './window_state'; -import type { CreateTemplateOptionsType } from './menu'; -import { createTemplate } from './menu'; -import { installFileHandler, installWebHandler } from './protocol_filter'; -import OS from '../ts/util/os/osMain'; -import { isNightly, isProduction } from '../ts/util/version'; -import { clearTimeoutIfNecessary } from '../ts/util/clearTimeoutIfNecessary'; -import { toggleMaximizedBrowserWindow } from '../ts/util/toggleMaximizedBrowserWindow'; -import { ChallengeMainHandler } from '../ts/main/challengeMain'; -import { NativeThemeNotifier } from '../ts/main/NativeThemeNotifier'; -import { PowerChannel } from '../ts/main/powerChannel'; -import { SettingsChannel } from '../ts/main/settingsChannel'; -import { maybeParseUrl, setUrlSearchParams } from '../ts/util/url'; -import { getHeicConverter } from '../ts/workers/heicConverterMain'; +} from '../ts/types/Settings.js'; +import * as ephemeralConfig from './ephemeral_config.js'; +import * as mainProcessLogging from '../ts/logging/main_process_logging.js'; +import { MainSQL } from '../ts/sql/main.js'; +import * as sqlChannels from './sql_channel.js'; +import * as windowState from './window_state.js'; +import type { CreateTemplateOptionsType } from './menu.js'; +import { createTemplate } from './menu.js'; +import { installFileHandler, installWebHandler } from './protocol_filter.js'; +import OS from '../ts/util/os/osMain.js'; +import { isNightly, isProduction } from '../ts/util/version.js'; +import { clearTimeoutIfNecessary } from '../ts/util/clearTimeoutIfNecessary.js'; +import { toggleMaximizedBrowserWindow } from '../ts/util/toggleMaximizedBrowserWindow.js'; +import { ChallengeMainHandler } from '../ts/main/challengeMain.js'; +import { NativeThemeNotifier } from '../ts/main/NativeThemeNotifier.js'; +import { PowerChannel } from '../ts/main/powerChannel.js'; +import { SettingsChannel } from '../ts/main/settingsChannel.js'; +import { maybeParseUrl, setUrlSearchParams } from '../ts/util/url.js'; +import { getHeicConverter } from '../ts/workers/heicConverterMain.js'; -import type { LocaleDirection, LocaleType } from './locale'; -import { load as loadLocale } from './locale'; +import type { LocaleDirection, LocaleType } from './locale.js'; +import { load as loadLocale } from './locale.js'; -import { HourCyclePreference } from '../ts/types/I18N'; -import { ScreenShareStatus } from '../ts/types/Calling'; -import type { ParsedSignalRoute } from '../ts/util/signalRoutes'; -import { parseSignalRoute } from '../ts/util/signalRoutes'; -import * as dns from '../ts/util/dns'; -import { ZoomFactorService } from '../ts/services/ZoomFactorService'; -import { SafeStorageBackendChangeError } from '../ts/types/SafeStorageBackendChangeError'; -import { LINUX_PASSWORD_STORE_FLAGS } from '../ts/util/linuxPasswordStoreFlags'; -import { getOwn } from '../ts/util/getOwn'; -import { safeParseLoose, safeParseUnknown } from '../ts/util/schemas'; -import { getAppErrorIcon } from '../ts/util/getAppErrorIcon'; -import { promptOSAuth } from '../ts/util/os/promptOSAuthMain'; +import { HourCyclePreference } from '../ts/types/I18N.js'; +import { ScreenShareStatus } from '../ts/types/Calling.js'; +import type { ParsedSignalRoute } from '../ts/util/signalRoutes.js'; +import { parseSignalRoute } from '../ts/util/signalRoutes.js'; +import * as dns from '../ts/util/dns.js'; +import { ZoomFactorService } from '../ts/services/ZoomFactorService.js'; +import { SafeStorageBackendChangeError } from '../ts/types/SafeStorageBackendChangeError.js'; +import { LINUX_PASSWORD_STORE_FLAGS } from '../ts/util/linuxPasswordStoreFlags.js'; +import { getOwn } from '../ts/util/getOwn.js'; +import { safeParseLoose, safeParseUnknown } from '../ts/util/schemas.js'; +import { getAppErrorIcon } from '../ts/util/getAppErrorIcon.js'; +import { promptOSAuth } from '../ts/util/os/promptOSAuthMain.js'; const log = createLogger('app/main'); const updaterLog = log.child('updater'); @@ -221,7 +221,7 @@ let sendDummyKeystroke: undefined | (() => void); if (OS.isWindows()) { try { // eslint-disable-next-line global-require, @typescript-eslint/no-var-requires - const windowsNotifications = require('./WindowsNotifications'); + const windowsNotifications = require('./WindowsNotifications.js'); sendDummyKeystroke = windowsNotifications.sendDummyKeystroke; } catch (error) { log.error('Failed to initialize Windows Notifications:', error.stack); diff --git a/app/menu.ts b/app/menu.ts index c67d4c615ac..9d2c3a67f03 100644 --- a/app/menu.ts +++ b/app/menu.ts @@ -3,12 +3,12 @@ import { isString } from 'lodash'; -import type { LocalizerType } from '../ts/types/I18N'; +import type { LocalizerType } from '../ts/types/I18N.js'; import type { MenuListType, MenuOptionsType, MenuActionsType, -} from '../ts/types/menu'; +} from '../ts/types/menu.js'; export type CreateTemplateOptionsType = MenuOptionsType & MenuActionsType; diff --git a/app/permissions.ts b/app/permissions.ts index 21f21581527..82a7082bb38 100644 --- a/app/permissions.ts +++ b/app/permissions.ts @@ -6,8 +6,8 @@ import type { session as ElectronSession, Session } from 'electron'; -import type { ConfigType } from './base_config'; -import { createLogger } from '../ts/logging/log'; +import type { ConfigType } from './base_config.js'; +import { createLogger } from '../ts/logging/log.js'; const log = createLogger('permissions'); diff --git a/app/protocol_filter.ts b/app/protocol_filter.ts index ca0fccd84df..ef2f4d2fc41 100644 --- a/app/protocol_filter.ts +++ b/app/protocol_filter.ts @@ -3,8 +3,8 @@ import type { ProtocolRequest, ProtocolResponse, Session } from 'electron'; -import { isAbsolute, normalize } from 'path'; -import { existsSync, realpathSync } from 'fs'; +import { isAbsolute, normalize } from 'node:path'; +import { existsSync, realpathSync } from 'node:fs'; import { getAvatarsPath, getBadgesPath, @@ -14,8 +14,8 @@ import { getStickersPath, getTempPath, getUpdateCachePath, -} from './attachments'; -import { createLogger } from '../ts/logging/log'; +} from './attachments.js'; +import { createLogger } from '../ts/logging/log.js'; const log = createLogger('protocol_filter'); diff --git a/app/spell_check.ts b/app/spell_check.ts index 288e39f7862..cfb714f394e 100644 --- a/app/spell_check.ts +++ b/app/spell_check.ts @@ -5,14 +5,14 @@ import type { BrowserWindow } from 'electron'; import { Menu, clipboard, nativeImage } from 'electron'; import * as LocaleMatcher from '@formatjs/intl-localematcher'; -import { maybeParseUrl } from '../ts/util/url'; +import { maybeParseUrl } from '../ts/util/url.js'; -import type { MenuListType } from '../ts/types/menu'; -import type { LocalizerType } from '../ts/types/Util'; -import { strictAssert } from '../ts/util/assert'; -import type { LoggerType } from '../ts/types/Logging'; -import { createLogger } from '../ts/logging/log'; -import { handleAttachmentRequest } from './attachment_channel'; +import type { MenuListType } from '../ts/types/menu.js'; +import type { LocalizerType } from '../ts/types/Util.js'; +import { strictAssert } from '../ts/util/assert.js'; +import type { LoggerType } from '../ts/types/Logging.js'; +import { createLogger } from '../ts/logging/log.js'; +import { handleAttachmentRequest } from './attachment_channel.js'; const log = createLogger('spell_check'); diff --git a/app/sql_channel.ts b/app/sql_channel.ts index 077c181f247..6141c79243d 100644 --- a/app/sql_channel.ts +++ b/app/sql_channel.ts @@ -3,9 +3,9 @@ import { ipcMain } from 'electron'; -import type { MainSQL } from '../ts/sql/main'; -import { remove as removeUserConfig } from './user_config'; -import { remove as removeEphemeralConfig } from './ephemeral_config'; +import type { MainSQL } from '../ts/sql/main.js'; +import { remove as removeUserConfig } from './user_config.js'; +import { remove as removeEphemeralConfig } from './ephemeral_config.js'; let sql: | Pick< diff --git a/app/startup_config.ts b/app/startup_config.ts index 2dc518344ba..336d3c9219f 100644 --- a/app/startup_config.ts +++ b/app/startup_config.ts @@ -4,8 +4,8 @@ import { app } from 'electron'; import packageJson from '../package.json'; -import { createLogger } from '../ts/logging/log'; -import * as GlobalErrors from './global_errors'; +import { createLogger } from '../ts/logging/log.js'; +import * as GlobalErrors from './global_errors.js'; const log = createLogger('startup_config'); diff --git a/app/updateDefaultSession.ts b/app/updateDefaultSession.ts index 42f9a8caa96..c48e3f2b9b6 100644 --- a/app/updateDefaultSession.ts +++ b/app/updateDefaultSession.ts @@ -5,10 +5,10 @@ import type { Session, DesktopCapturerSource, IpcMainEvent } from 'electron'; import { desktopCapturer, ipcMain, systemPreferences } from 'electron'; import { v4 as generateUuid } from 'uuid'; -import OS from '../ts/util/os/osMain'; -import type { LoggerType } from '../ts/types/Logging'; -import { strictAssert } from '../ts/util/assert'; -import { type IpcResponseType } from '../ts/util/desktopCapturer'; +import OS from '../ts/util/os/osMain.js'; +import type { LoggerType } from '../ts/types/Logging.js'; +import { strictAssert } from '../ts/util/assert.js'; +import { type IpcResponseType } from '../ts/util/desktopCapturer.js'; const SPELL_CHECKER_DICTIONARY_DOWNLOAD_URL = `https://updates.signal.org/desktop/hunspell_dictionaries/${process.versions.electron}/`; diff --git a/app/user_config.ts b/app/user_config.ts index f5d2fb6ff2c..eb4fe582508 100644 --- a/app/user_config.ts +++ b/app/user_config.ts @@ -1,13 +1,13 @@ // Copyright 2017 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { join } from 'path'; -import { mkdirSync } from 'fs'; +import { join } from 'node:path'; +import { mkdirSync } from 'node:fs'; import { app } from 'electron'; -import { start } from './base_config'; -import config from './config'; -import * as Errors from '../ts/types/errors'; +import { start } from './base_config.js'; +import config from './config.js'; +import * as Errors from '../ts/types/errors.js'; let userData: string | undefined; // Use separate data directory for benchmarks & development diff --git a/build/intl-linter/linter.ts b/build/intl-linter/linter.ts index 0abbb5edd9d..5291ecab0dc 100644 --- a/build/intl-linter/linter.ts +++ b/build/intl-linter/linter.ts @@ -7,21 +7,21 @@ import type { Location, } from '@formatjs/icu-messageformat-parser'; import parseJsonToAst from 'json-to-ast'; -import { readFile } from 'fs/promises'; -import { join as pathJoin, relative as pathRelative } from 'path'; +import { readFile } from 'node:fs/promises'; +import { join as pathJoin, relative as pathRelative } from 'node:path'; import chalk from 'chalk'; -import { deepEqual } from 'assert'; -import type { Rule } from './utils/rule'; +import { deepEqual } from 'node:assert'; +import type { Rule } from './utils/rule.js'; -import icuPrefix from './rules/icuPrefix'; -import wrapEmoji from './rules/wrapEmoji'; -import onePlural from './rules/onePlural'; -import noLegacyVariables from './rules/noLegacyVariables'; -import noNestedChoice from './rules/noNestedChoice'; -import noOffset from './rules/noOffset'; -import noOneChoice from './rules/noOneChoice'; -import noOrdinal from './rules/noOrdinal'; -import pluralPound from './rules/pluralPound'; +import icuPrefix from './rules/icuPrefix.js'; +import wrapEmoji from './rules/wrapEmoji.js'; +import onePlural from './rules/onePlural.js'; +import noLegacyVariables from './rules/noLegacyVariables.js'; +import noNestedChoice from './rules/noNestedChoice.js'; +import noOffset from './rules/noOffset.js'; +import noOneChoice from './rules/noOneChoice.js'; +import noOrdinal from './rules/noOrdinal.js'; +import pluralPound from './rules/pluralPound.js'; const RULES = [ icuPrefix, diff --git a/build/intl-linter/rules/icuPrefix.ts b/build/intl-linter/rules/icuPrefix.ts index 3ca40fede98..43e0ad155fd 100644 --- a/build/intl-linter/rules/icuPrefix.ts +++ b/build/intl-linter/rules/icuPrefix.ts @@ -1,7 +1,7 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { rule } from '../utils/rule'; +import { rule } from '../utils/rule.js'; export default rule('icuPrefix', context => { if (!context.messageId.startsWith('icu:')) { diff --git a/build/intl-linter/rules/noLegacyVariables.ts b/build/intl-linter/rules/noLegacyVariables.ts index 452fe47b0f2..d0d0130e0d3 100644 --- a/build/intl-linter/rules/noLegacyVariables.ts +++ b/build/intl-linter/rules/noLegacyVariables.ts @@ -1,7 +1,7 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { rule } from '../utils/rule'; +import { rule } from '../utils/rule.js'; export default rule('noLegacyVariables', context => { return { diff --git a/build/intl-linter/rules/noNestedChoice.ts b/build/intl-linter/rules/noNestedChoice.ts index ed4e43b53ec..07192081f01 100644 --- a/build/intl-linter/rules/noNestedChoice.ts +++ b/build/intl-linter/rules/noNestedChoice.ts @@ -1,8 +1,8 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { Element } from '../utils/rule'; -import { rule } from '../utils/rule'; +import type { Element } from '../utils/rule.js'; +import { rule } from '../utils/rule.js'; export default rule('noNestedChoice', context => { let insideChoice = false; diff --git a/build/intl-linter/rules/noOffset.ts b/build/intl-linter/rules/noOffset.ts index 5262f0058e5..71c5c513eab 100644 --- a/build/intl-linter/rules/noOffset.ts +++ b/build/intl-linter/rules/noOffset.ts @@ -1,7 +1,7 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { rule } from '../utils/rule'; +import { rule } from '../utils/rule.js'; export default rule('noOffset', context => { return { diff --git a/build/intl-linter/rules/noOneChoice.ts b/build/intl-linter/rules/noOneChoice.ts index a4d5faa97a8..c1235fe7e1f 100644 --- a/build/intl-linter/rules/noOneChoice.ts +++ b/build/intl-linter/rules/noOneChoice.ts @@ -1,7 +1,7 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { rule } from '../utils/rule'; +import { rule } from '../utils/rule.js'; export default rule('noOneChoice', context => { return { diff --git a/build/intl-linter/rules/noOrdinal.ts b/build/intl-linter/rules/noOrdinal.ts index c8d6926bea0..cbebb2ce4eb 100644 --- a/build/intl-linter/rules/noOrdinal.ts +++ b/build/intl-linter/rules/noOrdinal.ts @@ -1,7 +1,7 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { rule } from '../utils/rule'; +import { rule } from '../utils/rule.js'; export default rule('noOrdinal', context => { return { diff --git a/build/intl-linter/rules/onePlural.ts b/build/intl-linter/rules/onePlural.ts index 74f6232dfa2..f6efb69eef1 100644 --- a/build/intl-linter/rules/onePlural.ts +++ b/build/intl-linter/rules/onePlural.ts @@ -1,7 +1,7 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { rule } from '../utils/rule'; +import { rule } from '../utils/rule.js'; export default rule('onePlural', context => { let plurals = 0; diff --git a/build/intl-linter/rules/pluralPound.ts b/build/intl-linter/rules/pluralPound.ts index e55561e166a..5d8fbe355cd 100644 --- a/build/intl-linter/rules/pluralPound.ts +++ b/build/intl-linter/rules/pluralPound.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { PluralElement } from '@formatjs/icu-messageformat-parser'; -import { rule } from '../utils/rule'; +import { rule } from '../utils/rule.js'; export default rule('pluralPound', context => { const stack: Array = []; diff --git a/build/intl-linter/rules/wrapEmoji.ts b/build/intl-linter/rules/wrapEmoji.ts index 627d1fc3092..c441724b6b3 100644 --- a/build/intl-linter/rules/wrapEmoji.ts +++ b/build/intl-linter/rules/wrapEmoji.ts @@ -10,7 +10,7 @@ import { isTagElement, isLiteralElement, } from '@formatjs/icu-messageformat-parser'; -import { rule } from '../utils/rule'; +import { rule } from '../utils/rule.js'; function isEmojifyTag( element: MessageFormatElement | null diff --git a/build/intl-linter/utils/rule.ts b/build/intl-linter/utils/rule.ts index 14d243c07fc..41315eee73a 100644 --- a/build/intl-linter/utils/rule.ts +++ b/build/intl-linter/utils/rule.ts @@ -5,8 +5,8 @@ import type { MessageFormatElement, Location, } from '@formatjs/icu-messageformat-parser'; -import type { Visitor } from './traverse'; -import { traverse } from './traverse'; +import type { Visitor } from './traverse.js'; +import { traverse } from './traverse.js'; export type Element = MessageFormatElement; export type { Location }; diff --git a/package.json b/package.json index 4cf750d7d43..bac9b8ad0df 100644 --- a/package.json +++ b/package.json @@ -313,12 +313,12 @@ "endanger": "7.0.4", "enhanced-resolve": "5.18.3", "enquirer": "2.4.1", - "esbuild": "0.24.0", + "esbuild": "0.25.9", "eslint": "8.56.0", "eslint-config-airbnb-typescript-prettier": "5.0.0", "eslint-config-prettier": "8.5.0", "eslint-plugin-better-tailwindcss": "3.7.2", - "eslint-plugin-import": "2.26.0", + "eslint-plugin-import": "2.32.0", "eslint-plugin-local-rules": "1.3.2", "eslint-plugin-mocha": "10.1.0", "eslint-plugin-more": "1.0.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3bd66144f80..e20bf923666 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -479,7 +479,7 @@ importers: version: 8.4.4(@storybook/test@8.4.4(storybook@8.4.4(bufferutil@4.0.9)(prettier@3.3.3)(utf-8-validate@5.0.10)))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@8.4.4(bufferutil@4.0.9)(prettier@3.3.3)(utf-8-validate@5.0.10))(typescript@5.6.3) '@storybook/react-webpack5': specifier: 8.4.4 - version: 8.4.4(@storybook/test@8.4.4(storybook@8.4.4(bufferutil@4.0.9)(prettier@3.3.3)(utf-8-validate@5.0.10)))(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.24.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@8.4.4(bufferutil@4.0.9)(prettier@3.3.3)(utf-8-validate@5.0.10))(typescript@5.6.3)(webpack-cli@5.1.4) + version: 8.4.4(@storybook/test@8.4.4(storybook@8.4.4(bufferutil@4.0.9)(prettier@3.3.3)(utf-8-validate@5.0.10)))(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.25.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@8.4.4(bufferutil@4.0.9)(prettier@3.3.3)(utf-8-validate@5.0.10))(typescript@5.6.3)(webpack-cli@5.1.4) '@storybook/test': specifier: 8.4.4 version: 8.4.4(storybook@8.4.4(bufferutil@4.0.9)(prettier@3.3.3)(utf-8-validate@5.0.10)) @@ -670,8 +670,8 @@ importers: specifier: 2.4.1 version: 2.4.1 esbuild: - specifier: 0.24.0 - version: 0.24.0 + specifier: 0.25.9 + version: 0.25.9 eslint: specifier: 8.56.0 version: 8.56.0 @@ -685,8 +685,8 @@ importers: specifier: 3.7.2 version: 3.7.2(patch_hash=a94affa4d170a27c4cfd44f7ac30ea11ae285cb4e270a5d930dd28cc79901b4f)(eslint@8.56.0)(tailwindcss@4.1.7) eslint-plugin-import: - specifier: 2.26.0 - version: 2.26.0(@typescript-eslint/parser@6.18.1(eslint@8.56.0)(typescript@5.6.3))(eslint@8.56.0) + specifier: 2.32.0 + version: 2.32.0(@typescript-eslint/parser@6.18.1(eslint@8.56.0)(typescript@5.6.3))(eslint@8.56.0) eslint-plugin-local-rules: specifier: 1.3.2 version: 1.3.2 @@ -806,7 +806,7 @@ importers: version: 4.1.7 terser-webpack-plugin: specifier: 5.3.10 - version: 5.3.10(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.24.0)(webpack@5.96.1) + version: 5.3.10(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.25.9)(webpack@5.96.1) ts-node: specifier: 10.9.2 version: 10.9.2(@swc/core@1.10.16(@swc/helpers@0.5.15))(@types/node@20.17.6)(typescript@5.6.3) @@ -818,7 +818,7 @@ importers: version: 8.0.1(debug@4.3.7) webpack: specifier: 5.96.1 - version: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.24.0)(webpack-cli@5.1.4) + version: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.25.9)(webpack-cli@5.1.4) webpack-cli: specifier: 5.1.4 version: 5.1.4(webpack-dev-server@5.1.0)(webpack@5.96.1) @@ -1223,144 +1223,300 @@ packages: cpu: [ppc64] os: [aix] + '@esbuild/aix-ppc64@0.25.9': + resolution: {integrity: sha512-OaGtL73Jck6pBKjNIe24BnFE6agGl+6KxDtTfHhy1HmhthfKouEcOhqpSL64K4/0WCtbKFLOdzD/44cJ4k9opA==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [aix] + '@esbuild/android-arm64@0.24.0': resolution: {integrity: sha512-Vsm497xFM7tTIPYK9bNTYJyF/lsP590Qc1WxJdlB6ljCbdZKU9SY8i7+Iin4kyhV/KV5J2rOKsBQbB77Ab7L/w==} engines: {node: '>=18'} cpu: [arm64] os: [android] + '@esbuild/android-arm64@0.25.9': + resolution: {integrity: sha512-IDrddSmpSv51ftWslJMvl3Q2ZT98fUSL2/rlUXuVqRXHCs5EUF1/f+jbjF5+NG9UffUDMCiTyh8iec7u8RlTLg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [android] + '@esbuild/android-arm@0.24.0': resolution: {integrity: sha512-arAtTPo76fJ/ICkXWetLCc9EwEHKaeya4vMrReVlEIUCAUncH7M4bhMQ+M9Vf+FFOZJdTNMXNBrWwW+OXWpSew==} engines: {node: '>=18'} cpu: [arm] os: [android] + '@esbuild/android-arm@0.25.9': + resolution: {integrity: sha512-5WNI1DaMtxQ7t7B6xa572XMXpHAaI/9Hnhk8lcxF4zVN4xstUgTlvuGDorBguKEnZO70qwEcLpfifMLoxiPqHQ==} + engines: {node: '>=18'} + cpu: [arm] + os: [android] + '@esbuild/android-x64@0.24.0': resolution: {integrity: sha512-t8GrvnFkiIY7pa7mMgJd7p8p8qqYIz1NYiAoKc75Zyv73L3DZW++oYMSHPRarcotTKuSs6m3hTOa5CKHaS02TQ==} engines: {node: '>=18'} cpu: [x64] os: [android] + '@esbuild/android-x64@0.25.9': + resolution: {integrity: sha512-I853iMZ1hWZdNllhVZKm34f4wErd4lMyeV7BLzEExGEIZYsOzqDWDf+y082izYUE8gtJnYHdeDpN/6tUdwvfiw==} + engines: {node: '>=18'} + cpu: [x64] + os: [android] + '@esbuild/darwin-arm64@0.24.0': resolution: {integrity: sha512-CKyDpRbK1hXwv79soeTJNHb5EiG6ct3efd/FTPdzOWdbZZfGhpbcqIpiD0+vwmpu0wTIL97ZRPZu8vUt46nBSw==} engines: {node: '>=18'} cpu: [arm64] os: [darwin] + '@esbuild/darwin-arm64@0.25.9': + resolution: {integrity: sha512-XIpIDMAjOELi/9PB30vEbVMs3GV1v2zkkPnuyRRURbhqjyzIINwj+nbQATh4H9GxUgH1kFsEyQMxwiLFKUS6Rg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [darwin] + '@esbuild/darwin-x64@0.24.0': resolution: {integrity: sha512-rgtz6flkVkh58od4PwTRqxbKH9cOjaXCMZgWD905JOzjFKW+7EiUObfd/Kav+A6Gyud6WZk9w+xu6QLytdi2OA==} engines: {node: '>=18'} cpu: [x64] os: [darwin] + '@esbuild/darwin-x64@0.25.9': + resolution: {integrity: sha512-jhHfBzjYTA1IQu8VyrjCX4ApJDnH+ez+IYVEoJHeqJm9VhG9Dh2BYaJritkYK3vMaXrf7Ogr/0MQ8/MeIefsPQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [darwin] + '@esbuild/freebsd-arm64@0.24.0': resolution: {integrity: sha512-6Mtdq5nHggwfDNLAHkPlyLBpE5L6hwsuXZX8XNmHno9JuL2+bg2BX5tRkwjyfn6sKbxZTq68suOjgWqCicvPXA==} engines: {node: '>=18'} cpu: [arm64] os: [freebsd] + '@esbuild/freebsd-arm64@0.25.9': + resolution: {integrity: sha512-z93DmbnY6fX9+KdD4Ue/H6sYs+bhFQJNCPZsi4XWJoYblUqT06MQUdBCpcSfuiN72AbqeBFu5LVQTjfXDE2A6Q==} + engines: {node: '>=18'} + cpu: [arm64] + os: [freebsd] + '@esbuild/freebsd-x64@0.24.0': resolution: {integrity: sha512-D3H+xh3/zphoX8ck4S2RxKR6gHlHDXXzOf6f/9dbFt/NRBDIE33+cVa49Kil4WUjxMGW0ZIYBYtaGCa2+OsQwQ==} engines: {node: '>=18'} cpu: [x64] os: [freebsd] + '@esbuild/freebsd-x64@0.25.9': + resolution: {integrity: sha512-mrKX6H/vOyo5v71YfXWJxLVxgy1kyt1MQaD8wZJgJfG4gq4DpQGpgTB74e5yBeQdyMTbgxp0YtNj7NuHN0PoZg==} + engines: {node: '>=18'} + cpu: [x64] + os: [freebsd] + '@esbuild/linux-arm64@0.24.0': resolution: {integrity: sha512-TDijPXTOeE3eaMkRYpcy3LarIg13dS9wWHRdwYRnzlwlA370rNdZqbcp0WTyyV/k2zSxfko52+C7jU5F9Tfj1g==} engines: {node: '>=18'} cpu: [arm64] os: [linux] + '@esbuild/linux-arm64@0.25.9': + resolution: {integrity: sha512-BlB7bIcLT3G26urh5Dmse7fiLmLXnRlopw4s8DalgZ8ef79Jj4aUcYbk90g8iCa2467HX8SAIidbL7gsqXHdRw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [linux] + '@esbuild/linux-arm@0.24.0': resolution: {integrity: sha512-gJKIi2IjRo5G6Glxb8d3DzYXlxdEj2NlkixPsqePSZMhLudqPhtZ4BUrpIuTjJYXxvF9njql+vRjB2oaC9XpBw==} engines: {node: '>=18'} cpu: [arm] os: [linux] + '@esbuild/linux-arm@0.25.9': + resolution: {integrity: sha512-HBU2Xv78SMgaydBmdor38lg8YDnFKSARg1Q6AT0/y2ezUAKiZvc211RDFHlEZRFNRVhcMamiToo7bDx3VEOYQw==} + engines: {node: '>=18'} + cpu: [arm] + os: [linux] + '@esbuild/linux-ia32@0.24.0': resolution: {integrity: sha512-K40ip1LAcA0byL05TbCQ4yJ4swvnbzHscRmUilrmP9Am7//0UjPreh4lpYzvThT2Quw66MhjG//20mrufm40mA==} engines: {node: '>=18'} cpu: [ia32] os: [linux] + '@esbuild/linux-ia32@0.25.9': + resolution: {integrity: sha512-e7S3MOJPZGp2QW6AK6+Ly81rC7oOSerQ+P8L0ta4FhVi+/j/v2yZzx5CqqDaWjtPFfYz21Vi1S0auHrap3Ma3A==} + engines: {node: '>=18'} + cpu: [ia32] + os: [linux] + '@esbuild/linux-loong64@0.24.0': resolution: {integrity: sha512-0mswrYP/9ai+CU0BzBfPMZ8RVm3RGAN/lmOMgW4aFUSOQBjA31UP8Mr6DDhWSuMwj7jaWOT0p0WoZ6jeHhrD7g==} engines: {node: '>=18'} cpu: [loong64] os: [linux] + '@esbuild/linux-loong64@0.25.9': + resolution: {integrity: sha512-Sbe10Bnn0oUAB2AalYztvGcK+o6YFFA/9829PhOCUS9vkJElXGdphz0A3DbMdP8gmKkqPmPcMJmJOrI3VYB1JQ==} + engines: {node: '>=18'} + cpu: [loong64] + os: [linux] + '@esbuild/linux-mips64el@0.24.0': resolution: {integrity: sha512-hIKvXm0/3w/5+RDtCJeXqMZGkI2s4oMUGj3/jM0QzhgIASWrGO5/RlzAzm5nNh/awHE0A19h/CvHQe6FaBNrRA==} engines: {node: '>=18'} cpu: [mips64el] os: [linux] + '@esbuild/linux-mips64el@0.25.9': + resolution: {integrity: sha512-YcM5br0mVyZw2jcQeLIkhWtKPeVfAerES5PvOzaDxVtIyZ2NUBZKNLjC5z3/fUlDgT6w89VsxP2qzNipOaaDyA==} + engines: {node: '>=18'} + cpu: [mips64el] + os: [linux] + '@esbuild/linux-ppc64@0.24.0': resolution: {integrity: sha512-HcZh5BNq0aC52UoocJxaKORfFODWXZxtBaaZNuN3PUX3MoDsChsZqopzi5UupRhPHSEHotoiptqikjN/B77mYQ==} engines: {node: '>=18'} cpu: [ppc64] os: [linux] + '@esbuild/linux-ppc64@0.25.9': + resolution: {integrity: sha512-++0HQvasdo20JytyDpFvQtNrEsAgNG2CY1CLMwGXfFTKGBGQT3bOeLSYE2l1fYdvML5KUuwn9Z8L1EWe2tzs1w==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [linux] + '@esbuild/linux-riscv64@0.24.0': resolution: {integrity: sha512-bEh7dMn/h3QxeR2KTy1DUszQjUrIHPZKyO6aN1X4BCnhfYhuQqedHaa5MxSQA/06j3GpiIlFGSsy1c7Gf9padw==} engines: {node: '>=18'} cpu: [riscv64] os: [linux] + '@esbuild/linux-riscv64@0.25.9': + resolution: {integrity: sha512-uNIBa279Y3fkjV+2cUjx36xkx7eSjb8IvnL01eXUKXez/CBHNRw5ekCGMPM0BcmqBxBcdgUWuUXmVWwm4CH9kg==} + engines: {node: '>=18'} + cpu: [riscv64] + os: [linux] + '@esbuild/linux-s390x@0.24.0': resolution: {integrity: sha512-ZcQ6+qRkw1UcZGPyrCiHHkmBaj9SiCD8Oqd556HldP+QlpUIe2Wgn3ehQGVoPOvZvtHm8HPx+bH20c9pvbkX3g==} engines: {node: '>=18'} cpu: [s390x] os: [linux] + '@esbuild/linux-s390x@0.25.9': + resolution: {integrity: sha512-Mfiphvp3MjC/lctb+7D287Xw1DGzqJPb/J2aHHcHxflUo+8tmN/6d4k6I2yFR7BVo5/g7x2Monq4+Yew0EHRIA==} + engines: {node: '>=18'} + cpu: [s390x] + os: [linux] + '@esbuild/linux-x64@0.24.0': resolution: {integrity: sha512-vbutsFqQ+foy3wSSbmjBXXIJ6PL3scghJoM8zCL142cGaZKAdCZHyf+Bpu/MmX9zT9Q0zFBVKb36Ma5Fzfa8xA==} engines: {node: '>=18'} cpu: [x64] os: [linux] + '@esbuild/linux-x64@0.25.9': + resolution: {integrity: sha512-iSwByxzRe48YVkmpbgoxVzn76BXjlYFXC7NvLYq+b+kDjyyk30J0JY47DIn8z1MO3K0oSl9fZoRmZPQI4Hklzg==} + engines: {node: '>=18'} + cpu: [x64] + os: [linux] + + '@esbuild/netbsd-arm64@0.25.9': + resolution: {integrity: sha512-9jNJl6FqaUG+COdQMjSCGW4QiMHH88xWbvZ+kRVblZsWrkXlABuGdFJ1E9L7HK+T0Yqd4akKNa/lO0+jDxQD4Q==} + engines: {node: '>=18'} + cpu: [arm64] + os: [netbsd] + '@esbuild/netbsd-x64@0.24.0': resolution: {integrity: sha512-hjQ0R/ulkO8fCYFsG0FZoH+pWgTTDreqpqY7UnQntnaKv95uP5iW3+dChxnx7C3trQQU40S+OgWhUVwCjVFLvg==} engines: {node: '>=18'} cpu: [x64] os: [netbsd] + '@esbuild/netbsd-x64@0.25.9': + resolution: {integrity: sha512-RLLdkflmqRG8KanPGOU7Rpg829ZHu8nFy5Pqdi9U01VYtG9Y0zOG6Vr2z4/S+/3zIyOxiK6cCeYNWOFR9QP87g==} + engines: {node: '>=18'} + cpu: [x64] + os: [netbsd] + '@esbuild/openbsd-arm64@0.24.0': resolution: {integrity: sha512-MD9uzzkPQbYehwcN583yx3Tu5M8EIoTD+tUgKF982WYL9Pf5rKy9ltgD0eUgs8pvKnmizxjXZyLt0z6DC3rRXg==} engines: {node: '>=18'} cpu: [arm64] os: [openbsd] + '@esbuild/openbsd-arm64@0.25.9': + resolution: {integrity: sha512-YaFBlPGeDasft5IIM+CQAhJAqS3St3nJzDEgsgFixcfZeyGPCd6eJBWzke5piZuZ7CtL656eOSYKk4Ls2C0FRQ==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openbsd] + '@esbuild/openbsd-x64@0.24.0': resolution: {integrity: sha512-4ir0aY1NGUhIC1hdoCzr1+5b43mw99uNwVzhIq1OY3QcEwPDO3B7WNXBzaKY5Nsf1+N11i1eOfFcq+D/gOS15Q==} engines: {node: '>=18'} cpu: [x64] os: [openbsd] + '@esbuild/openbsd-x64@0.25.9': + resolution: {integrity: sha512-1MkgTCuvMGWuqVtAvkpkXFmtL8XhWy+j4jaSO2wxfJtilVCi0ZE37b8uOdMItIHz4I6z1bWWtEX4CJwcKYLcuA==} + engines: {node: '>=18'} + cpu: [x64] + os: [openbsd] + + '@esbuild/openharmony-arm64@0.25.9': + resolution: {integrity: sha512-4Xd0xNiMVXKh6Fa7HEJQbrpP3m3DDn43jKxMjxLLRjWnRsfxjORYJlXPO4JNcXtOyfajXorRKY9NkOpTHptErg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openharmony] + '@esbuild/sunos-x64@0.24.0': resolution: {integrity: sha512-jVzdzsbM5xrotH+W5f1s+JtUy1UWgjU0Cf4wMvffTB8m6wP5/kx0KiaLHlbJO+dMgtxKV8RQ/JvtlFcdZ1zCPA==} engines: {node: '>=18'} cpu: [x64] os: [sunos] + '@esbuild/sunos-x64@0.25.9': + resolution: {integrity: sha512-WjH4s6hzo00nNezhp3wFIAfmGZ8U7KtrJNlFMRKxiI9mxEK1scOMAaa9i4crUtu+tBr+0IN6JCuAcSBJZfnphw==} + engines: {node: '>=18'} + cpu: [x64] + os: [sunos] + '@esbuild/win32-arm64@0.24.0': resolution: {integrity: sha512-iKc8GAslzRpBytO2/aN3d2yb2z8XTVfNV0PjGlCxKo5SgWmNXx82I/Q3aG1tFfS+A2igVCY97TJ8tnYwpUWLCA==} engines: {node: '>=18'} cpu: [arm64] os: [win32] + '@esbuild/win32-arm64@0.25.9': + resolution: {integrity: sha512-mGFrVJHmZiRqmP8xFOc6b84/7xa5y5YvR1x8djzXpJBSv/UsNK6aqec+6JDjConTgvvQefdGhFDAs2DLAds6gQ==} + engines: {node: '>=18'} + cpu: [arm64] + os: [win32] + '@esbuild/win32-ia32@0.24.0': resolution: {integrity: sha512-vQW36KZolfIudCcTnaTpmLQ24Ha1RjygBo39/aLkM2kmjkWmZGEJ5Gn9l5/7tzXA42QGIoWbICfg6KLLkIw6yw==} engines: {node: '>=18'} cpu: [ia32] os: [win32] + '@esbuild/win32-ia32@0.25.9': + resolution: {integrity: sha512-b33gLVU2k11nVx1OhX3C8QQP6UHQK4ZtN56oFWvVXvz2VkDoe6fbG8TOgHFxEvqeqohmRnIHe5A1+HADk4OQww==} + engines: {node: '>=18'} + cpu: [ia32] + os: [win32] + '@esbuild/win32-x64@0.24.0': resolution: {integrity: sha512-7IAFPrjSQIJrGsK6flwg7NFmwBoSTyF3rl7If0hNUFQU4ilTsEPL6GuMuU9BfIWVVGuRnuIidkSMC+c0Otu8IA==} engines: {node: '>=18'} cpu: [x64] os: [win32] + '@esbuild/win32-x64@0.25.9': + resolution: {integrity: sha512-PPOl1mi6lpLNQxnGoyAfschAodRFYXJ+9fs6WHXz7CSWKbOqiMZsubC+BQsVKuul+3vKLuwTHsS2c2y9EoKwxQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [win32] + '@eslint-community/eslint-utils@4.4.1': resolution: {integrity: sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -3284,6 +3440,9 @@ packages: resolution: {integrity: sha512-aR0uffYI700OEEH4gYnitAnv3vzVGXCFvYfdpu/CJKvk4pHfLPEy/JSZyrpQ+15WhXe1yJRXLtfQ84s4mEXnPg==} engines: {node: '>=14'} + '@rtsao/scc@1.1.0': + resolution: {integrity: sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==} + '@sideway/address@4.1.5': resolution: {integrity: sha512-IqO/DUQHUkPeixNQ8n0JA6102hT9CmaljNTPmQ1u8MEhBo/R4Q8eKLN/vGZxuebwOroDB4cbpjheD4+/sKFK4Q==} @@ -4471,10 +4630,18 @@ packages: resolution: {integrity: sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==} engines: {node: '>= 0.4'} + array-includes@3.1.9: + resolution: {integrity: sha512-FmeCCAenzH0KH381SPT5FZmiA/TmpndpcaShhfgEN9eCVjnFBqq3l1xrI42y8+PPLI6hypzou4GXw00WHmPBLQ==} + engines: {node: '>= 0.4'} + array-union@2.1.0: resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} engines: {node: '>=8'} + array.prototype.findlastindex@1.2.6: + resolution: {integrity: sha512-F/TKATkzseUExPlfvmwQKGITM3DGTK+vkAsCZoDc5daVygbJBnjEUCbgkAvVFsgfXfX4YIqZ/27G3k3tdXrTxQ==} + engines: {node: '>= 0.4'} + array.prototype.flat@1.3.3: resolution: {integrity: sha512-rwG/ja1neyLqCuGZ5YYrznA62D4mZXg0i1cIskIUKSiqF3Cje9/wXAls9B9s1Wa2fomMsIv8czB8jZcPmxCXFg==} engines: {node: '>= 0.4'} @@ -4782,6 +4949,10 @@ packages: resolution: {integrity: sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==} engines: {node: '>= 0.4'} + call-bound@1.0.4: + resolution: {integrity: sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==} + engines: {node: '>= 0.4'} + callsites@3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} @@ -5727,6 +5898,10 @@ packages: resolution: {integrity: sha512-py07lI0wjxAC/DcfK1S6G7iANonniZwTISvdPzk9hzeH0IZIshbuuFxLIU96OyF89Yb9hiqWn8M/bY83KY5vzA==} engines: {node: '>= 0.4'} + es-abstract@1.24.0: + resolution: {integrity: sha512-WSzPgsdLtTcQwm4CROfS5ju2Wa1QQcVeT37jFjYzdFz1r9ahadC8B8/a4qxJxM+09F18iumCdRmlr96ZYkQvEg==} + engines: {node: '>= 0.4'} + es-define-property@1.0.1: resolution: {integrity: sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==} engines: {node: '>= 0.4'} @@ -5781,6 +5956,11 @@ packages: engines: {node: '>=18'} hasBin: true + esbuild@0.25.9: + resolution: {integrity: sha512-CRbODhYyQx3qp7ZEwzxOk4JBqmD/seJrzPa/cGjY1VtIn5E09Oi9/dB4JwctnfZ8Q8iT7rioVv5k/FNT/uf54g==} + engines: {node: '>=18'} + hasBin: true + escalade@3.2.0: resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} engines: {node: '>=6'} @@ -5850,8 +6030,8 @@ packages: eslint-import-resolver-node@0.3.9: resolution: {integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==} - eslint-module-utils@2.12.0: - resolution: {integrity: sha512-wALZ0HFoytlyh/1+4wuZ9FJCD/leWHQzzrxJ8+rebyReSLk7LApMyd3WJaLVoN+D5+WIdJyDK1c6JnE65V4Zyg==} + eslint-module-utils@2.12.1: + resolution: {integrity: sha512-L8jSWTze7K2mTg0vos/RuLRS5soomksDPoJLXIslC7c8Wmut3bx7CPpJijDcBZtxQ5lrbUdM+s0OlNbz0DCDNw==} engines: {node: '>=4'} peerDependencies: '@typescript-eslint/parser': '*' @@ -5878,12 +6058,12 @@ packages: eslint: ^7.0.0 || ^8.0.0 || ^9.0.0 tailwindcss: ^3.3.0 || ^4.1.6 - eslint-plugin-import@2.26.0: - resolution: {integrity: sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA==} + eslint-plugin-import@2.32.0: + resolution: {integrity: sha512-whOE1HFo/qJDyX4SnXzP4N6zOWn79WhnCUY/iDR0mPfQZO8wcYE4JClzI2oZrhBnnMUCBCHZhO6VQyoBU95mZA==} engines: {node: '>=4'} peerDependencies: '@typescript-eslint/parser': '*' - eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 + eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9 peerDependenciesMeta: '@typescript-eslint/parser': optional: true @@ -6362,6 +6542,10 @@ packages: resolution: {integrity: sha512-VW6Pxhsrk0KAOqs3WEd0klDiF/+V7gQOpAvY1jVU/LHmaD/kQO4523aiJuikX/QAKYiW6x8Jh+RJej1almdtCA==} engines: {node: '>= 0.4'} + get-intrinsic@1.3.0: + resolution: {integrity: sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==} + engines: {node: '>= 0.4'} + get-nonce@1.0.1: resolution: {integrity: sha512-FJhYRoDaiatfEkUK8HKlicmu/3SGFD51q3itKDGoSTysQJBnfOcxU5GxnhE1E6soB76MbT0MBtnKJuXyAx+96Q==} engines: {node: '>=6'} @@ -6535,10 +6719,6 @@ packages: resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==} engines: {node: '>= 0.4'} - has@1.0.4: - resolution: {integrity: sha512-qdSAmqLF6209RFj4VVItywPMbm3vWylknmB3nvNiUIs72xAimcM8nVYxYr7ncvZq5qzk9MKIZR8ijqD/1QuYjQ==} - engines: {node: '>= 0.4.0'} - hasha@5.2.2: resolution: {integrity: sha512-Hrp5vIK/xr5SkeN2onO32H0MgNZ0f17HRNH39WfL0SYUNOTZ5Lz1TJ8Pajo/87dYGEFlLMm7mIc/k/s6Bvz9HQ==} engines: {node: '>=8'} @@ -6954,6 +7134,10 @@ packages: resolution: {integrity: sha512-czXVVn/QEmgvej1f50BZ648vUI+em0xqMq2Sn+QncCLN4zj1UAxlT+kw/6ggQTOaZPd1HqKQGEqbpQVtJucWug==} engines: {node: '>=0.10.0'} + is-negative-zero@2.0.3: + resolution: {integrity: sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==} + engines: {node: '>= 0.4'} + is-network-error@1.1.0: resolution: {integrity: sha512-tUdRRAnhT+OtCZR/LxZelH/C7QtjtFrTu5tXCA8pl55eTUElUHT+GPYV8MBMBvea/j+NxQqVt3LbWMRir7Gx9g==} engines: {node: '>=16'} @@ -8224,6 +8408,10 @@ packages: resolution: {integrity: sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==} engines: {node: '>= 0.4'} + object.groupby@1.0.3: + resolution: {integrity: sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==} + engines: {node: '>= 0.4'} + object.hasown@1.1.4: resolution: {integrity: sha512-FZ9LZt9/RHzGySlBARE3VF+gE26TxR38SdmqOqliuTnl9wrKulaQs+4dee1V+Io8VfxqzAfHu6YuRgUy8OHoTg==} engines: {node: '>= 0.4'} @@ -9630,6 +9818,10 @@ packages: resolution: {integrity: sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==} engines: {node: '>= 0.8'} + stop-iteration-iterator@1.1.0: + resolution: {integrity: sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==} + engines: {node: '>= 0.4'} + storybook@8.4.4: resolution: {integrity: sha512-xBOq3q/MuUUg3zM0imMMaK5ziKq3TO388jsnaiemJ4Uf0ZGwcHjM8HDBCDt0s5/CfsOQ49zo1ouZ3aNlu0qsUg==} hasBin: true @@ -10486,6 +10678,10 @@ packages: resolution: {integrity: sha512-qEcY+KJYlWyLH9vNbsr6/5j59AXk5ni5aakf8ldzBvGde6Iz4sxZGkJyWSAueTG7QhOvNRYb1lDdFmL5Td0QKA==} engines: {node: '>= 0.4'} + which-typed-array@1.1.19: + resolution: {integrity: sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw==} + engines: {node: '>= 0.4'} + which@1.3.1: resolution: {integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==} hasBin: true @@ -11218,75 +11414,153 @@ snapshots: '@esbuild/aix-ppc64@0.24.0': optional: true + '@esbuild/aix-ppc64@0.25.9': + optional: true + '@esbuild/android-arm64@0.24.0': optional: true + '@esbuild/android-arm64@0.25.9': + optional: true + '@esbuild/android-arm@0.24.0': optional: true + '@esbuild/android-arm@0.25.9': + optional: true + '@esbuild/android-x64@0.24.0': optional: true + '@esbuild/android-x64@0.25.9': + optional: true + '@esbuild/darwin-arm64@0.24.0': optional: true + '@esbuild/darwin-arm64@0.25.9': + optional: true + '@esbuild/darwin-x64@0.24.0': optional: true + '@esbuild/darwin-x64@0.25.9': + optional: true + '@esbuild/freebsd-arm64@0.24.0': optional: true + '@esbuild/freebsd-arm64@0.25.9': + optional: true + '@esbuild/freebsd-x64@0.24.0': optional: true + '@esbuild/freebsd-x64@0.25.9': + optional: true + '@esbuild/linux-arm64@0.24.0': optional: true + '@esbuild/linux-arm64@0.25.9': + optional: true + '@esbuild/linux-arm@0.24.0': optional: true + '@esbuild/linux-arm@0.25.9': + optional: true + '@esbuild/linux-ia32@0.24.0': optional: true + '@esbuild/linux-ia32@0.25.9': + optional: true + '@esbuild/linux-loong64@0.24.0': optional: true + '@esbuild/linux-loong64@0.25.9': + optional: true + '@esbuild/linux-mips64el@0.24.0': optional: true + '@esbuild/linux-mips64el@0.25.9': + optional: true + '@esbuild/linux-ppc64@0.24.0': optional: true + '@esbuild/linux-ppc64@0.25.9': + optional: true + '@esbuild/linux-riscv64@0.24.0': optional: true + '@esbuild/linux-riscv64@0.25.9': + optional: true + '@esbuild/linux-s390x@0.24.0': optional: true + '@esbuild/linux-s390x@0.25.9': + optional: true + '@esbuild/linux-x64@0.24.0': optional: true + '@esbuild/linux-x64@0.25.9': + optional: true + + '@esbuild/netbsd-arm64@0.25.9': + optional: true + '@esbuild/netbsd-x64@0.24.0': optional: true + '@esbuild/netbsd-x64@0.25.9': + optional: true + '@esbuild/openbsd-arm64@0.24.0': optional: true + '@esbuild/openbsd-arm64@0.25.9': + optional: true + '@esbuild/openbsd-x64@0.24.0': optional: true + '@esbuild/openbsd-x64@0.25.9': + optional: true + + '@esbuild/openharmony-arm64@0.25.9': + optional: true + '@esbuild/sunos-x64@0.24.0': optional: true + '@esbuild/sunos-x64@0.25.9': + optional: true + '@esbuild/win32-arm64@0.24.0': optional: true + '@esbuild/win32-arm64@0.25.9': + optional: true + '@esbuild/win32-ia32@0.24.0': optional: true + '@esbuild/win32-ia32@0.25.9': + optional: true + '@esbuild/win32-x64@0.24.0': optional: true + '@esbuild/win32-x64@0.25.9': + optional: true + '@eslint-community/eslint-utils@4.4.1(eslint@8.56.0)': dependencies: eslint: 8.56.0 @@ -13929,6 +14203,8 @@ snapshots: yallist: 4.0.0 optional: true + '@rtsao/scc@1.1.0': {} + '@sideway/address@4.1.5': dependencies: '@hapi/hoek': 9.3.0 @@ -14091,7 +14367,7 @@ snapshots: - '@swc/helpers' - webpack - '@storybook/builder-webpack5@8.4.4(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.24.0)(storybook@8.4.4(bufferutil@4.0.9)(prettier@3.3.3)(utf-8-validate@5.0.10))(typescript@5.6.3)(webpack-cli@5.1.4)': + '@storybook/builder-webpack5@8.4.4(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.25.9)(storybook@8.4.4(bufferutil@4.0.9)(prettier@3.3.3)(utf-8-validate@5.0.10))(typescript@5.6.3)(webpack-cli@5.1.4)': dependencies: '@storybook/core-webpack': 8.4.4(storybook@8.4.4(bufferutil@4.0.9)(prettier@3.3.3)(utf-8-validate@5.0.10)) '@types/node': 22.13.4 @@ -14110,12 +14386,12 @@ snapshots: semver: 7.6.3 storybook: 8.4.4(bufferutil@4.0.9)(prettier@3.3.3)(utf-8-validate@5.0.10) style-loader: 3.3.4(webpack@5.96.1) - terser-webpack-plugin: 5.3.10(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.24.0)(webpack@5.96.1) + terser-webpack-plugin: 5.3.10(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.25.9)(webpack@5.96.1) ts-dedent: 2.2.0 url: 0.11.4 util: 0.12.5 util-deprecate: 1.0.2 - webpack: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.24.0)(webpack-cli@5.1.4) + webpack: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.25.9)(webpack-cli@5.1.4) webpack-dev-middleware: 6.1.3(webpack@5.96.1) webpack-hot-middleware: 2.26.1 webpack-virtual-modules: 0.6.2 @@ -14191,7 +14467,7 @@ snapshots: dependencies: storybook: 8.4.4(bufferutil@4.0.9)(prettier@3.3.3)(utf-8-validate@5.0.10) - '@storybook/preset-react-webpack@8.4.4(@storybook/test@8.4.4(storybook@8.4.4(bufferutil@4.0.9)(prettier@3.3.3)(utf-8-validate@5.0.10)))(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.24.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@8.4.4(bufferutil@4.0.9)(prettier@3.3.3)(utf-8-validate@5.0.10))(typescript@5.6.3)(webpack-cli@5.1.4)': + '@storybook/preset-react-webpack@8.4.4(@storybook/test@8.4.4(storybook@8.4.4(bufferutil@4.0.9)(prettier@3.3.3)(utf-8-validate@5.0.10)))(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.25.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@8.4.4(bufferutil@4.0.9)(prettier@3.3.3)(utf-8-validate@5.0.10))(typescript@5.6.3)(webpack-cli@5.1.4)': dependencies: '@storybook/core-webpack': 8.4.4(storybook@8.4.4(bufferutil@4.0.9)(prettier@3.3.3)(utf-8-validate@5.0.10)) '@storybook/react': 8.4.4(@storybook/test@8.4.4(storybook@8.4.4(bufferutil@4.0.9)(prettier@3.3.3)(utf-8-validate@5.0.10)))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@8.4.4(bufferutil@4.0.9)(prettier@3.3.3)(utf-8-validate@5.0.10))(typescript@5.6.3) @@ -14207,7 +14483,7 @@ snapshots: semver: 7.6.3 storybook: 8.4.4(bufferutil@4.0.9)(prettier@3.3.3)(utf-8-validate@5.0.10) tsconfig-paths: 4.2.0 - webpack: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.24.0)(webpack-cli@5.1.4) + webpack: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.25.9)(webpack-cli@5.1.4) optionalDependencies: typescript: 5.6.3 transitivePeerDependencies: @@ -14232,7 +14508,7 @@ snapshots: react-docgen-typescript: 2.2.2(typescript@5.6.3) tslib: 2.8.1 typescript: 5.6.3 - webpack: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.24.0)(webpack-cli@5.1.4) + webpack: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.25.9)(webpack-cli@5.1.4) transitivePeerDependencies: - supports-color @@ -14242,10 +14518,10 @@ snapshots: react-dom: 18.3.1(react@18.3.1) storybook: 8.4.4(bufferutil@4.0.9)(prettier@3.3.3)(utf-8-validate@5.0.10) - '@storybook/react-webpack5@8.4.4(@storybook/test@8.4.4(storybook@8.4.4(bufferutil@4.0.9)(prettier@3.3.3)(utf-8-validate@5.0.10)))(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.24.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@8.4.4(bufferutil@4.0.9)(prettier@3.3.3)(utf-8-validate@5.0.10))(typescript@5.6.3)(webpack-cli@5.1.4)': + '@storybook/react-webpack5@8.4.4(@storybook/test@8.4.4(storybook@8.4.4(bufferutil@4.0.9)(prettier@3.3.3)(utf-8-validate@5.0.10)))(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.25.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@8.4.4(bufferutil@4.0.9)(prettier@3.3.3)(utf-8-validate@5.0.10))(typescript@5.6.3)(webpack-cli@5.1.4)': dependencies: - '@storybook/builder-webpack5': 8.4.4(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.24.0)(storybook@8.4.4(bufferutil@4.0.9)(prettier@3.3.3)(utf-8-validate@5.0.10))(typescript@5.6.3)(webpack-cli@5.1.4) - '@storybook/preset-react-webpack': 8.4.4(@storybook/test@8.4.4(storybook@8.4.4(bufferutil@4.0.9)(prettier@3.3.3)(utf-8-validate@5.0.10)))(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.24.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@8.4.4(bufferutil@4.0.9)(prettier@3.3.3)(utf-8-validate@5.0.10))(typescript@5.6.3)(webpack-cli@5.1.4) + '@storybook/builder-webpack5': 8.4.4(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.25.9)(storybook@8.4.4(bufferutil@4.0.9)(prettier@3.3.3)(utf-8-validate@5.0.10))(typescript@5.6.3)(webpack-cli@5.1.4) + '@storybook/preset-react-webpack': 8.4.4(@storybook/test@8.4.4(storybook@8.4.4(bufferutil@4.0.9)(prettier@3.3.3)(utf-8-validate@5.0.10)))(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.25.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@8.4.4(bufferutil@4.0.9)(prettier@3.3.3)(utf-8-validate@5.0.10))(typescript@5.6.3)(webpack-cli@5.1.4) '@storybook/react': 8.4.4(@storybook/test@8.4.4(storybook@8.4.4(bufferutil@4.0.9)(prettier@3.3.3)(utf-8-validate@5.0.10)))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@8.4.4(bufferutil@4.0.9)(prettier@3.3.3)(utf-8-validate@5.0.10))(typescript@5.6.3) '@types/node': 22.13.4 react: 18.3.1 @@ -15186,17 +15462,17 @@ snapshots: '@webpack-cli/configtest@2.1.1(webpack-cli@5.1.4)(webpack@5.96.1)': dependencies: - webpack: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.24.0)(webpack-cli@5.1.4) + webpack: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.25.9)(webpack-cli@5.1.4) webpack-cli: 5.1.4(webpack-dev-server@5.1.0)(webpack@5.96.1) '@webpack-cli/info@2.0.2(webpack-cli@5.1.4)(webpack@5.96.1)': dependencies: - webpack: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.24.0)(webpack-cli@5.1.4) + webpack: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.25.9)(webpack-cli@5.1.4) webpack-cli: 5.1.4(webpack-dev-server@5.1.0)(webpack@5.96.1) '@webpack-cli/serve@2.0.5(webpack-cli@5.1.4)(webpack-dev-server@5.1.0)(webpack@5.96.1)': dependencies: - webpack: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.24.0)(webpack-cli@5.1.4) + webpack: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.25.9)(webpack-cli@5.1.4) webpack-cli: 5.1.4(webpack-dev-server@5.1.0)(webpack@5.96.1) optionalDependencies: webpack-dev-server: 5.1.0(bufferutil@4.0.9)(debug@4.3.7)(utf-8-validate@5.0.10)(webpack-cli@5.1.4)(webpack@5.96.1) @@ -15405,8 +15681,29 @@ snapshots: get-intrinsic: 1.2.7 is-string: 1.1.1 + array-includes@3.1.9: + dependencies: + call-bind: 1.0.8 + call-bound: 1.0.4 + define-properties: 1.2.1 + es-abstract: 1.24.0 + es-object-atoms: 1.1.1 + get-intrinsic: 1.3.0 + is-string: 1.1.1 + math-intrinsics: 1.1.0 + array-union@2.1.0: {} + array.prototype.findlastindex@1.2.6: + dependencies: + call-bind: 1.0.8 + call-bound: 1.0.4 + define-properties: 1.2.1 + es-abstract: 1.23.9 + es-errors: 1.3.0 + es-object-atoms: 1.1.1 + es-shim-unscopables: 1.1.0 + array.prototype.flat@1.3.3: dependencies: call-bind: 1.0.8 @@ -15507,7 +15804,7 @@ snapshots: '@babel/core': 7.26.0 find-cache-dir: 4.0.0 schema-utils: 4.3.0 - webpack: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.24.0)(webpack-cli@5.1.4) + webpack: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.25.9)(webpack-cli@5.1.4) babel-plugin-istanbul@6.1.1: dependencies: @@ -15829,6 +16126,11 @@ snapshots: call-bind-apply-helpers: 1.0.2 get-intrinsic: 1.2.7 + call-bound@1.0.4: + dependencies: + call-bind-apply-helpers: 1.0.2 + get-intrinsic: 1.3.0 + callsites@3.1.0: {} camel-case@4.1.2: @@ -16241,7 +16543,7 @@ snapshots: postcss-value-parser: 4.2.0 semver: 7.6.3 optionalDependencies: - webpack: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.24.0)(webpack-cli@5.1.4) + webpack: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.25.9)(webpack-cli@5.1.4) css-loader@7.1.2(webpack@5.96.1): dependencies: @@ -16254,7 +16556,7 @@ snapshots: postcss-value-parser: 4.2.0 semver: 7.6.3 optionalDependencies: - webpack: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.24.0)(webpack-cli@5.1.4) + webpack: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.25.9)(webpack-cli@5.1.4) css-select@4.3.0: dependencies: @@ -16875,6 +17177,63 @@ snapshots: unbox-primitive: 1.1.0 which-typed-array: 1.1.18 + es-abstract@1.24.0: + dependencies: + array-buffer-byte-length: 1.0.2 + arraybuffer.prototype.slice: 1.0.4 + available-typed-arrays: 1.0.7 + call-bind: 1.0.8 + call-bound: 1.0.4 + data-view-buffer: 1.0.2 + data-view-byte-length: 1.0.2 + data-view-byte-offset: 1.0.1 + es-define-property: 1.0.1 + es-errors: 1.3.0 + es-object-atoms: 1.1.1 + es-set-tostringtag: 2.1.0 + es-to-primitive: 1.3.0 + function.prototype.name: 1.1.8 + get-intrinsic: 1.3.0 + get-proto: 1.0.1 + get-symbol-description: 1.1.0 + globalthis: 1.0.4 + gopd: 1.2.0 + has-property-descriptors: 1.0.2 + has-proto: 1.2.0 + has-symbols: 1.1.0 + hasown: 2.0.2 + internal-slot: 1.1.0 + is-array-buffer: 3.0.5 + is-callable: 1.2.7 + is-data-view: 1.0.2 + is-negative-zero: 2.0.3 + is-regex: 1.2.1 + is-set: 2.0.3 + is-shared-array-buffer: 1.0.4 + is-string: 1.1.1 + is-typed-array: 1.1.15 + is-weakref: 1.1.1 + math-intrinsics: 1.1.0 + object-inspect: 1.13.4 + object-keys: 1.1.1 + object.assign: 4.1.7 + own-keys: 1.0.1 + regexp.prototype.flags: 1.5.4 + safe-array-concat: 1.1.3 + safe-push-apply: 1.0.0 + safe-regex-test: 1.1.0 + set-proto: 1.0.0 + stop-iteration-iterator: 1.1.0 + string.prototype.trim: 1.2.10 + string.prototype.trimend: 1.0.9 + string.prototype.trimstart: 1.0.8 + typed-array-buffer: 1.0.3 + typed-array-byte-length: 1.0.3 + typed-array-byte-offset: 1.0.4 + typed-array-length: 1.0.7 + unbox-primitive: 1.1.0 + which-typed-array: 1.1.19 + es-define-property@1.0.1: {} es-errors@1.3.0: {} @@ -16963,6 +17322,35 @@ snapshots: '@esbuild/win32-ia32': 0.24.0 '@esbuild/win32-x64': 0.24.0 + esbuild@0.25.9: + optionalDependencies: + '@esbuild/aix-ppc64': 0.25.9 + '@esbuild/android-arm': 0.25.9 + '@esbuild/android-arm64': 0.25.9 + '@esbuild/android-x64': 0.25.9 + '@esbuild/darwin-arm64': 0.25.9 + '@esbuild/darwin-x64': 0.25.9 + '@esbuild/freebsd-arm64': 0.25.9 + '@esbuild/freebsd-x64': 0.25.9 + '@esbuild/linux-arm': 0.25.9 + '@esbuild/linux-arm64': 0.25.9 + '@esbuild/linux-ia32': 0.25.9 + '@esbuild/linux-loong64': 0.25.9 + '@esbuild/linux-mips64el': 0.25.9 + '@esbuild/linux-ppc64': 0.25.9 + '@esbuild/linux-riscv64': 0.25.9 + '@esbuild/linux-s390x': 0.25.9 + '@esbuild/linux-x64': 0.25.9 + '@esbuild/netbsd-arm64': 0.25.9 + '@esbuild/netbsd-x64': 0.25.9 + '@esbuild/openbsd-arm64': 0.25.9 + '@esbuild/openbsd-x64': 0.25.9 + '@esbuild/openharmony-arm64': 0.25.9 + '@esbuild/sunos-x64': 0.25.9 + '@esbuild/win32-arm64': 0.25.9 + '@esbuild/win32-ia32': 0.25.9 + '@esbuild/win32-x64': 0.25.9 + escalade@3.2.0: {} escape-html@1.0.3: {} @@ -16990,11 +17378,11 @@ snapshots: optionalDependencies: source-map: 0.6.1 - eslint-config-airbnb-base@15.0.0(eslint-plugin-import@2.26.0(@typescript-eslint/parser@6.18.1(eslint@8.56.0)(typescript@5.6.3))(eslint@8.56.0))(eslint@8.56.0): + eslint-config-airbnb-base@15.0.0(eslint-plugin-import@2.32.0(@typescript-eslint/parser@6.18.1(eslint@8.56.0)(typescript@5.6.3))(eslint@8.56.0))(eslint@8.56.0): dependencies: confusing-browser-globals: 1.0.11 eslint: 8.56.0 - eslint-plugin-import: 2.26.0(@typescript-eslint/parser@6.18.1(eslint@8.56.0)(typescript@5.6.3))(eslint@8.56.0) + eslint-plugin-import: 2.32.0(@typescript-eslint/parser@6.18.1(eslint@8.56.0)(typescript@5.6.3))(eslint@8.56.0) object.assign: 4.1.7 object.entries: 1.1.8 semver: 6.3.1 @@ -17004,9 +17392,9 @@ snapshots: '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.56.0)(typescript@5.6.3))(eslint@8.56.0)(typescript@5.6.3) '@typescript-eslint/parser': 5.62.0(eslint@8.56.0)(typescript@5.6.3) eslint: 8.56.0 - eslint-config-airbnb: 19.0.4(eslint-plugin-import@2.26.0(@typescript-eslint/parser@6.18.1(eslint@8.56.0)(typescript@5.6.3))(eslint@8.56.0))(eslint-plugin-jsx-a11y@6.10.2(eslint@8.56.0))(eslint-plugin-react-hooks@4.6.2(eslint@8.56.0))(eslint-plugin-react@7.31.10(eslint@8.56.0))(eslint@8.56.0) + eslint-config-airbnb: 19.0.4(eslint-plugin-import@2.32.0(@typescript-eslint/parser@6.18.1(eslint@8.56.0)(typescript@5.6.3))(eslint@8.56.0))(eslint-plugin-jsx-a11y@6.10.2(eslint@8.56.0))(eslint-plugin-react-hooks@4.6.2(eslint@8.56.0))(eslint-plugin-react@7.31.10(eslint@8.56.0))(eslint@8.56.0) eslint-config-prettier: 6.15.0(eslint@8.56.0) - eslint-plugin-import: 2.26.0(@typescript-eslint/parser@5.62.0(eslint@8.56.0)(typescript@5.6.3))(eslint@8.56.0) + eslint-plugin-import: 2.32.0(@typescript-eslint/parser@5.62.0(eslint@8.56.0)(typescript@5.6.3))(eslint@8.56.0) eslint-plugin-jsx-a11y: 6.10.2(eslint@8.56.0) eslint-plugin-prettier: 5.2.1(@types/eslint@9.6.1)(eslint-config-prettier@6.15.0(eslint@8.56.0))(eslint@8.56.0)(prettier@3.3.3) eslint-plugin-react: 7.31.10(eslint@8.56.0) @@ -17019,11 +17407,11 @@ snapshots: - eslint-import-resolver-webpack - supports-color - eslint-config-airbnb@19.0.4(eslint-plugin-import@2.26.0(@typescript-eslint/parser@6.18.1(eslint@8.56.0)(typescript@5.6.3))(eslint@8.56.0))(eslint-plugin-jsx-a11y@6.10.2(eslint@8.56.0))(eslint-plugin-react-hooks@4.6.2(eslint@8.56.0))(eslint-plugin-react@7.31.10(eslint@8.56.0))(eslint@8.56.0): + eslint-config-airbnb@19.0.4(eslint-plugin-import@2.32.0(@typescript-eslint/parser@6.18.1(eslint@8.56.0)(typescript@5.6.3))(eslint@8.56.0))(eslint-plugin-jsx-a11y@6.10.2(eslint@8.56.0))(eslint-plugin-react-hooks@4.6.2(eslint@8.56.0))(eslint-plugin-react@7.31.10(eslint@8.56.0))(eslint@8.56.0): dependencies: eslint: 8.56.0 - eslint-config-airbnb-base: 15.0.0(eslint-plugin-import@2.26.0(@typescript-eslint/parser@6.18.1(eslint@8.56.0)(typescript@5.6.3))(eslint@8.56.0))(eslint@8.56.0) - eslint-plugin-import: 2.26.0(@typescript-eslint/parser@6.18.1(eslint@8.56.0)(typescript@5.6.3))(eslint@8.56.0) + eslint-config-airbnb-base: 15.0.0(eslint-plugin-import@2.32.0(@typescript-eslint/parser@6.18.1(eslint@8.56.0)(typescript@5.6.3))(eslint@8.56.0))(eslint@8.56.0) + eslint-plugin-import: 2.32.0(@typescript-eslint/parser@6.18.1(eslint@8.56.0)(typescript@5.6.3))(eslint@8.56.0) eslint-plugin-jsx-a11y: 6.10.2(eslint@8.56.0) eslint-plugin-react: 7.31.10(eslint@8.56.0) eslint-plugin-react-hooks: 4.6.2(eslint@8.56.0) @@ -17047,7 +17435,7 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-module-utils@2.12.0(@typescript-eslint/parser@5.62.0(eslint@8.56.0)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint@8.56.0): + eslint-module-utils@2.12.1(@typescript-eslint/parser@5.62.0(eslint@8.56.0)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint@8.56.0): dependencies: debug: 3.2.7 optionalDependencies: @@ -17057,7 +17445,7 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-module-utils@2.12.0(@typescript-eslint/parser@6.18.1(eslint@8.56.0)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint@8.56.0): + eslint-module-utils@2.12.1(@typescript-eslint/parser@6.18.1(eslint@8.56.0)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint@8.56.0): dependencies: debug: 3.2.7 optionalDependencies: @@ -17080,21 +17468,27 @@ snapshots: tailwindcss: 4.1.7 tsconfig-paths-webpack-plugin: 4.2.0 - eslint-plugin-import@2.26.0(@typescript-eslint/parser@5.62.0(eslint@8.56.0)(typescript@5.6.3))(eslint@8.56.0): + eslint-plugin-import@2.32.0(@typescript-eslint/parser@5.62.0(eslint@8.56.0)(typescript@5.6.3))(eslint@8.56.0): dependencies: - array-includes: 3.1.8 + '@rtsao/scc': 1.1.0 + array-includes: 3.1.9 + array.prototype.findlastindex: 1.2.6 array.prototype.flat: 1.3.3 - debug: 2.6.9 + array.prototype.flatmap: 1.3.3 + debug: 3.2.7 doctrine: 2.1.0 eslint: 8.56.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.12.0(@typescript-eslint/parser@5.62.0(eslint@8.56.0)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint@8.56.0) - has: 1.0.4 + eslint-module-utils: 2.12.1(@typescript-eslint/parser@5.62.0(eslint@8.56.0)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint@8.56.0) + hasown: 2.0.2 is-core-module: 2.16.1 is-glob: 4.0.3 minimatch: 3.1.2 + object.fromentries: 2.0.8 + object.groupby: 1.0.3 object.values: 1.2.1 - resolve: 1.22.10 + semver: 6.3.1 + string.prototype.trimend: 1.0.9 tsconfig-paths: 3.15.0 optionalDependencies: '@typescript-eslint/parser': 5.62.0(eslint@8.56.0)(typescript@5.6.3) @@ -17103,21 +17497,27 @@ snapshots: - eslint-import-resolver-webpack - supports-color - eslint-plugin-import@2.26.0(@typescript-eslint/parser@6.18.1(eslint@8.56.0)(typescript@5.6.3))(eslint@8.56.0): + eslint-plugin-import@2.32.0(@typescript-eslint/parser@6.18.1(eslint@8.56.0)(typescript@5.6.3))(eslint@8.56.0): dependencies: - array-includes: 3.1.8 + '@rtsao/scc': 1.1.0 + array-includes: 3.1.9 + array.prototype.findlastindex: 1.2.6 array.prototype.flat: 1.3.3 - debug: 2.6.9 + array.prototype.flatmap: 1.3.3 + debug: 3.2.7 doctrine: 2.1.0 eslint: 8.56.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.12.0(@typescript-eslint/parser@6.18.1(eslint@8.56.0)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint@8.56.0) - has: 1.0.4 + eslint-module-utils: 2.12.1(@typescript-eslint/parser@6.18.1(eslint@8.56.0)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint@8.56.0) + hasown: 2.0.2 is-core-module: 2.16.1 is-glob: 4.0.3 minimatch: 3.1.2 + object.fromentries: 2.0.8 + object.groupby: 1.0.3 object.values: 1.2.1 - resolve: 1.22.10 + semver: 6.3.1 + string.prototype.trimend: 1.0.9 tsconfig-paths: 3.15.0 optionalDependencies: '@typescript-eslint/parser': 6.18.1(eslint@8.56.0)(typescript@5.6.3) @@ -17590,7 +17990,7 @@ snapshots: semver: 7.6.3 tapable: 2.2.1 typescript: 5.6.3 - webpack: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.24.0)(webpack-cli@5.1.4) + webpack: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.25.9)(webpack-cli@5.1.4) form-data@4.0.1: dependencies: @@ -17720,6 +18120,19 @@ snapshots: hasown: 2.0.2 math-intrinsics: 1.1.0 + get-intrinsic@1.3.0: + dependencies: + call-bind-apply-helpers: 1.0.2 + es-define-property: 1.0.1 + es-errors: 1.3.0 + es-object-atoms: 1.1.1 + function-bind: 1.1.2 + get-proto: 1.0.1 + gopd: 1.2.0 + has-symbols: 1.1.0 + hasown: 2.0.2 + math-intrinsics: 1.1.0 + get-nonce@1.0.1: {} get-package-type@0.1.0: {} @@ -17934,8 +18347,6 @@ snapshots: dependencies: has-symbols: 1.1.0 - has@1.0.4: {} - hasha@5.2.2: dependencies: is-stream: 2.0.1 @@ -18008,7 +18419,7 @@ snapshots: pretty-error: 4.0.0 tapable: 2.2.1 optionalDependencies: - webpack: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.24.0)(webpack-cli@5.1.4) + webpack: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.25.9)(webpack-cli@5.1.4) htmlparser2@3.10.1: dependencies: @@ -18395,6 +18806,8 @@ snapshots: is-negated-glob@1.0.0: {} + is-negative-zero@2.0.3: {} + is-network-error@1.1.0: {} is-npm@1.0.0: {} @@ -19608,7 +20021,7 @@ snapshots: dependencies: schema-utils: 4.3.0 tapable: 2.2.1 - webpack: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.24.0)(webpack-cli@5.1.4) + webpack: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.25.9)(webpack-cli@5.1.4) minimalistic-assert@1.0.1: {} @@ -19932,6 +20345,12 @@ snapshots: es-abstract: 1.23.9 es-object-atoms: 1.1.1 + object.groupby@1.0.3: + dependencies: + call-bind: 1.0.8 + define-properties: 1.2.1 + es-abstract: 1.23.9 + object.hasown@1.1.4: dependencies: define-properties: 1.2.1 @@ -20326,7 +20745,7 @@ snapshots: postcss: 8.5.3 semver: 7.6.3 optionalDependencies: - webpack: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.24.0)(webpack-cli@5.1.4) + webpack: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.25.9)(webpack-cli@5.1.4) transitivePeerDependencies: - typescript @@ -21221,7 +21640,7 @@ snapshots: neo-async: 2.6.2 optionalDependencies: sass: 1.80.7 - webpack: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.24.0)(webpack-cli@5.1.4) + webpack: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.25.9)(webpack-cli@5.1.4) sass@1.80.7: dependencies: @@ -21559,6 +21978,11 @@ snapshots: statuses@2.0.1: {} + stop-iteration-iterator@1.1.0: + dependencies: + es-errors: 1.3.0 + internal-slot: 1.1.0 + storybook@8.4.4(bufferutil@4.0.9)(prettier@3.3.3)(utf-8-validate@5.0.10): dependencies: '@storybook/core': 8.4.4(bufferutil@4.0.9)(prettier@3.3.3)(utf-8-validate@5.0.10) @@ -21704,11 +22128,11 @@ snapshots: style-loader@3.3.4(webpack@5.96.1): dependencies: - webpack: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.24.0)(webpack-cli@5.1.4) + webpack: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.25.9)(webpack-cli@5.1.4) style-loader@4.0.0(webpack@5.96.1): dependencies: - webpack: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.24.0)(webpack-cli@5.1.4) + webpack: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.25.9)(webpack-cli@5.1.4) style-value-types@5.0.0: dependencies: @@ -21840,7 +22264,7 @@ snapshots: dependencies: '@swc/core': 1.10.16(@swc/helpers@0.5.15) '@swc/counter': 0.1.3 - webpack: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.24.0)(webpack-cli@5.1.4) + webpack: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.25.9)(webpack-cli@5.1.4) synckit@0.11.11: dependencies: @@ -21903,17 +22327,17 @@ snapshots: dependencies: execa: 0.7.0 - terser-webpack-plugin@5.3.10(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.24.0)(webpack@5.96.1): + terser-webpack-plugin@5.3.10(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.25.9)(webpack@5.96.1): dependencies: '@jridgewell/trace-mapping': 0.3.25 jest-worker: 27.5.1 schema-utils: 3.3.0 serialize-javascript: 6.0.2 terser: 5.39.0 - webpack: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.24.0)(webpack-cli@5.1.4) + webpack: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.25.9)(webpack-cli@5.1.4) optionalDependencies: '@swc/core': 1.10.16(@swc/helpers@0.5.15) - esbuild: 0.24.0 + esbuild: 0.25.9 terser@5.39.0: dependencies: @@ -22413,7 +22837,7 @@ snapshots: import-local: 3.2.0 interpret: 3.1.1 rechoir: 0.8.0 - webpack: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.24.0)(webpack-cli@5.1.4) + webpack: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.25.9)(webpack-cli@5.1.4) webpack-merge: 5.10.0 optionalDependencies: webpack-dev-server: 5.1.0(bufferutil@4.0.9)(debug@4.3.7)(utf-8-validate@5.0.10)(webpack-cli@5.1.4)(webpack@5.96.1) @@ -22426,7 +22850,7 @@ snapshots: range-parser: 1.2.1 schema-utils: 4.3.0 optionalDependencies: - webpack: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.24.0)(webpack-cli@5.1.4) + webpack: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.25.9)(webpack-cli@5.1.4) webpack-dev-middleware@7.4.2(webpack@5.96.1): dependencies: @@ -22437,7 +22861,7 @@ snapshots: range-parser: 1.2.1 schema-utils: 4.3.0 optionalDependencies: - webpack: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.24.0)(webpack-cli@5.1.4) + webpack: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.25.9)(webpack-cli@5.1.4) webpack-dev-server@5.1.0(bufferutil@4.0.9)(debug@4.3.7)(utf-8-validate@5.0.10)(webpack-cli@5.1.4)(webpack@5.96.1): dependencies: @@ -22470,7 +22894,7 @@ snapshots: webpack-dev-middleware: 7.4.2(webpack@5.96.1) ws: 8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) optionalDependencies: - webpack: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.24.0)(webpack-cli@5.1.4) + webpack: 5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.25.9)(webpack-cli@5.1.4) webpack-cli: 5.1.4(webpack-dev-server@5.1.0)(webpack@5.96.1) transitivePeerDependencies: - bufferutil @@ -22494,7 +22918,7 @@ snapshots: webpack-virtual-modules@0.6.2: {} - webpack@5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.24.0)(webpack-cli@5.1.4): + webpack@5.96.1(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.25.9)(webpack-cli@5.1.4): dependencies: '@types/eslint-scope': 3.7.7 '@types/estree': 1.0.6 @@ -22516,7 +22940,7 @@ snapshots: neo-async: 2.6.2 schema-utils: 3.3.0 tapable: 2.2.1 - terser-webpack-plugin: 5.3.10(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.24.0)(webpack@5.96.1) + terser-webpack-plugin: 5.3.10(@swc/core@1.10.16(@swc/helpers@0.5.15))(esbuild@0.25.9)(webpack@5.96.1) watchpack: 2.4.2 webpack-sources: 3.2.3 optionalDependencies: @@ -22596,6 +23020,16 @@ snapshots: gopd: 1.2.0 has-tostringtag: 1.0.2 + which-typed-array@1.1.19: + dependencies: + available-typed-arrays: 1.0.7 + call-bind: 1.0.8 + call-bound: 1.0.4 + for-each: 0.3.5 + get-proto: 1.0.1 + gopd: 1.2.0 + has-tostringtag: 1.0.2 + which@1.3.1: dependencies: isexe: 2.0.0 diff --git a/scripts/esbuild.js b/scripts/esbuild.js index e2a81200396..ebc03be2d89 100644 --- a/scripts/esbuild.js +++ b/scripts/esbuild.js @@ -2,11 +2,13 @@ // SPDX-License-Identifier: AGPL-3.0-only const esbuild = require('esbuild'); -const path = require('path'); +const path = require('node:path'); +const fs = require('node:fs'); const fastGlob = require('fast-glob'); const ROOT_DIR = path.join(__dirname, '..'); const BUNDLES_DIR = 'bundles'; +const NODE_MODULES_DIR = path.join(ROOT_DIR, 'node_modules'); const watch = process.argv.some(argv => argv === '-w' || argv === '--watch'); const isProd = process.argv.some(argv => argv === '-prod' || argv === '--prod'); @@ -22,6 +24,33 @@ const nodeDefaults = { // See: https://github.com/evanw/esbuild/issues/1147 keepNames: true, logLevel: 'info', + plugins: [ + { + name: 'resolve-ts', + setup(b) { + b.onResolve({ filter: /\.js$/ }, args => { + if (!args.path.startsWith('.')) { + return undefined; + } + + const targetPath = path.join(args.resolveDir, args.path); + if (targetPath.startsWith(NODE_MODULES_DIR)) { + return undefined; + } + const tsPath = targetPath.replace(/\.js$/, '.ts'); + const tsxPath = targetPath.replace(/\.js$/, '.tsx'); + if (fs.existsSync(tsPath)) { + return { path: tsPath }; + } + if (fs.existsSync(tsxPath)) { + return { path: tsxPath }; + } + + return undefined; + }); + }, + }, + ], }; const bundleDefaults = { @@ -61,8 +90,11 @@ const bundleDefaults = { 'moment', 'quill', + // Imported, but not used in production builds + 'mocha', + // Uses fast-glob and dynamic requires - './preload_test', + './preload_test.js', ], }; @@ -119,7 +151,7 @@ async function main() { entryPoints: [ 'preload.wrapper.ts', ...fastGlob - .sync('{app,ts}/**/*.{ts,tsx}', { + .sync('{app,ts,build}/**/*.{ts,tsx}', { onlyFiles: true, cwd: ROOT_DIR, }) diff --git a/scripts/generate-acknowledgments.js b/scripts/generate-acknowledgments.js index 9042398bf7f..32edef1cbd6 100644 --- a/scripts/generate-acknowledgments.js +++ b/scripts/generate-acknowledgments.js @@ -1,9 +1,9 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -const assert = require('assert'); -const fs = require('fs'); -const { join } = require('path'); +const assert = require('node:assert'); +const fs = require('node:fs'); +const { join } = require('node:path'); const pMap = require('p-map'); const prettier = require('prettier'); diff --git a/scripts/prepare_adhoc_build.js b/scripts/prepare_adhoc_build.js index 20570943431..3d195b6a719 100644 --- a/scripts/prepare_adhoc_build.js +++ b/scripts/prepare_adhoc_build.js @@ -1,12 +1,12 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -const fs = require('fs'); +const fs = require('node:fs'); const _ = require('lodash'); -const { execSync } = require('child_process'); +const { execSync } = require('node:child_process'); const packageJson = require('../package.json'); -const { isAdhoc } = require('../ts/util/version'); +const { isAdhoc } = require('../ts/util/version.js'); const { version } = packageJson; diff --git a/scripts/prepare_alpha_build.js b/scripts/prepare_alpha_build.js index 4748c2cf919..bd28ae713d6 100644 --- a/scripts/prepare_alpha_build.js +++ b/scripts/prepare_alpha_build.js @@ -1,11 +1,11 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -const fs = require('fs'); +const fs = require('node:fs'); const _ = require('lodash'); const packageJson = require('../package.json'); -const { isAlpha } = require('../ts/util/version'); +const { isAlpha } = require('../ts/util/version.js'); const { version } = packageJson; diff --git a/scripts/prepare_axolotl_build.js b/scripts/prepare_axolotl_build.js index 3763c1280e0..4fd16e5ef6a 100644 --- a/scripts/prepare_axolotl_build.js +++ b/scripts/prepare_axolotl_build.js @@ -1,11 +1,11 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -const fs = require('fs'); +const fs = require('node:fs'); const _ = require('lodash'); const packageJson = require('../package.json'); -const { isAxolotl } = require('../ts/util/version'); +const { isAxolotl } = require('../ts/util/version.js'); const { version } = packageJson; diff --git a/scripts/prepare_beta_build.js b/scripts/prepare_beta_build.js index be0cb8ad445..6366d93225e 100644 --- a/scripts/prepare_beta_build.js +++ b/scripts/prepare_beta_build.js @@ -1,11 +1,11 @@ // Copyright 2018 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -const fs = require('fs'); +const fs = require('node:fs'); const _ = require('lodash'); const packageJson = require('../package.json'); -const { isBeta } = require('../ts/util/version'); +const { isBeta } = require('../ts/util/version.js'); const { version } = packageJson; diff --git a/scripts/prepare_staging_build.js b/scripts/prepare_staging_build.js index c8c258d9783..981a6fd37d9 100644 --- a/scripts/prepare_staging_build.js +++ b/scripts/prepare_staging_build.js @@ -1,11 +1,11 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -const fs = require('fs'); +const fs = require('node:fs'); const _ = require('lodash'); const packageJson = require('../package.json'); -const { isAlpha } = require('../ts/util/version'); +const { isAlpha } = require('../ts/util/version.js'); const { version } = packageJson; diff --git a/scripts/prepare_tagged_version.js b/scripts/prepare_tagged_version.js index 603d275d2ae..b3a493d1396 100644 --- a/scripts/prepare_tagged_version.js +++ b/scripts/prepare_tagged_version.js @@ -1,8 +1,8 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -const fs = require('fs'); -const { execSync } = require('child_process'); +const fs = require('node:fs'); +const { execSync } = require('node:child_process'); const _ = require('lodash'); @@ -12,7 +12,7 @@ if (release !== 'alpha' && release !== 'axolotl' && release !== 'adhoc') { process.exit(1); } -const { generateTaggedVersion } = require('../ts/util/version'); +const { generateTaggedVersion } = require('../ts/util/version.js'); const packageJson = require('../package.json'); diff --git a/ts/AttachmentCrypto.ts b/ts/AttachmentCrypto.ts index 426295a3318..3a95a98c593 100644 --- a/ts/AttachmentCrypto.ts +++ b/ts/AttachmentCrypto.ts @@ -1,13 +1,18 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createReadStream, createWriteStream } from 'fs'; -import { open, unlink, stat } from 'fs/promises'; -import type { FileHandle } from 'fs/promises'; -import { createCipheriv, createHash, createHmac, randomBytes } from 'crypto'; -import type { Hash } from 'crypto'; -import { PassThrough, Transform, type Writable, Readable } from 'stream'; -import { pipeline } from 'stream/promises'; +import { createReadStream, createWriteStream } from 'node:fs'; +import { open, unlink, stat } from 'node:fs/promises'; +import type { FileHandle } from 'node:fs/promises'; +import { + createCipheriv, + createHash, + createHmac, + randomBytes, +} from 'node:crypto'; +import type { Hash } from 'node:crypto'; +import { PassThrough, Transform, type Writable, Readable } from 'node:stream'; +import { pipeline } from 'node:stream/promises'; import { isNumber } from 'lodash'; import { ensureFile } from 'fs-extra'; @@ -19,9 +24,9 @@ import { ValidatingPassThrough, } from '@signalapp/libsignal-client/dist/incremental_mac'; import type { ChunkSizeChoice } from '@signalapp/libsignal-client/dist/incremental_mac'; -import { isAbsolute } from 'path'; +import { isAbsolute } from 'node:path'; -import { createLogger } from './logging/log'; +import { createLogger } from './logging/log.js'; import { HashType, CipherType, @@ -31,22 +36,22 @@ import { DIGEST_LENGTH, ATTACHMENT_MAC_LENGTH, AES_KEY_LENGTH, -} from './types/Crypto'; -import { constantTimeEqual } from './Crypto'; -import { createName, getRelativePath } from './util/attachmentPath'; -import { appendPaddingStream, logPadSize } from './util/logPadding'; -import { prependStream } from './util/prependStream'; -import { appendMacStream } from './util/appendMacStream'; -import { finalStream } from './util/finalStream'; -import { getMacAndUpdateHmac } from './util/getMacAndUpdateHmac'; -import { trimPadding } from './util/trimPadding'; -import { assertDev, strictAssert } from './util/assert'; -import * as Errors from './types/errors'; -import { isNotNil } from './util/isNotNil'; -import { missingCaseError } from './util/missingCaseError'; -import { getEnvironment, Environment } from './environment'; -import { isNotEmpty, toBase64, toHex } from './Bytes'; -import { decipherWithAesKey } from './util/decipherWithAesKey'; +} from './types/Crypto.js'; +import { constantTimeEqual } from './Crypto.js'; +import { createName, getRelativePath } from './util/attachmentPath.js'; +import { appendPaddingStream, logPadSize } from './util/logPadding.js'; +import { prependStream } from './util/prependStream.js'; +import { appendMacStream } from './util/appendMacStream.js'; +import { finalStream } from './util/finalStream.js'; +import { getMacAndUpdateHmac } from './util/getMacAndUpdateHmac.js'; +import { trimPadding } from './util/trimPadding.js'; +import { assertDev, strictAssert } from './util/assert.js'; +import * as Errors from './types/errors.js'; +import { isNotNil } from './util/isNotNil.js'; +import { missingCaseError } from './util/missingCaseError.js'; +import { getEnvironment, Environment } from './environment.js'; +import { isNotEmpty, toBase64, toHex } from './Bytes.js'; +import { decipherWithAesKey } from './util/decipherWithAesKey.js'; const log = createLogger('AttachmentCrypto'); diff --git a/ts/Bytes.ts b/ts/Bytes.ts index bf1678c1ecc..4310c49bfb4 100644 --- a/ts/Bytes.ts +++ b/ts/Bytes.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { Bytes } from './context/Bytes'; +import { Bytes } from './context/Bytes.js'; const bytes = globalThis.window?.SignalContext?.bytes || new Bytes(); diff --git a/ts/CI.ts b/ts/CI.ts index 3e8006cd6b5..a0b1c9d4b35 100644 --- a/ts/CI.ts +++ b/ts/CI.ts @@ -4,20 +4,20 @@ import { format } from 'node:util'; import { ipcRenderer } from 'electron'; -import type { IPCResponse as ChallengeResponseType } from './challenge'; -import type { MessageAttributesType } from './model-types.d'; -import { createLogger } from './logging/log'; -import { explodePromise } from './util/explodePromise'; -import { AccessType, ipcInvoke } from './sql/channels'; -import { backupsService } from './services/backups'; -import { notificationService } from './services/notifications'; -import { AttachmentBackupManager } from './jobs/AttachmentBackupManager'; -import { migrateAllMessages } from './messages/migrateMessageData'; -import { SECOND } from './util/durations'; -import { isSignalRoute } from './util/signalRoutes'; -import { strictAssert } from './util/assert'; -import { MessageModel } from './models/messages'; -import type { SocketStatuses } from './textsecure/SocketManager'; +import type { IPCResponse as ChallengeResponseType } from './challenge.js'; +import type { MessageAttributesType } from './model-types.d.ts'; +import { createLogger } from './logging/log.js'; +import { explodePromise } from './util/explodePromise.js'; +import { AccessType, ipcInvoke } from './sql/channels.js'; +import { backupsService } from './services/backups/index.js'; +import { notificationService } from './services/notifications.js'; +import { AttachmentBackupManager } from './jobs/AttachmentBackupManager.js'; +import { migrateAllMessages } from './messages/migrateMessageData.js'; +import { SECOND } from './util/durations/index.js'; +import { isSignalRoute } from './util/signalRoutes.js'; +import { strictAssert } from './util/assert.js'; +import { MessageModel } from './models/messages.js'; +import type { SocketStatuses } from './textsecure/SocketManager.js'; const log = createLogger('CI'); diff --git a/ts/CI/benchmarkConversationOpen.ts b/ts/CI/benchmarkConversationOpen.ts index 26d7d466381..90da7bd92cc 100644 --- a/ts/CI/benchmarkConversationOpen.ts +++ b/ts/CI/benchmarkConversationOpen.ts @@ -3,20 +3,20 @@ import { v4 as uuid } from 'uuid'; -import { incrementMessageCounter } from '../util/incrementMessageCounter'; -import { ReadStatus } from '../messages/MessageReadStatus'; -import { SendStatus } from '../messages/MessageSendState'; -import { DataWriter } from '../sql/Client'; -import { BodyRange } from '../types/BodyRange'; -import { strictAssert } from '../util/assert'; -import { MINUTE } from '../util/durations'; -import { isOlderThan } from '../util/timestamp'; -import { sleep } from '../util/sleep'; -import { stats } from '../util/benchmark/stats'; -import type { StatsType } from '../util/benchmark/stats'; -import type { MessageAttributesType } from '../model-types.d'; -import { createLogger } from '../logging/log'; -import { postSaveUpdates } from '../util/cleanup'; +import { incrementMessageCounter } from '../util/incrementMessageCounter.js'; +import { ReadStatus } from '../messages/MessageReadStatus.js'; +import { SendStatus } from '../messages/MessageSendState.js'; +import { DataWriter } from '../sql/Client.js'; +import { BodyRange } from '../types/BodyRange.js'; +import { strictAssert } from '../util/assert.js'; +import { MINUTE } from '../util/durations/index.js'; +import { isOlderThan } from '../util/timestamp.js'; +import { sleep } from '../util/sleep.js'; +import { stats } from '../util/benchmark/stats.js'; +import type { StatsType } from '../util/benchmark/stats.js'; +import type { MessageAttributesType } from '../model-types.d.ts'; +import { createLogger } from '../logging/log.js'; +import { postSaveUpdates } from '../util/cleanup.js'; const log = createLogger('benchmarkConversationOpen'); diff --git a/ts/ConversationController.ts b/ts/ConversationController.ts index 67463832433..a441bfebdd1 100644 --- a/ts/ConversationController.ts +++ b/ts/ConversationController.ts @@ -5,50 +5,54 @@ import { debounce, pick, uniq, without } from 'lodash'; import PQueue from 'p-queue'; import { v4 as generateUuid } from 'uuid'; -import { DataReader, DataWriter } from './sql/Client'; -import { createLogger } from './logging/log'; -import * as Errors from './types/errors'; -import { getAuthorId } from './messages/helpers'; -import { maybeDeriveGroupV2Id } from './groups'; -import { assertDev, strictAssert } from './util/assert'; -import { drop } from './util/drop'; +import { DataReader, DataWriter } from './sql/Client.js'; +import { createLogger } from './logging/log.js'; +import * as Errors from './types/errors.js'; +import { getAuthorId } from './messages/helpers.js'; +import { maybeDeriveGroupV2Id } from './groups.js'; +import { assertDev, strictAssert } from './util/assert.js'; +import { drop } from './util/drop.js'; import { isDirectConversation, isGroup, isGroupV1, isGroupV2, -} from './util/whatTypeOfConversation'; +} from './util/whatTypeOfConversation.js'; import { isServiceIdString, normalizePni, normalizeServiceId, -} from './types/ServiceId'; -import { normalizeAci } from './util/normalizeAci'; -import { sleep } from './util/sleep'; -import { isNotNil } from './util/isNotNil'; -import { MINUTE, SECOND } from './util/durations'; -import { getServiceIdsForE164s } from './util/getServiceIdsForE164s'; -import { SIGNAL_ACI, SIGNAL_AVATAR_PATH } from './types/SignalConversation'; -import { getTitleNoDefault } from './util/getTitle'; -import * as StorageService from './services/storage'; -import type { ConversationPropsForUnreadStats } from './util/countUnreadStats'; -import { countAllConversationsUnreadStats } from './util/countUnreadStats'; -import { isTestOrMockEnvironment } from './environment'; -import { isConversationAccepted } from './util/isConversationAccepted'; -import { areWePending } from './util/groupMembershipUtils'; -import { conversationJobQueue } from './jobs/conversationJobQueue'; -import { createBatcher } from './util/batcher'; -import { validateConversation } from './util/validateConversation'; -import { ConversationModel } from './models/conversations'; -import { INITIAL_EXPIRE_TIMER_VERSION } from './util/expirationTimer'; -import { missingCaseError } from './util/missingCaseError'; +} from './types/ServiceId.js'; +import { normalizeAci } from './util/normalizeAci.js'; +import { sleep } from './util/sleep.js'; +import { isNotNil } from './util/isNotNil.js'; +import { MINUTE, SECOND } from './util/durations/index.js'; +import { getServiceIdsForE164s } from './util/getServiceIdsForE164s.js'; +import { SIGNAL_ACI, SIGNAL_AVATAR_PATH } from './types/SignalConversation.js'; +import { getTitleNoDefault } from './util/getTitle.js'; +import * as StorageService from './services/storage.js'; +import type { ConversationPropsForUnreadStats } from './util/countUnreadStats.js'; +import { countAllConversationsUnreadStats } from './util/countUnreadStats.js'; +import { isTestOrMockEnvironment } from './environment.js'; +import { isConversationAccepted } from './util/isConversationAccepted.js'; +import { areWePending } from './util/groupMembershipUtils.js'; +import { conversationJobQueue } from './jobs/conversationJobQueue.js'; +import { createBatcher } from './util/batcher.js'; +import { validateConversation } from './util/validateConversation.js'; +import { ConversationModel } from './models/conversations.js'; +import { INITIAL_EXPIRE_TIMER_VERSION } from './util/expirationTimer.js'; +import { missingCaseError } from './util/missingCaseError.js'; import type { ConversationAttributesType, ConversationAttributesTypeType, ConversationRenderInfoType, -} from './model-types.d'; -import type { ServiceIdString, AciString, PniString } from './types/ServiceId'; +} from './model-types.d.ts'; +import type { + ServiceIdString, + AciString, + PniString, +} from './types/ServiceId.js'; const log = createLogger('ConversationController'); diff --git a/ts/Crypto.ts b/ts/Crypto.ts index 7a0aeec605e..62536bf52a1 100644 --- a/ts/Crypto.ts +++ b/ts/Crypto.ts @@ -7,18 +7,18 @@ import { Aci, Pni, hkdf } from '@signalapp/libsignal-client'; import type { PublicKey, PrivateKey } from '@signalapp/libsignal-client'; import { AccountEntropyPool } from '@signalapp/libsignal-client/dist/AccountKeys'; -import * as Bytes from './Bytes'; -import { Crypto } from './context/Crypto'; -import { calculateAgreement, generateKeyPair } from './Curve'; -import { HashType, CipherType } from './types/Crypto'; -import { AVATAR_COLOR_COUNT, AvatarColors } from './types/Colors'; -import { ProfileDecryptError } from './types/errors'; -import { getBytesSubarray } from './util/uuidToBytes'; -import { logPadSize } from './util/logPadding'; -import { Environment, getEnvironment } from './environment'; -import { toWebSafeBase64 } from './util/webSafeBase64'; +import * as Bytes from './Bytes.js'; +import { Crypto } from './context/Crypto.js'; +import { calculateAgreement, generateKeyPair } from './Curve.js'; +import { HashType, CipherType } from './types/Crypto.js'; +import { AVATAR_COLOR_COUNT, AvatarColors } from './types/Colors.js'; +import { ProfileDecryptError } from './types/errors.js'; +import { getBytesSubarray } from './util/uuidToBytes.js'; +import { logPadSize } from './util/logPadding.js'; +import { Environment, getEnvironment } from './environment.js'; +import { toWebSafeBase64 } from './util/webSafeBase64.js'; -import type { AciString, PniString } from './types/ServiceId'; +import type { AciString, PniString } from './types/ServiceId.js'; export { HashType, CipherType }; diff --git a/ts/Curve.ts b/ts/Curve.ts index 968c2a800b3..4339aa9b338 100644 --- a/ts/Curve.ts +++ b/ts/Curve.ts @@ -4,14 +4,14 @@ import * as client from '@signalapp/libsignal-client'; import type { KyberPreKeyRecord } from '@signalapp/libsignal-client'; -import * as Bytes from './Bytes'; -import { constantTimeEqual } from './Crypto'; +import * as Bytes from './Bytes.js'; +import { constantTimeEqual } from './Crypto.js'; import type { KeyPairType, CompatPreKeyType, CompatSignedPreKeyType, -} from './textsecure/Types.d'; -import { createLogger } from './logging/log'; +} from './textsecure/Types.d.ts'; +import { createLogger } from './logging/log.js'; const log = createLogger('Curve'); diff --git a/ts/IdleDetector.ts b/ts/IdleDetector.ts index bcdeb3b33d0..1952f587d74 100644 --- a/ts/IdleDetector.ts +++ b/ts/IdleDetector.ts @@ -1,9 +1,9 @@ // Copyright 2018 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import EventEmitter from 'events'; -import { createLogger } from './logging/log'; -import { clearTimeoutIfNecessary } from './util/clearTimeoutIfNecessary'; +import EventEmitter from 'node:events'; +import { createLogger } from './logging/log.js'; +import { clearTimeoutIfNecessary } from './util/clearTimeoutIfNecessary.js'; const log = createLogger('IdleDetector'); diff --git a/ts/LibSignalStores.ts b/ts/LibSignalStores.ts index 94fce3d670e..c30b80796ae 100644 --- a/ts/LibSignalStores.ts +++ b/ts/LibSignalStores.ts @@ -26,12 +26,12 @@ import { SessionStore, SignedPreKeyStore, } from '@signalapp/libsignal-client'; -import { Address } from './types/Address'; -import { QualifiedAddress } from './types/QualifiedAddress'; -import type { ServiceIdString } from './types/ServiceId'; -import { normalizeServiceId } from './types/ServiceId'; +import { Address } from './types/Address.js'; +import { QualifiedAddress } from './types/QualifiedAddress.js'; +import type { ServiceIdString } from './types/ServiceId.js'; +import { normalizeServiceId } from './types/ServiceId.js'; -import type { Zone } from './util/Zone'; +import type { Zone } from './util/Zone.js'; function encodeAddress(address: ProtocolAddress): Address { const name = address.name(); diff --git a/ts/RemoteConfig.ts b/ts/RemoteConfig.ts index c2008ff503b..f7d1a02ad32 100644 --- a/ts/RemoteConfig.ts +++ b/ts/RemoteConfig.ts @@ -3,16 +3,16 @@ import { get, throttle } from 'lodash'; -import type { WebAPIType } from './textsecure/WebAPI'; -import { createLogger } from './logging/log'; -import type { AciString } from './types/ServiceId'; -import { parseIntOrThrow } from './util/parseIntOrThrow'; -import { HOUR } from './util/durations'; -import * as Bytes from './Bytes'; -import { uuidToBytes } from './util/uuidToBytes'; -import { HashType } from './types/Crypto'; -import { getCountryCode } from './types/PhoneNumber'; -import { parseRemoteClientExpiration } from './util/parseRemoteClientExpiration'; +import type { WebAPIType } from './textsecure/WebAPI.js'; +import { createLogger } from './logging/log.js'; +import type { AciString } from './types/ServiceId.js'; +import { parseIntOrThrow } from './util/parseIntOrThrow.js'; +import { HOUR } from './util/durations/index.js'; +import * as Bytes from './Bytes.js'; +import { uuidToBytes } from './util/uuidToBytes.js'; +import { HashType } from './types/Crypto.js'; +import { getCountryCode } from './types/PhoneNumber.js'; +import { parseRemoteClientExpiration } from './util/parseRemoteClientExpiration.js'; const log = createLogger('RemoteConfig'); diff --git a/ts/SignalProtocolStore.ts b/ts/SignalProtocolStore.ts index 7436955009f..9d9f1350d54 100644 --- a/ts/SignalProtocolStore.ts +++ b/ts/SignalProtocolStore.ts @@ -4,7 +4,7 @@ import PQueue from 'p-queue'; import { omit } from 'lodash'; import { z } from 'zod'; -import { EventEmitter } from 'events'; +import { EventEmitter } from 'node:events'; import { Direction, @@ -19,15 +19,15 @@ import { SignedPreKeyRecord, } from '@signalapp/libsignal-client'; -import { DataReader, DataWriter } from './sql/Client'; -import type { ItemType } from './sql/Interface'; -import * as Bytes from './Bytes'; -import { constantTimeEqual, sha256 } from './Crypto'; -import { assertDev, strictAssert } from './util/assert'; -import { isNotNil } from './util/isNotNil'; -import { drop } from './util/drop'; -import { Zone } from './util/Zone'; -import { isMoreRecentThan } from './util/timestamp'; +import { DataReader, DataWriter } from './sql/Client.js'; +import type { ItemType } from './sql/Interface.js'; +import * as Bytes from './Bytes.js'; +import { constantTimeEqual, sha256 } from './Crypto.js'; +import { assertDev, strictAssert } from './util/assert.js'; +import { isNotNil } from './util/isNotNil.js'; +import { drop } from './util/drop.js'; +import { Zone } from './util/Zone.js'; +import { isMoreRecentThan } from './util/timestamp.js'; import type { DeviceType, IdentityKeyType, @@ -48,22 +48,26 @@ import type { SignedPreKeyType, UnprocessedType, CompatPreKeyType, -} from './textsecure/Types.d'; -import type { ServiceIdString, PniString, AciString } from './types/ServiceId'; -import { isServiceIdString, ServiceIdKind } from './types/ServiceId'; -import type { Address } from './types/Address'; -import type { QualifiedAddressStringType } from './types/QualifiedAddress'; -import { QualifiedAddress } from './types/QualifiedAddress'; -import { createLogger } from './logging/log'; -import * as Errors from './types/errors'; -import { MINUTE } from './util/durations'; -import { conversationJobQueue } from './jobs/conversationJobQueue'; +} from './textsecure/Types.d.ts'; +import type { + ServiceIdString, + PniString, + AciString, +} from './types/ServiceId.js'; +import { isServiceIdString, ServiceIdKind } from './types/ServiceId.js'; +import type { Address } from './types/Address.js'; +import type { QualifiedAddressStringType } from './types/QualifiedAddress.js'; +import { QualifiedAddress } from './types/QualifiedAddress.js'; +import { createLogger } from './logging/log.js'; +import * as Errors from './types/errors.js'; +import { MINUTE } from './util/durations/index.js'; +import { conversationJobQueue } from './jobs/conversationJobQueue.js'; import { KYBER_KEY_ID_KEY, SIGNED_PRE_KEY_ID_KEY, -} from './textsecure/AccountManager'; -import { formatGroups, groupWhile } from './util/groupWhile'; -import { parseUnknown } from './util/schemas'; +} from './textsecure/AccountManager.js'; +import { formatGroups, groupWhile } from './util/groupWhile.js'; +import { parseUnknown } from './util/schemas.js'; const log = createLogger('SignalProtocolStore'); diff --git a/ts/Timers.ts b/ts/Timers.ts index ec26422fbcb..b1c3b782029 100644 --- a/ts/Timers.ts +++ b/ts/Timers.ts @@ -3,7 +3,7 @@ const { timers } = window.SignalContext; -export type { Timeout } from './context/Timers'; +export type { Timeout } from './context/Timers.js'; export function setTimeout( ...args: Parameters diff --git a/ts/axo/AriaClickable.stories.tsx b/ts/axo/AriaClickable.stories.tsx index 010f5bb48d1..99ce148f533 100644 --- a/ts/axo/AriaClickable.stories.tsx +++ b/ts/axo/AriaClickable.stories.tsx @@ -4,9 +4,9 @@ import type { ReactNode } from 'react'; import React, { useId } from 'react'; import type { Meta } from '@storybook/react'; import { action } from '@storybook/addon-actions'; -import { AriaClickable } from './AriaClickable'; -import { AxoButton } from './AxoButton'; -import { tw } from './tw'; +import { AriaClickable } from './AriaClickable.js'; +import { AxoButton } from './AxoButton.js'; +import { tw } from './tw.js'; export default { title: 'Axo/AriaClickable', diff --git a/ts/axo/AriaClickable.tsx b/ts/axo/AriaClickable.tsx index 39e53970544..984dba87c03 100644 --- a/ts/axo/AriaClickable.tsx +++ b/ts/axo/AriaClickable.tsx @@ -10,8 +10,8 @@ import React, { } from 'react'; import type { ReactNode, MouseEvent, FC } from 'react'; import { useLayoutEffect } from '@react-aria/utils'; -import { tw } from './tw'; -import { assert } from './_internal/assert'; +import { tw } from './tw.js'; +import { assert } from './_internal/assert.js'; const Namespace = 'AriaClickable'; diff --git a/ts/axo/AxoButton.stories.tsx b/ts/axo/AxoButton.stories.tsx index 63f02814642..8b26680e91b 100644 --- a/ts/axo/AxoButton.stories.tsx +++ b/ts/axo/AxoButton.stories.tsx @@ -7,8 +7,8 @@ import { _getAllAxoButtonVariants, _getAllAxoButtonSizes, AxoButton, -} from './AxoButton'; -import { tw } from './tw'; +} from './AxoButton.js'; +import { tw } from './tw.js'; export default { title: 'Axo/AxoButton', diff --git a/ts/axo/AxoButton.tsx b/ts/axo/AxoButton.tsx index 059cdcc0587..0ba04943e51 100644 --- a/ts/axo/AxoButton.tsx +++ b/ts/axo/AxoButton.tsx @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo, forwardRef } from 'react'; import type { ButtonHTMLAttributes, FC, ForwardedRef, ReactNode } from 'react'; -import type { TailwindStyles } from './tw'; -import { tw } from './tw'; -import { AxoSymbol, type AxoSymbolName } from './AxoSymbol'; -import { assert } from './_internal/assert'; +import type { TailwindStyles } from './tw.js'; +import { tw } from './tw.js'; +import { AxoSymbol, type AxoSymbolName } from './AxoSymbol.js'; +import { assert } from './_internal/assert.js'; const Namespace = 'AxoButton'; diff --git a/ts/axo/AxoCheckbox.stories.tsx b/ts/axo/AxoCheckbox.stories.tsx index 322129fd09a..a5685c7b9c2 100644 --- a/ts/axo/AxoCheckbox.stories.tsx +++ b/ts/axo/AxoCheckbox.stories.tsx @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { useState } from 'react'; import type { Meta } from '@storybook/react'; -import { AxoCheckbox } from './AxoCheckbox'; -import { tw } from './tw'; +import { AxoCheckbox } from './AxoCheckbox.js'; +import { tw } from './tw.js'; export default { title: 'Axo/AxoCheckbox', diff --git a/ts/axo/AxoCheckbox.tsx b/ts/axo/AxoCheckbox.tsx index 2223b7471bd..4985352c7fe 100644 --- a/ts/axo/AxoCheckbox.tsx +++ b/ts/axo/AxoCheckbox.tsx @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo } from 'react'; import { Checkbox } from 'radix-ui'; -import { AxoSymbol } from './AxoSymbol'; -import { tw } from './tw'; +import { AxoSymbol } from './AxoSymbol.js'; +import { tw } from './tw.js'; const Namespace = 'AxoCheckbox'; diff --git a/ts/axo/AxoContextMenu.stories.tsx b/ts/axo/AxoContextMenu.stories.tsx index 6c734e3c83b..72af31b8de9 100644 --- a/ts/axo/AxoContextMenu.stories.tsx +++ b/ts/axo/AxoContextMenu.stories.tsx @@ -3,8 +3,8 @@ import React, { useState } from 'react'; import type { Meta } from '@storybook/react'; import { action } from '@storybook/addon-actions'; -import { AxoContextMenu } from './AxoContextMenu'; -import { tw } from './tw'; +import { AxoContextMenu } from './AxoContextMenu.js'; +import { tw } from './tw.js'; export default { title: 'Axo/AxoContextMenu', diff --git a/ts/axo/AxoContextMenu.tsx b/ts/axo/AxoContextMenu.tsx index 49e6adf7083..a1070bd442f 100644 --- a/ts/axo/AxoContextMenu.tsx +++ b/ts/axo/AxoContextMenu.tsx @@ -3,9 +3,9 @@ import React, { memo } from 'react'; import { ContextMenu } from 'radix-ui'; import type { FC } from 'react'; -import { AxoSymbol } from './AxoSymbol'; -import { AxoBaseMenu } from './_internal/AxoBaseMenu'; -import { tw } from './tw'; +import { AxoSymbol } from './AxoSymbol.js'; +import { AxoBaseMenu } from './_internal/AxoBaseMenu.js'; +import { tw } from './tw.js'; const Namespace = 'AxoContextMenu'; diff --git a/ts/axo/AxoDropdownMenu.stories.tsx b/ts/axo/AxoDropdownMenu.stories.tsx index 508cb57e650..dcfe0f04bea 100644 --- a/ts/axo/AxoDropdownMenu.stories.tsx +++ b/ts/axo/AxoDropdownMenu.stories.tsx @@ -3,9 +3,9 @@ import React, { useState } from 'react'; import type { Meta } from '@storybook/react'; import { action } from '@storybook/addon-actions'; -import { AxoDropdownMenu } from './AxoDropdownMenu'; -import { AxoButton } from './AxoButton'; -import { tw } from './tw'; +import { AxoDropdownMenu } from './AxoDropdownMenu.js'; +import { AxoButton } from './AxoButton.js'; +import { tw } from './tw.js'; export default { title: 'Axo/AxoDropdownMenu', diff --git a/ts/axo/AxoDropdownMenu.tsx b/ts/axo/AxoDropdownMenu.tsx index 4bd2efb7832..bc06677957c 100644 --- a/ts/axo/AxoDropdownMenu.tsx +++ b/ts/axo/AxoDropdownMenu.tsx @@ -3,9 +3,9 @@ import React, { memo } from 'react'; import { DropdownMenu } from 'radix-ui'; import type { FC } from 'react'; -import { AxoSymbol } from './AxoSymbol'; -import { AxoBaseMenu } from './_internal/AxoBaseMenu'; -import { tw } from './tw'; +import { AxoSymbol } from './AxoSymbol.js'; +import { AxoBaseMenu } from './_internal/AxoBaseMenu.js'; +import { tw } from './tw.js'; const Namespace = 'AxoDropdownMenu'; diff --git a/ts/axo/AxoSelect.stories.tsx b/ts/axo/AxoSelect.stories.tsx index b7ecaec0bae..a061de3527b 100644 --- a/ts/axo/AxoSelect.stories.tsx +++ b/ts/axo/AxoSelect.stories.tsx @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { useState } from 'react'; import type { Meta } from '@storybook/react'; -import { AxoSelect } from './AxoSelect'; -import { tw } from './tw'; +import { AxoSelect } from './AxoSelect.js'; +import { tw } from './tw.js'; export default { title: 'Axo/AxoSelect', diff --git a/ts/axo/AxoSelect.tsx b/ts/axo/AxoSelect.tsx index dcd7afbbed2..04b87137061 100644 --- a/ts/axo/AxoSelect.tsx +++ b/ts/axo/AxoSelect.tsx @@ -3,10 +3,10 @@ import React, { memo } from 'react'; import type { FC, ReactNode } from 'react'; import { Select } from 'radix-ui'; -import { AxoBaseMenu } from './_internal/AxoBaseMenu'; -import { AxoSymbol } from './AxoSymbol'; -import type { TailwindStyles } from './tw'; -import { tw } from './tw'; +import { AxoBaseMenu } from './_internal/AxoBaseMenu.js'; +import { AxoSymbol } from './AxoSymbol.js'; +import type { TailwindStyles } from './tw.js'; +import { tw } from './tw.js'; const Namespace = 'AxoSelect'; diff --git a/ts/axo/AxoSwitch.stories.tsx b/ts/axo/AxoSwitch.stories.tsx index 4b6ee6f66d0..cc4ba5fb17b 100644 --- a/ts/axo/AxoSwitch.stories.tsx +++ b/ts/axo/AxoSwitch.stories.tsx @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { useState } from 'react'; import type { Meta } from '@storybook/react'; -import { AxoSwitch } from './AxoSwitch'; -import { tw } from './tw'; +import { AxoSwitch } from './AxoSwitch.js'; +import { tw } from './tw.js'; export default { title: 'Axo/AxoSwitch', diff --git a/ts/axo/AxoSwitch.tsx b/ts/axo/AxoSwitch.tsx index 26fdae1558f..32ee19a2896 100644 --- a/ts/axo/AxoSwitch.tsx +++ b/ts/axo/AxoSwitch.tsx @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo } from 'react'; import { Switch } from 'radix-ui'; -import { tw } from './tw'; -import { AxoSymbol } from './AxoSymbol'; +import { tw } from './tw.js'; +import { AxoSymbol } from './AxoSymbol.js'; const Namespace = 'AxoSwitch'; diff --git a/ts/axo/AxoSymbol.stories.tsx b/ts/axo/AxoSymbol.stories.tsx index 68dcf9ff0d1..d1ab21aed02 100644 --- a/ts/axo/AxoSymbol.stories.tsx +++ b/ts/axo/AxoSymbol.stories.tsx @@ -4,9 +4,13 @@ import React, { memo, useMemo, useState } from 'react'; import type { Meta } from '@storybook/react'; import { Direction } from 'radix-ui'; import Fuse from 'fuse.js'; -import type { AxoSymbolName } from './AxoSymbol'; -import { AxoSymbol, _getAllAxoSymbolNames, _getAxoSymbol } from './AxoSymbol'; -import { tw } from './tw'; +import type { AxoSymbolName } from './AxoSymbol.js'; +import { + AxoSymbol, + _getAllAxoSymbolNames, + _getAxoSymbol, +} from './AxoSymbol.js'; +import { tw } from './tw.js'; export default { title: 'Axo/AxoSymbol', diff --git a/ts/axo/AxoSymbol.tsx b/ts/axo/AxoSymbol.tsx index 84a67c14150..7abd04144de 100644 --- a/ts/axo/AxoSymbol.tsx +++ b/ts/axo/AxoSymbol.tsx @@ -4,8 +4,8 @@ import type { FC } from 'react'; import React, { memo } from 'react'; import { Direction } from 'radix-ui'; import { VisuallyHidden } from 'react-aria'; -import { assert } from './_internal/assert'; -import { tw } from './tw'; +import { assert } from './_internal/assert.js'; +import { tw } from './tw.js'; const { useDirection } = Direction; diff --git a/ts/axo/_internal/AxoBaseMenu.tsx b/ts/axo/_internal/AxoBaseMenu.tsx index 542d3891e10..3aebe771fa0 100644 --- a/ts/axo/_internal/AxoBaseMenu.tsx +++ b/ts/axo/_internal/AxoBaseMenu.tsx @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; import type { ReactNode } from 'react'; -import { tw } from '../tw'; -import { AxoSymbol, type AxoSymbolName } from '../AxoSymbol'; +import { tw } from '../tw.js'; +import { AxoSymbol, type AxoSymbolName } from '../AxoSymbol.js'; // eslint-disable-next-line @typescript-eslint/no-namespace export namespace AxoBaseMenu { diff --git a/ts/background.ts b/ts/background.ts index 6d2d2abd15e..404b6336c93 100644 --- a/ts/background.ts +++ b/ts/background.ts @@ -7,75 +7,78 @@ import PQueue from 'p-queue'; import pMap from 'p-map'; import { v7 as generateUuid } from 'uuid'; -import * as Registration from './util/registration'; -import MessageReceiver from './textsecure/MessageReceiver'; +import * as Registration from './util/registration.js'; +import MessageReceiver from './textsecure/MessageReceiver.js'; import type { SessionResetsType, ProcessedDataMessage, -} from './textsecure/Types.d'; -import { HTTPError } from './textsecure/Errors'; +} from './textsecure/Types.d.ts'; +import { HTTPError } from './textsecure/Errors.js'; import createTaskWithTimeout, { suspendTasksWithTimeout, resumeTasksWithTimeout, reportLongRunningTasks, -} from './textsecure/TaskWithTimeout'; -import type { MessageAttributesType } from './model-types.d'; -import * as Bytes from './Bytes'; -import * as Timers from './Timers'; -import * as indexedDb from './indexeddb'; -import type { MenuOptionsType } from './types/menu'; -import { SocketStatus } from './types/SocketStatus'; -import { DEFAULT_CONVERSATION_COLOR } from './types/Colors'; -import { ThemeType } from './types/Util'; -import { ToastType } from './types/Toast'; -import { ChallengeHandler } from './challenge'; -import * as durations from './util/durations'; -import { drop } from './util/drop'; -import { explodePromise } from './util/explodePromise'; -import type { ExplodePromiseResultType } from './util/explodePromise'; -import { isWindowDragElement } from './util/isWindowDragElement'; -import { assertDev, strictAssert } from './util/assert'; -import { filter } from './util/iterables'; -import { isNotNil } from './util/isNotNil'; -import { areRemoteBackupsTurnedOn } from './util/isBackupEnabled'; -import { setAppLoadingScreenMessage } from './setAppLoadingScreenMessage'; -import { IdleDetector } from './IdleDetector'; +} from './textsecure/TaskWithTimeout.js'; +import type { MessageAttributesType } from './model-types.d.ts'; +import * as Bytes from './Bytes.js'; +import * as Timers from './Timers.js'; +import * as indexedDb from './indexeddb.js'; +import type { MenuOptionsType } from './types/menu.js'; +import { SocketStatus } from './types/SocketStatus.js'; +import { DEFAULT_CONVERSATION_COLOR } from './types/Colors.js'; +import { ThemeType } from './types/Util.js'; +import { ToastType } from './types/Toast.js'; +import { ChallengeHandler } from './challenge.js'; +import * as durations from './util/durations/index.js'; +import { drop } from './util/drop.js'; +import { explodePromise } from './util/explodePromise.js'; +import type { ExplodePromiseResultType } from './util/explodePromise.js'; +import { isWindowDragElement } from './util/isWindowDragElement.js'; +import { assertDev, strictAssert } from './util/assert.js'; +import { filter } from './util/iterables.js'; +import { isNotNil } from './util/isNotNil.js'; +import { areRemoteBackupsTurnedOn } from './util/isBackupEnabled.js'; +import { setAppLoadingScreenMessage } from './setAppLoadingScreenMessage.js'; +import { IdleDetector } from './IdleDetector.js'; import { initialize as initializeExpiringMessageService, update as updateExpiringMessagesService, -} from './services/expiringMessagesDeletion'; +} from './services/expiringMessagesDeletion.js'; import { initialize as initializeNotificationProfilesService, update as updateNotificationProfileService, -} from './services/notificationProfilesService'; -import { tapToViewMessagesDeletionService } from './services/tapToViewMessagesDeletionService'; -import { senderCertificateService } from './services/senderCertificate'; -import { GROUP_CREDENTIALS_KEY } from './services/groupCredentialFetcher'; -import * as KeyboardLayout from './services/keyboardLayout'; -import * as StorageService from './services/storage'; -import { usernameIntegrity } from './services/usernameIntegrity'; -import { updateIdentityKey } from './services/profiles'; -import { RoutineProfileRefresher } from './routineProfileRefresh'; -import { isOlderThan } from './util/timestamp'; -import { isValidReactionEmoji } from './reactions/isValidReactionEmoji'; -import type { ConversationModel } from './models/conversations'; -import { getAuthor, isIncoming } from './messages/helpers'; -import { migrateBatchOfMessages } from './messages/migrateMessageData'; -import { createBatcher } from './util/batcher'; +} from './services/notificationProfilesService.js'; +import { tapToViewMessagesDeletionService } from './services/tapToViewMessagesDeletionService.js'; +import { senderCertificateService } from './services/senderCertificate.js'; +import { GROUP_CREDENTIALS_KEY } from './services/groupCredentialFetcher.js'; +import * as KeyboardLayout from './services/keyboardLayout.js'; +import * as StorageService from './services/storage.js'; +import { usernameIntegrity } from './services/usernameIntegrity.js'; +import { updateIdentityKey } from './services/profiles.js'; +import { RoutineProfileRefresher } from './routineProfileRefresh.js'; +import { isOlderThan } from './util/timestamp.js'; +import { isValidReactionEmoji } from './reactions/isValidReactionEmoji.js'; +import type { ConversationModel } from './models/conversations.js'; +import { getAuthor, isIncoming } from './messages/helpers.js'; +import { migrateBatchOfMessages } from './messages/migrateMessageData.js'; +import { createBatcher } from './util/batcher.js'; import { initializeAllJobQueues, shutdownAllJobQueues, -} from './jobs/initializeAllJobQueues'; -import { removeStorageKeyJobQueue } from './jobs/removeStorageKeyJobQueue'; -import { ourProfileKeyService } from './services/ourProfileKey'; -import { notificationService } from './services/notifications'; -import { areWeASubscriberService } from './services/areWeASubscriber'; -import { onContactSync, setIsInitialContactSync } from './services/contactSync'; -import { startTimeTravelDetector } from './util/startTimeTravelDetector'; -import { shouldRespondWithProfileKey } from './util/shouldRespondWithProfileKey'; -import { LatestQueue } from './util/LatestQueue'; -import { parseIntOrThrow } from './util/parseIntOrThrow'; -import { getProfile } from './util/getProfile'; +} from './jobs/initializeAllJobQueues.js'; +import { removeStorageKeyJobQueue } from './jobs/removeStorageKeyJobQueue.js'; +import { ourProfileKeyService } from './services/ourProfileKey.js'; +import { notificationService } from './services/notifications.js'; +import { areWeASubscriberService } from './services/areWeASubscriber.js'; +import { + onContactSync, + setIsInitialContactSync, +} from './services/contactSync.js'; +import { startTimeTravelDetector } from './util/startTimeTravelDetector.js'; +import { shouldRespondWithProfileKey } from './util/shouldRespondWithProfileKey.js'; +import { LatestQueue } from './util/LatestQueue.js'; +import { parseIntOrThrow } from './util/parseIntOrThrow.js'; +import { getProfile } from './util/getProfile.js'; import type { AttachmentBackfillResponseSyncEvent, ConfigurationEvent, @@ -101,118 +104,118 @@ import type { ViewEvent, ViewOnceOpenSyncEvent, ViewSyncEvent, -} from './textsecure/messageReceiverEvents'; -import type { WebAPIType } from './textsecure/WebAPI'; -import * as KeyChangeListener from './textsecure/KeyChangeListener'; -import { UpdateKeysListener } from './textsecure/UpdateKeysListener'; -import { isDirectConversation } from './util/whatTypeOfConversation'; -import { BackOff, FIBONACCI_TIMEOUTS } from './util/BackOff'; -import { AppViewType } from './state/ducks/app'; -import { areAnyCallsActiveOrRinging } from './state/selectors/calling'; -import { badgeImageFileDownloader } from './badges/badgeImageFileDownloader'; -import * as Deletes from './messageModifiers/Deletes'; -import * as Edits from './messageModifiers/Edits'; -import * as MessageReceipts from './messageModifiers/MessageReceipts'; -import * as MessageRequests from './messageModifiers/MessageRequests'; -import * as Reactions from './messageModifiers/Reactions'; -import * as ViewOnceOpenSyncs from './messageModifiers/ViewOnceOpenSyncs'; -import type { DeleteAttributesType } from './messageModifiers/Deletes'; -import type { EditAttributesType } from './messageModifiers/Edits'; -import type { MessageRequestAttributesType } from './messageModifiers/MessageRequests'; -import type { ReactionAttributesType } from './messageModifiers/Reactions'; -import type { ViewOnceOpenSyncAttributesType } from './messageModifiers/ViewOnceOpenSyncs'; -import { ReadStatus } from './messages/MessageReadStatus'; -import type { SendStateByConversationId } from './messages/MessageSendState'; -import { SendStatus } from './messages/MessageSendState'; -import * as Stickers from './types/Stickers'; -import * as Errors from './types/errors'; -import { InstallScreenStep } from './types/InstallScreen'; -import { getEnvironment } from './environment'; -import { SignalService as Proto } from './protobuf'; +} from './textsecure/messageReceiverEvents.js'; +import type { WebAPIType } from './textsecure/WebAPI.js'; +import * as KeyChangeListener from './textsecure/KeyChangeListener.js'; +import { UpdateKeysListener } from './textsecure/UpdateKeysListener.js'; +import { isDirectConversation } from './util/whatTypeOfConversation.js'; +import { BackOff, FIBONACCI_TIMEOUTS } from './util/BackOff.js'; +import { AppViewType } from './state/ducks/app.js'; +import { areAnyCallsActiveOrRinging } from './state/selectors/calling.js'; +import { badgeImageFileDownloader } from './badges/badgeImageFileDownloader.js'; +import * as Deletes from './messageModifiers/Deletes.js'; +import * as Edits from './messageModifiers/Edits.js'; +import * as MessageReceipts from './messageModifiers/MessageReceipts.js'; +import * as MessageRequests from './messageModifiers/MessageRequests.js'; +import * as Reactions from './messageModifiers/Reactions.js'; +import * as ViewOnceOpenSyncs from './messageModifiers/ViewOnceOpenSyncs.js'; +import type { DeleteAttributesType } from './messageModifiers/Deletes.js'; +import type { EditAttributesType } from './messageModifiers/Edits.js'; +import type { MessageRequestAttributesType } from './messageModifiers/MessageRequests.js'; +import type { ReactionAttributesType } from './messageModifiers/Reactions.js'; +import type { ViewOnceOpenSyncAttributesType } from './messageModifiers/ViewOnceOpenSyncs.js'; +import { ReadStatus } from './messages/MessageReadStatus.js'; +import type { SendStateByConversationId } from './messages/MessageSendState.js'; +import { SendStatus } from './messages/MessageSendState.js'; +import * as Stickers from './types/Stickers.js'; +import * as Errors from './types/errors.js'; +import { InstallScreenStep } from './types/InstallScreen.js'; +import { getEnvironment } from './environment.js'; +import { SignalService as Proto } from './protobuf/index.js'; import { getOnDecryptionError, onRetryRequest, onInvalidPlaintextMessage, onSuccessfulDecrypt, -} from './util/handleRetry'; -import { themeChanged } from './shims/themeChanged'; -import { createIPCEvents } from './util/createIPCEvents'; -import type { ServiceIdString } from './types/ServiceId'; +} from './util/handleRetry.js'; +import { themeChanged } from './shims/themeChanged.js'; +import { createIPCEvents } from './util/createIPCEvents.js'; +import type { ServiceIdString } from './types/ServiceId.js'; import { ServiceIdKind, isPniString, isServiceIdString, -} from './types/ServiceId'; -import { isAciString } from './util/isAciString'; -import { normalizeAci } from './util/normalizeAci'; -import { createLogger } from './logging/log'; -import { deleteAllLogs } from './util/deleteAllLogs'; -import { startInteractionMode } from './services/InteractionMode'; -import { ReactionSource } from './reactions/ReactionSource'; -import { singleProtoJobQueue } from './jobs/singleProtoJobQueue'; -import { conversationJobQueue } from './jobs/conversationJobQueue'; -import { SeenStatus } from './MessageSeenStatus'; -import MessageSender from './textsecure/SendMessage'; -import type AccountManager from './textsecure/AccountManager'; -import { onStoryRecipientUpdate } from './util/onStoryRecipientUpdate'; -import { flushAttachmentDownloadQueue } from './util/attachmentDownloadQueue'; -import { initializeRedux } from './state/initializeRedux'; -import { StartupQueue } from './util/StartupQueue'; -import { showConfirmationDialog } from './util/showConfirmationDialog'; -import { onCallEventSync } from './util/onCallEventSync'; -import { sleeper } from './util/sleeper'; -import { DAY, HOUR, SECOND } from './util/durations'; -import { copyDataMessageIntoMessage } from './util/copyDataMessageIntoMessage'; +} from './types/ServiceId.js'; +import { isAciString } from './util/isAciString.js'; +import { normalizeAci } from './util/normalizeAci.js'; +import { createLogger } from './logging/log.js'; +import { deleteAllLogs } from './util/deleteAllLogs.js'; +import { startInteractionMode } from './services/InteractionMode.js'; +import { ReactionSource } from './reactions/ReactionSource.js'; +import { singleProtoJobQueue } from './jobs/singleProtoJobQueue.js'; +import { conversationJobQueue } from './jobs/conversationJobQueue.js'; +import { SeenStatus } from './MessageSeenStatus.js'; +import MessageSender from './textsecure/SendMessage.js'; +import type AccountManager from './textsecure/AccountManager.js'; +import { onStoryRecipientUpdate } from './util/onStoryRecipientUpdate.js'; +import { flushAttachmentDownloadQueue } from './util/attachmentDownloadQueue.js'; +import { initializeRedux } from './state/initializeRedux.js'; +import { StartupQueue } from './util/StartupQueue.js'; +import { showConfirmationDialog } from './util/showConfirmationDialog.js'; +import { onCallEventSync } from './util/onCallEventSync.js'; +import { sleeper } from './util/sleeper.js'; +import { DAY, HOUR, SECOND } from './util/durations/index.js'; +import { copyDataMessageIntoMessage } from './util/copyDataMessageIntoMessage.js'; import { flushMessageCounter, incrementMessageCounter, initializeMessageCounter, -} from './util/incrementMessageCounter'; -import { generateMessageId } from './util/generateMessageId'; -import { RetryPlaceholders } from './util/retryPlaceholders'; -import { setBatchingStrategy } from './util/messageBatcher'; -import { parseRemoteClientExpiration } from './util/parseRemoteClientExpiration'; -import { addGlobalKeyboardShortcuts } from './services/addGlobalKeyboardShortcuts'; -import { createEventHandler } from './quill/signal-clipboard/util'; -import { onCallLogEventSync } from './util/onCallLogEventSync'; -import { backupsService } from './services/backups'; +} from './util/incrementMessageCounter.js'; +import { generateMessageId } from './util/generateMessageId.js'; +import { RetryPlaceholders } from './util/retryPlaceholders.js'; +import { setBatchingStrategy } from './util/messageBatcher.js'; +import { parseRemoteClientExpiration } from './util/parseRemoteClientExpiration.js'; +import { addGlobalKeyboardShortcuts } from './services/addGlobalKeyboardShortcuts.js'; +import { createEventHandler } from './quill/signal-clipboard/util.js'; +import { onCallLogEventSync } from './util/onCallLogEventSync.js'; +import { backupsService } from './services/backups/index.js'; import { getCallIdFromEra, updateLocalGroupCallHistoryTimestamp, -} from './util/callDisposition'; -import { deriveStorageServiceKey, deriveMasterKey } from './Crypto'; -import { AttachmentDownloadManager } from './jobs/AttachmentDownloadManager'; -import { onCallLinkUpdateSync } from './util/onCallLinkUpdateSync'; -import { CallMode } from './types/CallDisposition'; -import type { SyncTaskType } from './util/syncTasks'; -import { queueSyncTasks, runAllSyncTasks } from './util/syncTasks'; -import type { ViewSyncTaskType } from './messageModifiers/ViewSyncs'; -import type { ReceiptSyncTaskType } from './messageModifiers/MessageReceipts'; -import type { ReadSyncTaskType } from './messageModifiers/ReadSyncs'; -import { AttachmentBackupManager } from './jobs/AttachmentBackupManager'; -import { getConversationIdForLogging } from './util/idForLogging'; -import { encryptConversationAttachments } from './util/encryptConversationAttachments'; -import { DataReader, DataWriter } from './sql/Client'; -import { restoreRemoteConfigFromStorage } from './RemoteConfig'; -import { getParametersForRedux, loadAll } from './services/allLoaders'; -import { checkFirstEnvelope } from './util/checkFirstEnvelope'; -import { BLOCKED_UUIDS_ID } from './textsecure/storage/Blocked'; -import { ReleaseNotesFetcher } from './services/releaseNotesFetcher'; -import { BuildExpirationService } from './services/buildExpiration'; +} from './util/callDisposition.js'; +import { deriveStorageServiceKey, deriveMasterKey } from './Crypto.js'; +import { AttachmentDownloadManager } from './jobs/AttachmentDownloadManager.js'; +import { onCallLinkUpdateSync } from './util/onCallLinkUpdateSync.js'; +import { CallMode } from './types/CallDisposition.js'; +import type { SyncTaskType } from './util/syncTasks.js'; +import { queueSyncTasks, runAllSyncTasks } from './util/syncTasks.js'; +import type { ViewSyncTaskType } from './messageModifiers/ViewSyncs.js'; +import type { ReceiptSyncTaskType } from './messageModifiers/MessageReceipts.js'; +import type { ReadSyncTaskType } from './messageModifiers/ReadSyncs.js'; +import { AttachmentBackupManager } from './jobs/AttachmentBackupManager.js'; +import { getConversationIdForLogging } from './util/idForLogging.js'; +import { encryptConversationAttachments } from './util/encryptConversationAttachments.js'; +import { DataReader, DataWriter } from './sql/Client.js'; +import { restoreRemoteConfigFromStorage } from './RemoteConfig.js'; +import { getParametersForRedux, loadAll } from './services/allLoaders.js'; +import { checkFirstEnvelope } from './util/checkFirstEnvelope.js'; +import { BLOCKED_UUIDS_ID } from './textsecure/storage/Blocked.js'; +import { ReleaseNotesFetcher } from './services/releaseNotesFetcher.js'; +import { BuildExpirationService } from './services/buildExpiration.js'; import { maybeQueueDeviceNameFetch, onDeviceNameChangeSync, -} from './util/onDeviceNameChangeSync'; -import { postSaveUpdates } from './util/cleanup'; -import { handleDataMessage } from './messages/handleDataMessage'; -import { MessageModel } from './models/messages'; -import { waitForEvent } from './shims/events'; -import { sendSyncRequests } from './textsecure/syncRequests'; -import { handleServerAlerts } from './util/handleServerAlerts'; -import { isLocalBackupsEnabled } from './util/isLocalBackupsEnabled'; -import { NavTab, SettingsPage, ProfileEditorPage } from './types/Nav'; -import { initialize as initializeDonationService } from './services/donations'; -import { MessageRequestResponseSource } from './types/MessageRequestResponseEvent'; +} from './util/onDeviceNameChangeSync.js'; +import { postSaveUpdates } from './util/cleanup.js'; +import { handleDataMessage } from './messages/handleDataMessage.js'; +import { MessageModel } from './models/messages.js'; +import { waitForEvent } from './shims/events.js'; +import { sendSyncRequests } from './textsecure/syncRequests.js'; +import { handleServerAlerts } from './util/handleServerAlerts.js'; +import { isLocalBackupsEnabled } from './util/isLocalBackupsEnabled.js'; +import { NavTab, SettingsPage, ProfileEditorPage } from './types/Nav.js'; +import { initialize as initializeDonationService } from './services/donations.js'; +import { MessageRequestResponseSource } from './types/MessageRequestResponseEvent.js'; const log = createLogger('background'); diff --git a/ts/badges/BadgeCategory.ts b/ts/badges/BadgeCategory.ts index 8ba5810b089..fadacdd2987 100644 --- a/ts/badges/BadgeCategory.ts +++ b/ts/badges/BadgeCategory.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { makeEnumParser } from '../util/enum'; +import { makeEnumParser } from '../util/enum.js'; // The server may return "testing", which we should parse as "other". export enum BadgeCategory { diff --git a/ts/badges/BadgeImageTheme.ts b/ts/badges/BadgeImageTheme.ts index 5b402719746..831ad3d065c 100644 --- a/ts/badges/BadgeImageTheme.ts +++ b/ts/badges/BadgeImageTheme.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { makeEnumParser } from '../util/enum'; +import { makeEnumParser } from '../util/enum.js'; export enum BadgeImageTheme { Light = 'light', diff --git a/ts/badges/badgeImageFileDownloader.ts b/ts/badges/badgeImageFileDownloader.ts index f1f8ec41cce..31cd301fa97 100644 --- a/ts/badges/badgeImageFileDownloader.ts +++ b/ts/badges/badgeImageFileDownloader.ts @@ -2,11 +2,11 @@ // SPDX-License-Identifier: AGPL-3.0-only import PQueue from 'p-queue'; -import { DataWriter } from '../sql/Client'; -import { createLogger } from '../logging/log'; -import { MINUTE } from '../util/durations'; -import { missingCaseError } from '../util/missingCaseError'; -import { waitForOnline } from '../util/waitForOnline'; +import { DataWriter } from '../sql/Client.js'; +import { createLogger } from '../logging/log.js'; +import { MINUTE } from '../util/durations/index.js'; +import { missingCaseError } from '../util/missingCaseError.js'; +import { waitForOnline } from '../util/waitForOnline.js'; const log = createLogger('badgeImageFileDownloader'); diff --git a/ts/badges/getBadgeImageFileLocalPath.ts b/ts/badges/getBadgeImageFileLocalPath.ts index 072c907d0d5..8254a70d346 100644 --- a/ts/badges/getBadgeImageFileLocalPath.ts +++ b/ts/badges/getBadgeImageFileLocalPath.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import { find, findLast, first, last } from 'lodash'; -import type { BadgeType } from './types'; -import { BadgeImageTheme } from './BadgeImageTheme'; +import type { BadgeType } from './types.js'; +import { BadgeImageTheme } from './BadgeImageTheme.js'; export function getBadgeImageFileLocalPath( badge: Readonly, diff --git a/ts/badges/isBadgeImageFileUrlValid.ts b/ts/badges/isBadgeImageFileUrlValid.ts index e905d4c9460..e8293911b84 100644 --- a/ts/badges/isBadgeImageFileUrlValid.ts +++ b/ts/badges/isBadgeImageFileUrlValid.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { maybeParseUrl } from '../util/url'; +import { maybeParseUrl } from '../util/url.js'; export function isBadgeImageFileUrlValid( url: string, diff --git a/ts/badges/isBadgeVisible.ts b/ts/badges/isBadgeVisible.ts index 6903f640451..fc7f9c3bab2 100644 --- a/ts/badges/isBadgeVisible.ts +++ b/ts/badges/isBadgeVisible.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { BadgeType } from './types'; +import type { BadgeType } from './types.js'; export const isBadgeVisible = (badge: Readonly): boolean => 'isVisible' in badge ? badge.isVisible : true; diff --git a/ts/badges/parseBadgesFromServer.ts b/ts/badges/parseBadgesFromServer.ts index b78f2056ea4..ffb932e07aa 100644 --- a/ts/badges/parseBadgesFromServer.ts +++ b/ts/badges/parseBadgesFromServer.ts @@ -3,13 +3,13 @@ import * as z from 'zod'; import { isEmpty } from 'lodash'; -import { isRecord } from '../util/isRecord'; -import { isNormalNumber } from '../util/isNormalNumber'; -import { createLogger } from '../logging/log'; -import type { BadgeType, BadgeImageType } from './types'; -import { parseBadgeCategory } from './BadgeCategory'; -import { BadgeImageTheme, parseBadgeImageTheme } from './BadgeImageTheme'; -import { safeParseUnknown } from '../util/schemas'; +import { isRecord } from '../util/isRecord.js'; +import { isNormalNumber } from '../util/isNormalNumber.js'; +import { createLogger } from '../logging/log.js'; +import type { BadgeType, BadgeImageType } from './types.js'; +import { parseBadgeCategory } from './BadgeCategory.js'; +import { BadgeImageTheme, parseBadgeImageTheme } from './BadgeImageTheme.js'; +import { safeParseUnknown } from '../util/schemas.js'; const log = createLogger('parseBadgesFromServer'); diff --git a/ts/badges/types.ts b/ts/badges/types.ts index c9cf67d7e97..a1cd87d0dcd 100644 --- a/ts/badges/types.ts +++ b/ts/badges/types.ts @@ -1,8 +1,8 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { BadgeCategory } from './BadgeCategory'; -import type { BadgeImageTheme } from './BadgeImageTheme'; +import type { BadgeCategory } from './BadgeCategory.js'; +import type { BadgeImageTheme } from './BadgeImageTheme.js'; type SomeoneElsesBadgeType = Readonly<{ category: BadgeCategory; diff --git a/ts/calling/VideoSupport.ts b/ts/calling/VideoSupport.ts index e9a5fb43196..fa66989b924 100644 --- a/ts/calling/VideoSupport.ts +++ b/ts/calling/VideoSupport.ts @@ -9,7 +9,7 @@ import { videoPixelFormatToEnum } from '@signalapp/ringrtc'; import type { VideoFrameSender, VideoFrameSource } from '@signalapp/ringrtc'; import type { RefObject } from 'react'; -import { createLogger } from '../logging/log'; +import { createLogger } from '../logging/log.js'; const log = createLogger('VideoSupport'); diff --git a/ts/calling/useGetCallingFrameBuffer.ts b/ts/calling/useGetCallingFrameBuffer.ts index 1fdb9d3d675..ff91d56846e 100644 --- a/ts/calling/useGetCallingFrameBuffer.ts +++ b/ts/calling/useGetCallingFrameBuffer.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { useRef, useCallback } from 'react'; -import { FRAME_BUFFER_SIZE } from './constants'; +import { FRAME_BUFFER_SIZE } from './constants.js'; /** * A hook that returns a function. This function returns a "singleton" `ArrayBuffer` to be diff --git a/ts/challenge.ts b/ts/challenge.ts index 3990feab093..1b6e103c0f1 100644 --- a/ts/challenge.ts +++ b/ts/challenge.ts @@ -12,17 +12,20 @@ // are not immediately retried, however, until `.onOnline()` is called from // when we are actually online. -import { assertDev } from './util/assert'; -import { isOlderThan } from './util/timestamp'; -import { clearTimeoutIfNecessary } from './util/clearTimeoutIfNecessary'; -import { missingCaseError } from './util/missingCaseError'; -import type { StorageInterface } from './types/Storage.d'; -import * as Errors from './types/errors'; -import { HTTPError, type SendMessageChallengeData } from './textsecure/Errors'; -import { createLogger } from './logging/log'; -import { drop } from './util/drop'; -import { findRetryAfterTimeFromError } from './jobs/helpers/findRetryAfterTimeFromError'; -import { MINUTE } from './util/durations'; +import { assertDev } from './util/assert.js'; +import { isOlderThan } from './util/timestamp.js'; +import { clearTimeoutIfNecessary } from './util/clearTimeoutIfNecessary.js'; +import { missingCaseError } from './util/missingCaseError.js'; +import type { StorageInterface } from './types/Storage.d.ts'; +import * as Errors from './types/errors.js'; +import { + HTTPError, + type SendMessageChallengeData, +} from './textsecure/Errors.js'; +import { createLogger } from './logging/log.js'; +import { drop } from './util/drop.js'; +import { findRetryAfterTimeFromError } from './jobs/helpers/findRetryAfterTimeFromError.js'; +import { MINUTE } from './util/durations/index.js'; const log = createLogger('challenge'); diff --git a/ts/components/About.stories.tsx b/ts/components/About.stories.tsx index 6a0ce6727a2..9c360cc31ec 100644 --- a/ts/components/About.stories.tsx +++ b/ts/components/About.stories.tsx @@ -3,9 +3,9 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { ComponentMeta } from '../storybook/types'; -import type { AboutProps } from './About'; -import { About } from './About'; +import type { ComponentMeta } from '../storybook/types.js'; +import type { AboutProps } from './About.js'; +import { About } from './About.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/About.tsx b/ts/components/About.tsx index 24dabfcbb99..bd4bf82a17f 100644 --- a/ts/components/About.tsx +++ b/ts/components/About.tsx @@ -3,8 +3,8 @@ import React from 'react'; -import type { LocalizerType } from '../types/Util'; -import { useEscapeHandling } from '../hooks/useEscapeHandling'; +import type { LocalizerType } from '../types/Util.js'; +import { useEscapeHandling } from '../hooks/useEscapeHandling.js'; export type AboutProps = Readonly<{ closeAbout: () => unknown; diff --git a/ts/components/AddGroupMemberErrorDialog.stories.tsx b/ts/components/AddGroupMemberErrorDialog.stories.tsx index f0a333be9cb..fc61d407881 100644 --- a/ts/components/AddGroupMemberErrorDialog.stories.tsx +++ b/ts/components/AddGroupMemberErrorDialog.stories.tsx @@ -6,11 +6,11 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './AddGroupMemberErrorDialog'; +import type { PropsType } from './AddGroupMemberErrorDialog.js'; import { AddGroupMemberErrorDialog, AddGroupMemberErrorDialogMode, -} from './AddGroupMemberErrorDialog'; +} from './AddGroupMemberErrorDialog.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/AddGroupMemberErrorDialog.tsx b/ts/components/AddGroupMemberErrorDialog.tsx index 7cb81962dc8..d289da573d9 100644 --- a/ts/components/AddGroupMemberErrorDialog.tsx +++ b/ts/components/AddGroupMemberErrorDialog.tsx @@ -4,9 +4,9 @@ import type { ReactNode } from 'react'; import React from 'react'; -import type { LocalizerType } from '../types/Util'; -import { Alert } from './Alert'; -import { missingCaseError } from '../util/missingCaseError'; +import type { LocalizerType } from '../types/Util.js'; +import { Alert } from './Alert.js'; +import { missingCaseError } from '../util/missingCaseError.js'; export enum AddGroupMemberErrorDialogMode { MaximumGroupSize, diff --git a/ts/components/AddUserToAnotherGroupModal.stories.tsx b/ts/components/AddUserToAnotherGroupModal.stories.tsx index 0b2af18ab4e..1afca880e60 100644 --- a/ts/components/AddUserToAnotherGroupModal.stories.tsx +++ b/ts/components/AddUserToAnotherGroupModal.stories.tsx @@ -5,12 +5,12 @@ import React from 'react'; import type { Meta, StoryFn } from '@storybook/react'; import { action } from '@storybook/addon-actions'; -import type { Props } from './AddUserToAnotherGroupModal'; +import type { Props } from './AddUserToAnotherGroupModal.js'; import { getDefaultConversation, getDefaultGroup, -} from '../test-helpers/getDefaultConversation'; -import { AddUserToAnotherGroupModal } from './AddUserToAnotherGroupModal'; +} from '../test-helpers/getDefaultConversation.js'; +import { AddUserToAnotherGroupModal } from './AddUserToAnotherGroupModal.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/AddUserToAnotherGroupModal.tsx b/ts/components/AddUserToAnotherGroupModal.tsx index 8c202d247dd..ef2adb13429 100644 --- a/ts/components/AddUserToAnotherGroupModal.tsx +++ b/ts/components/AddUserToAnotherGroupModal.tsx @@ -5,23 +5,23 @@ import { pick } from 'lodash'; import React, { useCallback } from 'react'; import type { ListRowProps } from 'react-virtualized'; -import type { ConversationType } from '../state/ducks/conversations'; -import type { LocalizerType } from '../types/Util'; -import { ToastType } from '../types/Toast'; -import { filterAndSortConversations } from '../util/filterAndSortConversations'; -import { ConfirmationDialog } from './ConfirmationDialog'; -import type { GroupListItemConversationType } from './conversationList/GroupListItem'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import type { LocalizerType } from '../types/Util.js'; +import { ToastType } from '../types/Toast.js'; +import { filterAndSortConversations } from '../util/filterAndSortConversations.js'; +import { ConfirmationDialog } from './ConfirmationDialog.js'; +import type { GroupListItemConversationType } from './conversationList/GroupListItem.js'; import { DisabledReason, GroupListItem, -} from './conversationList/GroupListItem'; -import { Modal } from './Modal'; -import { SearchInput } from './SearchInput'; -import { useRestoreFocus } from '../hooks/useRestoreFocus'; -import { ListView } from './ListView'; -import { ListTile } from './ListTile'; -import type { ShowToastAction } from '../state/ducks/toast'; -import { SizeObserver } from '../hooks/useSizeObserver'; +} from './conversationList/GroupListItem.js'; +import { Modal } from './Modal.js'; +import { SearchInput } from './SearchInput.js'; +import { useRestoreFocus } from '../hooks/useRestoreFocus.js'; +import { ListView } from './ListView.js'; +import { ListTile } from './ListTile.js'; +import type { ShowToastAction } from '../state/ducks/toast.js'; +import { SizeObserver } from '../hooks/useSizeObserver.js'; type OwnProps = { i18n: LocalizerType; diff --git a/ts/components/Alert.stories.tsx b/ts/components/Alert.stories.tsx index f0e86c2fa2d..aefedce45a7 100644 --- a/ts/components/Alert.stories.tsx +++ b/ts/components/Alert.stories.tsx @@ -4,8 +4,8 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './Alert'; -import { Alert } from './Alert'; +import type { PropsType } from './Alert.js'; +import { Alert } from './Alert.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/Alert.tsx b/ts/components/Alert.tsx index 56eec431d7d..a8be8728dae 100644 --- a/ts/components/Alert.tsx +++ b/ts/components/Alert.tsx @@ -4,10 +4,10 @@ import type { ReactNode } from 'react'; import React from 'react'; -import type { LocalizerType } from '../types/Util'; -import type { Theme } from '../util/theme'; -import { Button } from './Button'; -import { Modal } from './Modal'; +import type { LocalizerType } from '../types/Util.js'; +import type { Theme } from '../util/theme.js'; +import { Button } from './Button.js'; +import { Modal } from './Modal.js'; export type PropsType = { body: ReactNode; diff --git a/ts/components/AnimatedEmojiGalore.stories.tsx b/ts/components/AnimatedEmojiGalore.stories.tsx index acc4edc314c..3e2e6ace69d 100644 --- a/ts/components/AnimatedEmojiGalore.stories.tsx +++ b/ts/components/AnimatedEmojiGalore.stories.tsx @@ -5,8 +5,8 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './AnimatedEmojiGalore'; -import { AnimatedEmojiGalore } from './AnimatedEmojiGalore'; +import type { PropsType } from './AnimatedEmojiGalore.js'; +import { AnimatedEmojiGalore } from './AnimatedEmojiGalore.js'; export default { title: 'Components/AnimatedEmojiGalore', diff --git a/ts/components/AnimatedEmojiGalore.tsx b/ts/components/AnimatedEmojiGalore.tsx index 0d8018cc977..869f5ed4708 100644 --- a/ts/components/AnimatedEmojiGalore.tsx +++ b/ts/components/AnimatedEmojiGalore.tsx @@ -4,14 +4,14 @@ import React from 'react'; import { animated, to as interpolate, useSprings } from '@react-spring/web'; import { random } from 'lodash'; -import { useReducedMotion } from '../hooks/useReducedMotion'; -import { FunStaticEmoji } from './fun/FunEmoji'; -import { strictAssert } from '../util/assert'; +import { useReducedMotion } from '../hooks/useReducedMotion.js'; +import { FunStaticEmoji } from './fun/FunEmoji.js'; +import { strictAssert } from '../util/assert.js'; import { getEmojiVariantByKey, getEmojiVariantKeyByValue, isEmojiVariantValue, -} from './fun/data/emojis'; +} from './fun/data/emojis.js'; export type PropsType = { emoji: string; diff --git a/ts/components/AnnouncementsOnlyGroupBanner.tsx b/ts/components/AnnouncementsOnlyGroupBanner.tsx index b78835b7274..7eb229c5731 100644 --- a/ts/components/AnnouncementsOnlyGroupBanner.tsx +++ b/ts/components/AnnouncementsOnlyGroupBanner.tsx @@ -6,11 +6,11 @@ import { noop } from 'lodash'; import type { ConversationType, ShowConversationType, -} from '../state/ducks/conversations'; -import { I18n } from './I18n'; -import type { LocalizerType, ThemeType } from '../types/Util'; -import { Modal } from './Modal'; -import { ConversationListItem } from './conversationList/ConversationListItem'; +} from '../state/ducks/conversations.js'; +import { I18n } from './I18n.js'; +import type { LocalizerType, ThemeType } from '../types/Util.js'; +import { Modal } from './Modal.js'; +import { ConversationListItem } from './conversationList/ConversationListItem.js'; type PropsType = { groupAdmins: Array; diff --git a/ts/components/App.tsx b/ts/components/App.tsx index ed7fb58cc99..1e1551bb962 100644 --- a/ts/components/App.tsx +++ b/ts/components/App.tsx @@ -4,14 +4,14 @@ import React, { useEffect } from 'react'; import classNames from 'classnames'; -import type { ViewStoryActionCreatorType } from '../state/ducks/stories'; -import type { VerificationTransport } from '../types/VerificationTransport'; -import { ThemeType } from '../types/Util'; -import { missingCaseError } from '../util/missingCaseError'; -import { type AppStateType, AppViewType } from '../state/ducks/app'; -import { SmartInstallScreen } from '../state/smart/InstallScreen'; -import { StandaloneRegistration } from './StandaloneRegistration'; -import { usePageVisibility } from '../hooks/usePageVisibility'; +import type { ViewStoryActionCreatorType } from '../state/ducks/stories.js'; +import type { VerificationTransport } from '../types/VerificationTransport.js'; +import { ThemeType } from '../types/Util.js'; +import { missingCaseError } from '../util/missingCaseError.js'; +import { type AppStateType, AppViewType } from '../state/ducks/app.js'; +import { SmartInstallScreen } from '../state/smart/InstallScreen.js'; +import { StandaloneRegistration } from './StandaloneRegistration.js'; +import { usePageVisibility } from '../hooks/usePageVisibility.js'; type PropsType = { state: AppStateType; diff --git a/ts/components/AutoSizeInput.stories.tsx b/ts/components/AutoSizeInput.stories.tsx index 94e51a041f1..d396fb22313 100644 --- a/ts/components/AutoSizeInput.stories.tsx +++ b/ts/components/AutoSizeInput.stories.tsx @@ -4,8 +4,8 @@ import React, { useState } from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './AutoSizeInput'; -import { AutoSizeInput } from './AutoSizeInput'; +import type { PropsType } from './AutoSizeInput.js'; +import { AutoSizeInput } from './AutoSizeInput.js'; export default { title: 'Components/AutoSizeInput', diff --git a/ts/components/AutoSizeInput.tsx b/ts/components/AutoSizeInput.tsx index 5e96d92465a..166e24776e8 100644 --- a/ts/components/AutoSizeInput.tsx +++ b/ts/components/AutoSizeInput.tsx @@ -6,7 +6,7 @@ import React, { useCallback, useState, useEffect, useRef } from 'react'; import { createPortal } from 'react-dom'; import classNames from 'classnames'; -import { getClassNamesFor } from '../util/getClassNamesFor'; +import { getClassNamesFor } from '../util/getClassNamesFor.js'; export type PropsType = Readonly<{ disableSpellcheck?: boolean; diff --git a/ts/components/AutoSizeTextArea.tsx b/ts/components/AutoSizeTextArea.tsx index 2de3a08353a..4cc183f44f3 100644 --- a/ts/components/AutoSizeTextArea.tsx +++ b/ts/components/AutoSizeTextArea.tsx @@ -3,9 +3,9 @@ import type { ForwardedRef } from 'react'; import React, { forwardRef, useEffect, useLayoutEffect, useRef } from 'react'; import { mergeRefs } from '@react-aria/utils'; -import { strictAssert } from '../util/assert'; -import type { PropsType } from './Input'; -import { Input } from './Input'; +import { strictAssert } from '../util/assert.js'; +import type { PropsType } from './Input.js'; +import { Input } from './Input.js'; export const AutoSizeTextArea = forwardRef(function AutoSizeTextArea( props: PropsType, diff --git a/ts/components/Avatar.stories.tsx b/ts/components/Avatar.stories.tsx index 5fd1b12c6c5..a41cc88a0a7 100644 --- a/ts/components/Avatar.stories.tsx +++ b/ts/components/Avatar.stories.tsx @@ -5,13 +5,13 @@ import type { Meta, StoryFn } from '@storybook/react'; import * as React from 'react'; import { action } from '@storybook/addon-actions'; import { expect, fn, within, userEvent } from '@storybook/test'; -import type { AvatarColorType } from '../types/Colors'; -import type { Props } from './Avatar'; -import { Avatar, AvatarBlur, AvatarSize } from './Avatar'; -import { AvatarColors } from '../types/Colors'; -import { HasStories } from '../types/Stories'; -import { ThemeType } from '../types/Util'; -import { getFakeBadge } from '../test-helpers/getFakeBadge'; +import type { AvatarColorType } from '../types/Colors.js'; +import type { Props } from './Avatar.js'; +import { Avatar, AvatarBlur, AvatarSize } from './Avatar.js'; +import { AvatarColors } from '../types/Colors.js'; +import { HasStories } from '../types/Stories.js'; +import { ThemeType } from '../types/Util.js'; +import { getFakeBadge } from '../test-helpers/getFakeBadge.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/Avatar.tsx b/ts/components/Avatar.tsx index b7a79c296b4..8144eff1e14 100644 --- a/ts/components/Avatar.tsx +++ b/ts/components/Avatar.tsx @@ -13,20 +13,20 @@ import classNames from 'classnames'; import { noop } from 'lodash'; import { filterDOMProps } from '@react-aria/utils'; -import type { AvatarColorType } from '../types/Colors'; -import type { BadgeType } from '../badges/types'; -import type { LocalizerType } from '../types/Util'; -import { createLogger } from '../logging/log'; -import { BadgeImageTheme } from '../badges/BadgeImageTheme'; -import { HasStories } from '../types/Stories'; -import { Spinner } from './Spinner'; -import { ThemeType } from '../types/Util'; -import { assertDev } from '../util/assert'; -import { getBadgeImageFileLocalPath } from '../badges/getBadgeImageFileLocalPath'; -import { getInitials } from '../util/getInitials'; -import { isBadgeVisible } from '../badges/isBadgeVisible'; -import { SIGNAL_AVATAR_PATH } from '../types/SignalConversation'; -import { getAvatarPlaceholderGradient } from '../utils/getAvatarPlaceholderGradient'; +import type { AvatarColorType } from '../types/Colors.js'; +import type { BadgeType } from '../badges/types.js'; +import type { LocalizerType } from '../types/Util.js'; +import { createLogger } from '../logging/log.js'; +import { BadgeImageTheme } from '../badges/BadgeImageTheme.js'; +import { HasStories } from '../types/Stories.js'; +import { Spinner } from './Spinner.js'; +import { ThemeType } from '../types/Util.js'; +import { assertDev } from '../util/assert.js'; +import { getBadgeImageFileLocalPath } from '../badges/getBadgeImageFileLocalPath.js'; +import { getInitials } from '../util/getInitials.js'; +import { isBadgeVisible } from '../badges/isBadgeVisible.js'; +import { SIGNAL_AVATAR_PATH } from '../types/SignalConversation.js'; +import { getAvatarPlaceholderGradient } from '../utils/getAvatarPlaceholderGradient.js'; const log = createLogger('Avatar'); diff --git a/ts/components/AvatarColorPicker.stories.tsx b/ts/components/AvatarColorPicker.stories.tsx index a3a61864952..e534076bbfd 100644 --- a/ts/components/AvatarColorPicker.stories.tsx +++ b/ts/components/AvatarColorPicker.stories.tsx @@ -5,9 +5,9 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './AvatarColorPicker'; -import { AvatarColorPicker } from './AvatarColorPicker'; -import { AvatarColors } from '../types/Colors'; +import type { PropsType } from './AvatarColorPicker.js'; +import { AvatarColorPicker } from './AvatarColorPicker.js'; +import { AvatarColors } from '../types/Colors.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/AvatarColorPicker.tsx b/ts/components/AvatarColorPicker.tsx index fa1b422a130..e4d2f5a3aac 100644 --- a/ts/components/AvatarColorPicker.tsx +++ b/ts/components/AvatarColorPicker.tsx @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import type { AvatarColorType } from '../types/Colors'; -import { AvatarColors } from '../types/Colors'; -import type { LocalizerType } from '../types/Util'; -import { BetterAvatarBubble } from './BetterAvatarBubble'; +import type { AvatarColorType } from '../types/Colors.js'; +import { AvatarColors } from '../types/Colors.js'; +import type { LocalizerType } from '../types/Util.js'; +import { BetterAvatarBubble } from './BetterAvatarBubble.js'; export type PropsType = { i18n: LocalizerType; diff --git a/ts/components/AvatarEditor.stories.tsx b/ts/components/AvatarEditor.stories.tsx index 6b4f32d015a..2370b117bc9 100644 --- a/ts/components/AvatarEditor.stories.tsx +++ b/ts/components/AvatarEditor.stories.tsx @@ -5,11 +5,11 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { AvatarColors } from '../types/Colors'; -import type { PropsType } from './AvatarEditor'; -import { AvatarEditor } from './AvatarEditor'; -import { getDefaultAvatars } from '../types/Avatar'; -import { createAvatarData } from '../util/createAvatarData'; +import { AvatarColors } from '../types/Colors.js'; +import type { PropsType } from './AvatarEditor.js'; +import { AvatarEditor } from './AvatarEditor.js'; +import { getDefaultAvatars } from '../types/Avatar.js'; +import { createAvatarData } from '../util/createAvatarData.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/AvatarEditor.tsx b/ts/components/AvatarEditor.tsx index 4b212d41680..2b45a611c29 100644 --- a/ts/components/AvatarEditor.tsx +++ b/ts/components/AvatarEditor.tsx @@ -4,25 +4,25 @@ import React, { useCallback, useEffect, useRef, useState } from 'react'; import { isEqual } from 'lodash'; -import type { AvatarColorType } from '../types/Colors'; +import type { AvatarColorType } from '../types/Colors.js'; import type { AvatarDataType, DeleteAvatarFromDiskActionType, ReplaceAvatarActionType, SaveAvatarToDiskActionType, -} from '../types/Avatar'; -import { AvatarIconEditor } from './AvatarIconEditor'; -import { AvatarModalButtons } from './AvatarModalButtons'; -import { AvatarPreview } from './AvatarPreview'; -import { AvatarTextEditor } from './AvatarTextEditor'; -import { AvatarUploadButton } from './AvatarUploadButton'; -import { BetterAvatar } from './BetterAvatar'; -import type { LocalizerType } from '../types/Util'; -import { avatarDataToBytes } from '../util/avatarDataToBytes'; -import { createAvatarData } from '../util/createAvatarData'; -import { isSameAvatarData } from '../util/isSameAvatarData'; -import { missingCaseError } from '../util/missingCaseError'; -import { useConfirmDiscard } from '../hooks/useConfirmDiscard'; +} from '../types/Avatar.js'; +import { AvatarIconEditor } from './AvatarIconEditor.js'; +import { AvatarModalButtons } from './AvatarModalButtons.js'; +import { AvatarPreview } from './AvatarPreview.js'; +import { AvatarTextEditor } from './AvatarTextEditor.js'; +import { AvatarUploadButton } from './AvatarUploadButton.js'; +import { BetterAvatar } from './BetterAvatar.js'; +import type { LocalizerType } from '../types/Util.js'; +import { avatarDataToBytes } from '../util/avatarDataToBytes.js'; +import { createAvatarData } from '../util/createAvatarData.js'; +import { isSameAvatarData } from '../util/isSameAvatarData.js'; +import { missingCaseError } from '../util/missingCaseError.js'; +import { useConfirmDiscard } from '../hooks/useConfirmDiscard.js'; export type PropsType = { avatarColor?: AvatarColorType; diff --git a/ts/components/AvatarIconEditor.stories.tsx b/ts/components/AvatarIconEditor.stories.tsx index 6804d1f5d80..3f159ce1c5e 100644 --- a/ts/components/AvatarIconEditor.stories.tsx +++ b/ts/components/AvatarIconEditor.stories.tsx @@ -5,11 +5,11 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './AvatarIconEditor'; -import { AvatarIconEditor } from './AvatarIconEditor'; -import { GroupAvatarIcons, PersonalAvatarIcons } from '../types/Avatar'; -import { AvatarColors } from '../types/Colors'; -import { createAvatarData } from '../util/createAvatarData'; +import type { PropsType } from './AvatarIconEditor.js'; +import { AvatarIconEditor } from './AvatarIconEditor.js'; +import { GroupAvatarIcons, PersonalAvatarIcons } from '../types/Avatar.js'; +import { AvatarColors } from '../types/Colors.js'; +import { createAvatarData } from '../util/createAvatarData.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/AvatarIconEditor.tsx b/ts/components/AvatarIconEditor.tsx index fb1bf179c73..33ff0c87946 100644 --- a/ts/components/AvatarIconEditor.tsx +++ b/ts/components/AvatarIconEditor.tsx @@ -3,13 +3,13 @@ import React, { useCallback, useEffect, useState } from 'react'; -import { AvatarColorPicker } from './AvatarColorPicker'; -import type { AvatarColorType } from '../types/Colors'; -import type { AvatarDataType } from '../types/Avatar'; -import { AvatarModalButtons } from './AvatarModalButtons'; -import { AvatarPreview } from './AvatarPreview'; -import type { LocalizerType } from '../types/Util'; -import { avatarDataToBytes } from '../util/avatarDataToBytes'; +import { AvatarColorPicker } from './AvatarColorPicker.js'; +import type { AvatarColorType } from '../types/Colors.js'; +import type { AvatarDataType } from '../types/Avatar.js'; +import { AvatarModalButtons } from './AvatarModalButtons.js'; +import { AvatarPreview } from './AvatarPreview.js'; +import type { LocalizerType } from '../types/Util.js'; +import { avatarDataToBytes } from '../util/avatarDataToBytes.js'; export type PropsType = { avatarData: AvatarDataType; diff --git a/ts/components/AvatarLightbox.stories.tsx b/ts/components/AvatarLightbox.stories.tsx index e209d94609b..afa0d01d02a 100644 --- a/ts/components/AvatarLightbox.stories.tsx +++ b/ts/components/AvatarLightbox.stories.tsx @@ -4,10 +4,10 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { AvatarColors } from '../types/Colors'; -import type { PropsType } from './AvatarLightbox'; -import { AvatarLightbox } from './AvatarLightbox'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation'; +import { AvatarColors } from '../types/Colors.js'; +import type { PropsType } from './AvatarLightbox.js'; +import { AvatarLightbox } from './AvatarLightbox.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/AvatarLightbox.tsx b/ts/components/AvatarLightbox.tsx index 304442ccfa8..2413e537d48 100644 --- a/ts/components/AvatarLightbox.tsx +++ b/ts/components/AvatarLightbox.tsx @@ -4,10 +4,10 @@ import React from 'react'; import { noop } from 'lodash'; -import type { AvatarColorType } from '../types/Colors'; -import { AvatarPreview } from './AvatarPreview'; -import { Lightbox } from './Lightbox'; -import type { LocalizerType } from '../types/Util'; +import type { AvatarColorType } from '../types/Colors.js'; +import { AvatarPreview } from './AvatarPreview.js'; +import { Lightbox } from './Lightbox.js'; +import type { LocalizerType } from '../types/Util.js'; export type PropsType = { avatarPlaceholderGradient?: Readonly<[string, string]>; diff --git a/ts/components/AvatarModalButtons.stories.tsx b/ts/components/AvatarModalButtons.stories.tsx index 8a5bb7fbb90..3165affebb3 100644 --- a/ts/components/AvatarModalButtons.stories.tsx +++ b/ts/components/AvatarModalButtons.stories.tsx @@ -6,8 +6,8 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './AvatarModalButtons'; -import { AvatarModalButtons } from './AvatarModalButtons'; +import type { PropsType } from './AvatarModalButtons.js'; +import { AvatarModalButtons } from './AvatarModalButtons.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/AvatarModalButtons.tsx b/ts/components/AvatarModalButtons.tsx index 83297161c5e..e976f891917 100644 --- a/ts/components/AvatarModalButtons.tsx +++ b/ts/components/AvatarModalButtons.tsx @@ -3,10 +3,10 @@ import React, { useState } from 'react'; -import { Button, ButtonVariant } from './Button'; -import { ConfirmDiscardDialog } from './ConfirmDiscardDialog'; -import type { LocalizerType } from '../types/Util'; -import { Modal } from './Modal'; +import { Button, ButtonVariant } from './Button.js'; +import { ConfirmDiscardDialog } from './ConfirmDiscardDialog.js'; +import type { LocalizerType } from '../types/Util.js'; +import { Modal } from './Modal.js'; export type PropsType = { hasChanges: boolean; diff --git a/ts/components/AvatarPreview.stories.tsx b/ts/components/AvatarPreview.stories.tsx index a5e71a44737..4b2f9eb7df2 100644 --- a/ts/components/AvatarPreview.stories.tsx +++ b/ts/components/AvatarPreview.stories.tsx @@ -7,9 +7,9 @@ import { chunk } from 'lodash'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './AvatarPreview'; -import { AvatarPreview } from './AvatarPreview'; -import { AvatarColors } from '../types/Colors'; +import type { PropsType } from './AvatarPreview.js'; +import { AvatarPreview } from './AvatarPreview.js'; +import { AvatarColors } from '../types/Colors.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/AvatarPreview.tsx b/ts/components/AvatarPreview.tsx index 53d9643f399..cbf5203979a 100644 --- a/ts/components/AvatarPreview.tsx +++ b/ts/components/AvatarPreview.tsx @@ -5,14 +5,14 @@ import type { CSSProperties } from 'react'; import React, { useEffect, useState } from 'react'; import { noop } from 'lodash'; -import { createLogger } from '../logging/log'; -import type { LocalizerType } from '../types/Util'; -import { Spinner } from './Spinner'; -import type { AvatarColorType } from '../types/Colors'; -import { AvatarColors } from '../types/Colors'; -import { getInitials } from '../util/getInitials'; -import { imagePathToBytes } from '../util/imagePathToBytes'; -import { type ConversationType } from '../state/ducks/conversations'; +import { createLogger } from '../logging/log.js'; +import type { LocalizerType } from '../types/Util.js'; +import { Spinner } from './Spinner.js'; +import type { AvatarColorType } from '../types/Colors.js'; +import { AvatarColors } from '../types/Colors.js'; +import { getInitials } from '../util/getInitials.js'; +import { imagePathToBytes } from '../util/imagePathToBytes.js'; +import { type ConversationType } from '../state/ducks/conversations.js'; const log = createLogger('AvatarPreview'); diff --git a/ts/components/AvatarSpacer.tsx b/ts/components/AvatarSpacer.tsx index c3b3356ee51..5de80df6977 100644 --- a/ts/components/AvatarSpacer.tsx +++ b/ts/components/AvatarSpacer.tsx @@ -3,7 +3,7 @@ import type { ReactElement } from 'react'; import React from 'react'; -import type { AvatarSize } from './Avatar'; +import type { AvatarSize } from './Avatar.js'; export function AvatarSpacer({ size, diff --git a/ts/components/AvatarTextEditor.stories.tsx b/ts/components/AvatarTextEditor.stories.tsx index 93f08e8350e..997985ab329 100644 --- a/ts/components/AvatarTextEditor.stories.tsx +++ b/ts/components/AvatarTextEditor.stories.tsx @@ -5,9 +5,9 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './AvatarTextEditor'; -import { AvatarTextEditor } from './AvatarTextEditor'; -import { AvatarColors } from '../types/Colors'; +import type { PropsType } from './AvatarTextEditor.js'; +import { AvatarTextEditor } from './AvatarTextEditor.js'; +import { AvatarColors } from '../types/Colors.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/AvatarTextEditor.tsx b/ts/components/AvatarTextEditor.tsx index a290599f388..52063701a53 100644 --- a/ts/components/AvatarTextEditor.tsx +++ b/ts/components/AvatarTextEditor.tsx @@ -11,19 +11,19 @@ import React, { } from 'react'; import { noop } from 'lodash'; -import * as grapheme from '../util/grapheme'; -import { AvatarColorPicker } from './AvatarColorPicker'; -import { AvatarColors } from '../types/Colors'; -import type { AvatarDataType } from '../types/Avatar'; -import { AvatarModalButtons } from './AvatarModalButtons'; -import { BetterAvatarBubble } from './BetterAvatarBubble'; -import type { LocalizerType } from '../types/Util'; -import { avatarDataToBytes } from '../util/avatarDataToBytes'; -import { createAvatarData } from '../util/createAvatarData'; +import * as grapheme from '../util/grapheme.js'; +import { AvatarColorPicker } from './AvatarColorPicker.js'; +import { AvatarColors } from '../types/Colors.js'; +import type { AvatarDataType } from '../types/Avatar.js'; +import { AvatarModalButtons } from './AvatarModalButtons.js'; +import { BetterAvatarBubble } from './BetterAvatarBubble.js'; +import type { LocalizerType } from '../types/Util.js'; +import { avatarDataToBytes } from '../util/avatarDataToBytes.js'; +import { createAvatarData } from '../util/createAvatarData.js'; import { getFittedFontSize, getFontSizes, -} from '../util/avatarTextSizeCalculator'; +} from '../util/avatarTextSizeCalculator.js'; type DoneHandleType = ( avatarBuffer: Uint8Array, diff --git a/ts/components/AvatarUploadButton.stories.tsx b/ts/components/AvatarUploadButton.stories.tsx index 15eea3e4ef8..b2d3d74ad3d 100644 --- a/ts/components/AvatarUploadButton.stories.tsx +++ b/ts/components/AvatarUploadButton.stories.tsx @@ -5,8 +5,8 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './AvatarUploadButton'; -import { AvatarUploadButton } from './AvatarUploadButton'; +import type { PropsType } from './AvatarUploadButton.js'; +import { AvatarUploadButton } from './AvatarUploadButton.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/AvatarUploadButton.tsx b/ts/components/AvatarUploadButton.tsx index f7010828c40..72e62259cc5 100644 --- a/ts/components/AvatarUploadButton.tsx +++ b/ts/components/AvatarUploadButton.tsx @@ -5,8 +5,8 @@ import type { ChangeEventHandler } from 'react'; import React, { useEffect, useRef, useState } from 'react'; import { noop } from 'lodash'; -import type { LocalizerType } from '../types/Util'; -import { processImageFile } from '../util/processImageFile'; +import type { LocalizerType } from '../types/Util.js'; +import { processImageFile } from '../util/processImageFile.js'; export type PropsType = { className: string; diff --git a/ts/components/BackfillFailureModal.stories.tsx b/ts/components/BackfillFailureModal.stories.tsx index 6686793e3a1..c5a802bfa66 100644 --- a/ts/components/BackfillFailureModal.stories.tsx +++ b/ts/components/BackfillFailureModal.stories.tsx @@ -3,12 +3,12 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { PropsType } from './BackfillFailureModal'; +import type { PropsType } from './BackfillFailureModal.js'; import { BackfillFailureModal, BackfillFailureKind, -} from './BackfillFailureModal'; -import type { ComponentMeta } from '../storybook/types'; +} from './BackfillFailureModal.js'; +import type { ComponentMeta } from '../storybook/types.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/BackfillFailureModal.tsx b/ts/components/BackfillFailureModal.tsx index 758a52d85c8..5814f5ca428 100644 --- a/ts/components/BackfillFailureModal.tsx +++ b/ts/components/BackfillFailureModal.tsx @@ -3,10 +3,10 @@ import * as React from 'react'; -import type { LocalizerType } from '../types/Util'; -import { missingCaseError } from '../util/missingCaseError'; -import { Modal } from './Modal'; -import { Button, ButtonVariant } from './Button'; +import type { LocalizerType } from '../types/Util.js'; +import { missingCaseError } from '../util/missingCaseError.js'; +import { Modal } from './Modal.js'; +import { Button, ButtonVariant } from './Button.js'; export enum BackfillFailureKind { Timeout = 'Timeout', diff --git a/ts/components/BackupMediaDownloadCancelConfirmationDialog.tsx b/ts/components/BackupMediaDownloadCancelConfirmationDialog.tsx index aeb67f10eb2..bdd139bce1c 100644 --- a/ts/components/BackupMediaDownloadCancelConfirmationDialog.tsx +++ b/ts/components/BackupMediaDownloadCancelConfirmationDialog.tsx @@ -3,9 +3,9 @@ import React from 'react'; -import { ConfirmationDialog } from './ConfirmationDialog'; -import type { LocalizerType } from '../types/I18N'; -import { I18n } from './I18n'; +import { ConfirmationDialog } from './ConfirmationDialog.js'; +import type { LocalizerType } from '../types/I18N.js'; +import { I18n } from './I18n.js'; const BACKUP_AND_RESTORE_SUPPORT_PAGE = 'https://support.signal.org/hc/articles/360007059752-Backup-and-Restore-Messages'; diff --git a/ts/components/BackupMediaDownloadProgress.stories.tsx b/ts/components/BackupMediaDownloadProgress.stories.tsx index f4644bc8919..29b1804b9c2 100644 --- a/ts/components/BackupMediaDownloadProgress.stories.tsx +++ b/ts/components/BackupMediaDownloadProgress.stories.tsx @@ -5,9 +5,9 @@ import React, { type ComponentProps } from 'react'; import type { Meta } from '@storybook/react'; import { action } from '@storybook/addon-actions'; -import { BackupMediaDownloadProgress } from './BackupMediaDownloadProgress'; -import { KIBIBYTE } from '../types/AttachmentSize'; -import { WidthBreakpoint } from './_util'; +import { BackupMediaDownloadProgress } from './BackupMediaDownloadProgress.js'; +import { KIBIBYTE } from '../types/AttachmentSize.js'; +import { WidthBreakpoint } from './_util.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/BackupMediaDownloadProgress.tsx b/ts/components/BackupMediaDownloadProgress.tsx index 1b83d4bf1c4..90c34c6520b 100644 --- a/ts/components/BackupMediaDownloadProgress.tsx +++ b/ts/components/BackupMediaDownloadProgress.tsx @@ -3,13 +3,13 @@ import React, { useState } from 'react'; -import type { LocalizerType } from '../types/Util'; -import { formatFileSize } from '../util/formatFileSize'; -import { SpinnerV2 } from './SpinnerV2'; -import { ContextMenu } from './ContextMenu'; -import { BackupMediaDownloadCancelConfirmationDialog } from './BackupMediaDownloadCancelConfirmationDialog'; -import { LeftPaneDialog } from './LeftPaneDialog'; -import { WidthBreakpoint } from './_util'; +import type { LocalizerType } from '../types/Util.js'; +import { formatFileSize } from '../util/formatFileSize.js'; +import { SpinnerV2 } from './SpinnerV2.js'; +import { ContextMenu } from './ContextMenu.js'; +import { BackupMediaDownloadCancelConfirmationDialog } from './BackupMediaDownloadCancelConfirmationDialog.js'; +import { LeftPaneDialog } from './LeftPaneDialog.js'; +import { WidthBreakpoint } from './_util.js'; export type PropsType = Readonly<{ i18n: LocalizerType; diff --git a/ts/components/BackupMediaDownloadProgressSettings.tsx b/ts/components/BackupMediaDownloadProgressSettings.tsx index 33a8d0b7219..a5b3acc13f8 100644 --- a/ts/components/BackupMediaDownloadProgressSettings.tsx +++ b/ts/components/BackupMediaDownloadProgressSettings.tsx @@ -3,12 +3,12 @@ import React, { useState } from 'react'; -import type { LocalizerType } from '../types/Util'; -import { formatFileSize } from '../util/formatFileSize'; -import { roundFractionForProgressBar } from '../util/numbers'; -import { ProgressBar } from './ProgressBar'; -import { Button, ButtonSize, ButtonVariant } from './Button'; -import { BackupMediaDownloadCancelConfirmationDialog } from './BackupMediaDownloadCancelConfirmationDialog'; +import type { LocalizerType } from '../types/Util.js'; +import { formatFileSize } from '../util/formatFileSize.js'; +import { roundFractionForProgressBar } from '../util/numbers.js'; +import { ProgressBar } from './ProgressBar.js'; +import { Button, ButtonSize, ButtonVariant } from './Button.js'; +import { BackupMediaDownloadCancelConfirmationDialog } from './BackupMediaDownloadCancelConfirmationDialog.js'; export type PropsType = Readonly<{ i18n: LocalizerType; diff --git a/ts/components/BadgeCarouselIndex.tsx b/ts/components/BadgeCarouselIndex.tsx index a0948e666ef..bd8f31d9a22 100644 --- a/ts/components/BadgeCarouselIndex.tsx +++ b/ts/components/BadgeCarouselIndex.tsx @@ -5,7 +5,7 @@ import React from 'react'; import classNames from 'classnames'; import { times } from 'lodash'; -import { strictAssert } from '../util/assert'; +import { strictAssert } from '../util/assert.js'; export function BadgeCarouselIndex({ currentIndex, diff --git a/ts/components/BadgeDescription.stories.tsx b/ts/components/BadgeDescription.stories.tsx index fe9b1a8f14b..507b79125bc 100644 --- a/ts/components/BadgeDescription.stories.tsx +++ b/ts/components/BadgeDescription.stories.tsx @@ -4,8 +4,8 @@ import React from 'react'; import type { Meta } from '@storybook/react'; -import type { Props } from './BadgeDescription'; -import { BadgeDescription } from './BadgeDescription'; +import type { Props } from './BadgeDescription.js'; +import { BadgeDescription } from './BadgeDescription.js'; export default { title: 'Components/BadgeDescription', diff --git a/ts/components/BadgeDescription.tsx b/ts/components/BadgeDescription.tsx index 5fee7f4a026..7144a19c72d 100644 --- a/ts/components/BadgeDescription.tsx +++ b/ts/components/BadgeDescription.tsx @@ -3,7 +3,7 @@ import type { ReactChild, ReactElement } from 'react'; import React from 'react'; -import { ContactName } from './conversation/ContactName'; +import { ContactName } from './conversation/ContactName.js'; export type Props = Readonly<{ firstName?: string; diff --git a/ts/components/BadgeDialog.stories.tsx b/ts/components/BadgeDialog.stories.tsx index 3e6f4faecfd..9dfa865c7b8 100644 --- a/ts/components/BadgeDialog.stories.tsx +++ b/ts/components/BadgeDialog.stories.tsx @@ -6,11 +6,11 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { getFakeBadge, getFakeBadges } from '../test-helpers/getFakeBadge'; -import { repeat, zipObject } from '../util/iterables'; -import { BadgeImageTheme } from '../badges/BadgeImageTheme'; -import type { PropsType } from './BadgeDialog'; -import { BadgeDialog } from './BadgeDialog'; +import { getFakeBadge, getFakeBadges } from '../test-helpers/getFakeBadge.js'; +import { repeat, zipObject } from '../util/iterables.js'; +import { BadgeImageTheme } from '../badges/BadgeImageTheme.js'; +import type { PropsType } from './BadgeDialog.js'; +import { BadgeDialog } from './BadgeDialog.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/BadgeDialog.tsx b/ts/components/BadgeDialog.tsx index fafc7c7b494..c2d885af52e 100644 --- a/ts/components/BadgeDialog.tsx +++ b/ts/components/BadgeDialog.tsx @@ -4,16 +4,16 @@ import React, { useEffect, useState } from 'react'; import classNames from 'classnames'; -import { strictAssert } from '../util/assert'; -import type { LocalizerType } from '../types/Util'; -import type { BadgeType } from '../badges/types'; -import { BadgeCategory } from '../badges/BadgeCategory'; -import { Modal } from './Modal'; -import { Button, ButtonSize } from './Button'; -import { BadgeDescription } from './BadgeDescription'; -import { BadgeImage } from './BadgeImage'; -import { BadgeCarouselIndex } from './BadgeCarouselIndex'; -import { BadgeSustainerInstructionsDialog } from './BadgeSustainerInstructionsDialog'; +import { strictAssert } from '../util/assert.js'; +import type { LocalizerType } from '../types/Util.js'; +import type { BadgeType } from '../badges/types.js'; +import { BadgeCategory } from '../badges/BadgeCategory.js'; +import { Modal } from './Modal.js'; +import { Button, ButtonSize } from './Button.js'; +import { BadgeDescription } from './BadgeDescription.js'; +import { BadgeImage } from './BadgeImage.js'; +import { BadgeCarouselIndex } from './BadgeCarouselIndex.js'; +import { BadgeSustainerInstructionsDialog } from './BadgeSustainerInstructionsDialog.js'; export type PropsType = Readonly<{ areWeASubscriber: boolean; diff --git a/ts/components/BadgeImage.tsx b/ts/components/BadgeImage.tsx index c4e8036569a..204bfd98189 100644 --- a/ts/components/BadgeImage.tsx +++ b/ts/components/BadgeImage.tsx @@ -3,10 +3,10 @@ import React from 'react'; -import type { BadgeType } from '../badges/types'; -import { Spinner } from './Spinner'; -import { getBadgeImageFileLocalPath } from '../badges/getBadgeImageFileLocalPath'; -import { BadgeImageTheme } from '../badges/BadgeImageTheme'; +import type { BadgeType } from '../badges/types.js'; +import { Spinner } from './Spinner.js'; +import { getBadgeImageFileLocalPath } from '../badges/getBadgeImageFileLocalPath.js'; +import { BadgeImageTheme } from '../badges/BadgeImageTheme.js'; export function BadgeImage({ badge, diff --git a/ts/components/BadgeSustainerInstructionsDialog.tsx b/ts/components/BadgeSustainerInstructionsDialog.tsx index f8a762a75f6..a3460bbb54e 100644 --- a/ts/components/BadgeSustainerInstructionsDialog.tsx +++ b/ts/components/BadgeSustainerInstructionsDialog.tsx @@ -3,8 +3,8 @@ import type { ReactElement } from 'react'; import React from 'react'; -import type { LocalizerType } from '../types/Util'; -import { Modal } from './Modal'; +import type { LocalizerType } from '../types/Util.js'; +import { Modal } from './Modal.js'; export function BadgeSustainerInstructionsDialog({ i18n, diff --git a/ts/components/BetterAvatar.stories.tsx b/ts/components/BetterAvatar.stories.tsx index fd48b832959..06a594ab1e1 100644 --- a/ts/components/BetterAvatar.stories.tsx +++ b/ts/components/BetterAvatar.stories.tsx @@ -6,11 +6,11 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { AvatarColors } from '../types/Colors'; -import { GroupAvatarIcons, PersonalAvatarIcons } from '../types/Avatar'; -import type { PropsType } from './BetterAvatar'; -import { BetterAvatar } from './BetterAvatar'; -import { createAvatarData } from '../util/createAvatarData'; +import { AvatarColors } from '../types/Colors.js'; +import { GroupAvatarIcons, PersonalAvatarIcons } from '../types/Avatar.js'; +import type { PropsType } from './BetterAvatar.js'; +import { BetterAvatar } from './BetterAvatar.js'; +import { createAvatarData } from '../util/createAvatarData.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/BetterAvatar.tsx b/ts/components/BetterAvatar.tsx index e69db81dd84..3fe1b0b23c5 100644 --- a/ts/components/BetterAvatar.tsx +++ b/ts/components/BetterAvatar.tsx @@ -4,11 +4,11 @@ import type { MouseEvent } from 'react'; import React, { useEffect, useState } from 'react'; import { noop } from 'lodash'; -import type { AvatarDataType } from '../types/Avatar'; -import { BetterAvatarBubble } from './BetterAvatarBubble'; -import type { LocalizerType } from '../types/Util'; -import { Spinner } from './Spinner'; -import { avatarDataToBytes } from '../util/avatarDataToBytes'; +import type { AvatarDataType } from '../types/Avatar.js'; +import { BetterAvatarBubble } from './BetterAvatarBubble.js'; +import type { LocalizerType } from '../types/Util.js'; +import { Spinner } from './Spinner.js'; +import { avatarDataToBytes } from '../util/avatarDataToBytes.js'; type AvatarSize = 48 | 80; diff --git a/ts/components/BetterAvatarBubble.stories.tsx b/ts/components/BetterAvatarBubble.stories.tsx index 4d08eb22e3f..c2f0b3e8a09 100644 --- a/ts/components/BetterAvatarBubble.stories.tsx +++ b/ts/components/BetterAvatarBubble.stories.tsx @@ -6,9 +6,9 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { AvatarColors } from '../types/Colors'; -import type { PropsType } from './BetterAvatarBubble'; -import { BetterAvatarBubble } from './BetterAvatarBubble'; +import { AvatarColors } from '../types/Colors.js'; +import type { PropsType } from './BetterAvatarBubble.js'; +import { BetterAvatarBubble } from './BetterAvatarBubble.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/BetterAvatarBubble.tsx b/ts/components/BetterAvatarBubble.tsx index 54f507e2b16..2fd6b8ce4a1 100644 --- a/ts/components/BetterAvatarBubble.tsx +++ b/ts/components/BetterAvatarBubble.tsx @@ -5,8 +5,8 @@ import type { CSSProperties, MouseEvent, ReactNode } from 'react'; import React from 'react'; import classNames from 'classnames'; -import type { AvatarColorType } from '../types/Colors'; -import type { LocalizerType } from '../types/Util'; +import type { AvatarColorType } from '../types/Colors.js'; +import type { LocalizerType } from '../types/Util.js'; export type PropsType = { children?: ReactNode; diff --git a/ts/components/BrandedQRCode.stories.tsx b/ts/components/BrandedQRCode.stories.tsx index 49e7c056069..dda5968733e 100644 --- a/ts/components/BrandedQRCode.stories.tsx +++ b/ts/components/BrandedQRCode.stories.tsx @@ -3,8 +3,8 @@ import React from 'react'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './BrandedQRCode'; -import { BrandedQRCode } from './BrandedQRCode'; +import type { PropsType } from './BrandedQRCode.js'; +import { BrandedQRCode } from './BrandedQRCode.js'; export default { title: 'Components/BrandedQRCode', diff --git a/ts/components/Button.stories.tsx b/ts/components/Button.stories.tsx index 42296fee40e..4b62b81f46b 100644 --- a/ts/components/Button.stories.tsx +++ b/ts/components/Button.stories.tsx @@ -4,8 +4,8 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './Button'; -import { Button, ButtonSize, ButtonVariant } from './Button'; +import type { PropsType } from './Button.js'; +import { Button, ButtonSize, ButtonVariant } from './Button.js'; export default { title: 'Components/Button', diff --git a/ts/components/Button.tsx b/ts/components/Button.tsx index 8c511c11889..d19e2519698 100644 --- a/ts/components/Button.tsx +++ b/ts/components/Button.tsx @@ -10,9 +10,9 @@ import type { import React from 'react'; import classNames from 'classnames'; -import type { Theme } from '../util/theme'; -import { assertDev } from '../util/assert'; -import { themeClassName } from '../util/theme'; +import type { Theme } from '../util/theme.js'; +import { assertDev } from '../util/assert.js'; +import { themeClassName } from '../util/theme.js'; export enum ButtonSize { Large, diff --git a/ts/components/CallLinkAddNameModal.stories.tsx b/ts/components/CallLinkAddNameModal.stories.tsx index b7cc0572147..ba1b069a9af 100644 --- a/ts/components/CallLinkAddNameModal.stories.tsx +++ b/ts/components/CallLinkAddNameModal.stories.tsx @@ -3,10 +3,10 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { CallLinkAddNameModalProps } from './CallLinkAddNameModal'; -import { CallLinkAddNameModal } from './CallLinkAddNameModal'; -import type { ComponentMeta } from '../storybook/types'; -import { FAKE_CALL_LINK_WITH_ADMIN_KEY } from '../test-helpers/fakeCallLink'; +import type { CallLinkAddNameModalProps } from './CallLinkAddNameModal.js'; +import { CallLinkAddNameModal } from './CallLinkAddNameModal.js'; +import type { ComponentMeta } from '../storybook/types.js'; +import { FAKE_CALL_LINK_WITH_ADMIN_KEY } from '../test-helpers/fakeCallLink.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CallLinkAddNameModal.tsx b/ts/components/CallLinkAddNameModal.tsx index 092f2f3e59b..76257ea3416 100644 --- a/ts/components/CallLinkAddNameModal.tsx +++ b/ts/components/CallLinkAddNameModal.tsx @@ -2,17 +2,17 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { useCallback, useMemo, useState } from 'react'; import { v4 as generateUuid } from 'uuid'; -import { Modal } from './Modal'; -import type { LocalizerType } from '../types/I18N'; -import { Button, ButtonVariant } from './Button'; -import { Avatar, AvatarSize } from './Avatar'; -import { Input } from './Input'; +import { Modal } from './Modal.js'; +import type { LocalizerType } from '../types/I18N.js'; +import { Button, ButtonVariant } from './Button.js'; +import { Avatar, AvatarSize } from './Avatar.js'; +import { Input } from './Input.js'; import { CallLinkNameMaxByteLength, CallLinkNameMaxLength, type CallLinkType, -} from '../types/CallLink'; -import { getColorForCallLink } from '../util/getColorForCallLink'; +} from '../types/CallLink.js'; +import { getColorForCallLink } from '../util/getColorForCallLink.js'; export type CallLinkAddNameModalProps = Readonly<{ i18n: LocalizerType; diff --git a/ts/components/CallLinkDetails.stories.tsx b/ts/components/CallLinkDetails.stories.tsx index c9040ac236b..519bc2027cb 100644 --- a/ts/components/CallLinkDetails.stories.tsx +++ b/ts/components/CallLinkDetails.stories.tsx @@ -2,14 +2,14 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { ComponentMeta } from '../storybook/types'; -import type { CallLinkDetailsProps } from './CallLinkDetails'; -import { CallLinkDetails } from './CallLinkDetails'; +import type { ComponentMeta } from '../storybook/types.js'; +import type { CallLinkDetailsProps } from './CallLinkDetails.js'; +import { CallLinkDetails } from './CallLinkDetails.js'; import { FAKE_CALL_LINK, FAKE_CALL_LINK_WITH_ADMIN_KEY, -} from '../test-helpers/fakeCallLink'; -import { getFakeCallLinkHistoryGroup } from '../test-helpers/getFakeCallHistoryGroup'; +} from '../test-helpers/fakeCallLink.js'; +import { getFakeCallLinkHistoryGroup } from '../test-helpers/getFakeCallHistoryGroup.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CallLinkDetails.tsx b/ts/components/CallLinkDetails.tsx index 98c3e57795b..0b3aa9afae9 100644 --- a/ts/components/CallLinkDetails.tsx +++ b/ts/components/CallLinkDetails.tsx @@ -2,28 +2,28 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { useState } from 'react'; import classNames from 'classnames'; -import type { CallHistoryGroup } from '../types/CallDisposition'; -import type { LocalizerType } from '../types/I18N'; -import { CallHistoryGroupPanelSection } from './conversation/conversation-details/CallHistoryGroupPanelSection'; -import { PanelSection } from './conversation/conversation-details/PanelSection'; +import type { CallHistoryGroup } from '../types/CallDisposition.js'; +import type { LocalizerType } from '../types/I18N.js'; +import { CallHistoryGroupPanelSection } from './conversation/conversation-details/CallHistoryGroupPanelSection.js'; +import { PanelSection } from './conversation/conversation-details/PanelSection.js'; import { ConversationDetailsIcon, IconType, -} from './conversation/conversation-details/ConversationDetailsIcon'; -import { PanelRow } from './conversation/conversation-details/PanelRow'; -import type { CallLinkRestrictions, CallLinkType } from '../types/CallLink'; -import { linkCallRoute } from '../util/signalRoutes'; -import { drop } from '../util/drop'; -import { Avatar, AvatarSize } from './Avatar'; -import { Button, ButtonSize, ButtonVariant } from './Button'; -import { copyCallLink } from '../util/copyLinksWithToast'; -import { getColorForCallLink } from '../util/getColorForCallLink'; -import { isCallLinkAdmin } from '../types/CallLink'; -import { CallLinkRestrictionsSelect } from './CallLinkRestrictionsSelect'; -import { ConfirmationDialog } from './ConfirmationDialog'; -import { InAnotherCallTooltip } from './conversation/InAnotherCallTooltip'; -import { offsetDistanceModifier } from '../util/popperUtil'; -import { Tooltip, TooltipPlacement } from './Tooltip'; +} from './conversation/conversation-details/ConversationDetailsIcon.js'; +import { PanelRow } from './conversation/conversation-details/PanelRow.js'; +import type { CallLinkRestrictions, CallLinkType } from '../types/CallLink.js'; +import { linkCallRoute } from '../util/signalRoutes.js'; +import { drop } from '../util/drop.js'; +import { Avatar, AvatarSize } from './Avatar.js'; +import { Button, ButtonSize, ButtonVariant } from './Button.js'; +import { copyCallLink } from '../util/copyLinksWithToast.js'; +import { getColorForCallLink } from '../util/getColorForCallLink.js'; +import { isCallLinkAdmin } from '../types/CallLink.js'; +import { CallLinkRestrictionsSelect } from './CallLinkRestrictionsSelect.js'; +import { ConfirmationDialog } from './ConfirmationDialog.js'; +import { InAnotherCallTooltip } from './conversation/InAnotherCallTooltip.js'; +import { offsetDistanceModifier } from '../util/popperUtil.js'; +import { Tooltip, TooltipPlacement } from './Tooltip.js'; function toUrlWithoutProtocol(url: URL): string { return `${url.hostname}${url.pathname}${url.search}${url.hash}`; diff --git a/ts/components/CallLinkEditModal.stories.tsx b/ts/components/CallLinkEditModal.stories.tsx index 423df4f276f..efc14258fec 100644 --- a/ts/components/CallLinkEditModal.stories.tsx +++ b/ts/components/CallLinkEditModal.stories.tsx @@ -3,10 +3,10 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { CallLinkEditModalProps } from './CallLinkEditModal'; -import { CallLinkEditModal } from './CallLinkEditModal'; -import type { ComponentMeta } from '../storybook/types'; -import { FAKE_CALL_LINK_WITH_ADMIN_KEY } from '../test-helpers/fakeCallLink'; +import type { CallLinkEditModalProps } from './CallLinkEditModal.js'; +import { CallLinkEditModal } from './CallLinkEditModal.js'; +import type { ComponentMeta } from '../storybook/types.js'; +import { FAKE_CALL_LINK_WITH_ADMIN_KEY } from '../test-helpers/fakeCallLink.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CallLinkEditModal.tsx b/ts/components/CallLinkEditModal.tsx index a1602e4b53f..02fe2985e09 100644 --- a/ts/components/CallLinkEditModal.tsx +++ b/ts/components/CallLinkEditModal.tsx @@ -4,16 +4,15 @@ import type { ReactNode } from 'react'; import React, { useMemo, useState } from 'react'; import { v4 as generateUuid } from 'uuid'; -import { Modal } from './Modal'; -import type { LocalizerType } from '../types/I18N'; -import type { CallLinkRestrictions } from '../types/CallLink'; -import { type CallLinkType } from '../types/CallLink'; -import { linkCallRoute } from '../util/signalRoutes'; -import { Button, ButtonSize, ButtonVariant } from './Button'; -import { Avatar, AvatarSize } from './Avatar'; -import { getColorForCallLink } from '../util/getColorForCallLink'; -import { CallLinkRestrictionsSelect } from './CallLinkRestrictionsSelect'; -import { InAnotherCallTooltip } from './conversation/InAnotherCallTooltip'; +import { Modal } from './Modal.js'; +import type { LocalizerType } from '../types/I18N.js'; +import type { CallLinkRestrictions, CallLinkType } from '../types/CallLink.js'; +import { linkCallRoute } from '../util/signalRoutes.js'; +import { Button, ButtonSize, ButtonVariant } from './Button.js'; +import { Avatar, AvatarSize } from './Avatar.js'; +import { getColorForCallLink } from '../util/getColorForCallLink.js'; +import { CallLinkRestrictionsSelect } from './CallLinkRestrictionsSelect.js'; +import { InAnotherCallTooltip } from './conversation/InAnotherCallTooltip.js'; const CallLinkEditModalRowIconClasses = { Edit: 'CallLinkEditModal__RowIcon--Edit', diff --git a/ts/components/CallLinkPendingParticipantModal.stories.tsx b/ts/components/CallLinkPendingParticipantModal.stories.tsx index 22162660438..0de42ac74b1 100644 --- a/ts/components/CallLinkPendingParticipantModal.stories.tsx +++ b/ts/components/CallLinkPendingParticipantModal.stories.tsx @@ -3,10 +3,10 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { CallLinkPendingParticipantModalProps } from './CallLinkPendingParticipantModal'; -import { CallLinkPendingParticipantModal } from './CallLinkPendingParticipantModal'; -import type { ComponentMeta } from '../storybook/types'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation'; +import type { CallLinkPendingParticipantModalProps } from './CallLinkPendingParticipantModal.js'; +import { CallLinkPendingParticipantModal } from './CallLinkPendingParticipantModal.js'; +import type { ComponentMeta } from '../storybook/types.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CallLinkPendingParticipantModal.tsx b/ts/components/CallLinkPendingParticipantModal.tsx index 505113dfcb2..688c8265d59 100644 --- a/ts/components/CallLinkPendingParticipantModal.tsx +++ b/ts/components/CallLinkPendingParticipantModal.tsx @@ -2,17 +2,17 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { useCallback, useEffect, useMemo } from 'react'; -import { Modal } from './Modal'; -import type { LocalizerType } from '../types/I18N'; -import { Avatar, AvatarSize } from './Avatar'; -import type { PendingUserActionPayloadType } from '../state/ducks/calling'; -import type { ConversationType } from '../state/ducks/conversations'; -import { InContactsIcon } from './InContactsIcon'; -import { isInSystemContacts } from '../util/isInSystemContacts'; -import { ThemeType } from '../types/Util'; -import { Theme } from '../util/theme'; -import { UserText } from './UserText'; -import { SharedGroupNames } from './SharedGroupNames'; +import { Modal } from './Modal.js'; +import type { LocalizerType } from '../types/I18N.js'; +import { Avatar, AvatarSize } from './Avatar.js'; +import type { PendingUserActionPayloadType } from '../state/ducks/calling.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import { InContactsIcon } from './InContactsIcon.js'; +import { isInSystemContacts } from '../util/isInSystemContacts.js'; +import { ThemeType } from '../types/Util.js'; +import { Theme } from '../util/theme.js'; +import { UserText } from './UserText.js'; +import { SharedGroupNames } from './SharedGroupNames.js'; export type CallLinkPendingParticipantModalProps = { readonly i18n: LocalizerType; diff --git a/ts/components/CallLinkRestrictionsSelect.tsx b/ts/components/CallLinkRestrictionsSelect.tsx index 4434be4d7d5..a07cb5a5dc6 100644 --- a/ts/components/CallLinkRestrictionsSelect.tsx +++ b/ts/components/CallLinkRestrictionsSelect.tsx @@ -4,9 +4,9 @@ import React from 'react'; import { CallLinkRestrictions, toCallLinkRestrictions, -} from '../types/CallLink'; -import type { LocalizerType } from '../types/I18N'; -import { Select } from './Select'; +} from '../types/CallLink.js'; +import type { LocalizerType } from '../types/I18N.js'; +import { Select } from './Select.js'; export type CallLinkRestrictionsSelectProps = Readonly<{ disabled?: boolean; diff --git a/ts/components/CallManager.stories.tsx b/ts/components/CallManager.stories.tsx index d3b95dfeb04..be203536bbb 100644 --- a/ts/components/CallManager.stories.tsx +++ b/ts/components/CallManager.stories.tsx @@ -4,36 +4,36 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './CallManager'; -import { CallManager } from './CallManager'; +import type { PropsType } from './CallManager.js'; +import { CallManager } from './CallManager.js'; import { CallEndedReason, CallState, CallViewMode, GroupCallConnectionState, GroupCallJoinState, -} from '../types/Calling'; -import { CallMode } from '../types/CallDisposition'; +} from '../types/Calling.js'; +import { CallMode } from '../types/CallDisposition.js'; import type { ActiveGroupCallType, GroupCallRemoteParticipantType, -} from '../types/Calling'; +} from '../types/Calling.js'; import type { ConversationType, ConversationTypeType, -} from '../state/ducks/conversations'; -import { AvatarColors } from '../types/Colors'; -import { generateAci } from '../types/ServiceId'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation'; -import { fakeGetGroupCallVideoFrameSource } from '../test-helpers/fakeGetGroupCallVideoFrameSource'; -import { StorySendMode } from '../types/Stories'; +} from '../state/ducks/conversations.js'; +import { AvatarColors } from '../types/Colors.js'; +import { generateAci } from '../types/ServiceId.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; +import { fakeGetGroupCallVideoFrameSource } from '../test-helpers/fakeGetGroupCallVideoFrameSource.js'; +import { StorySendMode } from '../types/Stories.js'; import { FAKE_CALL_LINK, FAKE_CALL_LINK_WITH_ADMIN_KEY, getDefaultCallLinkConversation, -} from '../test-helpers/fakeCallLink'; -import { allRemoteParticipants } from './CallScreen.stories'; -import { getPlaceholderContact } from '../state/selectors/conversations'; +} from '../test-helpers/fakeCallLink.js'; +import { allRemoteParticipants } from './CallScreen.stories.js'; +import { getPlaceholderContact } from '../state/selectors/conversations.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CallManager.tsx b/ts/components/CallManager.tsx index ee5eaf85672..c70650def5e 100644 --- a/ts/components/CallManager.tsx +++ b/ts/components/CallManager.tsx @@ -4,26 +4,26 @@ import React, { useCallback, useEffect } from 'react'; import { noop } from 'lodash'; import type { VideoFrameSource } from '@signalapp/ringrtc'; -import { CallNeedPermissionScreen } from './CallNeedPermissionScreen'; -import { CallScreen } from './CallScreen'; -import { CallingLobby } from './CallingLobby'; -import { CallingParticipantsList } from './CallingParticipantsList'; -import { CallingSelectPresentingSourcesModal } from './CallingSelectPresentingSourcesModal'; -import { CallingPip } from './CallingPip'; -import { IncomingCallBar } from './IncomingCallBar'; +import { CallNeedPermissionScreen } from './CallNeedPermissionScreen.js'; +import { CallScreen } from './CallScreen.js'; +import { CallingLobby } from './CallingLobby.js'; +import { CallingParticipantsList } from './CallingParticipantsList.js'; +import { CallingSelectPresentingSourcesModal } from './CallingSelectPresentingSourcesModal.js'; +import { CallingPip } from './CallingPip.js'; +import { IncomingCallBar } from './IncomingCallBar.js'; import type { ActiveCallType, CallViewMode, GroupCallConnectionState, GroupCallVideoRequest, -} from '../types/Calling'; +} from '../types/Calling.js'; import { CallEndedReason, CallState, GroupCallJoinState, -} from '../types/Calling'; -import { CallMode } from '../types/CallDisposition'; -import type { ConversationType } from '../state/ducks/conversations'; +} from '../types/Calling.js'; +import { CallMode } from '../types/CallDisposition.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; import type { AcceptCallType, BatchUserActionPayloadType, @@ -40,26 +40,26 @@ import type { SetLocalVideoType, SetRendererCanvasType, StartCallType, -} from '../state/ducks/calling'; -import { CallLinkRestrictions } from '../types/CallLink'; -import type { CallLinkType } from '../types/CallLink'; -import type { LocalizerType } from '../types/Util'; -import { missingCaseError } from '../util/missingCaseError'; -import { CallingToastProvider } from './CallingToast'; -import type { SmartReactionPicker } from '../state/smart/ReactionPicker'; -import type { Props as ReactionPickerProps } from './conversation/ReactionPicker'; -import { createLogger } from '../logging/log'; -import { isGroupOrAdhocActiveCall } from '../util/isGroupOrAdhocCall'; -import { CallingAdhocCallInfo } from './CallingAdhocCallInfo'; -import { callLinkRootKeyToUrl } from '../util/callLinkRootKeyToUrl'; -import { usePrevious } from '../hooks/usePrevious'; -import { copyCallLink } from '../util/copyLinksWithToast'; +} from '../state/ducks/calling.js'; +import { CallLinkRestrictions } from '../types/CallLink.js'; +import type { CallLinkType } from '../types/CallLink.js'; +import type { LocalizerType } from '../types/Util.js'; +import { missingCaseError } from '../util/missingCaseError.js'; +import { CallingToastProvider } from './CallingToast.js'; +import type { SmartReactionPicker } from '../state/smart/ReactionPicker.js'; +import type { Props as ReactionPickerProps } from './conversation/ReactionPicker.js'; +import { createLogger } from '../logging/log.js'; +import { isGroupOrAdhocActiveCall } from '../util/isGroupOrAdhocCall.js'; +import { CallingAdhocCallInfo } from './CallingAdhocCallInfo.js'; +import { callLinkRootKeyToUrl } from '../util/callLinkRootKeyToUrl.js'; +import { usePrevious } from '../hooks/usePrevious.js'; +import { copyCallLink } from '../util/copyLinksWithToast.js'; import { redactNotificationProfileId, shouldNotify, -} from '../types/NotificationProfile'; -import type { NotificationProfileType } from '../types/NotificationProfile'; -import { strictAssert } from '../util/assert'; +} from '../types/NotificationProfile.js'; +import type { NotificationProfileType } from '../types/NotificationProfile.js'; +import { strictAssert } from '../util/assert.js'; const log = createLogger('CallManager'); diff --git a/ts/components/CallNeedPermissionScreen.stories.tsx b/ts/components/CallNeedPermissionScreen.stories.tsx index e0dd03e6213..72e1cdb2ece 100644 --- a/ts/components/CallNeedPermissionScreen.stories.tsx +++ b/ts/components/CallNeedPermissionScreen.stories.tsx @@ -3,10 +3,10 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { ComponentMeta } from '../storybook/types'; -import type { Props } from './CallNeedPermissionScreen'; -import { CallNeedPermissionScreen } from './CallNeedPermissionScreen'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation'; +import type { ComponentMeta } from '../storybook/types.js'; +import type { Props } from './CallNeedPermissionScreen.js'; +import { CallNeedPermissionScreen } from './CallNeedPermissionScreen.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CallNeedPermissionScreen.tsx b/ts/components/CallNeedPermissionScreen.tsx index ea31d19830a..812491c56f8 100644 --- a/ts/components/CallNeedPermissionScreen.tsx +++ b/ts/components/CallNeedPermissionScreen.tsx @@ -2,12 +2,12 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { useRef, useEffect } from 'react'; -import type { LocalizerType } from '../types/Util'; -import { AvatarColors } from '../types/Colors'; -import { Avatar, AvatarSize } from './Avatar'; -import { I18n } from './I18n'; -import { ContactName } from './conversation/ContactName'; -import type { ConversationType } from '../state/ducks/conversations'; +import type { LocalizerType } from '../types/Util.js'; +import { AvatarColors } from '../types/Colors.js'; +import { Avatar, AvatarSize } from './Avatar.js'; +import { I18n } from './I18n.js'; +import { ContactName } from './conversation/ContactName.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; export type Props = { conversation: Pick< diff --git a/ts/components/CallParticipantCount.tsx b/ts/components/CallParticipantCount.tsx index 6aed12c23d3..500b1f82b09 100644 --- a/ts/components/CallParticipantCount.tsx +++ b/ts/components/CallParticipantCount.tsx @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import type { LocalizerType } from '../types/Util'; -import { CallMode } from '../types/CallDisposition'; +import type { LocalizerType } from '../types/Util.js'; +import { CallMode } from '../types/CallDisposition.js'; export type PropsType = { callMode: CallMode.Group | CallMode.Adhoc; diff --git a/ts/components/CallReactionBurst.tsx b/ts/components/CallReactionBurst.tsx index 8e2bb3f54a9..67b891cc048 100644 --- a/ts/components/CallReactionBurst.tsx +++ b/ts/components/CallReactionBurst.tsx @@ -12,8 +12,8 @@ import React, { } from 'react'; import { createPortal } from 'react-dom'; import { v4 as uuid } from 'uuid'; -import { useIsMounted } from '../hooks/useIsMounted'; -import { CallReactionBurstEmoji } from './CallReactionBurstEmoji'; +import { useIsMounted } from '../hooks/useIsMounted.js'; +import { CallReactionBurstEmoji } from './CallReactionBurstEmoji.js'; const LIFETIME = 3000; diff --git a/ts/components/CallReactionBurstEmoji.tsx b/ts/components/CallReactionBurstEmoji.tsx index e64bfe894ae..a5b9b82bb14 100644 --- a/ts/components/CallReactionBurstEmoji.tsx +++ b/ts/components/CallReactionBurstEmoji.tsx @@ -5,8 +5,8 @@ import React from 'react'; import { animated, useSpring } from '@react-spring/web'; import { random } from 'lodash'; import { v4 as uuid } from 'uuid'; -import { Emojify } from './conversation/Emojify'; -import { useReducedMotion } from '../hooks/useReducedMotion'; +import { Emojify } from './conversation/Emojify.js'; +import { useReducedMotion } from '../hooks/useReducedMotion.js'; export type PropsType = { values: Array; diff --git a/ts/components/CallScreen.stories.tsx b/ts/components/CallScreen.stories.tsx index 5cc86c6c805..dabb74c05e9 100644 --- a/ts/components/CallScreen.stories.tsx +++ b/ts/components/CallScreen.stories.tsx @@ -11,30 +11,30 @@ import type { ActiveGroupCallType, GroupCallRemoteParticipantType, ObservedRemoteMuteType, -} from '../types/Calling'; +} from '../types/Calling.js'; import { CallViewMode, CallState, GroupCallConnectionState, GroupCallJoinState, -} from '../types/Calling'; -import { CallMode } from '../types/CallDisposition'; -import { generateAci } from '../types/ServiceId'; -import type { AciString } from '../types/ServiceId'; -import type { ConversationType } from '../state/ducks/conversations'; -import { AvatarColors } from '../types/Colors'; -import type { PropsType } from './CallScreen'; -import { CallScreen as UnwrappedCallScreen } from './CallScreen'; -import { DEFAULT_PREFERRED_REACTION_EMOJI } from '../reactions/constants'; -import { missingCaseError } from '../util/missingCaseError'; +} from '../types/Calling.js'; +import { CallMode } from '../types/CallDisposition.js'; +import { generateAci } from '../types/ServiceId.js'; +import type { AciString } from '../types/ServiceId.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import { AvatarColors } from '../types/Colors.js'; +import type { PropsType } from './CallScreen.js'; +import { CallScreen as UnwrappedCallScreen } from './CallScreen.js'; +import { DEFAULT_PREFERRED_REACTION_EMOJI } from '../reactions/constants.js'; +import { missingCaseError } from '../util/missingCaseError.js'; import { getDefaultConversation, getDefaultConversationWithServiceId, -} from '../test-helpers/getDefaultConversation'; -import { fakeGetGroupCallVideoFrameSource } from '../test-helpers/fakeGetGroupCallVideoFrameSource'; -import { CallingToastProvider, useCallingToasts } from './CallingToast'; -import type { CallingImageDataCache } from './CallManager'; -import { MINUTE } from '../util/durations'; +} from '../test-helpers/getDefaultConversation.js'; +import { fakeGetGroupCallVideoFrameSource } from '../test-helpers/fakeGetGroupCallVideoFrameSource.js'; +import { CallingToastProvider, useCallingToasts } from './CallingToast.js'; +import type { CallingImageDataCache } from './CallManager.js'; +import { MINUTE } from '../util/durations/index.js'; const MAX_PARTICIPANTS = 75; const LOCAL_DEMUX_ID = 1; diff --git a/ts/components/CallScreen.tsx b/ts/components/CallScreen.tsx index 3e64e9849b8..30a9d73bceb 100644 --- a/ts/components/CallScreen.tsx +++ b/ts/components/CallScreen.tsx @@ -16,88 +16,88 @@ import type { SetLocalVideoType, SetRendererCanvasType, SetMutedByType, -} from '../state/ducks/calling'; -import { Avatar, AvatarSize } from './Avatar'; -import { CallingHeader, getCallViewIconClassname } from './CallingHeader'; -import { CallingPreCallInfo, RingMode } from './CallingPreCallInfo'; -import { CallingButton, CallingButtonType } from './CallingButton'; -import { Button, ButtonVariant } from './Button'; -import { TooltipPlacement } from './Tooltip'; -import { CallBackgroundBlur } from './CallBackgroundBlur'; +} from '../state/ducks/calling.js'; +import { Avatar, AvatarSize } from './Avatar.js'; +import { CallingHeader, getCallViewIconClassname } from './CallingHeader.js'; +import { CallingPreCallInfo, RingMode } from './CallingPreCallInfo.js'; +import { CallingButton, CallingButtonType } from './CallingButton.js'; +import { Button, ButtonVariant } from './Button.js'; +import { TooltipPlacement } from './Tooltip.js'; +import { CallBackgroundBlur } from './CallBackgroundBlur.js'; import type { ActiveCallType, ActiveCallReactionsType, ConversationsByDemuxIdType, GroupCallVideoRequest, -} from '../types/Calling'; +} from '../types/Calling.js'; import { CALLING_REACTIONS_LIFETIME, CallViewMode, CallState, GroupCallConnectionState, GroupCallJoinState, -} from '../types/Calling'; -import { CallMode } from '../types/CallDisposition'; -import type { ServiceIdString } from '../types/ServiceId'; -import { AvatarColors } from '../types/Colors'; -import type { ConversationType } from '../state/ducks/conversations'; +} from '../types/Calling.js'; +import { CallMode } from '../types/CallDisposition.js'; +import type { ServiceIdString } from '../types/ServiceId.js'; +import { AvatarColors } from '../types/Colors.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; import { CallingButtonToastsContainer, useScreenSharingStoppedToast, -} from './CallingToastManager'; -import { DirectCallRemoteParticipant } from './DirectCallRemoteParticipant'; -import { GroupCallRemoteParticipants } from './GroupCallRemoteParticipants'; -import { CallParticipantCount } from './CallParticipantCount'; -import type { LocalizerType } from '../types/Util'; -import { NeedsScreenRecordingPermissionsModal } from './NeedsScreenRecordingPermissionsModal'; -import { missingCaseError } from '../util/missingCaseError'; -import * as KeyboardLayout from '../services/keyboardLayout'; +} from './CallingToastManager.js'; +import { DirectCallRemoteParticipant } from './DirectCallRemoteParticipant.js'; +import { GroupCallRemoteParticipants } from './GroupCallRemoteParticipants.js'; +import { CallParticipantCount } from './CallParticipantCount.js'; +import type { LocalizerType } from '../types/Util.js'; +import { NeedsScreenRecordingPermissionsModal } from './NeedsScreenRecordingPermissionsModal.js'; +import { missingCaseError } from '../util/missingCaseError.js'; +import * as KeyboardLayout from '../services/keyboardLayout.js'; import { usePresenter, useActivateSpeakerViewOnPresenting, -} from '../hooks/useActivateSpeakerViewOnPresenting'; +} from '../hooks/useActivateSpeakerViewOnPresenting.js'; import { CallingAudioIndicator, SPEAKING_LINGER_MS, -} from './CallingAudioIndicator'; +} from './CallingAudioIndicator.js'; import { useActiveCallShortcuts, useKeyboardShortcuts, -} from '../hooks/useKeyboardShortcuts'; -import { useValueAtFixedRate } from '../hooks/useValueAtFixedRate'; -import { isReconnecting as callingIsReconnecting } from '../util/callingIsReconnecting'; -import { usePrevious } from '../hooks/usePrevious'; +} from '../hooks/useKeyboardShortcuts.js'; +import { useValueAtFixedRate } from '../hooks/useValueAtFixedRate.js'; +import { isReconnecting as callingIsReconnecting } from '../util/callingIsReconnecting.js'; +import { usePrevious } from '../hooks/usePrevious.js'; import { CallingToastProvider, PersistentCallingToast, useCallingToasts, -} from './CallingToast'; -import { handleOutsideClick } from '../util/handleOutsideClick'; -import { Spinner } from './Spinner'; -import type { Props as ReactionPickerProps } from './conversation/ReactionPicker'; -import type { SmartReactionPicker } from '../state/smart/ReactionPicker'; +} from './CallingToast.js'; +import { handleOutsideClick } from '../util/handleOutsideClick.js'; +import { Spinner } from './Spinner.js'; +import type { Props as ReactionPickerProps } from './conversation/ReactionPicker.js'; +import type { SmartReactionPicker } from '../state/smart/ReactionPicker.js'; import { CallingRaisedHandsList, CallingRaisedHandsListButton, -} from './CallingRaisedHandsList'; -import type { CallReactionBurstType } from './CallReactionBurst'; +} from './CallingRaisedHandsList.js'; +import type { CallReactionBurstType } from './CallReactionBurst.js'; import { CallReactionBurstProvider, useCallReactionBursts, -} from './CallReactionBurst'; -import { isGroupOrAdhocActiveCall } from '../util/isGroupOrAdhocCall'; -import { assertDev, strictAssert } from '../util/assert'; -import { emojiToData } from './emoji/lib'; -import { CallingPendingParticipants } from './CallingPendingParticipants'; -import type { CallingImageDataCache } from './CallManager'; -import { FunStaticEmoji } from './fun/FunEmoji'; +} from './CallReactionBurst.js'; +import { isGroupOrAdhocActiveCall } from '../util/isGroupOrAdhocCall.js'; +import { assertDev, strictAssert } from '../util/assert.js'; +import { emojiToData } from './emoji/lib.js'; +import { CallingPendingParticipants } from './CallingPendingParticipants.js'; +import type { CallingImageDataCache } from './CallManager.js'; +import { FunStaticEmoji } from './fun/FunEmoji.js'; import { getEmojiVariantByKey, getEmojiVariantKeyByValue, isEmojiVariantValue, -} from './fun/data/emojis'; -import { useFunEmojiLocalizer } from './fun/useFunEmojiLocalizer'; -import { BeforeNavigateResponse } from '../services/BeforeNavigate'; +} from './fun/data/emojis.js'; +import { useFunEmojiLocalizer } from './fun/useFunEmojiLocalizer.js'; +import { BeforeNavigateResponse } from '../services/BeforeNavigate.js'; export type PropsType = { activeCall: ActiveCallType; diff --git a/ts/components/CallingAdhocCallInfo.stories.tsx b/ts/components/CallingAdhocCallInfo.stories.tsx index 725d196d9b8..5c2b063c0e2 100644 --- a/ts/components/CallingAdhocCallInfo.stories.tsx +++ b/ts/components/CallingAdhocCallInfo.stories.tsx @@ -6,14 +6,14 @@ import { sample } from 'lodash'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './CallingAdhocCallInfo'; -import { CallingAdhocCallInfo } from './CallingAdhocCallInfo'; -import { AvatarColors } from '../types/Colors'; -import type { GroupCallRemoteParticipantType } from '../types/Calling'; -import { generateAci } from '../types/ServiceId'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation'; -import type { CallLinkType } from '../types/CallLink'; -import { CallLinkRestrictions } from '../types/CallLink'; +import type { PropsType } from './CallingAdhocCallInfo.js'; +import { CallingAdhocCallInfo } from './CallingAdhocCallInfo.js'; +import { AvatarColors } from '../types/Colors.js'; +import type { GroupCallRemoteParticipantType } from '../types/Calling.js'; +import { generateAci } from '../types/ServiceId.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; +import type { CallLinkType } from '../types/CallLink.js'; +import { CallLinkRestrictions } from '../types/CallLink.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CallingAdhocCallInfo.tsx b/ts/components/CallingAdhocCallInfo.tsx index fceecb1d604..ffaa9aae872 100644 --- a/ts/components/CallingAdhocCallInfo.tsx +++ b/ts/components/CallingAdhocCallInfo.tsx @@ -5,22 +5,22 @@ import React from 'react'; import classNames from 'classnames'; import { partition } from 'lodash'; -import { Avatar, AvatarSize } from './Avatar'; -import { ContactName } from './conversation/ContactName'; -import { InContactsIcon } from './InContactsIcon'; -import type { CallLinkType } from '../types/CallLink'; -import type { LocalizerType } from '../types/Util'; -import type { ServiceIdString } from '../types/ServiceId'; -import { sortByTitle } from '../util/sortByTitle'; -import type { ConversationType } from '../state/ducks/conversations'; -import { ModalHost } from './ModalHost'; -import { isInSystemContacts } from '../util/isInSystemContacts'; -import type { RemoveClientType } from '../state/ducks/calling'; -import { AVATAR_COLOR_COUNT, AvatarColors } from '../types/Colors'; -import { Button } from './Button'; -import { Modal } from './Modal'; -import { Theme } from '../util/theme'; -import { ConfirmationDialog } from './ConfirmationDialog'; +import { Avatar, AvatarSize } from './Avatar.js'; +import { ContactName } from './conversation/ContactName.js'; +import { InContactsIcon } from './InContactsIcon.js'; +import type { CallLinkType } from '../types/CallLink.js'; +import type { LocalizerType } from '../types/Util.js'; +import type { ServiceIdString } from '../types/ServiceId.js'; +import { sortByTitle } from '../util/sortByTitle.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import { ModalHost } from './ModalHost.js'; +import { isInSystemContacts } from '../util/isInSystemContacts.js'; +import type { RemoveClientType } from '../state/ducks/calling.js'; +import { AVATAR_COLOR_COUNT, AvatarColors } from '../types/Colors.js'; +import { Button } from './Button.js'; +import { Modal } from './Modal.js'; +import { Theme } from '../util/theme.js'; +import { ConfirmationDialog } from './ConfirmationDialog.js'; const MAX_UNKNOWN_AVATARS_COUNT = 3; diff --git a/ts/components/CallingAudioIndicator.stories.tsx b/ts/components/CallingAudioIndicator.stories.tsx index 5090a4eaf38..0c575ace18f 100644 --- a/ts/components/CallingAudioIndicator.stories.tsx +++ b/ts/components/CallingAudioIndicator.stories.tsx @@ -3,13 +3,13 @@ import React, { useState, useEffect } from 'react'; import type { Meta } from '@storybook/react'; -import type { Props } from './CallingAudioIndicator'; +import type { Props } from './CallingAudioIndicator.js'; import { CallingAudioIndicator, SPEAKING_LINGER_MS, -} from './CallingAudioIndicator'; -import { AUDIO_LEVEL_INTERVAL_MS } from '../calling/constants'; -import { useValueAtFixedRate } from '../hooks/useValueAtFixedRate'; +} from './CallingAudioIndicator.js'; +import { AUDIO_LEVEL_INTERVAL_MS } from '../calling/constants.js'; +import { useValueAtFixedRate } from '../hooks/useValueAtFixedRate.js'; export default { title: 'Components/CallingAudioIndicator', diff --git a/ts/components/CallingAudioIndicator.tsx b/ts/components/CallingAudioIndicator.tsx index f3d1266d677..63e4293f925 100644 --- a/ts/components/CallingAudioIndicator.tsx +++ b/ts/components/CallingAudioIndicator.tsx @@ -6,8 +6,8 @@ import type { ReactElement } from 'react'; import React, { useEffect } from 'react'; import { useSpring, animated } from '@react-spring/web'; -import { AUDIO_LEVEL_INTERVAL_MS } from '../calling/constants'; -import { missingCaseError } from '../util/missingCaseError'; +import { AUDIO_LEVEL_INTERVAL_MS } from '../calling/constants.js'; +import { missingCaseError } from '../util/missingCaseError.js'; export const SPEAKING_LINGER_MS = 200; const BASE_CLASS_NAME = 'CallingAudioIndicator'; diff --git a/ts/components/CallingButton.stories.tsx b/ts/components/CallingButton.stories.tsx index 71014d607ab..857430c81e4 100644 --- a/ts/components/CallingButton.stories.tsx +++ b/ts/components/CallingButton.stories.tsx @@ -4,9 +4,9 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './CallingButton'; -import { CallingButton, CallingButtonType } from './CallingButton'; -import { TooltipPlacement } from './Tooltip'; +import type { PropsType } from './CallingButton.js'; +import { CallingButton, CallingButtonType } from './CallingButton.js'; +import { TooltipPlacement } from './Tooltip.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CallingButton.tsx b/ts/components/CallingButton.tsx index e232d3e5415..4be3fea23ab 100644 --- a/ts/components/CallingButton.tsx +++ b/ts/components/CallingButton.tsx @@ -4,10 +4,10 @@ import React, { useMemo } from 'react'; import classNames from 'classnames'; import { v4 as uuid } from 'uuid'; -import type { TooltipPlacement } from './Tooltip'; -import { Tooltip } from './Tooltip'; -import { Theme } from '../util/theme'; -import type { LocalizerType } from '../types/Util'; +import type { TooltipPlacement } from './Tooltip.js'; +import { Tooltip } from './Tooltip.js'; +import { Theme } from '../util/theme.js'; +import type { LocalizerType } from '../types/Util.js'; export enum CallingButtonType { AUDIO_DISABLED = 'AUDIO_DISABLED', diff --git a/ts/components/CallingDeviceSelection.stories.tsx b/ts/components/CallingDeviceSelection.stories.tsx index 218e6eb1e95..a0a775547b7 100644 --- a/ts/components/CallingDeviceSelection.stories.tsx +++ b/ts/components/CallingDeviceSelection.stories.tsx @@ -5,8 +5,8 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './CallingDeviceSelection'; -import { CallingDeviceSelection } from './CallingDeviceSelection'; +import type { Props } from './CallingDeviceSelection.js'; +import { CallingDeviceSelection } from './CallingDeviceSelection.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CallingDeviceSelection.tsx b/ts/components/CallingDeviceSelection.tsx index 9746afbaab9..1b6ea549f66 100644 --- a/ts/components/CallingDeviceSelection.tsx +++ b/ts/components/CallingDeviceSelection.tsx @@ -4,16 +4,16 @@ import * as React from 'react'; import type { AudioDevice } from '@signalapp/ringrtc'; -import type { Option } from './Select'; -import { Modal } from './Modal'; -import { Select } from './Select'; -import type { LocalizerType } from '../types/Util'; +import type { Option } from './Select.js'; +import { Modal } from './Modal.js'; +import { Select } from './Select.js'; +import type { LocalizerType } from '../types/Util.js'; import type { ChangeIODevicePayloadType, MediaDeviceSettings, -} from '../types/Calling'; -import { CallingDeviceType } from '../types/Calling'; -import { Theme } from '../util/theme'; +} from '../types/Calling.js'; +import { CallingDeviceType } from '../types/Calling.js'; +import { Theme } from '../util/theme.js'; export type Props = MediaDeviceSettings & { changeIODevice: (payload: ChangeIODevicePayloadType) => void; diff --git a/ts/components/CallingHeader.stories.tsx b/ts/components/CallingHeader.stories.tsx index 2046df68d40..dd3cc46fd22 100644 --- a/ts/components/CallingHeader.stories.tsx +++ b/ts/components/CallingHeader.stories.tsx @@ -4,9 +4,9 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './CallingHeader'; -import { CallingHeader } from './CallingHeader'; -import { CallViewMode } from '../types/Calling'; +import type { PropsType } from './CallingHeader.js'; +import { CallingHeader } from './CallingHeader.js'; +import { CallViewMode } from '../types/Calling.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CallingHeader.tsx b/ts/components/CallingHeader.tsx index bb3002504eb..acd4b073613 100644 --- a/ts/components/CallingHeader.tsx +++ b/ts/components/CallingHeader.tsx @@ -3,11 +3,11 @@ import classNames from 'classnames'; import React from 'react'; -import type { LocalizerType } from '../types/Util'; -import { CallViewMode } from '../types/Calling'; -import { Tooltip } from './Tooltip'; -import { Theme } from '../util/theme'; -import { ContextMenu } from './ContextMenu'; +import type { LocalizerType } from '../types/Util.js'; +import { CallViewMode } from '../types/Calling.js'; +import { Tooltip } from './Tooltip.js'; +import { Theme } from '../util/theme.js'; +import { ContextMenu } from './ContextMenu.js'; export type PropsType = { callViewMode?: CallViewMode; diff --git a/ts/components/CallingLobby.stories.tsx b/ts/components/CallingLobby.stories.tsx index 605a1c718bd..0421e936b93 100644 --- a/ts/components/CallingLobby.stories.tsx +++ b/ts/components/CallingLobby.stories.tsx @@ -7,18 +7,18 @@ import { action } from '@storybook/addon-actions'; import { v4 as generateUuid } from 'uuid'; import type { Meta } from '@storybook/react'; -import { AvatarColors } from '../types/Colors'; -import type { ConversationType } from '../state/ducks/conversations'; -import type { PropsType } from './CallingLobby'; -import { CallingLobby as UnwrappedCallingLobby } from './CallingLobby'; -import { generateAci } from '../types/ServiceId'; +import { AvatarColors } from '../types/Colors.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import type { PropsType } from './CallingLobby.js'; +import { CallingLobby as UnwrappedCallingLobby } from './CallingLobby.js'; +import { generateAci } from '../types/ServiceId.js'; import { getDefaultConversation, getDefaultConversationWithServiceId, -} from '../test-helpers/getDefaultConversation'; -import { CallingToastProvider } from './CallingToast'; -import { CallMode } from '../types/CallDisposition'; -import { getDefaultCallLinkConversation } from '../test-helpers/fakeCallLink'; +} from '../test-helpers/getDefaultConversation.js'; +import { CallingToastProvider } from './CallingToast.js'; +import { CallMode } from '../types/CallDisposition.js'; +import { getDefaultCallLinkConversation } from '../test-helpers/fakeCallLink.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CallingLobby.tsx b/ts/components/CallingLobby.tsx index 9e14fec2980..14e5bf661a1 100644 --- a/ts/components/CallingLobby.tsx +++ b/ts/components/CallingLobby.tsx @@ -7,28 +7,28 @@ import { FocusScope } from 'react-aria'; import type { SetLocalAudioType, SetLocalVideoType, -} from '../state/ducks/calling'; -import { CallingButton, CallingButtonType } from './CallingButton'; -import { TooltipPlacement } from './Tooltip'; -import { CallBackgroundBlur } from './CallBackgroundBlur'; -import { CallParticipantCount } from './CallParticipantCount'; -import { CallingHeader } from './CallingHeader'; -import { CallingPreCallInfo, RingMode } from './CallingPreCallInfo'; +} from '../state/ducks/calling.js'; +import { CallingButton, CallingButtonType } from './CallingButton.js'; +import { TooltipPlacement } from './Tooltip.js'; +import { CallBackgroundBlur } from './CallBackgroundBlur.js'; +import { CallParticipantCount } from './CallParticipantCount.js'; +import { CallingHeader } from './CallingHeader.js'; +import { CallingPreCallInfo, RingMode } from './CallingPreCallInfo.js'; import { CallingLobbyJoinButton, CallingLobbyJoinButtonVariant, -} from './CallingLobbyJoinButton'; -import { CallMode } from '../types/CallDisposition'; -import type { CallingConversationType } from '../types/Calling'; -import type { LocalizerType } from '../types/Util'; -import { useIsOnline } from '../hooks/useIsOnline'; -import * as KeyboardLayout from '../services/keyboardLayout'; -import type { ConversationType } from '../state/ducks/conversations'; -import { useCallingToasts } from './CallingToast'; -import { CallingButtonToastsContainer } from './CallingToastManager'; -import { isGroupOrAdhocCallMode } from '../util/isGroupOrAdhocCall'; -import { Button, ButtonVariant } from './Button'; -import { SpinnerV2 } from './SpinnerV2'; +} from './CallingLobbyJoinButton.js'; +import { CallMode } from '../types/CallDisposition.js'; +import type { CallingConversationType } from '../types/Calling.js'; +import type { LocalizerType } from '../types/Util.js'; +import { useIsOnline } from '../hooks/useIsOnline.js'; +import * as KeyboardLayout from '../services/keyboardLayout.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import { useCallingToasts } from './CallingToast.js'; +import { CallingButtonToastsContainer } from './CallingToastManager.js'; +import { isGroupOrAdhocCallMode } from '../util/isGroupOrAdhocCall.js'; +import { Button, ButtonVariant } from './Button.js'; +import { SpinnerV2 } from './SpinnerV2.js'; export type PropsType = { availableCameras: Array; diff --git a/ts/components/CallingLobbyJoinButton.tsx b/ts/components/CallingLobbyJoinButton.tsx index 40b2f8af48a..73fc780e0dc 100644 --- a/ts/components/CallingLobbyJoinButton.tsx +++ b/ts/components/CallingLobbyJoinButton.tsx @@ -5,9 +5,9 @@ import type { ReactChild } from 'react'; import React, { useState } from 'react'; import { noop } from 'lodash'; -import type { LocalizerType } from '../types/Util'; -import { Button, ButtonVariant } from './Button'; -import { Spinner } from './Spinner'; +import type { LocalizerType } from '../types/Util.js'; +import { Button, ButtonVariant } from './Button.js'; +import { Spinner } from './Spinner.js'; export enum CallingLobbyJoinButtonVariant { CallIsFull = 'CallIsFull', diff --git a/ts/components/CallingParticipantsList.stories.tsx b/ts/components/CallingParticipantsList.stories.tsx index 741fd9172e6..9ca636b4990 100644 --- a/ts/components/CallingParticipantsList.stories.tsx +++ b/ts/components/CallingParticipantsList.stories.tsx @@ -6,10 +6,10 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './CallingParticipantsList'; -import { CallingParticipantsList } from './CallingParticipantsList'; -import { generateAci } from '../types/ServiceId'; -import { createCallParticipant } from '../test-helpers/createCallParticipant'; +import type { PropsType } from './CallingParticipantsList.js'; +import { CallingParticipantsList } from './CallingParticipantsList.js'; +import { generateAci } from '../types/ServiceId.js'; +import { createCallParticipant } from '../test-helpers/createCallParticipant.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CallingParticipantsList.tsx b/ts/components/CallingParticipantsList.tsx index 53dc826d1c6..bcbe2fe5557 100644 --- a/ts/components/CallingParticipantsList.tsx +++ b/ts/components/CallingParticipantsList.tsx @@ -7,15 +7,15 @@ import React, { useContext } from 'react'; import { createPortal } from 'react-dom'; import classNames from 'classnames'; import { FocusScope } from 'react-aria'; -import { Avatar, AvatarSize } from './Avatar'; -import { ContactName } from './conversation/ContactName'; -import { InContactsIcon } from './InContactsIcon'; -import type { LocalizerType } from '../types/Util'; -import type { ServiceIdString } from '../types/ServiceId'; -import { sortByTitle } from '../util/sortByTitle'; -import type { ConversationType } from '../state/ducks/conversations'; -import { isInSystemContacts } from '../util/isInSystemContacts'; -import { ModalContainerContext } from './ModalHost'; +import { Avatar, AvatarSize } from './Avatar.js'; +import { ContactName } from './conversation/ContactName.js'; +import { InContactsIcon } from './InContactsIcon.js'; +import type { LocalizerType } from '../types/Util.js'; +import type { ServiceIdString } from '../types/ServiceId.js'; +import { sortByTitle } from '../util/sortByTitle.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import { isInSystemContacts } from '../util/isInSystemContacts.js'; +import { ModalContainerContext } from './ModalHost.js'; type ParticipantType = ConversationType & { hasRemoteAudio?: boolean; diff --git a/ts/components/CallingPendingParticipants.stories.tsx b/ts/components/CallingPendingParticipants.stories.tsx index 597a9e92617..c60e276181d 100644 --- a/ts/components/CallingPendingParticipants.stories.tsx +++ b/ts/components/CallingPendingParticipants.stories.tsx @@ -4,9 +4,9 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './CallingPendingParticipants'; -import { CallingPendingParticipants } from './CallingPendingParticipants'; -import { allRemoteParticipants } from './CallScreen.stories'; +import type { PropsType } from './CallingPendingParticipants.js'; +import { CallingPendingParticipants } from './CallingPendingParticipants.js'; +import { allRemoteParticipants } from './CallScreen.stories.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CallingPendingParticipants.tsx b/ts/components/CallingPendingParticipants.tsx index b3c77b546b2..d380d10fd24 100644 --- a/ts/components/CallingPendingParticipants.tsx +++ b/ts/components/CallingPendingParticipants.tsx @@ -7,24 +7,24 @@ import React, { useCallback, useEffect, useRef, useState } from 'react'; import { noop } from 'lodash'; import classNames from 'classnames'; import { animated, useSpring } from '@react-spring/web'; -import { Avatar, AvatarSize } from './Avatar'; -import { ContactName } from './conversation/ContactName'; -import { InContactsIcon } from './InContactsIcon'; -import type { LocalizerType } from '../types/Util'; -import type { ConversationType } from '../state/ducks/conversations'; -import { isInSystemContacts } from '../util/isInSystemContacts'; +import { Avatar, AvatarSize } from './Avatar.js'; +import { ContactName } from './conversation/ContactName.js'; +import { InContactsIcon } from './InContactsIcon.js'; +import type { LocalizerType } from '../types/Util.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import { isInSystemContacts } from '../util/isInSystemContacts.js'; import type { BatchUserActionPayloadType, PendingUserActionPayloadType, -} from '../state/ducks/calling'; -import { Button, ButtonVariant } from './Button'; -import type { ServiceIdString } from '../types/ServiceId'; -import { handleOutsideClick } from '../util/handleOutsideClick'; -import { Theme } from '../util/theme'; -import { ConfirmationDialog } from './ConfirmationDialog'; -import { usePrevious } from '../hooks/usePrevious'; -import { useReducedMotion } from '../hooks/useReducedMotion'; -import { drop } from '../util/drop'; +} from '../state/ducks/calling.js'; +import { Button, ButtonVariant } from './Button.js'; +import type { ServiceIdString } from '../types/ServiceId.js'; +import { handleOutsideClick } from '../util/handleOutsideClick.js'; +import { Theme } from '../util/theme.js'; +import { ConfirmationDialog } from './ConfirmationDialog.js'; +import { usePrevious } from '../hooks/usePrevious.js'; +import { useReducedMotion } from '../hooks/useReducedMotion.js'; +import { drop } from '../util/drop.js'; enum ConfirmDialogState { None = 'None', diff --git a/ts/components/CallingPip.stories.tsx b/ts/components/CallingPip.stories.tsx index 31ab480b9ce..b06b19a63bf 100644 --- a/ts/components/CallingPip.stories.tsx +++ b/ts/components/CallingPip.stories.tsx @@ -5,23 +5,23 @@ import * as React from 'react'; import { times } from 'lodash'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { AvatarColors } from '../types/Colors'; -import type { ConversationType } from '../state/ducks/conversations'; -import type { PropsType } from './CallingPip'; -import { CallingPip } from './CallingPip'; -import type { ActiveDirectCallType } from '../types/Calling'; +import { AvatarColors } from '../types/Colors.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import type { PropsType } from './CallingPip.js'; +import { CallingPip } from './CallingPip.js'; +import type { ActiveDirectCallType } from '../types/Calling.js'; import { CallViewMode, CallState, GroupCallConnectionState, GroupCallJoinState, -} from '../types/Calling'; -import { CallMode } from '../types/CallDisposition'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation'; -import { fakeGetGroupCallVideoFrameSource } from '../test-helpers/fakeGetGroupCallVideoFrameSource'; -import { MINUTE } from '../util/durations'; -import type { SetRendererCanvasType } from '../state/ducks/calling'; -import { createCallParticipant } from '../test-helpers/createCallParticipant'; +} from '../types/Calling.js'; +import { CallMode } from '../types/CallDisposition.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; +import { fakeGetGroupCallVideoFrameSource } from '../test-helpers/fakeGetGroupCallVideoFrameSource.js'; +import { MINUTE } from '../util/durations/index.js'; +import type { SetRendererCanvasType } from '../state/ducks/calling.js'; +import { createCallParticipant } from '../test-helpers/createCallParticipant.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CallingPip.tsx b/ts/components/CallingPip.tsx index 5384a94866a..1375ac8f109 100644 --- a/ts/components/CallingPip.tsx +++ b/ts/components/CallingPip.tsx @@ -7,22 +7,25 @@ import { minBy, debounce, noop } from 'lodash'; import type { VideoFrameSource } from '@signalapp/ringrtc'; -import { missingCaseError } from '../util/missingCaseError'; -import { isGroupOrAdhocActiveCall } from '../util/isGroupOrAdhocCall'; -import { useActivateSpeakerViewOnPresenting } from '../hooks/useActivateSpeakerViewOnPresenting'; -import { CallMode } from '../types/CallDisposition'; -import { TooltipPlacement } from './Tooltip'; -import { CallingButton, CallingButtonType } from './CallingButton'; -import { CallingPipRemoteVideo } from './CallingPipRemoteVideo'; -import { CallBackgroundBlur } from './CallBackgroundBlur'; +import { missingCaseError } from '../util/missingCaseError.js'; +import { isGroupOrAdhocActiveCall } from '../util/isGroupOrAdhocCall.js'; +import { useActivateSpeakerViewOnPresenting } from '../hooks/useActivateSpeakerViewOnPresenting.js'; +import { CallMode } from '../types/CallDisposition.js'; +import { TooltipPlacement } from './Tooltip.js'; +import { CallingButton, CallingButtonType } from './CallingButton.js'; +import { CallingPipRemoteVideo } from './CallingPipRemoteVideo.js'; +import { CallBackgroundBlur } from './CallBackgroundBlur.js'; -import type { LocalizerType } from '../types/Util'; -import type { ActiveCallType, GroupCallVideoRequest } from '../types/Calling'; -import type { SetRendererCanvasType } from '../state/ducks/calling'; -import type { CallingImageDataCache } from './CallManager'; -import type { ConversationType } from '../state/ducks/conversations'; -import { Avatar, AvatarSize } from './Avatar'; -import { AvatarColors } from '../types/Colors'; +import type { LocalizerType } from '../types/Util.js'; +import type { + ActiveCallType, + GroupCallVideoRequest, +} from '../types/Calling.js'; +import type { SetRendererCanvasType } from '../state/ducks/calling.js'; +import type { CallingImageDataCache } from './CallManager.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import { Avatar, AvatarSize } from './Avatar.js'; +import { AvatarColors } from '../types/Colors.js'; enum PositionMode { BeingDragged, diff --git a/ts/components/CallingPipRemoteVideo.tsx b/ts/components/CallingPipRemoteVideo.tsx index e649fd4966c..3ff4cdb57a1 100644 --- a/ts/components/CallingPipRemoteVideo.tsx +++ b/ts/components/CallingPipRemoteVideo.tsx @@ -4,34 +4,34 @@ import React, { useEffect } from 'react'; import { clamp, isNumber, maxBy } from 'lodash'; import type { VideoFrameSource } from '@signalapp/ringrtc'; -import { Avatar, AvatarSize } from './Avatar'; -import { CallBackgroundBlur } from './CallBackgroundBlur'; -import { DirectCallRemoteParticipant } from './DirectCallRemoteParticipant'; -import { GroupCallRemoteParticipant } from './GroupCallRemoteParticipant'; -import type { LocalizerType } from '../types/Util'; +import { Avatar, AvatarSize } from './Avatar.js'; +import { CallBackgroundBlur } from './CallBackgroundBlur.js'; +import { DirectCallRemoteParticipant } from './DirectCallRemoteParticipant.js'; +import { GroupCallRemoteParticipant } from './GroupCallRemoteParticipant.js'; +import type { LocalizerType } from '../types/Util.js'; import { GroupCallJoinState, type ActiveCallType, type GroupCallRemoteParticipantType, type GroupCallVideoRequest, -} from '../types/Calling'; -import { CallMode } from '../types/CallDisposition'; -import { AvatarColors } from '../types/Colors'; -import type { SetRendererCanvasType } from '../state/ducks/calling'; -import { useGetCallingFrameBuffer } from '../calling/useGetCallingFrameBuffer'; -import { MAX_FRAME_HEIGHT } from '../calling/constants'; -import { usePageVisibility } from '../hooks/usePageVisibility'; -import { missingCaseError } from '../util/missingCaseError'; -import { nonRenderedRemoteParticipant } from '../util/ringrtc/nonRenderedRemoteParticipant'; -import { isReconnecting } from '../util/callingIsReconnecting'; -import { isGroupOrAdhocActiveCall } from '../util/isGroupOrAdhocCall'; -import { assertDev } from '../util/assert'; -import type { CallingImageDataCache } from './CallManager'; +} from '../types/Calling.js'; +import { CallMode } from '../types/CallDisposition.js'; +import { AvatarColors } from '../types/Colors.js'; +import type { SetRendererCanvasType } from '../state/ducks/calling.js'; +import { useGetCallingFrameBuffer } from '../calling/useGetCallingFrameBuffer.js'; +import { MAX_FRAME_HEIGHT } from '../calling/constants.js'; +import { usePageVisibility } from '../hooks/usePageVisibility.js'; +import { missingCaseError } from '../util/missingCaseError.js'; +import { nonRenderedRemoteParticipant } from '../util/ringrtc/nonRenderedRemoteParticipant.js'; +import { isReconnecting } from '../util/callingIsReconnecting.js'; +import { isGroupOrAdhocActiveCall } from '../util/isGroupOrAdhocCall.js'; +import { assertDev } from '../util/assert.js'; +import type { CallingImageDataCache } from './CallManager.js'; import { PIP_MAXIMUM_HEIGHT_MULTIPLIER, PIP_MINIMUM_HEIGHT_MULTIPLIER, PIP_WIDTH_NORMAL, -} from './CallingPip'; +} from './CallingPip.js'; function BlurredBackground({ activeCall, diff --git a/ts/components/CallingPreCallInfo.stories.tsx b/ts/components/CallingPreCallInfo.stories.tsx index b0ea785b7b7..3bbd978d040 100644 --- a/ts/components/CallingPreCallInfo.stories.tsx +++ b/ts/components/CallingPreCallInfo.stories.tsx @@ -4,14 +4,14 @@ import React from 'react'; import { times } from 'lodash'; import type { Meta } from '@storybook/react'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation'; -import type { PropsType } from './CallingPreCallInfo'; -import { CallingPreCallInfo, RingMode } from './CallingPreCallInfo'; -import type { ConversationType } from '../state/ducks/conversations'; -import { getPlaceholderContact } from '../state/selectors/conversations'; -import { generateAci } from '../types/ServiceId'; -import { FAKE_CALL_LINK } from '../test-helpers/fakeCallLink'; -import { callLinkToConversation } from '../util/callLinks'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; +import type { PropsType } from './CallingPreCallInfo.js'; +import { CallingPreCallInfo, RingMode } from './CallingPreCallInfo.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import { getPlaceholderContact } from '../state/selectors/conversations.js'; +import { generateAci } from '../types/ServiceId.js'; +import { FAKE_CALL_LINK } from '../test-helpers/fakeCallLink.js'; +import { callLinkToConversation } from '../util/callLinks.js'; const { i18n } = window.SignalContext; const getDefaultGroupConversation = () => diff --git a/ts/components/CallingPreCallInfo.tsx b/ts/components/CallingPreCallInfo.tsx index fa2db73b7dd..d7b0cd5b51a 100644 --- a/ts/components/CallingPreCallInfo.tsx +++ b/ts/components/CallingPreCallInfo.tsx @@ -3,13 +3,13 @@ import React from 'react'; import { partition } from 'lodash'; -import type { ConversationType } from '../state/ducks/conversations'; -import type { CallingConversationType } from '../types/Calling'; -import type { LocalizerType } from '../types/Util'; -import { Avatar, AvatarSize } from './Avatar'; -import { getParticipantName } from '../util/callingGetParticipantName'; -import { missingCaseError } from '../util/missingCaseError'; -import { UserText } from './UserText'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import type { CallingConversationType } from '../types/Calling.js'; +import type { LocalizerType } from '../types/Util.js'; +import { Avatar, AvatarSize } from './Avatar.js'; +import { getParticipantName } from '../util/callingGetParticipantName.js'; +import { missingCaseError } from '../util/missingCaseError.js'; +import { UserText } from './UserText.js'; export enum RingMode { WillNotRing, diff --git a/ts/components/CallingRaisedHandsList.stories.tsx b/ts/components/CallingRaisedHandsList.stories.tsx index e475c5011c1..e1450d52204 100644 --- a/ts/components/CallingRaisedHandsList.stories.tsx +++ b/ts/components/CallingRaisedHandsList.stories.tsx @@ -9,14 +9,14 @@ import type { Meta } from '@storybook/react'; import type { CallingRaisedHandsListButtonPropsType, PropsType, -} from './CallingRaisedHandsList'; +} from './CallingRaisedHandsList.js'; import { CallingRaisedHandsList, CallingRaisedHandsListButton, -} from './CallingRaisedHandsList'; -import type { ConversationType } from '../state/ducks/conversations'; -import { AvatarColors } from '../types/Colors'; -import { getDefaultConversationWithServiceId } from '../test-helpers/getDefaultConversation'; +} from './CallingRaisedHandsList.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import { AvatarColors } from '../types/Colors.js'; +import { getDefaultConversationWithServiceId } from '../test-helpers/getDefaultConversation.js'; const MAX_HANDS = 20; const LOCAL_DEMUX_ID = 1; diff --git a/ts/components/CallingRaisedHandsList.tsx b/ts/components/CallingRaisedHandsList.tsx index a2599b9c74a..6f7c2779323 100644 --- a/ts/components/CallingRaisedHandsList.tsx +++ b/ts/components/CallingRaisedHandsList.tsx @@ -4,17 +4,17 @@ import React from 'react'; import { animated, useSpring } from '@react-spring/web'; -import { Avatar, AvatarSize } from './Avatar'; -import { ContactName } from './conversation/ContactName'; -import type { ConversationsByDemuxIdType } from '../types/Calling'; -import type { ServiceIdString } from '../types/ServiceId'; -import type { LocalizerType } from '../types/Util'; -import type { ConversationType } from '../state/ducks/conversations'; -import { ModalHost } from './ModalHost'; -import { drop } from '../util/drop'; -import { createLogger } from '../logging/log'; -import { usePrevious } from '../hooks/usePrevious'; -import { useReducedMotion } from '../hooks/useReducedMotion'; +import { Avatar, AvatarSize } from './Avatar.js'; +import { ContactName } from './conversation/ContactName.js'; +import type { ConversationsByDemuxIdType } from '../types/Calling.js'; +import type { ServiceIdString } from '../types/ServiceId.js'; +import type { LocalizerType } from '../types/Util.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import { ModalHost } from './ModalHost.js'; +import { drop } from '../util/drop.js'; +import { createLogger } from '../logging/log.js'; +import { usePrevious } from '../hooks/usePrevious.js'; +import { useReducedMotion } from '../hooks/useReducedMotion.js'; const log = createLogger('CallingRaisedHandsList'); diff --git a/ts/components/CallingScreenSharingController.stories.tsx b/ts/components/CallingScreenSharingController.stories.tsx index 463c5de214d..0ffc8faea4a 100644 --- a/ts/components/CallingScreenSharingController.stories.tsx +++ b/ts/components/CallingScreenSharingController.stories.tsx @@ -5,10 +5,10 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './CallingScreenSharingController'; -import { CallingScreenSharingController } from './CallingScreenSharingController'; +import type { PropsType } from './CallingScreenSharingController.js'; +import { CallingScreenSharingController } from './CallingScreenSharingController.js'; -import { ScreenShareStatus } from '../types/Calling'; +import { ScreenShareStatus } from '../types/Calling.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CallingScreenSharingController.tsx b/ts/components/CallingScreenSharingController.tsx index 49b72ab76b8..e63572ca6dc 100644 --- a/ts/components/CallingScreenSharingController.tsx +++ b/ts/components/CallingScreenSharingController.tsx @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import { Button, ButtonVariant } from './Button'; -import type { LocalizerType } from '../types/Util'; -import { ScreenShareStatus } from '../types/Calling'; +import { Button, ButtonVariant } from './Button.js'; +import type { LocalizerType } from '../types/Util.js'; +import { ScreenShareStatus } from '../types/Calling.js'; export type PropsType = { i18n: LocalizerType; diff --git a/ts/components/CallingSelectPresentingSourcesModal.stories.tsx b/ts/components/CallingSelectPresentingSourcesModal.stories.tsx index efa671c8f3f..f64291e5076 100644 --- a/ts/components/CallingSelectPresentingSourcesModal.stories.tsx +++ b/ts/components/CallingSelectPresentingSourcesModal.stories.tsx @@ -5,8 +5,8 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './CallingSelectPresentingSourcesModal'; -import { CallingSelectPresentingSourcesModal } from './CallingSelectPresentingSourcesModal'; +import type { PropsType } from './CallingSelectPresentingSourcesModal.js'; +import { CallingSelectPresentingSourcesModal } from './CallingSelectPresentingSourcesModal.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CallingSelectPresentingSourcesModal.tsx b/ts/components/CallingSelectPresentingSourcesModal.tsx index b431e10cb7a..6a7a27b8dde 100644 --- a/ts/components/CallingSelectPresentingSourcesModal.tsx +++ b/ts/components/CallingSelectPresentingSourcesModal.tsx @@ -4,12 +4,12 @@ import React, { useState } from 'react'; import classNames from 'classnames'; import { groupBy } from 'lodash'; -import { Button, ButtonVariant } from './Button'; -import type { LocalizerType } from '../types/Util'; -import { Modal } from './Modal'; -import type { PresentedSource, PresentableSource } from '../types/Calling'; -import { Theme } from '../util/theme'; -import { strictAssert } from '../util/assert'; +import { Button, ButtonVariant } from './Button.js'; +import type { LocalizerType } from '../types/Util.js'; +import { Modal } from './Modal.js'; +import type { PresentedSource, PresentableSource } from '../types/Calling.js'; +import { Theme } from '../util/theme.js'; +import { strictAssert } from '../util/assert.js'; export type PropsType = { i18n: LocalizerType; diff --git a/ts/components/CallingToast.tsx b/ts/components/CallingToast.tsx index f4a086c35bc..40f8c324c8a 100644 --- a/ts/components/CallingToast.tsx +++ b/ts/components/CallingToast.tsx @@ -14,11 +14,11 @@ import { createPortal } from 'react-dom'; import { useTransition, animated } from '@react-spring/web'; import classNames from 'classnames'; import { v4 as uuid } from 'uuid'; -import { useIsMounted } from '../hooks/useIsMounted'; -import type { LocalizerType } from '../types/I18N'; -import { usePrevious } from '../hooks/usePrevious'; -import { difference } from '../util/setUtil'; -import { useReducedMotion } from '../hooks/useReducedMotion'; +import { useIsMounted } from '../hooks/useIsMounted.js'; +import type { LocalizerType } from '../types/I18N.js'; +import { usePrevious } from '../hooks/usePrevious.js'; +import { difference } from '../util/setUtil.js'; +import { useReducedMotion } from '../hooks/useReducedMotion.js'; const DEFAULT_LIFETIME = 5000; const DEFAULT_TRANSITION_FROM = { diff --git a/ts/components/CallingToastManager.tsx b/ts/components/CallingToastManager.tsx index 331be88d7ba..16c32510c3c 100644 --- a/ts/components/CallingToastManager.tsx +++ b/ts/components/CallingToastManager.tsx @@ -2,17 +2,20 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { useEffect, useMemo, useRef } from 'react'; -import type { ActiveCallType, ObservedRemoteMuteType } from '../types/Calling'; -import { CallMode } from '../types/CallDisposition'; -import type { ConversationType } from '../state/ducks/conversations'; -import type { LocalizerType } from '../types/Util'; -import { CallingToastProvider, useCallingToasts } from './CallingToast'; -import { usePrevious } from '../hooks/usePrevious'; -import { difference as setDifference } from '../util/setUtil'; -import { isMoreRecentThan } from '../util/timestamp'; -import { isGroupOrAdhocActiveCall } from '../util/isGroupOrAdhocCall'; -import { SECOND } from '../util/durations'; -import type { SetMutedByType } from '../state/ducks/calling'; +import type { + ActiveCallType, + ObservedRemoteMuteType, +} from '../types/Calling.js'; +import { CallMode } from '../types/CallDisposition.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import type { LocalizerType } from '../types/Util.js'; +import { CallingToastProvider, useCallingToasts } from './CallingToast.js'; +import { usePrevious } from '../hooks/usePrevious.js'; +import { difference as setDifference } from '../util/setUtil.js'; +import { isMoreRecentThan } from '../util/timestamp.js'; +import { isGroupOrAdhocActiveCall } from '../util/isGroupOrAdhocCall.js'; +import { SECOND } from '../util/durations/index.js'; +import type { SetMutedByType } from '../state/ducks/calling.js'; type PropsType = { activeCall: ActiveCallType; diff --git a/ts/components/CallsList.tsx b/ts/components/CallsList.tsx index f277bae69be..fd91edd1208 100644 --- a/ts/components/CallsList.tsx +++ b/ts/components/CallsList.tsx @@ -12,15 +12,15 @@ import React, { import type { Index, IndexRange, ListRowProps } from 'react-virtualized'; import { InfiniteLoader, List } from 'react-virtualized'; import classNames from 'classnames'; -import type { LocalizerType } from '../types/I18N'; -import { ListTile } from './ListTile'; -import { Avatar, AvatarSize } from './Avatar'; -import { SearchInput } from './SearchInput'; +import type { LocalizerType } from '../types/I18N.js'; +import { ListTile } from './ListTile.js'; +import { Avatar, AvatarSize } from './Avatar.js'; +import { SearchInput } from './SearchInput.js'; import type { CallHistoryFilterOptions, CallHistoryGroup, CallHistoryPagination, -} from '../types/CallDisposition'; +} from '../types/CallDisposition.js'; import { CallHistoryFilterStatus, CallDirection, @@ -29,49 +29,49 @@ import { GroupCallStatus, isSameCallHistoryGroup, CallMode, -} from '../types/CallDisposition'; +} from '../types/CallDisposition.js'; import { formatDateTimeShort, isMoreRecentThan, toBoundedDate, -} from '../util/timestamp'; -import type { ConversationType } from '../state/ducks/conversations'; -import { createLogger } from '../logging/log'; -import { refMerger } from '../util/refMerger'; -import { drop } from '../util/drop'; -import { strictAssert } from '../util/assert'; -import { UserText } from './UserText'; -import { I18n } from './I18n'; -import { NavSidebarSearchHeader, NavSidebarEmpty } from './NavSidebar'; -import { SizeObserver } from '../hooks/useSizeObserver'; +} from '../util/timestamp.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import { createLogger } from '../logging/log.js'; +import { refMerger } from '../util/refMerger.js'; +import { drop } from '../util/drop.js'; +import { strictAssert } from '../util/assert.js'; +import { UserText } from './UserText.js'; +import { I18n } from './I18n.js'; +import { NavSidebarSearchHeader, NavSidebarEmpty } from './NavSidebar.js'; +import { SizeObserver } from '../hooks/useSizeObserver.js'; import { formatCallHistoryGroup, getCallIdFromEra, -} from '../util/callDisposition'; -import { CallsNewCallButton } from './CallsNewCallButton'; -import { Tooltip, TooltipPlacement } from './Tooltip'; -import { Theme } from '../util/theme'; -import type { CallingConversationType } from '../types/Calling'; -import type { CallLinkType } from '../types/CallLink'; +} from '../util/callDisposition.js'; +import { CallsNewCallButton } from './CallsNewCallButton.js'; +import { Tooltip, TooltipPlacement } from './Tooltip.js'; +import { Theme } from '../util/theme.js'; +import type { CallingConversationType } from '../types/Calling.js'; +import type { CallLinkType } from '../types/CallLink.js'; import { callLinkToConversation, getPlaceholderCallLinkConversation, -} from '../util/callLinks'; -import type { CallsTabSelectedView } from './CallsTab'; -import type { CallStateType } from '../state/selectors/calling'; +} from '../util/callLinks.js'; +import type { CallsTabSelectedView } from './CallsTab.js'; +import type { CallStateType } from '../state/selectors/calling.js'; import { isGroupOrAdhocCallMode, isGroupOrAdhocCallState, -} from '../util/isGroupOrAdhocCall'; -import { isAnybodyInGroupCall } from '../state/ducks/callingHelpers'; +} from '../util/isGroupOrAdhocCall.js'; +import { isAnybodyInGroupCall } from '../state/ducks/callingHelpers.js'; import type { ActiveCallStateType, PeekNotConnectedGroupCallType, -} from '../state/ducks/calling'; -import { DAY, MINUTE, SECOND } from '../util/durations'; -import type { StartCallData } from './ConfirmLeaveCallModal'; -import { Button, ButtonVariant } from './Button'; -import type { ICUJSXMessageParamsByKeyType } from '../types/Util'; +} from '../state/ducks/calling.js'; +import { DAY, MINUTE, SECOND } from '../util/durations/index.js'; +import type { StartCallData } from './ConfirmLeaveCallModal.js'; +import { Button, ButtonVariant } from './Button.js'; +import type { ICUJSXMessageParamsByKeyType } from '../types/Util.js'; const log = createLogger('CallsList'); diff --git a/ts/components/CallsNewCallButton.tsx b/ts/components/CallsNewCallButton.tsx index c7576d4c52b..e70831ca657 100644 --- a/ts/components/CallsNewCallButton.tsx +++ b/ts/components/CallsNewCallButton.tsx @@ -7,23 +7,23 @@ import { partition } from 'lodash'; import type { ListRowProps } from 'react-virtualized'; import { List } from 'react-virtualized'; import classNames from 'classnames'; -import type { ConversationType } from '../state/ducks/conversations'; -import type { LocalizerType } from '../types/I18N'; -import { SearchInput } from './SearchInput'; -import { filterAndSortConversations } from '../util/filterAndSortConversations'; -import { NavSidebarSearchHeader } from './NavSidebar'; -import { ListTile } from './ListTile'; -import { strictAssert } from '../util/assert'; -import { UserText } from './UserText'; -import { Avatar, AvatarSize } from './Avatar'; -import { I18n } from './I18n'; -import { SizeObserver } from '../hooks/useSizeObserver'; -import { CallType } from '../types/CallDisposition'; -import type { CallsTabSelectedView } from './CallsTab'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import type { LocalizerType } from '../types/I18N.js'; +import { SearchInput } from './SearchInput.js'; +import { filterAndSortConversations } from '../util/filterAndSortConversations.js'; +import { NavSidebarSearchHeader } from './NavSidebar.js'; +import { ListTile } from './ListTile.js'; +import { strictAssert } from '../util/assert.js'; +import { UserText } from './UserText.js'; +import { Avatar, AvatarSize } from './Avatar.js'; +import { I18n } from './I18n.js'; +import { SizeObserver } from '../hooks/useSizeObserver.js'; +import { CallType } from '../types/CallDisposition.js'; +import type { CallsTabSelectedView } from './CallsTab.js'; import { InAnotherCallTooltip, getTooltipContent, -} from './conversation/InAnotherCallTooltip'; +} from './conversation/InAnotherCallTooltip.js'; type CallsNewCallProps = Readonly<{ hasActiveCall: boolean; diff --git a/ts/components/CallsTab.tsx b/ts/components/CallsTab.tsx index 654db25f970..4727d99a344 100644 --- a/ts/components/CallsTab.tsx +++ b/ts/components/CallsTab.tsx @@ -2,29 +2,29 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { useCallback, useEffect, useState } from 'react'; -import type { LocalizerType } from '../types/I18N'; -import { NavSidebar, NavSidebarActionButton } from './NavSidebar'; -import { CallsList } from './CallsList'; -import type { ConversationType } from '../state/ducks/conversations'; +import type { LocalizerType } from '../types/I18N.js'; +import { NavSidebar, NavSidebarActionButton } from './NavSidebar.js'; +import { CallsList } from './CallsList.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; import type { CallHistoryFilterOptions, CallHistoryGroup, CallHistoryPagination, -} from '../types/CallDisposition'; -import { CallsNewCall } from './CallsNewCallButton'; -import { useEscapeHandling } from '../hooks/useEscapeHandling'; +} from '../types/CallDisposition.js'; +import { CallsNewCall } from './CallsNewCallButton.js'; +import { useEscapeHandling } from '../hooks/useEscapeHandling.js'; import type { ActiveCallStateType, PeekNotConnectedGroupCallType, -} from '../state/ducks/calling'; -import { ContextMenu } from './ContextMenu'; -import { ConfirmationDialog } from './ConfirmationDialog'; -import type { UnreadStats } from '../util/countUnreadStats'; -import type { WidthBreakpoint } from './_util'; -import type { CallLinkType } from '../types/CallLink'; -import type { CallStateType } from '../state/selectors/calling'; -import type { StartCallData } from './ConfirmLeaveCallModal'; -import { I18n } from './I18n'; +} from '../state/ducks/calling.js'; +import { ContextMenu } from './ContextMenu.js'; +import { ConfirmationDialog } from './ConfirmationDialog.js'; +import type { UnreadStats } from '../util/countUnreadStats.js'; +import type { WidthBreakpoint } from './_util.js'; +import type { CallLinkType } from '../types/CallLink.js'; +import type { CallStateType } from '../state/selectors/calling.js'; +import type { StartCallData } from './ConfirmLeaveCallModal.js'; +import { I18n } from './I18n.js'; enum CallsTabSidebarView { CallsListView, diff --git a/ts/components/CaptchaDialog.stories.tsx b/ts/components/CaptchaDialog.stories.tsx index b84d55b7ed6..37ffaee4808 100644 --- a/ts/components/CaptchaDialog.stories.tsx +++ b/ts/components/CaptchaDialog.stories.tsx @@ -4,9 +4,9 @@ import React, { useState } from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './CaptchaDialog'; -import { CaptchaDialog } from './CaptchaDialog'; -import { Button } from './Button'; +import type { PropsType } from './CaptchaDialog.js'; +import { CaptchaDialog } from './CaptchaDialog.js'; +import { Button } from './Button.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CaptchaDialog.tsx b/ts/components/CaptchaDialog.tsx index 2cd15c0a14b..2e4f0ff9ac7 100644 --- a/ts/components/CaptchaDialog.tsx +++ b/ts/components/CaptchaDialog.tsx @@ -3,10 +3,10 @@ import React, { useRef, useState } from 'react'; -import type { LocalizerType } from '../types/Util'; -import { Button, ButtonVariant } from './Button'; -import { Modal } from './Modal'; -import { Spinner } from './Spinner'; +import type { LocalizerType } from '../types/Util.js'; +import { Button, ButtonVariant } from './Button.js'; +import { Modal } from './Modal.js'; +import { Spinner } from './Spinner.js'; export type PropsType = Readonly<{ i18n: LocalizerType; diff --git a/ts/components/ChatColorPicker.stories.tsx b/ts/components/ChatColorPicker.stories.tsx index 0c6bbcb6713..af5383badc9 100644 --- a/ts/components/ChatColorPicker.stories.tsx +++ b/ts/components/ChatColorPicker.stories.tsx @@ -4,9 +4,9 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './ChatColorPicker'; -import { ChatColorPicker } from './ChatColorPicker'; -import { ConversationColors } from '../types/Colors'; +import type { PropsType } from './ChatColorPicker.js'; +import { ChatColorPicker } from './ChatColorPicker.js'; +import { ConversationColors } from '../types/Colors.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/ChatColorPicker.tsx b/ts/components/ChatColorPicker.tsx index eb559d9295c..9580f0ebc86 100644 --- a/ts/components/ChatColorPicker.tsx +++ b/ts/components/ChatColorPicker.tsx @@ -5,18 +5,21 @@ import type { KeyboardEvent, MouseEvent } from 'react'; import React, { useRef, useState } from 'react'; import classNames from 'classnames'; import { ContextMenu, ContextMenuTrigger, MenuItem } from 'react-contextmenu'; -import { ConfirmationDialog } from './ConfirmationDialog'; -import { CustomColorEditor } from './CustomColorEditor'; -import { Modal } from './Modal'; -import type { ConversationColorType, CustomColorType } from '../types/Colors'; -import { ConversationColors } from '../types/Colors'; -import type { ConversationType } from '../state/ducks/conversations'; -import type { LocalizerType } from '../types/Util'; -import { SampleMessageBubbles } from './SampleMessageBubbles'; -import { PanelRow } from './conversation/conversation-details/PanelRow'; -import { getCustomColorStyle } from '../util/getCustomColorStyle'; +import { ConfirmationDialog } from './ConfirmationDialog.js'; +import { CustomColorEditor } from './CustomColorEditor.js'; +import { Modal } from './Modal.js'; +import type { + ConversationColorType, + CustomColorType, +} from '../types/Colors.js'; +import { ConversationColors } from '../types/Colors.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import type { LocalizerType } from '../types/Util.js'; +import { SampleMessageBubbles } from './SampleMessageBubbles.js'; +import { PanelRow } from './conversation/conversation-details/PanelRow.js'; +import { getCustomColorStyle } from '../util/getCustomColorStyle.js'; -import { useDelayedRestoreFocus } from '../hooks/useRestoreFocus'; +import { useDelayedRestoreFocus } from '../hooks/useRestoreFocus.js'; type CustomColorDataType = { id?: string; diff --git a/ts/components/ChatsTab.stories.tsx b/ts/components/ChatsTab.stories.tsx index bf790200e36..a0517f76fe7 100644 --- a/ts/components/ChatsTab.stories.tsx +++ b/ts/components/ChatsTab.stories.tsx @@ -3,9 +3,9 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { ComponentMeta } from '../storybook/types'; -import type { ChatsTabProps } from './ChatsTab'; -import { ChatsTab } from './ChatsTab'; +import type { ComponentMeta } from '../storybook/types.js'; +import type { ChatsTabProps } from './ChatsTab.js'; +import { ChatsTab } from './ChatsTab.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/ChatsTab.tsx b/ts/components/ChatsTab.tsx index 9a464421b5a..14cd935c707 100644 --- a/ts/components/ChatsTab.tsx +++ b/ts/components/ChatsTab.tsx @@ -2,11 +2,11 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import type { LocalizerType } from '../types/I18N'; -import type { NavTabPanelProps } from './NavTabs'; -import { WhatsNewLink } from './WhatsNewLink'; -import type { UnreadStats } from '../util/countUnreadStats'; -import type { SmartConversationViewProps } from '../state/smart/ConversationView'; +import type { LocalizerType } from '../types/I18N.js'; +import type { NavTabPanelProps } from './NavTabs.js'; +import { WhatsNewLink } from './WhatsNewLink.js'; +import type { UnreadStats } from '../util/countUnreadStats.js'; +import type { SmartConversationViewProps } from '../state/smart/ConversationView.js'; export type ChatsTabProps = Readonly<{ otherTabsUnreadStats: UnreadStats; diff --git a/ts/components/Checkbox.stories.tsx b/ts/components/Checkbox.stories.tsx index 03a62196aab..bf69cf98d7d 100644 --- a/ts/components/Checkbox.stories.tsx +++ b/ts/components/Checkbox.stories.tsx @@ -5,8 +5,8 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './Checkbox'; -import { Checkbox } from './Checkbox'; +import type { PropsType } from './Checkbox.js'; +import { Checkbox } from './Checkbox.js'; const createProps = (): PropsType => ({ checked: false, diff --git a/ts/components/Checkbox.tsx b/ts/components/Checkbox.tsx index e6df20527ff..a11e882d2db 100644 --- a/ts/components/Checkbox.tsx +++ b/ts/components/Checkbox.tsx @@ -5,7 +5,7 @@ import type { ReactNode } from 'react'; import React, { forwardRef, useMemo } from 'react'; import { v4 as uuid } from 'uuid'; -import { getClassNamesFor } from '../util/getClassNamesFor'; +import { getClassNamesFor } from '../util/getClassNamesFor.js'; export type PropsType = { checked?: boolean; diff --git a/ts/components/CircleCheckbox.stories.tsx b/ts/components/CircleCheckbox.stories.tsx index 1e8b033b3f7..464d686f72c 100644 --- a/ts/components/CircleCheckbox.stories.tsx +++ b/ts/components/CircleCheckbox.stories.tsx @@ -4,8 +4,8 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './CircleCheckbox'; -import { CircleCheckbox, Variant } from './CircleCheckbox'; +import type { Props } from './CircleCheckbox.js'; +import { CircleCheckbox, Variant } from './CircleCheckbox.js'; const createProps = (): Props => ({ checked: false, diff --git a/ts/components/CircleCheckbox.tsx b/ts/components/CircleCheckbox.tsx index 1350c48a2fe..d836e302d31 100644 --- a/ts/components/CircleCheckbox.tsx +++ b/ts/components/CircleCheckbox.tsx @@ -4,8 +4,8 @@ import React, { useCallback } from 'react'; import classNames from 'classnames'; -import { getClassNamesFor } from '../util/getClassNamesFor'; -import { missingCaseError } from '../util/missingCaseError'; +import { getClassNamesFor } from '../util/getClassNamesFor.js'; +import { missingCaseError } from '../util/missingCaseError.js'; export enum Variant { Normal = 'Normal', diff --git a/ts/components/ClearingData.stories.tsx b/ts/components/ClearingData.stories.tsx index cf9f6121ca1..8e9ace04977 100644 --- a/ts/components/ClearingData.stories.tsx +++ b/ts/components/ClearingData.stories.tsx @@ -4,8 +4,8 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './ClearingData'; -import { ClearingData } from './ClearingData'; +import type { PropsType } from './ClearingData.js'; +import { ClearingData } from './ClearingData.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/ClearingData.tsx b/ts/components/ClearingData.tsx index 0a7b7c2672d..fd16e9b4514 100644 --- a/ts/components/ClearingData.tsx +++ b/ts/components/ClearingData.tsx @@ -3,10 +3,10 @@ import React, { useEffect } from 'react'; -import type { LocalizerType } from '../types/Util'; -import { TitlebarDragArea } from './TitlebarDragArea'; -import { ProgressBar } from './ProgressBar'; -import { InstallScreenSignalLogo } from './installScreen/InstallScreenSignalLogo'; +import type { LocalizerType } from '../types/Util.js'; +import { TitlebarDragArea } from './TitlebarDragArea.js'; +import { ProgressBar } from './ProgressBar.js'; +import { InstallScreenSignalLogo } from './installScreen/InstallScreenSignalLogo.js'; export type PropsType = { deleteAllData: () => void; diff --git a/ts/components/CollidingAvatars.stories.tsx b/ts/components/CollidingAvatars.stories.tsx index 171512a0c5c..3a6e526f605 100644 --- a/ts/components/CollidingAvatars.stories.tsx +++ b/ts/components/CollidingAvatars.stories.tsx @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import type { PropsType } from './CollidingAvatars'; -import { CollidingAvatars } from './CollidingAvatars'; -import { type ComponentMeta } from '../storybook/types'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation'; +import type { PropsType } from './CollidingAvatars.js'; +import { CollidingAvatars } from './CollidingAvatars.js'; +import { type ComponentMeta } from '../storybook/types.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CollidingAvatars.tsx b/ts/components/CollidingAvatars.tsx index 84b12e2afbe..75bf1137e56 100644 --- a/ts/components/CollidingAvatars.tsx +++ b/ts/components/CollidingAvatars.tsx @@ -4,9 +4,9 @@ import { v4 as uuid } from 'uuid'; import React, { useMemo, useCallback } from 'react'; -import type { LocalizerType } from '../types/Util'; -import type { ConversationType } from '../state/ducks/conversations'; -import { Avatar, AvatarSize } from './Avatar'; +import type { LocalizerType } from '../types/Util.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import { Avatar, AvatarSize } from './Avatar.js'; export type PropsType = Readonly<{ i18n: LocalizerType; diff --git a/ts/components/CompositionArea.stories.tsx b/ts/components/CompositionArea.stories.tsx index 1b0b1d7d47a..4fc142a48f3 100644 --- a/ts/components/CompositionArea.stories.tsx +++ b/ts/components/CompositionArea.stories.tsx @@ -4,18 +4,18 @@ import React, { useContext, useState } from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { IMAGE_JPEG } from '../types/MIME'; -import type { Props } from './CompositionArea'; -import { CompositionArea } from './CompositionArea'; -import { StorybookThemeContext } from '../../.storybook/StorybookThemeContext'; +import { IMAGE_JPEG } from '../types/MIME.js'; +import type { Props } from './CompositionArea.js'; +import { CompositionArea } from './CompositionArea.js'; +import { StorybookThemeContext } from '../../.storybook/StorybookThemeContext.js'; -import { fakeDraftAttachment } from '../test-helpers/fakeAttachment'; -import { landscapeGreenUrl } from '../storybook/Fixtures'; -import { RecordingState } from '../types/AudioRecorder'; -import { ConversationColors } from '../types/Colors'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation'; -import { PaymentEventKind } from '../types/Payment'; -import { EmojiSkinTone } from './fun/data/emojis'; +import { fakeDraftAttachment } from '../test-helpers/fakeAttachment.js'; +import { landscapeGreenUrl } from '../storybook/Fixtures.js'; +import { RecordingState } from '../types/AudioRecorder.js'; +import { ConversationColors } from '../types/Colors.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; +import { PaymentEventKind } from '../types/Payment.js'; +import { EmojiSkinTone } from './fun/data/emojis.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CompositionArea.tsx b/ts/components/CompositionArea.tsx index efb68afb086..2c466535b95 100644 --- a/ts/components/CompositionArea.tsx +++ b/ts/components/CompositionArea.tsx @@ -7,86 +7,86 @@ import type { ReadonlyDeep } from 'type-fest'; import type { DraftBodyRanges, HydratedBodyRangesType, -} from '../types/BodyRange'; -import type { LocalizerType, ThemeType } from '../types/Util'; -import type { ErrorDialogAudioRecorderType } from '../types/AudioRecorder'; -import { RecordingState } from '../types/AudioRecorder'; -import type { imageToBlurHash } from '../util/imageToBlurHash'; -import { dropNull } from '../util/dropNull'; -import { Spinner } from './Spinner'; +} from '../types/BodyRange.js'; +import type { LocalizerType, ThemeType } from '../types/Util.js'; +import type { ErrorDialogAudioRecorderType } from '../types/AudioRecorder.js'; +import { RecordingState } from '../types/AudioRecorder.js'; +import type { imageToBlurHash } from '../util/imageToBlurHash.js'; +import { dropNull } from '../util/dropNull.js'; +import { Spinner } from './Spinner.js'; import type { Props as EmojiButtonProps, EmojiButtonAPI, -} from './emoji/EmojiButton'; -import { EmojiButton } from './emoji/EmojiButton'; -import type { Props as StickerButtonProps } from './stickers/StickerButton'; -import { StickerButton } from './stickers/StickerButton'; +} from './emoji/EmojiButton.js'; +import { EmojiButton } from './emoji/EmojiButton.js'; +import type { Props as StickerButtonProps } from './stickers/StickerButton.js'; +import { StickerButton } from './stickers/StickerButton.js'; import type { InputApi, Props as CompositionInputProps, -} from './CompositionInput'; -import { CompositionInput } from './CompositionInput'; -import type { Props as MessageRequestActionsProps } from './conversation/MessageRequestActions'; -import { MessageRequestActions } from './conversation/MessageRequestActions'; -import type { PropsType as GroupV1DisabledActionsPropsType } from './conversation/GroupV1DisabledActions'; -import { GroupV1DisabledActions } from './conversation/GroupV1DisabledActions'; -import type { PropsType as GroupV2PendingApprovalActionsPropsType } from './conversation/GroupV2PendingApprovalActions'; -import { GroupV2PendingApprovalActions } from './conversation/GroupV2PendingApprovalActions'; -import { AnnouncementsOnlyGroupBanner } from './AnnouncementsOnlyGroupBanner'; -import { AttachmentList } from './conversation/AttachmentList'; +} from './CompositionInput.js'; +import { CompositionInput } from './CompositionInput.js'; +import type { Props as MessageRequestActionsProps } from './conversation/MessageRequestActions.js'; +import { MessageRequestActions } from './conversation/MessageRequestActions.js'; +import type { PropsType as GroupV1DisabledActionsPropsType } from './conversation/GroupV1DisabledActions.js'; +import { GroupV1DisabledActions } from './conversation/GroupV1DisabledActions.js'; +import type { PropsType as GroupV2PendingApprovalActionsPropsType } from './conversation/GroupV2PendingApprovalActions.js'; +import { GroupV2PendingApprovalActions } from './conversation/GroupV2PendingApprovalActions.js'; +import { AnnouncementsOnlyGroupBanner } from './AnnouncementsOnlyGroupBanner.js'; +import { AttachmentList } from './conversation/AttachmentList.js'; import type { AttachmentDraftType, InMemoryAttachmentDraftType, -} from '../types/Attachment'; -import { isImageAttachment, isVoiceMessage } from '../types/Attachment'; -import type { AciString } from '../types/ServiceId'; -import { AudioCapture } from './conversation/AudioCapture'; -import { CompositionUpload } from './CompositionUpload'; +} from '../types/Attachment.js'; +import { isImageAttachment, isVoiceMessage } from '../types/Attachment.js'; +import type { AciString } from '../types/ServiceId.js'; +import { AudioCapture } from './conversation/AudioCapture.js'; +import { CompositionUpload } from './CompositionUpload.js'; import type { ConversationRemovalStage, ConversationType, PushPanelForConversationActionType, ShowConversationType, -} from '../state/ducks/conversations'; -import type { EmojiPickDataType } from './emoji/EmojiPicker'; -import type { LinkPreviewForUIType } from '../types/message/LinkPreviews'; -import { isSameLinkPreview } from '../types/message/LinkPreviews'; +} from '../state/ducks/conversations.js'; +import type { EmojiPickDataType } from './emoji/EmojiPicker.js'; +import type { LinkPreviewForUIType } from '../types/message/LinkPreviews.js'; +import { isSameLinkPreview } from '../types/message/LinkPreviews.js'; -import { MandatoryProfileSharingActions } from './conversation/MandatoryProfileSharingActions'; -import { MediaQualitySelector } from './MediaQualitySelector'; -import type { Props as QuoteProps } from './conversation/Quote'; -import { Quote } from './conversation/Quote'; -import { countStickers } from './stickers/lib'; +import { MandatoryProfileSharingActions } from './conversation/MandatoryProfileSharingActions.js'; +import { MediaQualitySelector } from './MediaQualitySelector.js'; +import type { Props as QuoteProps } from './conversation/Quote.js'; +import { Quote } from './conversation/Quote.js'; +import { countStickers } from './stickers/lib.js'; import { useAttachFileShortcut, useEditLastMessageSent, useKeyboardShortcutsConditionally, -} from '../hooks/useKeyboardShortcuts'; -import { MediaEditor } from './MediaEditor'; -import { isImageTypeSupported } from '../util/GoogleChrome'; -import * as KeyboardLayout from '../services/keyboardLayout'; -import { usePrevious } from '../hooks/usePrevious'; -import { PanelType } from '../types/Panels'; -import type { SmartCompositionRecordingDraftProps } from '../state/smart/CompositionRecordingDraft'; -import { useEscapeHandling } from '../hooks/useEscapeHandling'; -import type { SmartCompositionRecordingProps } from '../state/smart/CompositionRecording'; -import SelectModeActions from './conversation/SelectModeActions'; -import type { ShowToastAction } from '../state/ducks/toast'; -import type { DraftEditMessageType } from '../model-types.d'; -import type { ForwardMessagesPayload } from '../state/ducks/globalModals'; -import { ForwardMessagesModalType } from './ForwardMessagesModal'; -import { SignalConversationMuteToggle } from './conversation/SignalConversationMuteToggle'; -import { FunPicker } from './fun/FunPicker'; -import type { FunEmojiSelection } from './fun/panels/FunPanelEmojis'; -import type { FunStickerSelection } from './fun/panels/FunPanelStickers'; -import type { FunGifSelection } from './fun/panels/FunPanelGifs'; -import type { SmartDraftGifMessageSendModalProps } from '../state/smart/DraftGifMessageSendModal'; -import { strictAssert } from '../util/assert'; -import { ConfirmationDialog } from './ConfirmationDialog'; -import type { EmojiSkinTone } from './fun/data/emojis'; -import type { StickerPackType, StickerType } from '../state/ducks/stickers'; -import { FunPickerButton } from './fun/FunButton'; -import { isFunPickerEnabled } from './fun/isFunPickerEnabled'; +} from '../hooks/useKeyboardShortcuts.js'; +import { MediaEditor } from './MediaEditor.js'; +import { isImageTypeSupported } from '../util/GoogleChrome.js'; +import * as KeyboardLayout from '../services/keyboardLayout.js'; +import { usePrevious } from '../hooks/usePrevious.js'; +import { PanelType } from '../types/Panels.js'; +import type { SmartCompositionRecordingDraftProps } from '../state/smart/CompositionRecordingDraft.js'; +import { useEscapeHandling } from '../hooks/useEscapeHandling.js'; +import type { SmartCompositionRecordingProps } from '../state/smart/CompositionRecording.js'; +import SelectModeActions from './conversation/SelectModeActions.js'; +import type { ShowToastAction } from '../state/ducks/toast.js'; +import type { DraftEditMessageType } from '../model-types.d.ts'; +import type { ForwardMessagesPayload } from '../state/ducks/globalModals.js'; +import { ForwardMessagesModalType } from './ForwardMessagesModal.js'; +import { SignalConversationMuteToggle } from './conversation/SignalConversationMuteToggle.js'; +import { FunPicker } from './fun/FunPicker.js'; +import type { FunEmojiSelection } from './fun/panels/FunPanelEmojis.js'; +import type { FunStickerSelection } from './fun/panels/FunPanelStickers.js'; +import type { FunGifSelection } from './fun/panels/FunPanelGifs.js'; +import type { SmartDraftGifMessageSendModalProps } from '../state/smart/DraftGifMessageSendModal.js'; +import { strictAssert } from '../util/assert.js'; +import { ConfirmationDialog } from './ConfirmationDialog.js'; +import type { EmojiSkinTone } from './fun/data/emojis.js'; +import type { StickerPackType, StickerType } from '../state/ducks/stickers.js'; +import { FunPickerButton } from './fun/FunButton.js'; +import { isFunPickerEnabled } from './fun/isFunPickerEnabled.js'; export type OwnProps = Readonly<{ acceptedMessageRequest: boolean | null; diff --git a/ts/components/CompositionInput.stories.tsx b/ts/components/CompositionInput.stories.tsx index 394201ca46c..355cf12cb60 100644 --- a/ts/components/CompositionInput.stories.tsx +++ b/ts/components/CompositionInput.stories.tsx @@ -6,12 +6,12 @@ import * as React from 'react'; import '@signalapp/quill-cjs/dist/quill.core.css'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation'; -import type { Props } from './CompositionInput'; -import { CompositionInput } from './CompositionInput'; -import { generateAci } from '../types/ServiceId'; -import { StorybookThemeContext } from '../../.storybook/StorybookThemeContext'; -import { EmojiSkinTone } from './fun/data/emojis'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; +import type { Props } from './CompositionInput.js'; +import { CompositionInput } from './CompositionInput.js'; +import { generateAci } from '../types/ServiceId.js'; +import { StorybookThemeContext } from '../../.storybook/StorybookThemeContext.js'; +import { EmojiSkinTone } from './fun/data/emojis.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CompositionInput.tsx b/ts/components/CompositionInput.tsx index 0e5849d00c0..bf3e83d05e0 100644 --- a/ts/components/CompositionInput.tsx +++ b/ts/components/CompositionInput.tsx @@ -15,36 +15,39 @@ import Emitter from '@signalapp/quill-cjs/core/emitter'; import type { Context } from '@signalapp/quill-cjs/modules/keyboard'; import type { Range as RangeStatic } from '@signalapp/quill-cjs'; -import { MentionCompletion } from '../quill/mentions/completion'; -import { FormattingMenu, QuillFormattingStyle } from '../quill/formatting/menu'; -import { MonospaceBlot } from '../quill/formatting/monospaceBlot'; -import { SpoilerBlot } from '../quill/formatting/spoilerBlot'; -import { EmojiBlot, EmojiCompletion } from '../quill/emoji'; -import type { EmojiPickDataType } from './emoji/EmojiPicker'; -import { convertShortName } from './emoji/lib'; +import { MentionCompletion } from '../quill/mentions/completion.js'; +import { + FormattingMenu, + QuillFormattingStyle, +} from '../quill/formatting/menu.js'; +import { MonospaceBlot } from '../quill/formatting/monospaceBlot.js'; +import { SpoilerBlot } from '../quill/formatting/spoilerBlot.js'; +import { EmojiBlot, EmojiCompletion } from '../quill/emoji/index.js'; +import type { EmojiPickDataType } from './emoji/EmojiPicker.js'; +import { convertShortName } from './emoji/lib.js'; import type { DraftBodyRanges, HydratedBodyRangesType, RangeNode, -} from '../types/BodyRange'; +} from '../types/BodyRange.js'; import { BodyRange, areBodyRangesEqual, collapseRangeTree, insertRange, -} from '../types/BodyRange'; -import type { LocalizerType, ThemeType } from '../types/Util'; -import type { ConversationType } from '../state/ducks/conversations'; -import type { PreferredBadgeSelectorType } from '../state/selectors/badges'; -import { isAciString } from '../util/isAciString'; -import { MentionBlot } from '../quill/mentions/blot'; +} from '../types/BodyRange.js'; +import type { LocalizerType, ThemeType } from '../types/Util.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import type { PreferredBadgeSelectorType } from '../state/selectors/badges.js'; +import { isAciString } from '../util/isAciString.js'; +import { MentionBlot } from '../quill/mentions/blot.js'; import { matchEmojiImage, matchEmojiBlot, matchEmojiText, -} from '../quill/emoji/matchers'; -import { matchMention } from '../quill/mentions/matchers'; -import { MemberRepository } from '../quill/memberRepository'; +} from '../quill/emoji/matchers.js'; +import { matchMention } from '../quill/mentions/matchers.js'; +import { MemberRepository } from '../quill/memberRepository.js'; import { getDeltaToRemoveStaleMentions, getTextAndRangesFromOps, @@ -54,34 +57,34 @@ import { getDeltaToRestartEmoji, insertEmojiOps, insertFormattingAndMentionsOps, -} from '../quill/util'; -import { SignalClipboard } from '../quill/signal-clipboard'; -import { DirectionalBlot } from '../quill/block/blot'; -import { getClassNamesFor } from '../util/getClassNamesFor'; -import { isNotNil } from '../util/isNotNil'; -import { createLogger } from '../logging/log'; -import type { LinkPreviewForUIType } from '../types/message/LinkPreviews'; -import { StagedLinkPreview } from './conversation/StagedLinkPreview'; -import type { DraftEditMessageType } from '../model-types.d'; -import { usePrevious } from '../hooks/usePrevious'; +} from '../quill/util.js'; +import { SignalClipboard } from '../quill/signal-clipboard/index.js'; +import { DirectionalBlot } from '../quill/block/blot.js'; +import { getClassNamesFor } from '../util/getClassNamesFor.js'; +import { isNotNil } from '../util/isNotNil.js'; +import { createLogger } from '../logging/log.js'; +import type { LinkPreviewForUIType } from '../types/message/LinkPreviews.js'; +import { StagedLinkPreview } from './conversation/StagedLinkPreview.js'; +import type { DraftEditMessageType } from '../model-types.d.ts'; +import { usePrevious } from '../hooks/usePrevious.js'; import { matchBold, matchItalic, matchMonospace, matchSpoiler, matchStrikethrough, -} from '../quill/formatting/matchers'; -import { missingCaseError } from '../util/missingCaseError'; -import type { AutoSubstituteAsciiEmojisOptions } from '../quill/auto-substitute-ascii-emojis'; -import { AutoSubstituteAsciiEmojis } from '../quill/auto-substitute-ascii-emojis'; -import { dropNull } from '../util/dropNull'; -import { SimpleQuillWrapper } from './SimpleQuillWrapper'; -import type { EmojiSkinTone } from './fun/data/emojis'; -import { FUN_STATIC_EMOJI_CLASS } from './fun/FunEmoji'; -import { useFunEmojiSearch } from './fun/useFunEmojiSearch'; -import type { EmojiCompletionOptions } from '../quill/emoji/completion'; -import { useFunEmojiLocalizer } from './fun/useFunEmojiLocalizer'; -import { MAX_BODY_ATTACHMENT_BYTE_LENGTH } from '../util/longAttachment'; +} from '../quill/formatting/matchers.js'; +import { missingCaseError } from '../util/missingCaseError.js'; +import type { AutoSubstituteAsciiEmojisOptions } from '../quill/auto-substitute-ascii-emojis/index.js'; +import { AutoSubstituteAsciiEmojis } from '../quill/auto-substitute-ascii-emojis/index.js'; +import { dropNull } from '../util/dropNull.js'; +import { SimpleQuillWrapper } from './SimpleQuillWrapper.js'; +import type { EmojiSkinTone } from './fun/data/emojis.js'; +import { FUN_STATIC_EMOJI_CLASS } from './fun/FunEmoji.js'; +import { useFunEmojiSearch } from './fun/useFunEmojiSearch.js'; +import type { EmojiCompletionOptions } from '../quill/emoji/completion.js'; +import { useFunEmojiLocalizer } from './fun/useFunEmojiLocalizer.js'; +import { MAX_BODY_ATTACHMENT_BYTE_LENGTH } from '../util/longAttachment.js'; const log = createLogger('CompositionInput'); diff --git a/ts/components/CompositionRecording.stories.tsx b/ts/components/CompositionRecording.stories.tsx index 3c7b7f06cce..98b1ca3814a 100644 --- a/ts/components/CompositionRecording.stories.tsx +++ b/ts/components/CompositionRecording.stories.tsx @@ -4,8 +4,8 @@ import React, { useState } from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './CompositionRecording'; -import { CompositionRecording } from './CompositionRecording'; +import type { Props } from './CompositionRecording.js'; +import { CompositionRecording } from './CompositionRecording.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CompositionRecording.tsx b/ts/components/CompositionRecording.tsx index bb269196d8c..06e76a51009 100644 --- a/ts/components/CompositionRecording.tsx +++ b/ts/components/CompositionRecording.tsx @@ -3,17 +3,17 @@ import { noop } from 'lodash'; import React, { useEffect, useRef, useState } from 'react'; -import { useEscapeHandling } from '../hooks/useEscapeHandling'; -import type { HideToastAction, ShowToastAction } from '../state/ducks/toast'; -import type { InMemoryAttachmentDraftType } from '../types/Attachment'; -import { ErrorDialogAudioRecorderType } from '../types/AudioRecorder'; -import type { LocalizerType } from '../types/Util'; -import type { AnyToast } from '../types/Toast'; -import { ToastType } from '../types/Toast'; -import { DurationInSeconds, SECOND } from '../util/durations'; -import { durationToPlaybackText } from '../util/durationToPlaybackText'; -import { ConfirmationDialog } from './ConfirmationDialog'; -import { RecordingComposer } from './RecordingComposer'; +import { useEscapeHandling } from '../hooks/useEscapeHandling.js'; +import type { HideToastAction, ShowToastAction } from '../state/ducks/toast.js'; +import type { InMemoryAttachmentDraftType } from '../types/Attachment.js'; +import { ErrorDialogAudioRecorderType } from '../types/AudioRecorder.js'; +import type { LocalizerType } from '../types/Util.js'; +import type { AnyToast } from '../types/Toast.js'; +import { ToastType } from '../types/Toast.js'; +import { DurationInSeconds, SECOND } from '../util/durations/index.js'; +import { durationToPlaybackText } from '../util/durationToPlaybackText.js'; +import { ConfirmationDialog } from './ConfirmationDialog.js'; +import { RecordingComposer } from './RecordingComposer.js'; export type Props = { i18n: LocalizerType; diff --git a/ts/components/CompositionRecordingDraft.stories.tsx b/ts/components/CompositionRecordingDraft.stories.tsx index e7720b270de..85b11088c39 100644 --- a/ts/components/CompositionRecordingDraft.stories.tsx +++ b/ts/components/CompositionRecordingDraft.stories.tsx @@ -4,8 +4,8 @@ import React, { useState } from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './CompositionRecordingDraft'; -import { CompositionRecordingDraft } from './CompositionRecordingDraft'; +import type { Props } from './CompositionRecordingDraft.js'; +import { CompositionRecordingDraft } from './CompositionRecordingDraft.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CompositionRecordingDraft.tsx b/ts/components/CompositionRecordingDraft.tsx index a2f0bdd26c8..8db5846d9cf 100644 --- a/ts/components/CompositionRecordingDraft.tsx +++ b/ts/components/CompositionRecordingDraft.tsx @@ -2,14 +2,14 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { useState, useCallback, useRef } from 'react'; -import { useComputePeaks } from '../hooks/useComputePeaks'; -import type { LocalizerType } from '../types/Util'; -import { WaveformScrubber } from './conversation/WaveformScrubber'; -import { PlaybackButton } from './PlaybackButton'; -import { RecordingComposer } from './RecordingComposer'; -import { createLogger } from '../logging/log'; -import type { Size } from '../hooks/useSizeObserver'; -import { SizeObserver } from '../hooks/useSizeObserver'; +import { useComputePeaks } from '../hooks/useComputePeaks.js'; +import type { LocalizerType } from '../types/Util.js'; +import { WaveformScrubber } from './conversation/WaveformScrubber.js'; +import { PlaybackButton } from './PlaybackButton.js'; +import { RecordingComposer } from './RecordingComposer.js'; +import { createLogger } from '../logging/log.js'; +import type { Size } from '../hooks/useSizeObserver.js'; +import { SizeObserver } from '../hooks/useSizeObserver.js'; const log = createLogger('CompositionRecordingDraft'); diff --git a/ts/components/CompositionTextArea.tsx b/ts/components/CompositionTextArea.tsx index d3a5f3affb4..ddfedbb168d 100644 --- a/ts/components/CompositionTextArea.tsx +++ b/ts/components/CompositionTextArea.tsx @@ -2,26 +2,26 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { useRef, useCallback, useState } from 'react'; -import type { LocalizerType } from '../types/I18N'; -import type { EmojiPickDataType } from './emoji/EmojiPicker'; -import type { InputApi } from './CompositionInput'; -import { CompositionInput } from './CompositionInput'; -import { EmojiButton } from './emoji/EmojiButton'; +import type { LocalizerType } from '../types/I18N.js'; +import type { EmojiPickDataType } from './emoji/EmojiPicker.js'; +import type { InputApi } from './CompositionInput.js'; +import { CompositionInput } from './CompositionInput.js'; +import { EmojiButton } from './emoji/EmojiButton.js'; import { hydrateRanges, type DraftBodyRanges, type HydratedBodyRangesType, -} from '../types/BodyRange'; -import type { ThemeType } from '../types/Util'; -import type { Props as EmojiButtonProps } from './emoji/EmojiButton'; -import type { PreferredBadgeSelectorType } from '../state/selectors/badges'; -import * as grapheme from '../util/grapheme'; -import { FunEmojiPicker } from './fun/FunEmojiPicker'; -import type { FunEmojiSelection } from './fun/panels/FunPanelEmojis'; -import type { EmojiSkinTone } from './fun/data/emojis'; -import { FunEmojiPickerButton } from './fun/FunButton'; -import { isFunPickerEnabled } from './fun/isFunPickerEnabled'; -import type { GetConversationByIdType } from '../state/selectors/conversations'; +} from '../types/BodyRange.js'; +import type { ThemeType } from '../types/Util.js'; +import type { Props as EmojiButtonProps } from './emoji/EmojiButton.js'; +import type { PreferredBadgeSelectorType } from '../state/selectors/badges.js'; +import * as grapheme from '../util/grapheme.js'; +import { FunEmojiPicker } from './fun/FunEmojiPicker.js'; +import type { FunEmojiSelection } from './fun/panels/FunPanelEmojis.js'; +import type { EmojiSkinTone } from './fun/data/emojis.js'; +import { FunEmojiPickerButton } from './fun/FunButton.js'; +import { isFunPickerEnabled } from './fun/isFunPickerEnabled.js'; +import type { GetConversationByIdType } from '../state/selectors/conversations.js'; export type CompositionTextAreaProps = { bodyRanges: HydratedBodyRangesType | null; diff --git a/ts/components/CompositionUpload.tsx b/ts/components/CompositionUpload.tsx index 30dca0824e6..73c69752635 100644 --- a/ts/components/CompositionUpload.tsx +++ b/ts/components/CompositionUpload.tsx @@ -4,14 +4,14 @@ import type { ChangeEventHandler } from 'react'; import React, { forwardRef } from 'react'; -import type { AttachmentDraftType } from '../types/Attachment'; -import { isVideoAttachment, isImageAttachment } from '../types/Attachment'; -import type { LocalizerType } from '../types/Util'; +import type { AttachmentDraftType } from '../types/Attachment.js'; +import { isVideoAttachment, isImageAttachment } from '../types/Attachment.js'; +import type { LocalizerType } from '../types/Util.js'; import { getSupportedImageTypes, getSupportedVideoTypes, -} from '../util/GoogleChrome'; +} from '../util/GoogleChrome.js'; export type PropsType = { conversationId: string; diff --git a/ts/components/ConfirmDiscardDialog.stories.tsx b/ts/components/ConfirmDiscardDialog.stories.tsx index fba3078ac3f..31bd0f37935 100644 --- a/ts/components/ConfirmDiscardDialog.stories.tsx +++ b/ts/components/ConfirmDiscardDialog.stories.tsx @@ -5,8 +5,8 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { ConfirmDialogProps } from './ConfirmDiscardDialog'; -import { ConfirmDiscardDialog } from './ConfirmDiscardDialog'; +import type { ConfirmDialogProps } from './ConfirmDiscardDialog.js'; +import { ConfirmDiscardDialog } from './ConfirmDiscardDialog.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/ConfirmDiscardDialog.tsx b/ts/components/ConfirmDiscardDialog.tsx index e45cfeff983..2bd58c38355 100644 --- a/ts/components/ConfirmDiscardDialog.tsx +++ b/ts/components/ConfirmDiscardDialog.tsx @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import { ConfirmationDialog } from './ConfirmationDialog'; -import type { LocalizerType } from '../types/Util'; +import { ConfirmationDialog } from './ConfirmationDialog.js'; +import type { LocalizerType } from '../types/Util.js'; export type ConfirmDialogProps = { i18n: LocalizerType; diff --git a/ts/components/ConfirmLeaveCallModal.tsx b/ts/components/ConfirmLeaveCallModal.tsx index 298fd445e5b..ee289c73536 100644 --- a/ts/components/ConfirmLeaveCallModal.tsx +++ b/ts/components/ConfirmLeaveCallModal.tsx @@ -3,14 +3,14 @@ import React from 'react'; -import { ConfirmationDialog } from './ConfirmationDialog'; +import { ConfirmationDialog } from './ConfirmationDialog.js'; -import type { LocalizerType } from '../types/Util'; +import type { LocalizerType } from '../types/Util.js'; import type { StartCallingLobbyType, StartCallLinkLobbyByRoomIdType, StartCallLinkLobbyType, -} from '../state/ducks/calling'; +} from '../state/ducks/calling.js'; export type StartCallData = | ({ diff --git a/ts/components/ConfirmationDialog.stories.tsx b/ts/components/ConfirmationDialog.stories.tsx index 507f942dadb..e0aa7b1433a 100644 --- a/ts/components/ConfirmationDialog.stories.tsx +++ b/ts/components/ConfirmationDialog.stories.tsx @@ -5,8 +5,8 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './ConfirmationDialog'; -import { ConfirmationDialog } from './ConfirmationDialog'; +import type { Props } from './ConfirmationDialog.js'; +import { ConfirmationDialog } from './ConfirmationDialog.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/ConfirmationDialog.tsx b/ts/components/ConfirmationDialog.tsx index bb32d27686b..56c1aeb9aee 100644 --- a/ts/components/ConfirmationDialog.tsx +++ b/ts/components/ConfirmationDialog.tsx @@ -4,13 +4,13 @@ import type { MouseEvent } from 'react'; import React, { useCallback } from 'react'; import { animated } from '@react-spring/web'; -import { Button, ButtonVariant } from './Button'; -import type { LocalizerType } from '../types/Util'; -import { ModalHost } from './ModalHost'; -import { ModalPage } from './Modal'; -import type { Theme } from '../util/theme'; -import { useAnimated } from '../hooks/useAnimated'; -import { Spinner } from './Spinner'; +import { Button, ButtonVariant } from './Button.js'; +import type { LocalizerType } from '../types/Util.js'; +import { ModalHost } from './ModalHost.js'; +import { ModalPage } from './Modal.js'; +import type { Theme } from '../util/theme.js'; +import { useAnimated } from '../hooks/useAnimated.js'; +import { Spinner } from './Spinner.js'; export type ActionSpec = { action: () => unknown; diff --git a/ts/components/ContactPill.tsx b/ts/components/ContactPill.tsx index 3520a3eb4ea..facec14f43d 100644 --- a/ts/components/ContactPill.tsx +++ b/ts/components/ContactPill.tsx @@ -3,10 +3,10 @@ import React from 'react'; -import type { ConversationType } from '../state/ducks/conversations'; -import type { LocalizerType } from '../types/Util'; -import { ContactName } from './conversation/ContactName'; -import { Avatar, AvatarSize } from './Avatar'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import type { LocalizerType } from '../types/Util.js'; +import { ContactName } from './conversation/ContactName.js'; +import { Avatar, AvatarSize } from './Avatar.js'; export type PropsType = { i18n: LocalizerType; diff --git a/ts/components/ContactPills.stories.tsx b/ts/components/ContactPills.stories.tsx index 7613eea614b..1133d8b086f 100644 --- a/ts/components/ContactPills.stories.tsx +++ b/ts/components/ContactPills.stories.tsx @@ -7,11 +7,11 @@ import { times } from 'lodash'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { ContactPills } from './ContactPills'; -import type { PropsType as ContactPillPropsType } from './ContactPill'; -import { ContactPill } from './ContactPill'; -import { gifUrl } from '../storybook/Fixtures'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation'; +import { ContactPills } from './ContactPills.js'; +import type { PropsType as ContactPillPropsType } from './ContactPill.js'; +import { ContactPill } from './ContactPill.js'; +import { gifUrl } from '../storybook/Fixtures.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/ContactPills.tsx b/ts/components/ContactPills.tsx index c599000883b..298acabe10a 100644 --- a/ts/components/ContactPills.tsx +++ b/ts/components/ContactPills.tsx @@ -5,8 +5,8 @@ import type { ReactNode } from 'react'; import React, { useRef, useEffect, Children } from 'react'; import classNames from 'classnames'; -import { usePrevious } from '../hooks/usePrevious'; -import { scrollToBottom } from '../util/scrollUtil'; +import { usePrevious } from '../hooks/usePrevious.js'; +import { scrollToBottom } from '../util/scrollUtil.js'; type PropsType = { moduleClassName?: string; diff --git a/ts/components/ContextMenu.stories.tsx b/ts/components/ContextMenu.stories.tsx index 89d6ea7a36a..0b501c6c35d 100644 --- a/ts/components/ContextMenu.stories.tsx +++ b/ts/components/ContextMenu.stories.tsx @@ -5,8 +5,8 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './ContextMenu'; -import { ContextMenu } from './ContextMenu'; +import type { PropsType } from './ContextMenu.js'; +import { ContextMenu } from './ContextMenu.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/ContextMenu.tsx b/ts/components/ContextMenu.tsx index dddf4da4f29..f2c7ff1919b 100644 --- a/ts/components/ContextMenu.tsx +++ b/ts/components/ContextMenu.tsx @@ -9,11 +9,11 @@ import classNames from 'classnames'; import { usePopper } from 'react-popper'; import { noop } from 'lodash'; -import type { Theme } from '../util/theme'; -import type { LocalizerType } from '../types/Util'; -import { getClassNamesFor } from '../util/getClassNamesFor'; -import { themeClassName } from '../util/theme'; -import { handleOutsideClick } from '../util/handleOutsideClick'; +import type { Theme } from '../util/theme.js'; +import type { LocalizerType } from '../types/Util.js'; +import { getClassNamesFor } from '../util/getClassNamesFor.js'; +import { themeClassName } from '../util/theme.js'; +import { handleOutsideClick } from '../util/handleOutsideClick.js'; export type ContextMenuOptionType = Readonly<{ description?: string; diff --git a/ts/components/ConversationList.stories.tsx b/ts/components/ConversationList.stories.tsx index 60873432f8c..c024c044a96 100644 --- a/ts/components/ConversationList.stories.tsx +++ b/ts/components/ConversationList.stories.tsx @@ -6,16 +6,16 @@ import { times, omit } from 'lodash'; import { v4 as generateUuid } from 'uuid'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Row, PropsType } from './ConversationList'; -import { ConversationList, RowType } from './ConversationList'; -import { MessageSearchResult } from './conversationList/MessageSearchResult'; -import type { PropsData as ConversationListItemPropsType } from './conversationList/ConversationListItem'; -import { MessageStatuses } from './conversationList/ConversationListItem'; -import { ContactCheckboxDisabledReason } from './conversationList/ContactCheckbox'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation'; -import { ThemeType } from '../types/Util'; -import { StorybookThemeContext } from '../../.storybook/StorybookThemeContext'; -import { makeFakeLookupConversationWithoutServiceId } from '../test-helpers/fakeLookupConversationWithoutServiceId'; +import type { Row, PropsType } from './ConversationList.js'; +import { ConversationList, RowType } from './ConversationList.js'; +import { MessageSearchResult } from './conversationList/MessageSearchResult.js'; +import type { PropsData as ConversationListItemPropsType } from './conversationList/ConversationListItem.js'; +import { MessageStatuses } from './conversationList/ConversationListItem.js'; +import { ContactCheckboxDisabledReason } from './conversationList/ContactCheckbox.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; +import { ThemeType } from '../types/Util.js'; +import { StorybookThemeContext } from '../../.storybook/StorybookThemeContext.js'; +import { makeFakeLookupConversationWithoutServiceId } from '../test-helpers/fakeLookupConversationWithoutServiceId.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/ConversationList.tsx b/ts/components/ConversationList.tsx index 74072f040ef..079caf16e3a 100644 --- a/ts/components/ConversationList.tsx +++ b/ts/components/ConversationList.tsx @@ -7,37 +7,37 @@ import type { ListRowRenderer } from 'react-virtualized'; import classNames from 'classnames'; import { get, pick } from 'lodash'; -import { missingCaseError } from '../util/missingCaseError'; -import { assertDev } from '../util/assert'; -import type { ParsedE164Type } from '../util/libphonenumberInstance'; -import type { LocalizerType, ThemeType } from '../types/Util'; -import { ScrollBehavior } from '../types/Util'; -import { getNavSidebarWidthBreakpoint } from './_util'; -import type { PreferredBadgeSelectorType } from '../state/selectors/badges'; -import type { LookupConversationWithoutServiceIdActionsType } from '../util/lookupConversationWithoutServiceId'; -import type { ShowConversationType } from '../state/ducks/conversations'; +import { missingCaseError } from '../util/missingCaseError.js'; +import { assertDev } from '../util/assert.js'; +import type { ParsedE164Type } from '../util/libphonenumberInstance.js'; +import type { LocalizerType, ThemeType } from '../types/Util.js'; +import { ScrollBehavior } from '../types/Util.js'; +import { getNavSidebarWidthBreakpoint } from './_util.js'; +import type { PreferredBadgeSelectorType } from '../state/selectors/badges.js'; +import type { LookupConversationWithoutServiceIdActionsType } from '../util/lookupConversationWithoutServiceId.js'; +import type { ShowConversationType } from '../state/ducks/conversations.js'; -import type { PropsData as ConversationListItemPropsType } from './conversationList/ConversationListItem'; -import type { ContactCheckboxDisabledReason } from './conversationList/ContactCheckbox'; -import type { ContactListItemConversationType as ContactListItemPropsType } from './conversationList/ContactListItem'; -import type { GroupListItemConversationType } from './conversationList/GroupListItem'; -import { ConversationListItem } from './conversationList/ConversationListItem'; -import { ContactListItem } from './conversationList/ContactListItem'; -import { ContactCheckbox as ContactCheckboxComponent } from './conversationList/ContactCheckbox'; -import { PhoneNumberCheckbox as PhoneNumberCheckboxComponent } from './conversationList/PhoneNumberCheckbox'; -import { UsernameCheckbox as UsernameCheckboxComponent } from './conversationList/UsernameCheckbox'; +import type { PropsData as ConversationListItemPropsType } from './conversationList/ConversationListItem.js'; +import type { ContactCheckboxDisabledReason } from './conversationList/ContactCheckbox.js'; +import type { ContactListItemConversationType as ContactListItemPropsType } from './conversationList/ContactListItem.js'; +import type { GroupListItemConversationType } from './conversationList/GroupListItem.js'; +import { ConversationListItem } from './conversationList/ConversationListItem.js'; +import { ContactListItem } from './conversationList/ContactListItem.js'; +import { ContactCheckbox as ContactCheckboxComponent } from './conversationList/ContactCheckbox.js'; +import { PhoneNumberCheckbox as PhoneNumberCheckboxComponent } from './conversationList/PhoneNumberCheckbox.js'; +import { UsernameCheckbox as UsernameCheckboxComponent } from './conversationList/UsernameCheckbox.js'; import { ComposeStepButton, Icon as ComposeStepButtonIcon, -} from './conversationList/ComposeStepButton'; -import { StartNewConversation as StartNewConversationComponent } from './conversationList/StartNewConversation'; -import { SearchResultsLoadingFakeHeader as SearchResultsLoadingFakeHeaderComponent } from './conversationList/SearchResultsLoadingFakeHeader'; -import { SearchResultsLoadingFakeRow as SearchResultsLoadingFakeRowComponent } from './conversationList/SearchResultsLoadingFakeRow'; -import { UsernameSearchResultListItem } from './conversationList/UsernameSearchResultListItem'; -import { GroupListItem } from './conversationList/GroupListItem'; -import { ListView } from './ListView'; -import { Button, ButtonVariant } from './Button'; -import { ListTile } from './ListTile'; +} from './conversationList/ComposeStepButton.js'; +import { StartNewConversation as StartNewConversationComponent } from './conversationList/StartNewConversation.js'; +import { SearchResultsLoadingFakeHeader as SearchResultsLoadingFakeHeaderComponent } from './conversationList/SearchResultsLoadingFakeHeader.js'; +import { SearchResultsLoadingFakeRow as SearchResultsLoadingFakeRowComponent } from './conversationList/SearchResultsLoadingFakeRow.js'; +import { UsernameSearchResultListItem } from './conversationList/UsernameSearchResultListItem.js'; +import { GroupListItem } from './conversationList/GroupListItem.js'; +import { ListView } from './ListView.js'; +import { Button, ButtonVariant } from './Button.js'; +import { ListTile } from './ListTile.js'; export enum RowType { ArchiveButton = 'ArchiveButton', diff --git a/ts/components/CountryCodeSelect.stories.tsx b/ts/components/CountryCodeSelect.stories.tsx index f7722816253..ed38333ebd8 100644 --- a/ts/components/CountryCodeSelect.stories.tsx +++ b/ts/components/CountryCodeSelect.stories.tsx @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { useState } from 'react'; -import type { PropsType } from './CountryCodeSelect'; -import { CountryCodeSelect } from './CountryCodeSelect'; -import { type ComponentMeta } from '../storybook/types'; +import type { PropsType } from './CountryCodeSelect.js'; +import { CountryCodeSelect } from './CountryCodeSelect.js'; +import { type ComponentMeta } from '../storybook/types.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CountryCodeSelect.tsx b/ts/components/CountryCodeSelect.tsx index 569c86b58c0..a2441fe0ac2 100644 --- a/ts/components/CountryCodeSelect.tsx +++ b/ts/components/CountryCodeSelect.tsx @@ -4,10 +4,10 @@ import React, { useState, useCallback, useMemo } from 'react'; import Fuse from 'fuse.js'; -import type { LocalizerType } from '../types/Util'; -import type { CountryDataType } from '../util/getCountryData'; -import { Modal } from './Modal'; -import { SearchInput } from './SearchInput'; +import type { LocalizerType } from '../types/Util.js'; +import type { CountryDataType } from '../util/getCountryData.js'; +import { Modal } from './Modal.js'; +import { SearchInput } from './SearchInput.js'; export type PropsType = Readonly<{ i18n: LocalizerType; diff --git a/ts/components/CrashReportDialog.stories.tsx b/ts/components/CrashReportDialog.stories.tsx index ffe188fdf69..d53618220a0 100644 --- a/ts/components/CrashReportDialog.stories.tsx +++ b/ts/components/CrashReportDialog.stories.tsx @@ -5,9 +5,9 @@ import React, { useState } from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './CrashReportDialog'; -import { CrashReportDialog } from './CrashReportDialog'; -import { sleep } from '../util/sleep'; +import type { PropsType } from './CrashReportDialog.js'; +import { CrashReportDialog } from './CrashReportDialog.js'; +import { sleep } from '../util/sleep.js'; export default { title: 'Components/CrashReportDialog', diff --git a/ts/components/CrashReportDialog.tsx b/ts/components/CrashReportDialog.tsx index cde606b5c6a..c6b8ae6603d 100644 --- a/ts/components/CrashReportDialog.tsx +++ b/ts/components/CrashReportDialog.tsx @@ -3,10 +3,10 @@ import React from 'react'; -import type { LocalizerType } from '../types/Util'; -import { Button, ButtonVariant } from './Button'; -import { Modal } from './Modal'; -import { Spinner } from './Spinner'; +import type { LocalizerType } from '../types/Util.js'; +import { Button, ButtonVariant } from './Button.js'; +import { Modal } from './Modal.js'; +import { Spinner } from './Spinner.js'; type PropsActionsType = { writeCrashReportsToLog: () => void; diff --git a/ts/components/CriticalIdlePrimaryDeviceDialog.tsx b/ts/components/CriticalIdlePrimaryDeviceDialog.tsx index b9f12b4ba4a..ca16ecfe3d7 100644 --- a/ts/components/CriticalIdlePrimaryDeviceDialog.tsx +++ b/ts/components/CriticalIdlePrimaryDeviceDialog.tsx @@ -3,10 +3,10 @@ import React from 'react'; -import { LeftPaneDialog } from './LeftPaneDialog'; -import type { WidthBreakpoint } from './_util'; -import type { LocalizerType } from '../types/I18N'; -import { I18n } from './I18n'; +import { LeftPaneDialog } from './LeftPaneDialog.js'; +import type { WidthBreakpoint } from './_util.js'; +import type { LocalizerType } from '../types/I18N.js'; +import { I18n } from './I18n.js'; export type PropsType = { containerWidthBreakpoint: WidthBreakpoint; diff --git a/ts/components/CriticalIdlePrimaryDeviceModal.stories.tsx b/ts/components/CriticalIdlePrimaryDeviceModal.stories.tsx index a4c5a2d7749..ca09de0bea3 100644 --- a/ts/components/CriticalIdlePrimaryDeviceModal.stories.tsx +++ b/ts/components/CriticalIdlePrimaryDeviceModal.stories.tsx @@ -5,7 +5,7 @@ import type { Meta, StoryFn } from '@storybook/react'; import React, { type ComponentProps } from 'react'; import { action } from '@storybook/addon-actions'; -import { CriticalIdlePrimaryDeviceModal } from './CriticalIdlePrimaryDeviceModal'; +import { CriticalIdlePrimaryDeviceModal } from './CriticalIdlePrimaryDeviceModal.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CriticalIdlePrimaryDeviceModal.tsx b/ts/components/CriticalIdlePrimaryDeviceModal.tsx index 576cd86699c..64812915521 100644 --- a/ts/components/CriticalIdlePrimaryDeviceModal.tsx +++ b/ts/components/CriticalIdlePrimaryDeviceModal.tsx @@ -3,11 +3,11 @@ import * as React from 'react'; -import type { LocalizerType } from '../types/Util'; -import { Modal } from './Modal'; -import { Button, ButtonVariant } from './Button'; -import { CRITICAL_IDLE_PRIMARY_DEVICE_SUPPORT_PAGE } from './CriticalIdlePrimaryDeviceDialog'; -import { I18n } from './I18n'; +import type { LocalizerType } from '../types/Util.js'; +import { Modal } from './Modal.js'; +import { Button, ButtonVariant } from './Button.js'; +import { CRITICAL_IDLE_PRIMARY_DEVICE_SUPPORT_PAGE } from './CriticalIdlePrimaryDeviceDialog.js'; +import { I18n } from './I18n.js'; type PropsType = Readonly<{ i18n: LocalizerType; diff --git a/ts/components/CustomColorEditor.stories.tsx b/ts/components/CustomColorEditor.stories.tsx index e6ebbe32011..293097a5177 100644 --- a/ts/components/CustomColorEditor.stories.tsx +++ b/ts/components/CustomColorEditor.stories.tsx @@ -6,8 +6,8 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './CustomColorEditor'; -import { CustomColorEditor } from './CustomColorEditor'; +import type { PropsType } from './CustomColorEditor.js'; +import { CustomColorEditor } from './CustomColorEditor.js'; export default { title: 'Components/CustomColorEditor', diff --git a/ts/components/CustomColorEditor.tsx b/ts/components/CustomColorEditor.tsx index 16e6a773000..f94bcd15de4 100644 --- a/ts/components/CustomColorEditor.tsx +++ b/ts/components/CustomColorEditor.tsx @@ -2,15 +2,15 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { useState } from 'react'; -import { Button, ButtonVariant } from './Button'; -import { GradientDial, KnobType } from './GradientDial'; -import { SampleMessageBubbles } from './SampleMessageBubbles'; -import { Slider } from './Slider'; -import { Tabs } from './Tabs'; -import type { CustomColorType } from '../types/Colors'; -import type { LocalizerType } from '../types/Util'; -import { getHSL } from '../util/getHSL'; -import { getCustomColorStyle } from '../util/getCustomColorStyle'; +import { Button, ButtonVariant } from './Button.js'; +import { GradientDial, KnobType } from './GradientDial.js'; +import { SampleMessageBubbles } from './SampleMessageBubbles.js'; +import { Slider } from './Slider.js'; +import { Tabs } from './Tabs.js'; +import type { CustomColorType } from '../types/Colors.js'; +import type { LocalizerType } from '../types/Util.js'; +import { getHSL } from '../util/getHSL.js'; +import { getCustomColorStyle } from '../util/getCustomColorStyle.js'; export type PropsType = { customColor?: CustomColorType; diff --git a/ts/components/CustomizingPreferredReactionsModal.stories.tsx b/ts/components/CustomizingPreferredReactionsModal.stories.tsx index 16dd74c5fdc..b044941d23b 100644 --- a/ts/components/CustomizingPreferredReactionsModal.stories.tsx +++ b/ts/components/CustomizingPreferredReactionsModal.stories.tsx @@ -6,10 +6,10 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { DEFAULT_PREFERRED_REACTION_EMOJI } from '../reactions/constants'; -import type { PropsType } from './CustomizingPreferredReactionsModal'; -import { CustomizingPreferredReactionsModal } from './CustomizingPreferredReactionsModal'; -import { EmojiSkinTone } from './fun/data/emojis'; +import { DEFAULT_PREFERRED_REACTION_EMOJI } from '../reactions/constants.js'; +import type { PropsType } from './CustomizingPreferredReactionsModal.js'; +import { CustomizingPreferredReactionsModal } from './CustomizingPreferredReactionsModal.js'; +import { EmojiSkinTone } from './fun/data/emojis.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CustomizingPreferredReactionsModal.tsx b/ts/components/CustomizingPreferredReactionsModal.tsx index a1d585cc84e..b2e07e168c3 100644 --- a/ts/components/CustomizingPreferredReactionsModal.tsx +++ b/ts/components/CustomizingPreferredReactionsModal.tsx @@ -5,23 +5,23 @@ import React, { useState, useEffect, useCallback, useRef } from 'react'; import { usePopper } from 'react-popper'; import { isEqual, noop } from 'lodash'; -import type { LocalizerType } from '../types/Util'; -import { Modal } from './Modal'; -import { Button, ButtonVariant } from './Button'; +import type { LocalizerType } from '../types/Util.js'; +import { Modal } from './Modal.js'; +import { Button, ButtonVariant } from './Button.js'; import { ReactionPickerPicker, ReactionPickerPickerEmojiButton, ReactionPickerPickerStyle, -} from './ReactionPickerPicker'; -import { EmojiPicker } from './emoji/EmojiPicker'; -import { DEFAULT_PREFERRED_REACTION_EMOJI_SHORT_NAMES } from '../reactions/constants'; -import { convertShortName } from './emoji/lib'; -import { offsetDistanceModifier } from '../util/popperUtil'; -import { handleOutsideClick } from '../util/handleOutsideClick'; -import { EmojiSkinTone, getEmojiVariantByKey } from './fun/data/emojis'; -import { FunEmojiPicker } from './fun/FunEmojiPicker'; -import type { FunEmojiSelection } from './fun/panels/FunPanelEmojis'; -import { isFunPickerEnabled } from './fun/isFunPickerEnabled'; +} from './ReactionPickerPicker.js'; +import { EmojiPicker } from './emoji/EmojiPicker.js'; +import { DEFAULT_PREFERRED_REACTION_EMOJI_SHORT_NAMES } from '../reactions/constants.js'; +import { convertShortName } from './emoji/lib.js'; +import { offsetDistanceModifier } from '../util/popperUtil.js'; +import { handleOutsideClick } from '../util/handleOutsideClick.js'; +import { EmojiSkinTone, getEmojiVariantByKey } from './fun/data/emojis.js'; +import { FunEmojiPicker } from './fun/FunEmojiPicker.js'; +import type { FunEmojiSelection } from './fun/panels/FunPanelEmojis.js'; +import { isFunPickerEnabled } from './fun/isFunPickerEnabled.js'; export type PropsType = { draftPreferredReactions: ReadonlyArray; diff --git a/ts/components/DebugLogErrorModal.stories.tsx b/ts/components/DebugLogErrorModal.stories.tsx index 4db48fe1164..3edea1aee3f 100644 --- a/ts/components/DebugLogErrorModal.stories.tsx +++ b/ts/components/DebugLogErrorModal.stories.tsx @@ -5,8 +5,8 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './DebugLogErrorModal'; -import { DebugLogErrorModal } from './DebugLogErrorModal'; +import type { PropsType } from './DebugLogErrorModal.js'; +import { DebugLogErrorModal } from './DebugLogErrorModal.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/DebugLogErrorModal.tsx b/ts/components/DebugLogErrorModal.tsx index 47ab5719b63..163bd521935 100644 --- a/ts/components/DebugLogErrorModal.tsx +++ b/ts/components/DebugLogErrorModal.tsx @@ -3,9 +3,9 @@ import * as React from 'react'; -import type { LocalizerType } from '../types/Util'; -import { Modal } from './Modal'; -import { Button, ButtonVariant } from './Button'; +import type { LocalizerType } from '../types/Util.js'; +import { Modal } from './Modal.js'; +import { Button, ButtonVariant } from './Button.js'; export type PropsType = { description?: string; diff --git a/ts/components/DebugLogWindow.stories.tsx b/ts/components/DebugLogWindow.stories.tsx index 909cae0634e..4c8a50e35ac 100644 --- a/ts/components/DebugLogWindow.stories.tsx +++ b/ts/components/DebugLogWindow.stories.tsx @@ -5,9 +5,9 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './DebugLogWindow'; -import { DebugLogWindow } from './DebugLogWindow'; -import { sleep } from '../util/sleep'; +import type { PropsType } from './DebugLogWindow.js'; +import { DebugLogWindow } from './DebugLogWindow.js'; +import { sleep } from '../util/sleep.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/DebugLogWindow.tsx b/ts/components/DebugLogWindow.tsx index 83ba13c907f..f0920ad280f 100644 --- a/ts/components/DebugLogWindow.tsx +++ b/ts/components/DebugLogWindow.tsx @@ -4,18 +4,18 @@ import type { MouseEvent } from 'react'; import React, { useEffect, useState } from 'react'; import copyText from 'copy-text-to-clipboard'; -import type { LocalizerType } from '../types/Util'; -import * as Errors from '../types/errors'; -import type { AnyToast } from '../types/Toast'; -import { ToastType } from '../types/Toast'; -import { createLogger } from '../logging/log'; -import { Button, ButtonVariant } from './Button'; -import { Spinner } from './Spinner'; -import { ToastManager } from './ToastManager'; -import { createSupportUrl } from '../util/createSupportUrl'; -import { shouldNeverBeCalled } from '../util/shouldNeverBeCalled'; -import { openLinkInWebBrowser } from '../util/openLinkInWebBrowser'; -import { useEscapeHandling } from '../hooks/useEscapeHandling'; +import type { LocalizerType } from '../types/Util.js'; +import * as Errors from '../types/errors.js'; +import type { AnyToast } from '../types/Toast.js'; +import { ToastType } from '../types/Toast.js'; +import { createLogger } from '../logging/log.js'; +import { Button, ButtonVariant } from './Button.js'; +import { Spinner } from './Spinner.js'; +import { ToastManager } from './ToastManager.js'; +import { createSupportUrl } from '../util/createSupportUrl.js'; +import { shouldNeverBeCalled } from '../util/shouldNeverBeCalled.js'; +import { openLinkInWebBrowser } from '../util/openLinkInWebBrowser.js'; +import { useEscapeHandling } from '../hooks/useEscapeHandling.js'; const log = createLogger('DebugLogWindow'); diff --git a/ts/components/DeleteMessagesModal.stories.tsx b/ts/components/DeleteMessagesModal.stories.tsx index 387b217eb7e..457aae3ad92 100644 --- a/ts/components/DeleteMessagesModal.stories.tsx +++ b/ts/components/DeleteMessagesModal.stories.tsx @@ -5,8 +5,8 @@ import React from 'react'; import type { Meta, StoryFn } from '@storybook/react'; import { action } from '@storybook/addon-actions'; -import DeleteMessagesModal from './DeleteMessagesModal'; -import type { DeleteMessagesModalProps } from './DeleteMessagesModal'; +import DeleteMessagesModal from './DeleteMessagesModal.js'; +import type { DeleteMessagesModalProps } from './DeleteMessagesModal.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/DeleteMessagesModal.tsx b/ts/components/DeleteMessagesModal.tsx index 7d0f78337bf..6f1511298c6 100644 --- a/ts/components/DeleteMessagesModal.tsx +++ b/ts/components/DeleteMessagesModal.tsx @@ -2,11 +2,11 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import type { ActionSpec } from './ConfirmationDialog'; -import { ConfirmationDialog } from './ConfirmationDialog'; -import type { LocalizerType } from '../types/Util'; -import type { ShowToastAction } from '../state/ducks/toast'; -import { ToastType } from '../types/Toast'; +import type { ActionSpec } from './ConfirmationDialog.js'; +import { ConfirmationDialog } from './ConfirmationDialog.js'; +import type { LocalizerType } from '../types/Util.js'; +import type { ShowToastAction } from '../state/ducks/toast.js'; +import { ToastType } from '../types/Toast.js'; export type DeleteMessagesModalProps = Readonly<{ isMe: boolean; diff --git a/ts/components/DialogExpiredBuild.stories.tsx b/ts/components/DialogExpiredBuild.stories.tsx index e17a9eb73c7..d86a9289d6a 100644 --- a/ts/components/DialogExpiredBuild.stories.tsx +++ b/ts/components/DialogExpiredBuild.stories.tsx @@ -3,10 +3,10 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './DialogExpiredBuild'; -import { DialogExpiredBuild } from './DialogExpiredBuild'; -import { WidthBreakpoint } from './_util'; -import { FakeLeftPaneContainer } from '../test-helpers/FakeLeftPaneContainer'; +import type { PropsType } from './DialogExpiredBuild.js'; +import { DialogExpiredBuild } from './DialogExpiredBuild.js'; +import { WidthBreakpoint } from './_util.js'; +import { FakeLeftPaneContainer } from '../test-helpers/FakeLeftPaneContainer.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/DialogExpiredBuild.tsx b/ts/components/DialogExpiredBuild.tsx index a1f8bd5b0aa..b6bf9d8c619 100644 --- a/ts/components/DialogExpiredBuild.tsx +++ b/ts/components/DialogExpiredBuild.tsx @@ -3,11 +3,11 @@ import React from 'react'; -import type { LocalizerType } from '../types/Util'; -import type { WidthBreakpoint } from './_util'; +import type { LocalizerType } from '../types/Util.js'; +import type { WidthBreakpoint } from './_util.js'; -import { LeftPaneDialog } from './LeftPaneDialog'; -import { openLinkInWebBrowser } from '../util/openLinkInWebBrowser'; +import { LeftPaneDialog } from './LeftPaneDialog.js'; +import { openLinkInWebBrowser } from '../util/openLinkInWebBrowser.js'; export type PropsType = { containerWidthBreakpoint: WidthBreakpoint; diff --git a/ts/components/DialogNetworkStatus.stories.tsx b/ts/components/DialogNetworkStatus.stories.tsx index e62579d9dbc..5779e1da1f3 100644 --- a/ts/components/DialogNetworkStatus.stories.tsx +++ b/ts/components/DialogNetworkStatus.stories.tsx @@ -5,11 +5,11 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './DialogNetworkStatus'; -import { DialogNetworkStatus } from './DialogNetworkStatus'; -import { SocketStatus } from '../types/SocketStatus'; -import { WidthBreakpoint } from './_util'; -import { FakeLeftPaneContainer } from '../test-helpers/FakeLeftPaneContainer'; +import type { PropsType } from './DialogNetworkStatus.js'; +import { DialogNetworkStatus } from './DialogNetworkStatus.js'; +import { SocketStatus } from '../types/SocketStatus.js'; +import { WidthBreakpoint } from './_util.js'; +import { FakeLeftPaneContainer } from '../test-helpers/FakeLeftPaneContainer.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/DialogNetworkStatus.tsx b/ts/components/DialogNetworkStatus.tsx index 6182db5220a..8e4ab354e14 100644 --- a/ts/components/DialogNetworkStatus.tsx +++ b/ts/components/DialogNetworkStatus.tsx @@ -3,13 +3,13 @@ import React, { useEffect } from 'react'; -import { LeftPaneDialog } from './LeftPaneDialog'; -import { Spinner } from './Spinner'; -import type { LocalizerType } from '../types/Util'; -import { SocketStatus } from '../types/SocketStatus'; -import type { NetworkStateType } from '../state/ducks/network'; -import type { WidthBreakpoint } from './_util'; -import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary'; +import { LeftPaneDialog } from './LeftPaneDialog.js'; +import { Spinner } from './Spinner.js'; +import type { LocalizerType } from '../types/Util.js'; +import { SocketStatus } from '../types/SocketStatus.js'; +import type { NetworkStateType } from '../state/ducks/network.js'; +import type { WidthBreakpoint } from './_util.js'; +import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary.js'; const FIVE_SECONDS = 5 * 1000; diff --git a/ts/components/DialogRelink.stories.tsx b/ts/components/DialogRelink.stories.tsx index 874f1193a26..6d716b2945c 100644 --- a/ts/components/DialogRelink.stories.tsx +++ b/ts/components/DialogRelink.stories.tsx @@ -4,10 +4,10 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './DialogRelink'; -import { DialogRelink } from './DialogRelink'; -import { WidthBreakpoint } from './_util'; -import { FakeLeftPaneContainer } from '../test-helpers/FakeLeftPaneContainer'; +import type { PropsType } from './DialogRelink.js'; +import { DialogRelink } from './DialogRelink.js'; +import { WidthBreakpoint } from './_util.js'; +import { FakeLeftPaneContainer } from '../test-helpers/FakeLeftPaneContainer.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/DialogRelink.tsx b/ts/components/DialogRelink.tsx index d5c0e191b8a..3ad37cdf0d3 100644 --- a/ts/components/DialogRelink.tsx +++ b/ts/components/DialogRelink.tsx @@ -3,10 +3,10 @@ import React from 'react'; -import type { LocalizerType } from '../types/Util'; -import type { WidthBreakpoint } from './_util'; +import type { LocalizerType } from '../types/Util.js'; +import type { WidthBreakpoint } from './_util.js'; -import { LeftPaneDialog } from './LeftPaneDialog'; +import { LeftPaneDialog } from './LeftPaneDialog.js'; export type PropsType = { containerWidthBreakpoint: WidthBreakpoint; diff --git a/ts/components/DialogUpdate.stories.tsx b/ts/components/DialogUpdate.stories.tsx index b3038e383bb..406fd4c5178 100644 --- a/ts/components/DialogUpdate.stories.tsx +++ b/ts/components/DialogUpdate.stories.tsx @@ -4,12 +4,12 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './DialogUpdate'; -import { DialogUpdate } from './DialogUpdate'; -import { DialogType } from '../types/Dialogs'; -import { WidthBreakpoint } from './_util'; -import { SECOND } from '../util/durations'; -import { FakeLeftPaneContainer } from '../test-helpers/FakeLeftPaneContainer'; +import type { PropsType } from './DialogUpdate.js'; +import { DialogUpdate } from './DialogUpdate.js'; +import { DialogType } from '../types/Dialogs.js'; +import { WidthBreakpoint } from './_util.js'; +import { SECOND } from '../util/durations/index.js'; +import { FakeLeftPaneContainer } from '../test-helpers/FakeLeftPaneContainer.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/DialogUpdate.tsx b/ts/components/DialogUpdate.tsx index a5a05109898..84d57a9c69a 100644 --- a/ts/components/DialogUpdate.tsx +++ b/ts/components/DialogUpdate.tsx @@ -4,16 +4,19 @@ import type { ReactNode } from 'react'; import React, { useCallback } from 'react'; -import { isBeta } from '../util/version'; -import { DialogType } from '../types/Dialogs'; -import { PRODUCTION_DOWNLOAD_URL, BETA_DOWNLOAD_URL } from '../types/support'; -import { I18n } from './I18n'; -import { LeftPaneDialog } from './LeftPaneDialog'; -import { formatFileSize } from '../util/formatFileSize'; +import { isBeta } from '../util/version.js'; +import { DialogType } from '../types/Dialogs.js'; +import { + PRODUCTION_DOWNLOAD_URL, + BETA_DOWNLOAD_URL, +} from '../types/support.js'; +import { I18n } from './I18n.js'; +import { LeftPaneDialog } from './LeftPaneDialog.js'; +import { formatFileSize } from '../util/formatFileSize.js'; -import type { LocalizerType } from '../types/Util'; -import type { DismissOptions } from './LeftPaneDialog'; -import type { WidthBreakpoint } from './_util'; +import type { LocalizerType } from '../types/Util.js'; +import type { DismissOptions } from './LeftPaneDialog.js'; +import type { WidthBreakpoint } from './_util.js'; function contactSupportLink(parts: ReactNode): JSX.Element { return ( diff --git a/ts/components/DirectCallRemoteParticipant.tsx b/ts/components/DirectCallRemoteParticipant.tsx index be8cd77a43c..ad71e096e5c 100644 --- a/ts/components/DirectCallRemoteParticipant.tsx +++ b/ts/components/DirectCallRemoteParticipant.tsx @@ -3,12 +3,12 @@ import React, { useRef, useEffect } from 'react'; import classNames from 'classnames'; -import type { SetRendererCanvasType } from '../state/ducks/calling'; -import type { ConversationType } from '../state/ducks/conversations'; -import type { LocalizerType } from '../types/Util'; -import { AvatarColors } from '../types/Colors'; -import { Avatar, AvatarSize } from './Avatar'; -import { CallBackgroundBlur } from './CallBackgroundBlur'; +import type { SetRendererCanvasType } from '../state/ducks/calling.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import type { LocalizerType } from '../types/Util.js'; +import { AvatarColors } from '../types/Colors.js'; +import { Avatar, AvatarSize } from './Avatar.js'; +import { CallBackgroundBlur } from './CallBackgroundBlur.js'; type PropsType = { conversation: ConversationType; diff --git a/ts/components/DisappearingTimeDialog.stories.tsx b/ts/components/DisappearingTimeDialog.stories.tsx index b618174addc..cdc25ee0675 100644 --- a/ts/components/DisappearingTimeDialog.stories.tsx +++ b/ts/components/DisappearingTimeDialog.stories.tsx @@ -4,9 +4,9 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './DisappearingTimeDialog'; -import { DisappearingTimeDialog } from './DisappearingTimeDialog'; -import { EXPIRE_TIMERS } from '../test-helpers/expireTimers'; +import type { PropsType } from './DisappearingTimeDialog.js'; +import { DisappearingTimeDialog } from './DisappearingTimeDialog.js'; +import { EXPIRE_TIMERS } from '../test-helpers/expireTimers.js'; export default { title: 'Components/DisappearingTimeDialog', diff --git a/ts/components/DisappearingTimeDialog.tsx b/ts/components/DisappearingTimeDialog.tsx index e0f940eed3e..b97c097e948 100644 --- a/ts/components/DisappearingTimeDialog.tsx +++ b/ts/components/DisappearingTimeDialog.tsx @@ -3,11 +3,11 @@ import React, { useState } from 'react'; -import { ConfirmationDialog } from './ConfirmationDialog'; -import { Select } from './Select'; -import type { LocalizerType } from '../types/Util'; -import type { Theme } from '../util/theme'; -import { DurationInSeconds } from '../util/durations'; +import { ConfirmationDialog } from './ConfirmationDialog.js'; +import { Select } from './Select.js'; +import type { LocalizerType } from '../types/Util.js'; +import type { Theme } from '../util/theme.js'; +import { DurationInSeconds } from '../util/durations/index.js'; const CSS_MODULE = 'module-disappearing-time-dialog'; diff --git a/ts/components/DisappearingTimerSelect.stories.tsx b/ts/components/DisappearingTimerSelect.stories.tsx index a6c57d746de..72d62d0ac35 100644 --- a/ts/components/DisappearingTimerSelect.stories.tsx +++ b/ts/components/DisappearingTimerSelect.stories.tsx @@ -3,9 +3,9 @@ import React, { useState } from 'react'; import type { Meta } from '@storybook/react'; -import type { Props } from './DisappearingTimerSelect'; -import { DisappearingTimerSelect } from './DisappearingTimerSelect'; -import { DurationInSeconds } from '../util/durations'; +import type { Props } from './DisappearingTimerSelect.js'; +import { DisappearingTimerSelect } from './DisappearingTimerSelect.js'; +import { DurationInSeconds } from '../util/durations/index.js'; export default { title: 'Components/DisappearingTimerSelect', diff --git a/ts/components/DisappearingTimerSelect.tsx b/ts/components/DisappearingTimerSelect.tsx index 7c0646965da..607df1acb69 100644 --- a/ts/components/DisappearingTimerSelect.tsx +++ b/ts/components/DisappearingTimerSelect.tsx @@ -3,12 +3,12 @@ import type { ReactNode } from 'react'; import React, { useCallback, useState, useMemo } from 'react'; -import type { LocalizerType } from '../types/Util'; -import * as expirationTimer from '../util/expirationTimer'; -import { DurationInSeconds } from '../util/durations'; -import { DisappearingTimeDialog } from './DisappearingTimeDialog'; -import { AxoSelect } from '../axo/AxoSelect'; -import { tw } from '../axo/tw'; +import type { LocalizerType } from '../types/Util.js'; +import * as expirationTimer from '../util/expirationTimer.js'; +import { DurationInSeconds } from '../util/durations/index.js'; +import { DisappearingTimeDialog } from './DisappearingTimeDialog.js'; +import { AxoSelect } from '../axo/AxoSelect.js'; +import { tw } from '../axo/tw.js'; export type Props = { i18n: LocalizerType; diff --git a/ts/components/DonationErrorModal.stories.tsx b/ts/components/DonationErrorModal.stories.tsx index f2b8f0f263d..1aad4bb3d69 100644 --- a/ts/components/DonationErrorModal.stories.tsx +++ b/ts/components/DonationErrorModal.stories.tsx @@ -6,9 +6,9 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './DonationErrorModal'; -import { DonationErrorModal } from './DonationErrorModal'; -import { donationErrorTypeSchema } from '../types/Donations'; +import type { PropsType } from './DonationErrorModal.js'; +import { DonationErrorModal } from './DonationErrorModal.js'; +import { donationErrorTypeSchema } from '../types/Donations.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/DonationErrorModal.tsx b/ts/components/DonationErrorModal.tsx index 7eb71c47483..0fcb76ea4f4 100644 --- a/ts/components/DonationErrorModal.tsx +++ b/ts/components/DonationErrorModal.tsx @@ -4,13 +4,13 @@ import React from 'react'; import type { ReactNode } from 'react'; -import { missingCaseError } from '../util/missingCaseError'; -import { donationErrorTypeSchema } from '../types/Donations'; +import { missingCaseError } from '../util/missingCaseError.js'; +import { donationErrorTypeSchema } from '../types/Donations.js'; -import type { LocalizerType } from '../types/Util'; -import type { DonationErrorType } from '../types/Donations'; -import { Button } from './Button'; -import { Modal } from './Modal'; +import type { LocalizerType } from '../types/Util.js'; +import type { DonationErrorType } from '../types/Donations.js'; +import { Button } from './Button.js'; +import { Modal } from './Modal.js'; export type PropsType = { i18n: LocalizerType; diff --git a/ts/components/DonationInterruptedModal.stories.tsx b/ts/components/DonationInterruptedModal.stories.tsx index e9866104f1f..e57f4864629 100644 --- a/ts/components/DonationInterruptedModal.stories.tsx +++ b/ts/components/DonationInterruptedModal.stories.tsx @@ -6,8 +6,8 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './DonationInterruptedModal'; -import { DonationInterruptedModal } from './DonationInterruptedModal'; +import type { PropsType } from './DonationInterruptedModal.js'; +import { DonationInterruptedModal } from './DonationInterruptedModal.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/DonationInterruptedModal.tsx b/ts/components/DonationInterruptedModal.tsx index 17488818aa5..697678a168b 100644 --- a/ts/components/DonationInterruptedModal.tsx +++ b/ts/components/DonationInterruptedModal.tsx @@ -3,9 +3,9 @@ import React from 'react'; -import type { LocalizerType } from '../types/Util'; -import { Modal } from './Modal'; -import { Button, ButtonVariant } from './Button'; +import type { LocalizerType } from '../types/Util.js'; +import { Modal } from './Modal.js'; +import { Button, ButtonVariant } from './Button.js'; export type PropsType = { i18n: LocalizerType; diff --git a/ts/components/DonationPrivacyInformationModal.tsx b/ts/components/DonationPrivacyInformationModal.tsx index ed693e14313..4673ef30626 100644 --- a/ts/components/DonationPrivacyInformationModal.tsx +++ b/ts/components/DonationPrivacyInformationModal.tsx @@ -2,11 +2,11 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { useCallback } from 'react'; -import { Modal } from './Modal'; -import { Button, ButtonSize } from './Button'; -import { I18n } from './I18n'; -import type { LocalizerType } from '../types/Util'; -import { openLinkInWebBrowser } from '../util/openLinkInWebBrowser'; +import { Modal } from './Modal.js'; +import { Button, ButtonSize } from './Button.js'; +import { I18n } from './I18n.js'; +import type { LocalizerType } from '../types/Util.js'; +import { openLinkInWebBrowser } from '../util/openLinkInWebBrowser.js'; export type DonationPrivacyInformationModalProps = { i18n: LocalizerType; diff --git a/ts/components/DonationProgressModal.stories.tsx b/ts/components/DonationProgressModal.stories.tsx index 1f3b3013992..a01859db5e5 100644 --- a/ts/components/DonationProgressModal.stories.tsx +++ b/ts/components/DonationProgressModal.stories.tsx @@ -6,8 +6,8 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './DonationProgressModal'; -import { DonationProgressModal } from './DonationProgressModal'; +import type { PropsType } from './DonationProgressModal.js'; +import { DonationProgressModal } from './DonationProgressModal.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/DonationProgressModal.tsx b/ts/components/DonationProgressModal.tsx index 29747b455b1..c75c447eb9b 100644 --- a/ts/components/DonationProgressModal.tsx +++ b/ts/components/DonationProgressModal.tsx @@ -3,10 +3,10 @@ import React, { useEffect } from 'react'; -import type { LocalizerType } from '../types/Util'; -import { Modal } from './Modal'; -import { SpinnerV2 } from './SpinnerV2'; -import { SECOND } from '../util/durations'; +import type { LocalizerType } from '../types/Util.js'; +import { Modal } from './Modal.js'; +import { SpinnerV2 } from './SpinnerV2.js'; +import { SECOND } from '../util/durations/index.js'; export type PropsType = { i18n: LocalizerType; diff --git a/ts/components/DonationStillProcessingModal.stories.tsx b/ts/components/DonationStillProcessingModal.stories.tsx index 1904a59594a..60c3f2127a2 100644 --- a/ts/components/DonationStillProcessingModal.stories.tsx +++ b/ts/components/DonationStillProcessingModal.stories.tsx @@ -6,8 +6,8 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './DonationStillProcessingModal'; -import { DonationStillProcessingModal } from './DonationStillProcessingModal'; +import type { PropsType } from './DonationStillProcessingModal.js'; +import { DonationStillProcessingModal } from './DonationStillProcessingModal.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/DonationStillProcessingModal.tsx b/ts/components/DonationStillProcessingModal.tsx index 0b66e19d8ba..1c3a3bc1616 100644 --- a/ts/components/DonationStillProcessingModal.tsx +++ b/ts/components/DonationStillProcessingModal.tsx @@ -3,9 +3,9 @@ import React from 'react'; -import type { LocalizerType } from '../types/Util'; -import { Modal } from './Modal'; -import { Button } from './Button'; +import type { LocalizerType } from '../types/Util.js'; +import { Modal } from './Modal.js'; +import { Button } from './Button.js'; export type PropsType = { i18n: LocalizerType; diff --git a/ts/components/DonationThanksModal.stories.tsx b/ts/components/DonationThanksModal.stories.tsx index 4054f71aac7..3bfb06f3430 100644 --- a/ts/components/DonationThanksModal.stories.tsx +++ b/ts/components/DonationThanksModal.stories.tsx @@ -5,9 +5,9 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta, StoryFn } from '@storybook/react'; -import type { PropsType } from './DonationThanksModal'; -import { DonationThanksModal } from './DonationThanksModal'; -import { getFakeBadge } from '../test-helpers/getFakeBadge'; +import type { PropsType } from './DonationThanksModal.js'; +import { DonationThanksModal } from './DonationThanksModal.js'; +import { getFakeBadge } from '../test-helpers/getFakeBadge.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/DonationThanksModal.tsx b/ts/components/DonationThanksModal.tsx index 4452ac2f70a..d548e20bab2 100644 --- a/ts/components/DonationThanksModal.tsx +++ b/ts/components/DonationThanksModal.tsx @@ -3,13 +3,13 @@ import React, { useState } from 'react'; -import type { LocalizerType } from '../types/Util'; -import type { BadgeType } from '../badges/types'; -import { Modal } from './Modal'; -import { Button, ButtonVariant } from './Button'; -import { Checkbox } from './Checkbox'; -import { BadgeImage } from './BadgeImage'; -import { Spinner } from './Spinner'; +import type { LocalizerType } from '../types/Util.js'; +import type { BadgeType } from '../badges/types.js'; +import { Modal } from './Modal.js'; +import { Button, ButtonVariant } from './Button.js'; +import { Checkbox } from './Checkbox.js'; +import { BadgeImage } from './BadgeImage.js'; +import { Spinner } from './Spinner.js'; export type PropsType = { i18n: LocalizerType; diff --git a/ts/components/DonationVerificationModal.stories.tsx b/ts/components/DonationVerificationModal.stories.tsx index cd9622aa494..5e43045cd54 100644 --- a/ts/components/DonationVerificationModal.stories.tsx +++ b/ts/components/DonationVerificationModal.stories.tsx @@ -6,9 +6,9 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './DonationVerificationModal'; -import { DonationVerificationModal } from './DonationVerificationModal'; -import { SECOND } from '../util/durations'; +import type { PropsType } from './DonationVerificationModal.js'; +import { DonationVerificationModal } from './DonationVerificationModal.js'; +import { SECOND } from '../util/durations/index.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/DonationVerificationModal.tsx b/ts/components/DonationVerificationModal.tsx index f9e8889acd2..cfcd3812fda 100644 --- a/ts/components/DonationVerificationModal.tsx +++ b/ts/components/DonationVerificationModal.tsx @@ -3,10 +3,10 @@ import React, { useEffect, useState } from 'react'; -import type { LocalizerType } from '../types/Util'; -import { Modal } from './Modal'; -import { Button, ButtonVariant } from './Button'; -import { DAY } from '../util/durations'; +import type { LocalizerType } from '../types/Util.js'; +import { Modal } from './Modal.js'; +import { Button, ButtonVariant } from './Button.js'; +import { DAY } from '../util/durations/index.js'; export type PropsType = { // Test-only diff --git a/ts/components/DonationsErrorBoundary.tsx b/ts/components/DonationsErrorBoundary.tsx index 99b69594a6e..5bfa3ecbb05 100644 --- a/ts/components/DonationsErrorBoundary.tsx +++ b/ts/components/DonationsErrorBoundary.tsx @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { ReactNode, ErrorInfo } from 'react'; import React, { Component, useCallback } from 'react'; -import { createLogger } from '../logging/log'; -import * as Errors from '../types/errors'; +import { createLogger } from '../logging/log.js'; +import * as Errors from '../types/errors.js'; const log = createLogger('DonationsErrorBoundary'); diff --git a/ts/components/DraftGifMessageSendModal.stories.tsx b/ts/components/DraftGifMessageSendModal.stories.tsx index 3497429a4b4..44cf393cb79 100644 --- a/ts/components/DraftGifMessageSendModal.stories.tsx +++ b/ts/components/DraftGifMessageSendModal.stories.tsx @@ -6,15 +6,15 @@ import { action } from '@storybook/addon-actions'; import { DraftGifMessageSendModal, type DraftGifMessageSendModalProps, -} from './DraftGifMessageSendModal'; -import { ThemeType } from '../types/Util'; -import { CompositionTextArea } from './CompositionTextArea'; -import type { SmartCompositionTextAreaProps } from '../state/smart/CompositionTextArea'; -import { EmojiSkinTone } from './fun/data/emojis'; -import { LoadingState } from '../util/loadable'; -import { VIDEO_MP4 } from '../types/MIME'; -import { drop } from '../util/drop'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation'; +} from './DraftGifMessageSendModal.js'; +import { ThemeType } from '../types/Util.js'; +import { CompositionTextArea } from './CompositionTextArea.js'; +import type { SmartCompositionTextAreaProps } from '../state/smart/CompositionTextArea.js'; +import { EmojiSkinTone } from './fun/data/emojis.js'; +import { LoadingState } from '../util/loadable.js'; +import { VIDEO_MP4 } from '../types/MIME.js'; +import { drop } from '../util/drop.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/DraftGifMessageSendModal.tsx b/ts/components/DraftGifMessageSendModal.tsx index 00d99c57ce9..288baa04317 100644 --- a/ts/components/DraftGifMessageSendModal.tsx +++ b/ts/components/DraftGifMessageSendModal.tsx @@ -2,17 +2,17 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { type ComponentType, useEffect, useMemo, useId } from 'react'; import { VisuallyHidden } from 'react-aria'; -import type { LocalizerType } from '../types/I18N'; -import { Button, ButtonVariant } from './Button'; -import { Modal } from './Modal'; -import type { HydratedBodyRangesType } from '../types/BodyRange'; -import type { SmartCompositionTextAreaProps } from '../state/smart/CompositionTextArea'; -import type { ThemeType } from '../types/Util'; -import { EmojiSkinTone } from './fun/data/emojis'; -import { FunGifPreview } from './fun/FunGif'; -import type { FunGifSelection } from './fun/panels/FunPanelGifs'; -import type { GifDownloadState } from '../state/smart/DraftGifMessageSendModal'; -import { LoadingState } from '../util/loadable'; +import type { LocalizerType } from '../types/I18N.js'; +import { Button, ButtonVariant } from './Button.js'; +import { Modal } from './Modal.js'; +import type { HydratedBodyRangesType } from '../types/BodyRange.js'; +import type { SmartCompositionTextAreaProps } from '../state/smart/CompositionTextArea.js'; +import type { ThemeType } from '../types/Util.js'; +import { EmojiSkinTone } from './fun/data/emojis.js'; +import { FunGifPreview } from './fun/FunGif.js'; +import type { FunGifSelection } from './fun/panels/FunPanelGifs.js'; +import type { GifDownloadState } from '../state/smart/DraftGifMessageSendModal.js'; +import { LoadingState } from '../util/loadable.js'; export type DraftGifMessageSendModalProps = Readonly<{ i18n: LocalizerType; diff --git a/ts/components/EditHistoryMessagesModal.tsx b/ts/components/EditHistoryMessagesModal.tsx index 68f1476d254..4109eb41108 100644 --- a/ts/components/EditHistoryMessagesModal.tsx +++ b/ts/components/EditHistoryMessagesModal.tsx @@ -4,18 +4,18 @@ import React, { useCallback, useState, useRef } from 'react'; import { noop } from 'lodash'; -import type { AttachmentType } from '../types/Attachment'; -import type { LocalizerType } from '../types/Util'; -import type { MessagePropsType } from '../state/selectors/message'; -import type { PreferredBadgeSelectorType } from '../state/selectors/badges'; -import { Message, TextDirection } from './conversation/Message'; -import { Modal } from './Modal'; -import { WidthBreakpoint } from './_util'; -import { shouldNeverBeCalled } from '../util/shouldNeverBeCalled'; -import { useTheme } from '../hooks/useTheme'; -import { isSameDay } from '../util/timestamp'; -import { TimelineDateHeader } from './conversation/TimelineDateHeader'; -import { drop } from '../util/drop'; +import type { AttachmentType } from '../types/Attachment.js'; +import type { LocalizerType } from '../types/Util.js'; +import type { MessagePropsType } from '../state/selectors/message.js'; +import type { PreferredBadgeSelectorType } from '../state/selectors/badges.js'; +import { Message, TextDirection } from './conversation/Message.js'; +import { Modal } from './Modal.js'; +import { WidthBreakpoint } from './_util.js'; +import { shouldNeverBeCalled } from '../util/shouldNeverBeCalled.js'; +import { useTheme } from '../hooks/useTheme.js'; +import { isSameDay } from '../util/timestamp.js'; +import { TimelineDateHeader } from './conversation/TimelineDateHeader.js'; +import { drop } from '../util/drop.js'; export type PropsType = { closeEditHistoryModal: () => unknown; diff --git a/ts/components/EditNicknameAndNoteModal.stories.tsx b/ts/components/EditNicknameAndNoteModal.stories.tsx index 28b97fb660b..d661811f46a 100644 --- a/ts/components/EditNicknameAndNoteModal.stories.tsx +++ b/ts/components/EditNicknameAndNoteModal.stories.tsx @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import { action } from '@storybook/addon-actions'; import * as React from 'react'; -import type { ComponentMeta } from '../storybook/types'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation'; -import type { EditNicknameAndNoteModalProps } from './EditNicknameAndNoteModal'; -import { EditNicknameAndNoteModal } from './EditNicknameAndNoteModal'; +import type { ComponentMeta } from '../storybook/types.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; +import type { EditNicknameAndNoteModalProps } from './EditNicknameAndNoteModal.js'; +import { EditNicknameAndNoteModal } from './EditNicknameAndNoteModal.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/EditNicknameAndNoteModal.tsx b/ts/components/EditNicknameAndNoteModal.tsx index 898faa447c5..9f176f1438c 100644 --- a/ts/components/EditNicknameAndNoteModal.tsx +++ b/ts/components/EditNicknameAndNoteModal.tsx @@ -4,18 +4,18 @@ import type { FormEvent } from 'react'; import React, { useCallback, useMemo, useState } from 'react'; import { v4 as uuid } from 'uuid'; import { z } from 'zod'; -import { Modal } from './Modal'; -import type { LocalizerType } from '../types/I18N'; -import { Avatar, AvatarSize } from './Avatar'; +import { Modal } from './Modal.js'; +import type { LocalizerType } from '../types/I18N.js'; +import { Avatar, AvatarSize } from './Avatar.js'; import type { ConversationType, NicknameAndNote, -} from '../state/ducks/conversations'; -import { Input } from './Input'; -import { AutoSizeTextArea } from './AutoSizeTextArea'; -import { Button, ButtonVariant } from './Button'; -import { strictAssert } from '../util/assert'; -import { safeParsePartial } from '../util/schemas'; +} from '../state/ducks/conversations.js'; +import { Input } from './Input.js'; +import { AutoSizeTextArea } from './AutoSizeTextArea.js'; +import { Button, ButtonVariant } from './Button.js'; +import { strictAssert } from '../util/assert.js'; +import { safeParsePartial } from '../util/schemas.js'; const formSchema = z.object({ nickname: z diff --git a/ts/components/ErrorBoundary.tsx b/ts/components/ErrorBoundary.tsx index 1cf2f73d353..f2a4dded24d 100644 --- a/ts/components/ErrorBoundary.tsx +++ b/ts/components/ErrorBoundary.tsx @@ -4,9 +4,9 @@ import type { ReactNode, ErrorInfo } from 'react'; import React from 'react'; -import * as Errors from '../types/errors'; -import { createLogger } from '../logging/log'; -import { ToastType } from '../types/Toast'; +import * as Errors from '../types/errors.js'; +import { createLogger } from '../logging/log.js'; +import { ToastType } from '../types/Toast.js'; const log = createLogger('ErrorBoundary'); diff --git a/ts/components/ErrorModal.stories.tsx b/ts/components/ErrorModal.stories.tsx index 2f1981db959..cd81d84159b 100644 --- a/ts/components/ErrorModal.stories.tsx +++ b/ts/components/ErrorModal.stories.tsx @@ -5,10 +5,10 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './ErrorModal'; -import { ErrorModal } from './ErrorModal'; +import type { PropsType } from './ErrorModal.js'; +import { ErrorModal } from './ErrorModal.js'; -import { ButtonVariant } from './Button'; +import { ButtonVariant } from './Button.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/ErrorModal.tsx b/ts/components/ErrorModal.tsx index b215cea3b17..a4aee6e4095 100644 --- a/ts/components/ErrorModal.tsx +++ b/ts/components/ErrorModal.tsx @@ -3,9 +3,9 @@ import * as React from 'react'; -import type { LocalizerType } from '../types/Util'; -import { Modal } from './Modal'; -import { Button, ButtonVariant } from './Button'; +import type { LocalizerType } from '../types/Util.js'; +import { Modal } from './Modal.js'; +import { Button, ButtonVariant } from './Button.js'; export type PropsType = { buttonVariant?: ButtonVariant; diff --git a/ts/components/FileThumbnail.stories.tsx b/ts/components/FileThumbnail.stories.tsx index 462eba621b5..6424fcdb0d0 100644 --- a/ts/components/FileThumbnail.stories.tsx +++ b/ts/components/FileThumbnail.stories.tsx @@ -3,8 +3,8 @@ import React from 'react'; import type { Meta } from '@storybook/react'; -import { FileThumbnail } from './FileThumbnail'; -import { APPLICATION_OCTET_STREAM } from '../types/MIME'; +import { FileThumbnail } from './FileThumbnail.js'; +import { APPLICATION_OCTET_STREAM } from '../types/MIME.js'; export default { title: 'FileThumbnail', diff --git a/ts/components/FileThumbnail.tsx b/ts/components/FileThumbnail.tsx index b2fec1f0978..fa50313d56a 100644 --- a/ts/components/FileThumbnail.tsx +++ b/ts/components/FileThumbnail.tsx @@ -3,9 +3,9 @@ import React from 'react'; -import { getExtensionForDisplay } from '../types/Attachment'; -import { isFileDangerous } from '../util/isFileDangerous'; -import { tw } from '../axo/tw'; +import { getExtensionForDisplay } from '../types/Attachment.js'; +import { isFileDangerous } from '../util/isFileDangerous.js'; +import { tw } from '../axo/tw.js'; export type PropsType = Readonly[0]>; diff --git a/ts/components/ForwardMessagesModal.stories.tsx b/ts/components/ForwardMessagesModal.stories.tsx index 672c0047654..e3b4006278b 100644 --- a/ts/components/ForwardMessagesModal.stories.tsx +++ b/ts/components/ForwardMessagesModal.stories.tsx @@ -4,18 +4,18 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { AttachmentForUIType } from '../types/Attachment'; -import type { PropsType } from './ForwardMessagesModal'; +import type { AttachmentForUIType } from '../types/Attachment.js'; +import type { PropsType } from './ForwardMessagesModal.js'; import { ForwardMessagesModal, ForwardMessagesModalType, -} from './ForwardMessagesModal'; -import { IMAGE_JPEG, VIDEO_MP4, stringToMIMEType } from '../types/MIME'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation'; -import { StorybookThemeContext } from '../../.storybook/StorybookThemeContext'; -import { CompositionTextArea } from './CompositionTextArea'; -import type { MessageForwardDraft } from '../types/ForwardDraft'; -import { EmojiSkinTone } from './fun/data/emojis'; +} from './ForwardMessagesModal.js'; +import { IMAGE_JPEG, VIDEO_MP4, stringToMIMEType } from '../types/MIME.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; +import { StorybookThemeContext } from '../../.storybook/StorybookThemeContext.js'; +import { CompositionTextArea } from './CompositionTextArea.js'; +import type { MessageForwardDraft } from '../types/ForwardDraft.js'; +import { EmojiSkinTone } from './fun/data/emojis.js'; const createAttachment = ( props: Partial = {} diff --git a/ts/components/ForwardMessagesModal.tsx b/ts/components/ForwardMessagesModal.tsx index e346d055131..b454beac0f6 100644 --- a/ts/components/ForwardMessagesModal.tsx +++ b/ts/components/ForwardMessagesModal.tsx @@ -10,41 +10,41 @@ import React, { useState, Fragment, } from 'react'; -import { AttachmentList } from './conversation/AttachmentList'; -import type { AttachmentForUIType } from '../types/Attachment'; -import { Button } from './Button'; -import { ConfirmationDialog } from './ConfirmationDialog'; -import { ContactCheckboxDisabledReason } from './conversationList/ContactCheckbox'; -import type { Row } from './ConversationList'; -import { ConversationList, RowType } from './ConversationList'; -import type { ConversationType } from '../state/ducks/conversations'; -import type { PreferredBadgeSelectorType } from '../state/selectors/badges'; -import type { LocalizerType, ThemeType } from '../types/Util'; -import type { SmartCompositionTextAreaProps } from '../state/smart/CompositionTextArea'; -import { SearchInput } from './SearchInput'; -import { StagedLinkPreview } from './conversation/StagedLinkPreview'; -import { filterAndSortConversations } from '../util/filterAndSortConversations'; +import { AttachmentList } from './conversation/AttachmentList.js'; +import type { AttachmentForUIType } from '../types/Attachment.js'; +import { Button } from './Button.js'; +import { ConfirmationDialog } from './ConfirmationDialog.js'; +import { ContactCheckboxDisabledReason } from './conversationList/ContactCheckbox.js'; +import type { Row } from './ConversationList.js'; +import { ConversationList, RowType } from './ConversationList.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import type { PreferredBadgeSelectorType } from '../state/selectors/badges.js'; +import type { LocalizerType, ThemeType } from '../types/Util.js'; +import type { SmartCompositionTextAreaProps } from '../state/smart/CompositionTextArea.js'; +import { SearchInput } from './SearchInput.js'; +import { StagedLinkPreview } from './conversation/StagedLinkPreview.js'; +import { filterAndSortConversations } from '../util/filterAndSortConversations.js'; import { shouldNeverBeCalled, asyncShouldNeverBeCalled, -} from '../util/shouldNeverBeCalled'; -import type { LinkPreviewForUIType } from '../types/message/LinkPreviews'; -import { LinkPreviewSourceType } from '../types/LinkPreview'; -import { ToastType } from '../types/Toast'; -import type { ShowToastAction } from '../state/ducks/toast'; -import type { HydratedBodyRangesType } from '../types/BodyRange'; -import { applyRangesToText } from '../types/BodyRange'; -import { UserText } from './UserText'; -import { Modal } from './Modal'; -import { SizeObserver } from '../hooks/useSizeObserver'; +} from '../util/shouldNeverBeCalled.js'; +import type { LinkPreviewForUIType } from '../types/message/LinkPreviews.js'; +import { LinkPreviewSourceType } from '../types/LinkPreview.js'; +import { ToastType } from '../types/Toast.js'; +import type { ShowToastAction } from '../state/ducks/toast.js'; +import type { HydratedBodyRangesType } from '../types/BodyRange.js'; +import { applyRangesToText } from '../types/BodyRange.js'; +import { UserText } from './UserText.js'; +import { Modal } from './Modal.js'; +import { SizeObserver } from '../hooks/useSizeObserver.js'; import { isDraftEditable, isDraftForwardable, type MessageForwardDraft, -} from '../types/ForwardDraft'; -import { missingCaseError } from '../util/missingCaseError'; -import { Theme } from '../util/theme'; -import { EmojiSkinTone } from './fun/data/emojis'; +} from '../types/ForwardDraft.js'; +import { missingCaseError } from '../util/missingCaseError.js'; +import { Theme } from '../util/theme.js'; +import { EmojiSkinTone } from './fun/data/emojis.js'; export enum ForwardMessagesModalType { Forward, diff --git a/ts/components/GlobalModalContainer.tsx b/ts/components/GlobalModalContainer.tsx index 42db59ac9ef..bacb604506c 100644 --- a/ts/components/GlobalModalContainer.tsx +++ b/ts/components/GlobalModalContainer.tsx @@ -11,28 +11,28 @@ import type { MessageRequestActionsConfirmationPropsType, SafetyNumberChangedBlockingDataType, UserNotFoundModalStateType, -} from '../state/ducks/globalModals'; -import type { LocalizerType, ThemeType } from '../types/Util'; -import { UsernameOnboardingState } from '../types/globalModals'; -import { missingCaseError } from '../util/missingCaseError'; +} from '../state/ducks/globalModals.js'; +import type { LocalizerType, ThemeType } from '../types/Util.js'; +import { UsernameOnboardingState } from '../types/globalModals.js'; +import { missingCaseError } from '../util/missingCaseError.js'; -import { ButtonVariant } from './Button'; -import { ConfirmationDialog } from './ConfirmationDialog'; -import { SignalConnectionsModal } from './SignalConnectionsModal'; -import { WhatsNewModal } from './WhatsNewModal'; -import { MediaPermissionsModal } from './MediaPermissionsModal'; -import type { StartCallData } from './ConfirmLeaveCallModal'; +import { ButtonVariant } from './Button.js'; +import { ConfirmationDialog } from './ConfirmationDialog.js'; +import { SignalConnectionsModal } from './SignalConnectionsModal.js'; +import { WhatsNewModal } from './WhatsNewModal.js'; +import { MediaPermissionsModal } from './MediaPermissionsModal.js'; +import type { StartCallData } from './ConfirmLeaveCallModal.js'; import { TapToViewNotAvailableModal, type DataPropsType as TapToViewNotAvailablePropsType, -} from './TapToViewNotAvailableModal'; +} from './TapToViewNotAvailableModal.js'; import { BackfillFailureModal, type DataPropsType as BackfillFailureModalPropsType, -} from './BackfillFailureModal'; -import type { SmartDraftGifMessageSendModalProps } from '../state/smart/DraftGifMessageSendModal'; -import { CriticalIdlePrimaryDeviceModal } from './CriticalIdlePrimaryDeviceModal'; -import { LowDiskSpaceBackupImportModal } from './LowDiskSpaceBackupImportModal'; +} from './BackfillFailureModal.js'; +import type { SmartDraftGifMessageSendModalProps } from '../state/smart/DraftGifMessageSendModal.js'; +import { CriticalIdlePrimaryDeviceModal } from './CriticalIdlePrimaryDeviceModal.js'; +import { LowDiskSpaceBackupImportModal } from './LowDiskSpaceBackupImportModal.js'; // NOTE: All types should be required for this component so that the smart // component gives you type errors when adding/removing props. diff --git a/ts/components/GradientDial.tsx b/ts/components/GradientDial.tsx index 54ea77ae921..7472581233d 100644 --- a/ts/components/GradientDial.tsx +++ b/ts/components/GradientDial.tsx @@ -4,8 +4,8 @@ import type { CSSProperties, KeyboardEvent } from 'react'; import React, { useEffect, useRef, useState } from 'react'; import classNames from 'classnames'; -import { arrow } from '../util/keyboard'; -import type { LocalizerType } from '../types/Util'; +import { arrow } from '../util/keyboard.js'; +import type { LocalizerType } from '../types/Util.js'; export enum KnobType { start = 'start', diff --git a/ts/components/GroupCallOverflowArea.stories.tsx b/ts/components/GroupCallOverflowArea.stories.tsx index ce1480ca4f9..ce3f26c8813 100644 --- a/ts/components/GroupCallOverflowArea.stories.tsx +++ b/ts/components/GroupCallOverflowArea.stories.tsx @@ -5,14 +5,14 @@ import React from 'react'; import { memoize, times } from 'lodash'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './GroupCallOverflowArea'; -import { GroupCallOverflowArea } from './GroupCallOverflowArea'; -import { getDefaultConversationWithServiceId } from '../test-helpers/getDefaultConversation'; -import { fakeGetGroupCallVideoFrameSource } from '../test-helpers/fakeGetGroupCallVideoFrameSource'; -import { FRAME_BUFFER_SIZE } from '../calling/constants'; -import { generateAci } from '../types/ServiceId'; -import type { CallingImageDataCache } from './CallManager'; -import { MINUTE } from '../util/durations'; +import type { PropsType } from './GroupCallOverflowArea.js'; +import { GroupCallOverflowArea } from './GroupCallOverflowArea.js'; +import { getDefaultConversationWithServiceId } from '../test-helpers/getDefaultConversation.js'; +import { fakeGetGroupCallVideoFrameSource } from '../test-helpers/fakeGetGroupCallVideoFrameSource.js'; +import { FRAME_BUFFER_SIZE } from '../calling/constants.js'; +import { generateAci } from '../types/ServiceId.js'; +import type { CallingImageDataCache } from './CallManager.js'; +import { MINUTE } from '../util/durations/index.js'; const MAX_PARTICIPANTS = 32; diff --git a/ts/components/GroupCallOverflowArea.tsx b/ts/components/GroupCallOverflowArea.tsx index b7163c89a3a..ebbd42bfd7f 100644 --- a/ts/components/GroupCallOverflowArea.tsx +++ b/ts/components/GroupCallOverflowArea.tsx @@ -5,10 +5,10 @@ import type { ReactElement } from 'react'; import React, { useRef, useState, useEffect } from 'react'; import classNames from 'classnames'; import type { VideoFrameSource } from '@signalapp/ringrtc'; -import type { LocalizerType } from '../types/Util'; -import type { GroupCallRemoteParticipantType } from '../types/Calling'; -import { GroupCallRemoteParticipant } from './GroupCallRemoteParticipant'; -import type { CallingImageDataCache } from './CallManager'; +import type { LocalizerType } from '../types/Util.js'; +import type { GroupCallRemoteParticipantType } from '../types/Calling.js'; +import { GroupCallRemoteParticipant } from './GroupCallRemoteParticipant.js'; +import type { CallingImageDataCache } from './CallManager.js'; const OVERFLOW_SCROLLED_TO_EDGE_THRESHOLD = 20; const OVERFLOW_SCROLL_BUTTON_RATIO = 0.75; diff --git a/ts/components/GroupCallRemoteParticipant.stories.tsx b/ts/components/GroupCallRemoteParticipant.stories.tsx index 680fd4d1be6..bb0e43fbcf0 100644 --- a/ts/components/GroupCallRemoteParticipant.stories.tsx +++ b/ts/components/GroupCallRemoteParticipant.stories.tsx @@ -4,13 +4,13 @@ import * as React from 'react'; import { memoize } from 'lodash'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './GroupCallRemoteParticipant'; -import { GroupCallRemoteParticipant } from './GroupCallRemoteParticipant'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation'; -import { FRAME_BUFFER_SIZE } from '../calling/constants'; -import { generateAci } from '../types/ServiceId'; -import type { CallingImageDataCache } from './CallManager'; -import { MINUTE } from '../util/durations'; +import type { PropsType } from './GroupCallRemoteParticipant.js'; +import { GroupCallRemoteParticipant } from './GroupCallRemoteParticipant.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; +import { FRAME_BUFFER_SIZE } from '../calling/constants.js'; +import { generateAci } from '../types/ServiceId.js'; +import type { CallingImageDataCache } from './CallManager.js'; +import { MINUTE } from '../util/durations/index.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/GroupCallRemoteParticipant.tsx b/ts/components/GroupCallRemoteParticipant.tsx index 71bc0f7c0da..4c6e9cbcb7e 100644 --- a/ts/components/GroupCallRemoteParticipant.tsx +++ b/ts/components/GroupCallRemoteParticipant.tsx @@ -12,25 +12,25 @@ import React, { import classNames from 'classnames'; import { debounce, noop } from 'lodash'; import type { VideoFrameSource } from '@signalapp/ringrtc'; -import type { GroupCallRemoteParticipantType } from '../types/Calling'; -import type { LocalizerType } from '../types/Util'; -import { AvatarColors } from '../types/Colors'; -import { CallBackgroundBlur } from './CallBackgroundBlur'; +import type { GroupCallRemoteParticipantType } from '../types/Calling.js'; +import type { LocalizerType } from '../types/Util.js'; +import { AvatarColors } from '../types/Colors.js'; +import { CallBackgroundBlur } from './CallBackgroundBlur.js'; import { CallingAudioIndicator, SPEAKING_LINGER_MS, -} from './CallingAudioIndicator'; -import { Avatar, AvatarSize } from './Avatar'; -import { ConfirmationDialog } from './ConfirmationDialog'; -import { I18n } from './I18n'; -import { ContactName } from './conversation/ContactName'; -import { useIntersectionObserver } from '../hooks/useIntersectionObserver'; -import { MAX_FRAME_HEIGHT, MAX_FRAME_WIDTH } from '../calling/constants'; -import { useValueAtFixedRate } from '../hooks/useValueAtFixedRate'; -import { Theme } from '../util/theme'; -import { isOlderThan } from '../util/timestamp'; -import type { CallingImageDataCache } from './CallManager'; -import { usePrevious } from '../hooks/usePrevious'; +} from './CallingAudioIndicator.js'; +import { Avatar, AvatarSize } from './Avatar.js'; +import { ConfirmationDialog } from './ConfirmationDialog.js'; +import { I18n } from './I18n.js'; +import { ContactName } from './conversation/ContactName.js'; +import { useIntersectionObserver } from '../hooks/useIntersectionObserver.js'; +import { MAX_FRAME_HEIGHT, MAX_FRAME_WIDTH } from '../calling/constants.js'; +import { useValueAtFixedRate } from '../hooks/useValueAtFixedRate.js'; +import { Theme } from '../util/theme.js'; +import { isOlderThan } from '../util/timestamp.js'; +import type { CallingImageDataCache } from './CallManager.js'; +import { usePrevious } from '../hooks/usePrevious.js'; const MAX_TIME_TO_SHOW_STALE_VIDEO_FRAMES = 10000; const MAX_TIME_TO_SHOW_STALE_SCREENSHARE_FRAMES = 60000; diff --git a/ts/components/GroupCallRemoteParticipants.tsx b/ts/components/GroupCallRemoteParticipants.tsx index 9063c593fc5..b6bbb3c06ff 100644 --- a/ts/components/GroupCallRemoteParticipants.tsx +++ b/ts/components/GroupCallRemoteParticipants.tsx @@ -4,30 +4,30 @@ import React, { useCallback, useState, useMemo, useEffect } from 'react'; import { clamp, chunk, maxBy, flatten, noop } from 'lodash'; import type { VideoFrameSource } from '@signalapp/ringrtc'; -import { GroupCallRemoteParticipant } from './GroupCallRemoteParticipant'; +import { GroupCallRemoteParticipant } from './GroupCallRemoteParticipant.js'; import { GroupCallOverflowArea, OVERFLOW_PARTICIPANT_WIDTH, -} from './GroupCallOverflowArea'; +} from './GroupCallOverflowArea.js'; import type { GroupCallRemoteParticipantType, GroupCallVideoRequest, -} from '../types/Calling'; -import { CallViewMode } from '../types/Calling'; -import { useGetCallingFrameBuffer } from '../calling/useGetCallingFrameBuffer'; -import type { LocalizerType } from '../types/Util'; -import { usePageVisibility } from '../hooks/usePageVisibility'; -import { useDevicePixelRatio } from '../hooks/useDevicePixelRatio'; -import { nonRenderedRemoteParticipant } from '../util/ringrtc/nonRenderedRemoteParticipant'; -import { missingCaseError } from '../util/missingCaseError'; -import { SECOND } from '../util/durations'; -import { filter, join } from '../util/iterables'; -import * as setUtil from '../util/setUtil'; -import { createLogger } from '../logging/log'; -import { MAX_FRAME_HEIGHT, MAX_FRAME_WIDTH } from '../calling/constants'; -import { SizeObserver } from '../hooks/useSizeObserver'; -import { strictAssert } from '../util/assert'; -import type { CallingImageDataCache } from './CallManager'; +} from '../types/Calling.js'; +import { CallViewMode } from '../types/Calling.js'; +import { useGetCallingFrameBuffer } from '../calling/useGetCallingFrameBuffer.js'; +import type { LocalizerType } from '../types/Util.js'; +import { usePageVisibility } from '../hooks/usePageVisibility.js'; +import { useDevicePixelRatio } from '../hooks/useDevicePixelRatio.js'; +import { nonRenderedRemoteParticipant } from '../util/ringrtc/nonRenderedRemoteParticipant.js'; +import { missingCaseError } from '../util/missingCaseError.js'; +import { SECOND } from '../util/durations/index.js'; +import { filter, join } from '../util/iterables.js'; +import * as setUtil from '../util/setUtil.js'; +import { createLogger } from '../logging/log.js'; +import { MAX_FRAME_HEIGHT, MAX_FRAME_WIDTH } from '../calling/constants.js'; +import { SizeObserver } from '../hooks/useSizeObserver.js'; +import { strictAssert } from '../util/assert.js'; +import type { CallingImageDataCache } from './CallManager.js'; const log = createLogger('GroupCallRemoteParticipants'); diff --git a/ts/components/GroupDescriptionInput.stories.tsx b/ts/components/GroupDescriptionInput.stories.tsx index 094daf41cf3..188a8a9ea6b 100644 --- a/ts/components/GroupDescriptionInput.stories.tsx +++ b/ts/components/GroupDescriptionInput.stories.tsx @@ -3,8 +3,8 @@ import React, { useState } from 'react'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './GroupDescriptionInput'; -import { GroupDescriptionInput } from './GroupDescriptionInput'; +import type { PropsType } from './GroupDescriptionInput.js'; +import { GroupDescriptionInput } from './GroupDescriptionInput.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/GroupDescriptionInput.tsx b/ts/components/GroupDescriptionInput.tsx index 2a470d819c4..d6cb057447c 100644 --- a/ts/components/GroupDescriptionInput.tsx +++ b/ts/components/GroupDescriptionInput.tsx @@ -3,8 +3,8 @@ import React, { forwardRef } from 'react'; -import { Input } from './Input'; -import type { LocalizerType } from '../types/Util'; +import { Input } from './Input.js'; +import type { LocalizerType } from '../types/Util.js'; export type PropsType = { disabled?: boolean; diff --git a/ts/components/GroupDescriptionText.tsx b/ts/components/GroupDescriptionText.tsx index 3940b71564b..489bc55b08e 100644 --- a/ts/components/GroupDescriptionText.tsx +++ b/ts/components/GroupDescriptionText.tsx @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import type { RenderTextCallbackType } from '../types/Util'; -import { AddNewLines } from './conversation/AddNewLines'; -import { Emojify } from './conversation/Emojify'; -import { Linkify } from './conversation/Linkify'; +import type { RenderTextCallbackType } from '../types/Util.js'; +import { AddNewLines } from './conversation/AddNewLines.js'; +import { Emojify } from './conversation/Emojify.js'; +import { Linkify } from './conversation/Linkify.js'; type PropsType = { text: string; diff --git a/ts/components/GroupDialog.tsx b/ts/components/GroupDialog.tsx index d68cb2be7b8..6685968be4c 100644 --- a/ts/components/GroupDialog.tsx +++ b/ts/components/GroupDialog.tsx @@ -4,13 +4,13 @@ import type { ReactChild, ReactNode } from 'react'; import React from 'react'; -import type { LocalizerType, ThemeType } from '../types/Util'; -import type { ConversationType } from '../state/ducks/conversations'; -import type { PreferredBadgeSelectorType } from '../state/selectors/badges'; -import { ModalHost } from './ModalHost'; -import { Button, ButtonVariant } from './Button'; -import { Avatar, AvatarSize } from './Avatar'; -import { ContactName } from './conversation/ContactName'; +import type { LocalizerType, ThemeType } from '../types/Util.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import type { PreferredBadgeSelectorType } from '../state/selectors/badges.js'; +import { ModalHost } from './ModalHost.js'; +import { Button, ButtonVariant } from './Button.js'; +import { Avatar, AvatarSize } from './Avatar.js'; +import { ContactName } from './conversation/ContactName.js'; type PropsType = { children: ReactNode; diff --git a/ts/components/GroupMembersNames.tsx b/ts/components/GroupMembersNames.tsx index 579e32cd606..b9da9bce3be 100644 --- a/ts/components/GroupMembersNames.tsx +++ b/ts/components/GroupMembersNames.tsx @@ -5,10 +5,10 @@ import React, { useMemo } from 'react'; import type { ReactNode } from 'react'; import { take } from 'lodash'; -import { I18n } from './I18n'; -import type { LocalizerType } from '../types/Util'; -import { UserText } from './UserText'; -import type { GroupV2Membership } from './conversation/conversation-details/ConversationDetailsMembershipList'; +import { I18n } from './I18n.js'; +import type { LocalizerType } from '../types/Util.js'; +import { UserText } from './UserText.js'; +import type { GroupV2Membership } from './conversation/conversation-details/ConversationDetailsMembershipList.js'; type PropsType = { i18n: LocalizerType; diff --git a/ts/components/GroupTitleInput.stories.tsx b/ts/components/GroupTitleInput.stories.tsx index b6d0b568119..6a9770a9162 100644 --- a/ts/components/GroupTitleInput.stories.tsx +++ b/ts/components/GroupTitleInput.stories.tsx @@ -3,8 +3,8 @@ import React, { useState } from 'react'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './GroupTitleInput'; -import { GroupTitleInput } from './GroupTitleInput'; +import type { PropsType } from './GroupTitleInput.js'; +import { GroupTitleInput } from './GroupTitleInput.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/GroupTitleInput.tsx b/ts/components/GroupTitleInput.tsx index ebd75e6c68f..ece44168abb 100644 --- a/ts/components/GroupTitleInput.tsx +++ b/ts/components/GroupTitleInput.tsx @@ -3,8 +3,8 @@ import React, { forwardRef } from 'react'; -import { Input } from './Input'; -import type { LocalizerType } from '../types/Util'; +import { Input } from './Input.js'; +import type { LocalizerType } from '../types/Util.js'; export type PropsType = { disabled?: boolean; diff --git a/ts/components/GroupV1MigrationDialog.stories.tsx b/ts/components/GroupV1MigrationDialog.stories.tsx index 61696b269e7..c9a07f2680a 100644 --- a/ts/components/GroupV1MigrationDialog.stories.tsx +++ b/ts/components/GroupV1MigrationDialog.stories.tsx @@ -6,11 +6,11 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './GroupV1MigrationDialog'; -import { GroupV1MigrationDialog } from './GroupV1MigrationDialog'; -import type { ConversationType } from '../state/ducks/conversations'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation'; -import { ThemeType } from '../types/Util'; +import type { PropsType } from './GroupV1MigrationDialog.js'; +import { GroupV1MigrationDialog } from './GroupV1MigrationDialog.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; +import { ThemeType } from '../types/Util.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/GroupV1MigrationDialog.tsx b/ts/components/GroupV1MigrationDialog.tsx index f967e9b7e2b..788e72e7ddc 100644 --- a/ts/components/GroupV1MigrationDialog.tsx +++ b/ts/components/GroupV1MigrationDialog.tsx @@ -2,12 +2,12 @@ // SPDX-License-Identifier: AGPL-3.0-only import * as React from 'react'; -import type { LocalizerType, ThemeType } from '../types/Util'; -import type { ConversationType } from '../state/ducks/conversations'; -import type { PreferredBadgeSelectorType } from '../state/selectors/badges'; -import { GroupDialog } from './GroupDialog'; -import { sortByTitle } from '../util/sortByTitle'; -import { missingCaseError } from '../util/missingCaseError'; +import type { LocalizerType, ThemeType } from '../types/Util.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import type { PreferredBadgeSelectorType } from '../state/selectors/badges.js'; +import { GroupDialog } from './GroupDialog.js'; +import { sortByTitle } from '../util/sortByTitle.js'; +import { missingCaseError } from '../util/missingCaseError.js'; export type DataPropsType = { readonly areWeInvited: boolean; diff --git a/ts/components/GroupV2JoinDialog.stories.tsx b/ts/components/GroupV2JoinDialog.stories.tsx index 5f8a6cad336..328baf03fca 100644 --- a/ts/components/GroupV2JoinDialog.stories.tsx +++ b/ts/components/GroupV2JoinDialog.stories.tsx @@ -4,8 +4,8 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './GroupV2JoinDialog'; -import { GroupV2JoinDialog } from './GroupV2JoinDialog'; +import type { PropsType } from './GroupV2JoinDialog.js'; +import { GroupV2JoinDialog } from './GroupV2JoinDialog.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/GroupV2JoinDialog.tsx b/ts/components/GroupV2JoinDialog.tsx index c1a17a34356..af32c4fd904 100644 --- a/ts/components/GroupV2JoinDialog.tsx +++ b/ts/components/GroupV2JoinDialog.tsx @@ -3,13 +3,13 @@ import * as React from 'react'; import classNames from 'classnames'; -import type { LocalizerType } from '../types/Util'; -import { Avatar, AvatarBlur } from './Avatar'; -import { Spinner } from './Spinner'; -import { Button, ButtonVariant } from './Button'; -import { GroupDescription } from './conversation/GroupDescription'; +import type { LocalizerType } from '../types/Util.js'; +import { Avatar, AvatarBlur } from './Avatar.js'; +import { Spinner } from './Spinner.js'; +import { Button, ButtonVariant } from './Button.js'; +import { GroupDescription } from './conversation/GroupDescription.js'; -import type { PreJoinConversationType } from '../state/ducks/conversations'; +import type { PreJoinConversationType } from '../state/ducks/conversations.js'; type CallbackType = () => unknown; diff --git a/ts/components/I18n.stories.tsx b/ts/components/I18n.stories.tsx index 88c4840121a..c670b81fb48 100644 --- a/ts/components/I18n.stories.tsx +++ b/ts/components/I18n.stories.tsx @@ -3,9 +3,9 @@ import * as React from 'react'; -import type { ComponentMeta } from '../storybook/types'; -import type { Props } from './I18n'; -import { I18n } from './I18n'; +import type { ComponentMeta } from '../storybook/types.js'; +import type { Props } from './I18n.js'; +import { I18n } from './I18n.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/I18n.tsx b/ts/components/I18n.tsx index e118c0a3c41..da5e14bdea8 100644 --- a/ts/components/I18n.tsx +++ b/ts/components/I18n.tsx @@ -6,8 +6,8 @@ import React from 'react'; import type { LocalizerType, ICUJSXMessageParamsByKeyType, -} from '../types/Util'; -import { strictAssert } from '../util/assert'; +} from '../types/Util.js'; +import { strictAssert } from '../util/assert.js'; export type Props = { /** The translation string id */ diff --git a/ts/components/IdenticonSVG.stories.tsx b/ts/components/IdenticonSVG.stories.tsx index eb01fdd78e9..2d8ed204b31 100644 --- a/ts/components/IdenticonSVG.stories.tsx +++ b/ts/components/IdenticonSVG.stories.tsx @@ -7,8 +7,8 @@ import { IdenticonSVGForCallLink, IdenticonSVGForContact, IdenticonSVGForGroup, -} from './IdenticonSVG'; -import { AvatarColorMap } from '../types/Colors'; +} from './IdenticonSVG.js'; +import { AvatarColorMap } from '../types/Colors.js'; export default { title: 'Components/IdenticonSVG', diff --git a/ts/components/ImageOrBlurhash.stories.tsx b/ts/components/ImageOrBlurhash.stories.tsx index 58800d16eb4..e84d771fb95 100644 --- a/ts/components/ImageOrBlurhash.stories.tsx +++ b/ts/components/ImageOrBlurhash.stories.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { Props } from './ImageOrBlurhash'; -import { ImageOrBlurhash } from './ImageOrBlurhash'; +import type { Props } from './ImageOrBlurhash.js'; +import { ImageOrBlurhash } from './ImageOrBlurhash.js'; export default { title: 'Components/ImageOrBlurhash', diff --git a/ts/components/ImageOrBlurhash.tsx b/ts/components/ImageOrBlurhash.tsx index f903f83ac41..58e7087d075 100644 --- a/ts/components/ImageOrBlurhash.tsx +++ b/ts/components/ImageOrBlurhash.tsx @@ -3,7 +3,7 @@ import React, { useMemo, useCallback, useState, useRef } from 'react'; -import { computeBlurHashUrl } from '../util/computeBlurHashUrl'; +import { computeBlurHashUrl } from '../util/computeBlurHashUrl.js'; export type Props = React.ImgHTMLAttributes & Readonly<{ diff --git a/ts/components/InContactsIcon.stories.tsx b/ts/components/InContactsIcon.stories.tsx index 4377cf590d8..801a08b1eb7 100644 --- a/ts/components/InContactsIcon.stories.tsx +++ b/ts/components/InContactsIcon.stories.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './InContactsIcon'; -import { InContactsIcon } from './InContactsIcon'; +import type { PropsType } from './InContactsIcon.js'; +import { InContactsIcon } from './InContactsIcon.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/InContactsIcon.tsx b/ts/components/InContactsIcon.tsx index e0cfe0d218c..14362474ff5 100644 --- a/ts/components/InContactsIcon.tsx +++ b/ts/components/InContactsIcon.tsx @@ -4,8 +4,8 @@ import React from 'react'; import classNames from 'classnames'; -import { Tooltip } from './Tooltip'; -import type { LocalizerType } from '../types/Util'; +import { Tooltip } from './Tooltip.js'; +import type { LocalizerType } from '../types/Util.js'; export type PropsType = { className?: string; diff --git a/ts/components/Inbox.stories.tsx b/ts/components/Inbox.stories.tsx index 4db17afb672..2634effc9b1 100644 --- a/ts/components/Inbox.stories.tsx +++ b/ts/components/Inbox.stories.tsx @@ -5,9 +5,9 @@ import React, { useState, useEffect, useMemo } from 'react'; import type { Meta, StoryFn } from '@storybook/react'; import { noop } from 'lodash'; -import { Inbox } from './Inbox'; -import type { PropsType } from './Inbox'; -import { DAY, SECOND } from '../util/durations'; +import { Inbox } from './Inbox.js'; +import type { PropsType } from './Inbox.js'; +import { DAY, SECOND } from '../util/durations/index.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/Inbox.tsx b/ts/components/Inbox.tsx index 9c564e192d0..f4bf56519ec 100644 --- a/ts/components/Inbox.tsx +++ b/ts/components/Inbox.tsx @@ -4,10 +4,10 @@ import type { ReactNode } from 'react'; import React, { useEffect, useState, useMemo } from 'react'; import classNames from 'classnames'; -import type { LocalizerType } from '../types/Util'; -import { createLogger } from '../logging/log'; -import { SECOND, DAY } from '../util/durations'; -import type { SmartNavTabsProps } from '../state/smart/NavTabs'; +import type { LocalizerType } from '../types/Util.js'; +import { createLogger } from '../logging/log.js'; +import { SECOND, DAY } from '../util/durations/index.js'; +import type { SmartNavTabsProps } from '../state/smart/NavTabs.js'; const log = createLogger('Inbox'); diff --git a/ts/components/IncomingCallBar.stories.tsx b/ts/components/IncomingCallBar.stories.tsx index 263e8c87fb1..c11804a365b 100644 --- a/ts/components/IncomingCallBar.stories.tsx +++ b/ts/components/IncomingCallBar.stories.tsx @@ -4,10 +4,10 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './IncomingCallBar'; -import { IncomingCallBar } from './IncomingCallBar'; -import { CallMode } from '../types/CallDisposition'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation'; +import type { PropsType } from './IncomingCallBar.js'; +import { IncomingCallBar } from './IncomingCallBar.js'; +import { CallMode } from '../types/CallDisposition.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/IncomingCallBar.tsx b/ts/components/IncomingCallBar.tsx index 4c91da293b7..8245d7c75ad 100644 --- a/ts/components/IncomingCallBar.tsx +++ b/ts/components/IncomingCallBar.tsx @@ -3,23 +3,26 @@ import type { ReactChild } from 'react'; import React, { useCallback, useEffect, useRef } from 'react'; -import { Avatar, AvatarSize } from './Avatar'; -import { Tooltip } from './Tooltip'; -import { I18n } from './I18n'; -import { Theme } from '../util/theme'; -import { getParticipantName } from '../util/callingGetParticipantName'; -import { ContactName } from './conversation/ContactName'; -import type { LocalizerType } from '../types/Util'; -import { AvatarColors } from '../types/Colors'; -import { CallMode } from '../types/CallDisposition'; -import type { ConversationType } from '../state/ducks/conversations'; -import type { AcceptCallType, DeclineCallType } from '../state/ducks/calling'; -import { missingCaseError } from '../util/missingCaseError'; +import { Avatar, AvatarSize } from './Avatar.js'; +import { Tooltip } from './Tooltip.js'; +import { I18n } from './I18n.js'; +import { Theme } from '../util/theme.js'; +import { getParticipantName } from '../util/callingGetParticipantName.js'; +import { ContactName } from './conversation/ContactName.js'; +import type { LocalizerType } from '../types/Util.js'; +import { AvatarColors } from '../types/Colors.js'; +import { CallMode } from '../types/CallDisposition.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import type { + AcceptCallType, + DeclineCallType, +} from '../state/ducks/calling.js'; +import { missingCaseError } from '../util/missingCaseError.js'; import { useIncomingCallShortcuts, useKeyboardShortcuts, -} from '../hooks/useKeyboardShortcuts'; -import { UserText } from './UserText'; +} from '../hooks/useKeyboardShortcuts.js'; +import { UserText } from './UserText.js'; export type PropsType = { acceptCall: (_: AcceptCallType) => void; diff --git a/ts/components/Input.stories.tsx b/ts/components/Input.stories.tsx index ed930400bf7..d8d6c5a9163 100644 --- a/ts/components/Input.stories.tsx +++ b/ts/components/Input.stories.tsx @@ -4,8 +4,8 @@ import React, { useState } from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './Input'; -import { Input } from './Input'; +import type { PropsType } from './Input.js'; +import { Input } from './Input.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/Input.tsx b/ts/components/Input.tsx index 94fa0023fd1..b0bdc6fa927 100644 --- a/ts/components/Input.tsx +++ b/ts/components/Input.tsx @@ -11,11 +11,11 @@ import React, { } from 'react'; import classNames from 'classnames'; -import * as grapheme from '../util/grapheme'; -import type { LocalizerType } from '../types/Util'; -import { getClassNamesFor } from '../util/getClassNamesFor'; -import { useRefMerger } from '../hooks/useRefMerger'; -import { byteLength } from '../Bytes'; +import * as grapheme from '../util/grapheme.js'; +import type { LocalizerType } from '../types/Util.js'; +import { getClassNamesFor } from '../util/getClassNamesFor.js'; +import { useRefMerger } from '../hooks/useRefMerger.js'; +import { byteLength } from '../Bytes.js'; export type PropsType = { autoFocus?: boolean; diff --git a/ts/components/InstallScreen.tsx b/ts/components/InstallScreen.tsx index 00f1708bb9b..21ab5af6286 100644 --- a/ts/components/InstallScreen.tsx +++ b/ts/components/InstallScreen.tsx @@ -4,12 +4,12 @@ import type { ComponentProps, ReactElement } from 'react'; import React from 'react'; -import { missingCaseError } from '../util/missingCaseError'; -import { InstallScreenStep } from '../types/InstallScreen'; -import { InstallScreenErrorStep } from './installScreen/InstallScreenErrorStep'; -import { InstallScreenLinkInProgressStep } from './installScreen/InstallScreenLinkInProgressStep'; -import { InstallScreenQrCodeNotScannedStep } from './installScreen/InstallScreenQrCodeNotScannedStep'; -import { InstallScreenBackupImportStep } from './installScreen/InstallScreenBackupImportStep'; +import { missingCaseError } from '../util/missingCaseError.js'; +import { InstallScreenStep } from '../types/InstallScreen.js'; +import { InstallScreenErrorStep } from './installScreen/InstallScreenErrorStep.js'; +import { InstallScreenLinkInProgressStep } from './installScreen/InstallScreenLinkInProgressStep.js'; +import { InstallScreenQrCodeNotScannedStep } from './installScreen/InstallScreenQrCodeNotScannedStep.js'; +import { InstallScreenBackupImportStep } from './installScreen/InstallScreenBackupImportStep.js'; // We can't always use destructuring assignment because of the complexity of this props // type. diff --git a/ts/components/LeftPane.stories.tsx b/ts/components/LeftPane.stories.tsx index 300071e6a84..936aec07858 100644 --- a/ts/components/LeftPane.stories.tsx +++ b/ts/components/LeftPane.stories.tsx @@ -4,36 +4,36 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './LeftPane'; -import { LeftPane } from './LeftPane'; -import { CaptchaDialog } from './CaptchaDialog'; -import { CrashReportDialog } from './CrashReportDialog'; -import { ToastManager } from './ToastManager'; -import type { PropsType as DialogNetworkStatusPropsType } from './DialogNetworkStatus'; -import { DialogExpiredBuild } from './DialogExpiredBuild'; -import { DialogNetworkStatus } from './DialogNetworkStatus'; -import { DialogRelink } from './DialogRelink'; -import type { PropsType as DialogUpdatePropsType } from './DialogUpdate'; -import { DialogUpdate } from './DialogUpdate'; -import { UnsupportedOSDialog } from './UnsupportedOSDialog'; -import type { ConversationType } from '../state/ducks/conversations'; -import { MessageSearchResult } from './conversationList/MessageSearchResult'; -import { DurationInSeconds, DAY } from '../util/durations'; -import { LeftPaneMode } from '../types/leftPane'; -import { ThemeType } from '../types/Util'; +import type { PropsType } from './LeftPane.js'; +import { LeftPane } from './LeftPane.js'; +import { CaptchaDialog } from './CaptchaDialog.js'; +import { CrashReportDialog } from './CrashReportDialog.js'; +import { ToastManager } from './ToastManager.js'; +import type { PropsType as DialogNetworkStatusPropsType } from './DialogNetworkStatus.js'; +import { DialogExpiredBuild } from './DialogExpiredBuild.js'; +import { DialogNetworkStatus } from './DialogNetworkStatus.js'; +import { DialogRelink } from './DialogRelink.js'; +import type { PropsType as DialogUpdatePropsType } from './DialogUpdate.js'; +import { DialogUpdate } from './DialogUpdate.js'; +import { UnsupportedOSDialog } from './UnsupportedOSDialog.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import { MessageSearchResult } from './conversationList/MessageSearchResult.js'; +import { DurationInSeconds, DAY } from '../util/durations/index.js'; +import { LeftPaneMode } from '../types/leftPane.js'; +import { ThemeType } from '../types/Util.js'; import { getDefaultConversation, getDefaultGroupListItem, -} from '../test-helpers/getDefaultConversation'; -import { DialogType } from '../types/Dialogs'; -import { SocketStatus } from '../types/SocketStatus'; -import { StorybookThemeContext } from '../../.storybook/StorybookThemeContext'; +} from '../test-helpers/getDefaultConversation.js'; +import { DialogType } from '../types/Dialogs.js'; +import { SocketStatus } from '../types/SocketStatus.js'; +import { StorybookThemeContext } from '../../.storybook/StorybookThemeContext.js'; import { makeFakeLookupConversationWithoutServiceId, useUuidFetchState, -} from '../test-helpers/fakeLookupConversationWithoutServiceId'; -import type { GroupListItemConversationType } from './conversationList/GroupListItem'; -import { ServerAlert } from '../util/handleServerAlerts'; +} from '../test-helpers/fakeLookupConversationWithoutServiceId.js'; +import type { GroupListItemConversationType } from './conversationList/GroupListItem.js'; +import { ServerAlert } from '../util/handleServerAlerts.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/LeftPane.tsx b/ts/components/LeftPane.tsx index 07e73ec9b6f..87fcb8a27ab 100644 --- a/ts/components/LeftPane.tsx +++ b/ts/components/LeftPane.tsx @@ -5,61 +5,61 @@ import React, { useEffect, useCallback, useMemo, useRef } from 'react'; import classNames from 'classnames'; import { isNumber } from 'lodash'; -import type { LeftPaneHelper, ToFindType } from './leftPane/LeftPaneHelper'; -import { FindDirection } from './leftPane/LeftPaneHelper'; -import type { LeftPaneInboxPropsType } from './leftPane/LeftPaneInboxHelper'; -import { LeftPaneInboxHelper } from './leftPane/LeftPaneInboxHelper'; -import type { LeftPaneSearchPropsType } from './leftPane/LeftPaneSearchHelper'; -import { LeftPaneSearchHelper } from './leftPane/LeftPaneSearchHelper'; -import type { LeftPaneArchivePropsType } from './leftPane/LeftPaneArchiveHelper'; -import { LeftPaneArchiveHelper } from './leftPane/LeftPaneArchiveHelper'; -import type { LeftPaneComposePropsType } from './leftPane/LeftPaneComposeHelper'; -import { LeftPaneComposeHelper } from './leftPane/LeftPaneComposeHelper'; -import type { LeftPaneFindByUsernamePropsType } from './leftPane/LeftPaneFindByUsernameHelper'; -import { LeftPaneFindByUsernameHelper } from './leftPane/LeftPaneFindByUsernameHelper'; -import type { LeftPaneFindByPhoneNumberPropsType } from './leftPane/LeftPaneFindByPhoneNumberHelper'; -import { LeftPaneFindByPhoneNumberHelper } from './leftPane/LeftPaneFindByPhoneNumberHelper'; -import type { LeftPaneChooseGroupMembersPropsType } from './leftPane/LeftPaneChooseGroupMembersHelper'; -import { LeftPaneChooseGroupMembersHelper } from './leftPane/LeftPaneChooseGroupMembersHelper'; -import type { LeftPaneSetGroupMetadataPropsType } from './leftPane/LeftPaneSetGroupMetadataHelper'; -import { LeftPaneSetGroupMetadataHelper } from './leftPane/LeftPaneSetGroupMetadataHelper'; +import type { LeftPaneHelper, ToFindType } from './leftPane/LeftPaneHelper.js'; +import { FindDirection } from './leftPane/LeftPaneHelper.js'; +import type { LeftPaneInboxPropsType } from './leftPane/LeftPaneInboxHelper.js'; +import { LeftPaneInboxHelper } from './leftPane/LeftPaneInboxHelper.js'; +import type { LeftPaneSearchPropsType } from './leftPane/LeftPaneSearchHelper.js'; +import { LeftPaneSearchHelper } from './leftPane/LeftPaneSearchHelper.js'; +import type { LeftPaneArchivePropsType } from './leftPane/LeftPaneArchiveHelper.js'; +import { LeftPaneArchiveHelper } from './leftPane/LeftPaneArchiveHelper.js'; +import type { LeftPaneComposePropsType } from './leftPane/LeftPaneComposeHelper.js'; +import { LeftPaneComposeHelper } from './leftPane/LeftPaneComposeHelper.js'; +import type { LeftPaneFindByUsernamePropsType } from './leftPane/LeftPaneFindByUsernameHelper.js'; +import { LeftPaneFindByUsernameHelper } from './leftPane/LeftPaneFindByUsernameHelper.js'; +import type { LeftPaneFindByPhoneNumberPropsType } from './leftPane/LeftPaneFindByPhoneNumberHelper.js'; +import { LeftPaneFindByPhoneNumberHelper } from './leftPane/LeftPaneFindByPhoneNumberHelper.js'; +import type { LeftPaneChooseGroupMembersPropsType } from './leftPane/LeftPaneChooseGroupMembersHelper.js'; +import { LeftPaneChooseGroupMembersHelper } from './leftPane/LeftPaneChooseGroupMembersHelper.js'; +import type { LeftPaneSetGroupMetadataPropsType } from './leftPane/LeftPaneSetGroupMetadataHelper.js'; +import { LeftPaneSetGroupMetadataHelper } from './leftPane/LeftPaneSetGroupMetadataHelper.js'; -import { LeftPaneMode } from '../types/leftPane'; -import type { LocalizerType, ThemeType } from '../types/Util'; -import { ScrollBehavior } from '../types/Util'; -import type { PreferredBadgeSelectorType } from '../state/selectors/badges'; -import { usePrevious } from '../hooks/usePrevious'; -import { missingCaseError } from '../util/missingCaseError'; -import type { DurationInSeconds } from '../util/durations'; -import { WidthBreakpoint, getNavSidebarWidthBreakpoint } from './_util'; -import * as KeyboardLayout from '../services/keyboardLayout'; -import type { LookupConversationWithoutServiceIdActionsType } from '../util/lookupConversationWithoutServiceId'; -import type { ShowConversationType } from '../state/ducks/conversations'; -import type { PropsType as UnsupportedOSDialogPropsType } from '../state/smart/UnsupportedOSDialog'; +import { LeftPaneMode } from '../types/leftPane.js'; +import type { LocalizerType, ThemeType } from '../types/Util.js'; +import { ScrollBehavior } from '../types/Util.js'; +import type { PreferredBadgeSelectorType } from '../state/selectors/badges.js'; +import { usePrevious } from '../hooks/usePrevious.js'; +import { missingCaseError } from '../util/missingCaseError.js'; +import type { DurationInSeconds } from '../util/durations/index.js'; +import { WidthBreakpoint, getNavSidebarWidthBreakpoint } from './_util.js'; +import * as KeyboardLayout from '../services/keyboardLayout.js'; +import type { LookupConversationWithoutServiceIdActionsType } from '../util/lookupConversationWithoutServiceId.js'; +import type { ShowConversationType } from '../state/ducks/conversations.js'; +import type { PropsType as UnsupportedOSDialogPropsType } from '../state/smart/UnsupportedOSDialog.js'; -import { ConversationList } from './ConversationList'; -import { ContactCheckboxDisabledReason } from './conversationList/ContactCheckbox'; -import type { PropsType as DialogExpiredBuildPropsType } from './DialogExpiredBuild'; -import { LeftPaneBanner } from './LeftPaneBanner'; +import { ConversationList } from './ConversationList.js'; +import { ContactCheckboxDisabledReason } from './conversationList/ContactCheckbox.js'; +import type { PropsType as DialogExpiredBuildPropsType } from './DialogExpiredBuild.js'; +import { LeftPaneBanner } from './LeftPaneBanner.js'; import type { DeleteAvatarFromDiskActionType, ReplaceAvatarActionType, SaveAvatarToDiskActionType, -} from '../types/Avatar'; -import { useSizeObserver } from '../hooks/useSizeObserver'; +} from '../types/Avatar.js'; +import { useSizeObserver } from '../hooks/useSizeObserver.js'; import { NavSidebar, NavSidebarActionButton, NavSidebarSearchHeader, -} from './NavSidebar'; -import { ContextMenu } from './ContextMenu'; -import type { UnreadStats } from '../util/countUnreadStats'; -import { BackupMediaDownloadProgress } from './BackupMediaDownloadProgress'; -import type { ServerAlertsType } from '../util/handleServerAlerts'; -import { getServerAlertDialog } from './ServerAlerts'; -import { NavTab, SettingsPage, ProfileEditorPage } from '../types/Nav'; -import type { Location } from '../types/Nav'; +} from './NavSidebar.js'; +import { ContextMenu } from './ContextMenu.js'; +import type { UnreadStats } from '../util/countUnreadStats.js'; +import { BackupMediaDownloadProgress } from './BackupMediaDownloadProgress.js'; +import type { ServerAlertsType } from '../util/handleServerAlerts.js'; +import { getServerAlertDialog } from './ServerAlerts.js'; +import { NavTab, SettingsPage, ProfileEditorPage } from '../types/Nav.js'; +import type { Location } from '../types/Nav.js'; export type PropsType = { backupMediaDownloadProgress: { diff --git a/ts/components/LeftPaneBanner.stories.tsx b/ts/components/LeftPaneBanner.stories.tsx index cc0b3491802..622977d8c27 100644 --- a/ts/components/LeftPaneBanner.stories.tsx +++ b/ts/components/LeftPaneBanner.stories.tsx @@ -4,7 +4,7 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { LeftPaneBanner, type PropsType } from './LeftPaneBanner'; +import { LeftPaneBanner, type PropsType } from './LeftPaneBanner.js'; export default { title: 'Components/LeftPaneBanner', diff --git a/ts/components/LeftPaneDialog.stories.tsx b/ts/components/LeftPaneDialog.stories.tsx index 607490f3a74..94a333679e8 100644 --- a/ts/components/LeftPaneDialog.stories.tsx +++ b/ts/components/LeftPaneDialog.stories.tsx @@ -3,9 +3,9 @@ import React from 'react'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './LeftPaneDialog'; -import { LeftPaneDialog } from './LeftPaneDialog'; -import { WidthBreakpoint } from './_util'; +import type { PropsType } from './LeftPaneDialog.js'; +import { LeftPaneDialog } from './LeftPaneDialog.js'; +import { WidthBreakpoint } from './_util.js'; const widths = { [WidthBreakpoint.Wide]: '400px', diff --git a/ts/components/LeftPaneDialog.tsx b/ts/components/LeftPaneDialog.tsx index 0e08fefef92..ee0b45f39e5 100644 --- a/ts/components/LeftPaneDialog.tsx +++ b/ts/components/LeftPaneDialog.tsx @@ -4,8 +4,8 @@ import type { ReactChild, ReactNode } from 'react'; import React from 'react'; import classNames from 'classnames'; -import { Tooltip, TooltipPlacement } from './Tooltip'; -import { WidthBreakpoint } from './_util'; +import { Tooltip, TooltipPlacement } from './Tooltip.js'; +import { WidthBreakpoint } from './_util.js'; const BASE_CLASS_NAME = 'LeftPaneDialog'; const TOOLTIP_CLASS_NAME = `${BASE_CLASS_NAME}__tooltip`; diff --git a/ts/components/LeftPaneSearchInput.tsx b/ts/components/LeftPaneSearchInput.tsx index 9a1c88fd0b0..7be4c72984e 100644 --- a/ts/components/LeftPaneSearchInput.tsx +++ b/ts/components/LeftPaneSearchInput.tsx @@ -6,13 +6,13 @@ import classNames from 'classnames'; import type { ConversationType, ShowConversationType, -} from '../state/ducks/conversations'; -import type { LocalizerType } from '../types/Util'; -import { Avatar, AvatarSize } from './Avatar'; -import { SearchInput } from './SearchInput'; -import { usePrevious } from '../hooks/usePrevious'; -import { Tooltip, TooltipPlacement } from './Tooltip'; -import { Theme } from '../util/theme'; +} from '../state/ducks/conversations.js'; +import type { LocalizerType } from '../types/Util.js'; +import { Avatar, AvatarSize } from './Avatar.js'; +import { SearchInput } from './SearchInput.js'; +import { usePrevious } from '../hooks/usePrevious.js'; +import { Tooltip, TooltipPlacement } from './Tooltip.js'; +import { Theme } from '../util/theme.js'; type BasePropsType = { clearConversationSearch: () => void; diff --git a/ts/components/Lightbox.stories.tsx b/ts/components/Lightbox.stories.tsx index 44ede476d05..b3d2218fcc8 100644 --- a/ts/components/Lightbox.stories.tsx +++ b/ts/components/Lightbox.stories.tsx @@ -5,9 +5,9 @@ import React, { useState } from 'react'; import { action } from '@storybook/addon-actions'; import { noop } from 'lodash'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './Lightbox'; -import { Lightbox } from './Lightbox'; -import type { MediaItemType } from '../types/MediaItem'; +import type { PropsType } from './Lightbox.js'; +import { Lightbox } from './Lightbox.js'; +import type { MediaItemType } from '../types/MediaItem.js'; import { AUDIO_MP3, IMAGE_JPEG, @@ -15,9 +15,9 @@ import { VIDEO_QUICKTIME, stringToMIMEType, type MIMEType, -} from '../types/MIME'; +} from '../types/MIME.js'; -import { fakeAttachment } from '../test-helpers/fakeAttachment'; +import { fakeAttachment } from '../test-helpers/fakeAttachment.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/Lightbox.tsx b/ts/components/Lightbox.tsx index 0c6c26e0454..79a06dc69b4 100644 --- a/ts/components/Lightbox.tsx +++ b/ts/components/Lightbox.tsx @@ -12,29 +12,29 @@ import type { ReadonlyDeep } from 'type-fest'; import type { ConversationType, SaveAttachmentActionCreatorType, -} from '../state/ducks/conversations'; -import type { LocalizerType } from '../types/Util'; -import type { MediaItemType } from '../types/MediaItem'; -import * as GoogleChrome from '../util/GoogleChrome'; -import { createLogger } from '../logging/log'; -import * as Errors from '../types/errors'; -import { Avatar, AvatarSize } from './Avatar'; -import { IMAGE_PNG, isImage, isVideo } from '../types/MIME'; -import { formatDateTimeForAttachment } from '../util/timestamp'; -import { formatDuration } from '../util/formatDuration'; -import { isGIF, isIncremental } from '../types/Attachment'; -import { useRestoreFocus } from '../hooks/useRestoreFocus'; -import { usePrevious } from '../hooks/usePrevious'; -import { arrow } from '../util/keyboard'; -import { drop } from '../util/drop'; -import { isCmdOrCtrl } from '../hooks/useKeyboardShortcuts'; -import type { ForwardMessagesPayload } from '../state/ducks/globalModals'; -import { ForwardMessagesModalType } from './ForwardMessagesModal'; -import { useReducedMotion } from '../hooks/useReducedMotion'; -import { formatFileSize } from '../util/formatFileSize'; -import { SECOND } from '../util/durations'; -import { Toast } from './Toast'; -import { isAbortError } from '../util/isAbortError'; +} from '../state/ducks/conversations.js'; +import type { LocalizerType } from '../types/Util.js'; +import type { MediaItemType } from '../types/MediaItem.js'; +import * as GoogleChrome from '../util/GoogleChrome.js'; +import { createLogger } from '../logging/log.js'; +import * as Errors from '../types/errors.js'; +import { Avatar, AvatarSize } from './Avatar.js'; +import { IMAGE_PNG, isImage, isVideo } from '../types/MIME.js'; +import { formatDateTimeForAttachment } from '../util/timestamp.js'; +import { formatDuration } from '../util/formatDuration.js'; +import { isGIF, isIncremental } from '../types/Attachment.js'; +import { useRestoreFocus } from '../hooks/useRestoreFocus.js'; +import { usePrevious } from '../hooks/usePrevious.js'; +import { arrow } from '../util/keyboard.js'; +import { drop } from '../util/drop.js'; +import { isCmdOrCtrl } from '../hooks/useKeyboardShortcuts.js'; +import type { ForwardMessagesPayload } from '../state/ducks/globalModals.js'; +import { ForwardMessagesModalType } from './ForwardMessagesModal.js'; +import { useReducedMotion } from '../hooks/useReducedMotion.js'; +import { formatFileSize } from '../util/formatFileSize.js'; +import { SECOND } from '../util/durations/index.js'; +import { Toast } from './Toast.js'; +import { isAbortError } from '../util/isAbortError.js'; const log = createLogger('Lightbox'); diff --git a/ts/components/ListTile.stories.tsx b/ts/components/ListTile.stories.tsx index b54c376b7b7..12fb1b1c6df 100644 --- a/ts/components/ListTile.stories.tsx +++ b/ts/components/ListTile.stories.tsx @@ -3,10 +3,10 @@ import type { Meta, StoryFn } from '@storybook/react'; import React from 'react'; -import { ListTile } from './ListTile'; -import type { Props } from './ListTile'; -import { CircleCheckbox } from './CircleCheckbox'; -import { UserText } from './UserText'; +import { ListTile } from './ListTile.js'; +import type { Props } from './ListTile.js'; +import { CircleCheckbox } from './CircleCheckbox.js'; +import { UserText } from './UserText.js'; export default { title: 'Components/ListTile', diff --git a/ts/components/ListTile.tsx b/ts/components/ListTile.tsx index e8fbf155c78..410b3ab4351 100644 --- a/ts/components/ListTile.tsx +++ b/ts/components/ListTile.tsx @@ -4,8 +4,8 @@ import classNames from 'classnames'; import React, { useMemo } from 'react'; import { v4 as uuid } from 'uuid'; -import { getClassNamesFor } from '../util/getClassNamesFor'; -import { CircleCheckbox } from './CircleCheckbox'; +import { getClassNamesFor } from '../util/getClassNamesFor.js'; +import { CircleCheckbox } from './CircleCheckbox.js'; export type Props = { title: string | JSX.Element; diff --git a/ts/components/ListView.tsx b/ts/components/ListView.tsx index 5e62e7cc7d6..3095999825f 100644 --- a/ts/components/ListView.tsx +++ b/ts/components/ListView.tsx @@ -5,7 +5,7 @@ import classNames from 'classnames'; import React, { useRef, useCallback, useMemo, useLayoutEffect } from 'react'; import type { Index, ListRowRenderer } from 'react-virtualized'; import { List } from 'react-virtualized'; -import { ScrollBehavior } from '../types/Util'; +import { ScrollBehavior } from '../types/Util.js'; type Props = { width: number; diff --git a/ts/components/LocalDeleteWarningModal.stories.tsx b/ts/components/LocalDeleteWarningModal.stories.tsx index 6ebb362bde4..5143c82d324 100644 --- a/ts/components/LocalDeleteWarningModal.stories.tsx +++ b/ts/components/LocalDeleteWarningModal.stories.tsx @@ -5,8 +5,8 @@ import type { Meta, StoryFn } from '@storybook/react'; import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { PropsType } from './LocalDeleteWarningModal'; -import { LocalDeleteWarningModal } from './LocalDeleteWarningModal'; +import type { PropsType } from './LocalDeleteWarningModal.js'; +import { LocalDeleteWarningModal } from './LocalDeleteWarningModal.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/LocalDeleteWarningModal.tsx b/ts/components/LocalDeleteWarningModal.tsx index 83051d9fce5..6492292d698 100644 --- a/ts/components/LocalDeleteWarningModal.tsx +++ b/ts/components/LocalDeleteWarningModal.tsx @@ -3,10 +3,10 @@ import React from 'react'; -import type { LocalizerType } from '../types/Util'; -import { Button, ButtonVariant } from './Button'; -import { I18n } from './I18n'; -import { Modal } from './Modal'; +import type { LocalizerType } from '../types/Util.js'; +import { Button, ButtonVariant } from './Button.js'; +import { I18n } from './I18n.js'; +import { Modal } from './Modal.js'; export type PropsType = { i18n: LocalizerType; diff --git a/ts/components/LowDiskSpaceBackupImportModal.stories.tsx b/ts/components/LowDiskSpaceBackupImportModal.stories.tsx index b8207f5b802..d30bfbd005c 100644 --- a/ts/components/LowDiskSpaceBackupImportModal.stories.tsx +++ b/ts/components/LowDiskSpaceBackupImportModal.stories.tsx @@ -5,8 +5,8 @@ import type { Meta, StoryFn } from '@storybook/react'; import React, { type ComponentProps } from 'react'; import { action } from '@storybook/addon-actions'; -import { LowDiskSpaceBackupImportModal } from './LowDiskSpaceBackupImportModal'; -import { MEBIBYTE } from '../types/AttachmentSize'; +import { LowDiskSpaceBackupImportModal } from './LowDiskSpaceBackupImportModal.js'; +import { MEBIBYTE } from '../types/AttachmentSize.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/LowDiskSpaceBackupImportModal.tsx b/ts/components/LowDiskSpaceBackupImportModal.tsx index d6a6f7f38f5..0ce0b18c39c 100644 --- a/ts/components/LowDiskSpaceBackupImportModal.tsx +++ b/ts/components/LowDiskSpaceBackupImportModal.tsx @@ -3,10 +3,10 @@ import * as React from 'react'; -import type { LocalizerType } from '../types/Util'; -import { Modal } from './Modal'; -import { Button, ButtonVariant } from './Button'; -import { formatFileSize } from '../util/formatFileSize'; +import type { LocalizerType } from '../types/Util.js'; +import { Modal } from './Modal.js'; +import { Button, ButtonVariant } from './Button.js'; +import { formatFileSize } from '../util/formatFileSize.js'; export type PropsType = Readonly<{ bytesNeeded: number; diff --git a/ts/components/MediaEditor.stories.tsx b/ts/components/MediaEditor.stories.tsx index e6eb29e00d2..bf09b519033 100644 --- a/ts/components/MediaEditor.stories.tsx +++ b/ts/components/MediaEditor.stories.tsx @@ -5,10 +5,10 @@ import type { Meta, StoryFn } from '@storybook/react'; import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { PropsType } from './MediaEditor'; -import { MediaEditor } from './MediaEditor'; -import { Stickers, installedPacks } from '../test-helpers/getStickerPacks'; -import { EmojiSkinTone } from './fun/data/emojis'; +import type { PropsType } from './MediaEditor.js'; +import { MediaEditor } from './MediaEditor.js'; +import { Stickers, installedPacks } from '../test-helpers/getStickerPacks.js'; +import { EmojiSkinTone } from './fun/data/emojis.js'; const { i18n } = window.SignalContext; const IMAGE_1 = '/fixtures/nathan-anderson-316188-unsplash.jpg'; diff --git a/ts/components/MediaEditor.tsx b/ts/components/MediaEditor.tsx index dab6ebd0f25..6bb9cef83ef 100644 --- a/ts/components/MediaEditor.tsx +++ b/ts/components/MediaEditor.tsx @@ -17,58 +17,61 @@ import { get, has, noop } from 'lodash'; import type { EmojiPickDataType, Props as EmojiPickerProps, -} from './emoji/EmojiPicker'; -import type { DraftBodyRanges } from '../types/BodyRange'; -import type { ImageStateType } from '../mediaEditor/ImageStateType'; +} from './emoji/EmojiPicker.js'; +import type { DraftBodyRanges } from '../types/BodyRange.js'; +import type { ImageStateType } from '../mediaEditor/ImageStateType.js'; import type { InputApi, Props as CompositionInputProps, -} from './CompositionInput'; -import type { LocalizerType } from '../types/Util'; -import type { MIMEType } from '../types/MIME'; -import type { Props as StickerButtonProps } from './stickers/StickerButton'; -import type { imageToBlurHash } from '../util/imageToBlurHash'; -import { MediaEditorFabricAnalogTimeSticker } from '../mediaEditor/MediaEditorFabricAnalogTimeSticker'; -import { MediaEditorFabricCropRect } from '../mediaEditor/MediaEditorFabricCropRect'; -import { MediaEditorFabricDigitalTimeSticker } from '../mediaEditor/MediaEditorFabricDigitalTimeSticker'; -import { MediaEditorFabricIText } from '../mediaEditor/MediaEditorFabricIText'; -import { MediaEditorFabricPencilBrush } from '../mediaEditor/MediaEditorFabricPencilBrush'; -import { MediaEditorFabricSticker } from '../mediaEditor/MediaEditorFabricSticker'; -import { fabricEffectListener } from '../mediaEditor/fabricEffectListener'; -import { getRGBA, getHSL } from '../mediaEditor/util/color'; +} from './CompositionInput.js'; +import type { LocalizerType } from '../types/Util.js'; +import type { MIMEType } from '../types/MIME.js'; +import type { Props as StickerButtonProps } from './stickers/StickerButton.js'; +import type { imageToBlurHash } from '../util/imageToBlurHash.js'; +import { MediaEditorFabricAnalogTimeSticker } from '../mediaEditor/MediaEditorFabricAnalogTimeSticker.js'; +import { MediaEditorFabricCropRect } from '../mediaEditor/MediaEditorFabricCropRect.js'; +import { MediaEditorFabricDigitalTimeSticker } from '../mediaEditor/MediaEditorFabricDigitalTimeSticker.js'; +import { MediaEditorFabricIText } from '../mediaEditor/MediaEditorFabricIText.js'; +import { MediaEditorFabricPencilBrush } from '../mediaEditor/MediaEditorFabricPencilBrush.js'; +import { MediaEditorFabricSticker } from '../mediaEditor/MediaEditorFabricSticker.js'; +import { fabricEffectListener } from '../mediaEditor/fabricEffectListener.js'; +import { getRGBA, getHSL } from '../mediaEditor/util/color.js'; import { getTextStyleAttributes, TextStyle, -} from '../mediaEditor/util/getTextStyleAttributes'; -import { createLogger } from '../logging/log'; -import { Button, ButtonVariant } from './Button'; -import { CompositionInput } from './CompositionInput'; -import { ContextMenu } from './ContextMenu'; -import { EmojiButton } from './emoji/EmojiButton'; -import { IMAGE_PNG } from '../types/MIME'; -import { SizeObserver } from '../hooks/useSizeObserver'; -import { Slider } from './Slider'; -import { Spinner } from './Spinner'; -import { StickerButton } from './stickers/StickerButton'; -import { Theme } from '../util/theme'; -import { ThemeType } from '../types/Util'; -import { arrow } from '../util/keyboard'; -import { canvasToBytes } from '../util/canvasToBytes'; -import { loadImage } from '../util/loadImage'; -import { getConversationSelector } from '../state/selectors/conversations'; -import { hydrateRanges } from '../types/BodyRange'; -import { useConfirmDiscard } from '../hooks/useConfirmDiscard'; -import { useFabricHistory } from '../mediaEditor/useFabricHistory'; -import { usePortal } from '../hooks/usePortal'; -import { isFunPickerEnabled } from './fun/isFunPickerEnabled'; -import { FunEmojiPicker } from './fun/FunEmojiPicker'; -import { FunEmojiPickerButton, FunStickerPickerButton } from './fun/FunButton'; -import type { FunEmojiSelection } from './fun/panels/FunPanelEmojis'; -import { FunStickerPicker } from './fun/FunStickerPicker'; -import type { FunStickerSelection } from './fun/panels/FunPanelStickers'; -import { drop } from '../util/drop'; -import type { FunTimeStickerStyle } from './fun/constants'; -import * as Errors from '../types/errors'; +} from '../mediaEditor/util/getTextStyleAttributes.js'; +import { createLogger } from '../logging/log.js'; +import { Button, ButtonVariant } from './Button.js'; +import { CompositionInput } from './CompositionInput.js'; +import { ContextMenu } from './ContextMenu.js'; +import { EmojiButton } from './emoji/EmojiButton.js'; +import { IMAGE_PNG } from '../types/MIME.js'; +import { SizeObserver } from '../hooks/useSizeObserver.js'; +import { Slider } from './Slider.js'; +import { Spinner } from './Spinner.js'; +import { StickerButton } from './stickers/StickerButton.js'; +import { Theme } from '../util/theme.js'; +import { ThemeType } from '../types/Util.js'; +import { arrow } from '../util/keyboard.js'; +import { canvasToBytes } from '../util/canvasToBytes.js'; +import { loadImage } from '../util/loadImage.js'; +import { getConversationSelector } from '../state/selectors/conversations.js'; +import { hydrateRanges } from '../types/BodyRange.js'; +import { useConfirmDiscard } from '../hooks/useConfirmDiscard.js'; +import { useFabricHistory } from '../mediaEditor/useFabricHistory.js'; +import { usePortal } from '../hooks/usePortal.js'; +import { isFunPickerEnabled } from './fun/isFunPickerEnabled.js'; +import { FunEmojiPicker } from './fun/FunEmojiPicker.js'; +import { + FunEmojiPickerButton, + FunStickerPickerButton, +} from './fun/FunButton.js'; +import type { FunEmojiSelection } from './fun/panels/FunPanelEmojis.js'; +import { FunStickerPicker } from './fun/FunStickerPicker.js'; +import type { FunStickerSelection } from './fun/panels/FunPanelStickers.js'; +import { drop } from '../util/drop.js'; +import type { FunTimeStickerStyle } from './fun/constants.js'; +import * as Errors from '../types/errors.js'; const log = createLogger('MediaEditor'); diff --git a/ts/components/MediaPermissionsModal.stories.tsx b/ts/components/MediaPermissionsModal.stories.tsx index cc6e8e1a321..5f70d376a83 100644 --- a/ts/components/MediaPermissionsModal.stories.tsx +++ b/ts/components/MediaPermissionsModal.stories.tsx @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; import { action } from '@storybook/addon-actions'; -import { type ComponentMeta } from '../storybook/types'; -import type { PropsType } from './MediaPermissionsModal'; -import { MediaPermissionsModal } from './MediaPermissionsModal'; +import { type ComponentMeta } from '../storybook/types.js'; +import type { PropsType } from './MediaPermissionsModal.js'; +import { MediaPermissionsModal } from './MediaPermissionsModal.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/MediaPermissionsModal.tsx b/ts/components/MediaPermissionsModal.tsx index 9ef95709ccb..ed9e245419d 100644 --- a/ts/components/MediaPermissionsModal.tsx +++ b/ts/components/MediaPermissionsModal.tsx @@ -3,10 +3,10 @@ import React, { useCallback } from 'react'; -import { Modal } from './Modal'; -import type { LocalizerType } from '../types/Util'; -import { missingCaseError } from '../util/missingCaseError'; -import { Button } from './Button'; +import { Modal } from './Modal.js'; +import type { LocalizerType } from '../types/Util.js'; +import { missingCaseError } from '../util/missingCaseError.js'; +import { Button } from './Button.js'; export type PropsType = { i18n: LocalizerType; diff --git a/ts/components/MediaQualitySelector.stories.tsx b/ts/components/MediaQualitySelector.stories.tsx index 01b776f9130..746b90f50de 100644 --- a/ts/components/MediaQualitySelector.stories.tsx +++ b/ts/components/MediaQualitySelector.stories.tsx @@ -4,8 +4,8 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './MediaQualitySelector'; -import { MediaQualitySelector } from './MediaQualitySelector'; +import type { PropsType } from './MediaQualitySelector.js'; +import { MediaQualitySelector } from './MediaQualitySelector.js'; export default { title: 'Components/MediaQualitySelector', diff --git a/ts/components/MediaQualitySelector.tsx b/ts/components/MediaQualitySelector.tsx index b1576ae8bd2..1694f30542e 100644 --- a/ts/components/MediaQualitySelector.tsx +++ b/ts/components/MediaQualitySelector.tsx @@ -7,9 +7,9 @@ import { noop } from 'lodash'; import { createPortal } from 'react-dom'; import classNames from 'classnames'; import { Manager, Popper, Reference } from 'react-popper'; -import type { LocalizerType } from '../types/Util'; -import { useRefMerger } from '../hooks/useRefMerger'; -import { handleOutsideClick } from '../util/handleOutsideClick'; +import type { LocalizerType } from '../types/Util.js'; +import { useRefMerger } from '../hooks/useRefMerger.js'; +import { handleOutsideClick } from '../util/handleOutsideClick.js'; export type PropsType = { conversationId: string; diff --git a/ts/components/MiniPlayer.stories.tsx b/ts/components/MiniPlayer.stories.tsx index 79f38c2a1c2..f72dbfac556 100644 --- a/ts/components/MiniPlayer.stories.tsx +++ b/ts/components/MiniPlayer.stories.tsx @@ -3,8 +3,8 @@ import React, { useEffect, useState } from 'react'; import type { Meta } from '@storybook/react'; -import type { Props } from './MiniPlayer'; -import { MiniPlayer, PlayerState } from './MiniPlayer'; +import type { Props } from './MiniPlayer.js'; +import { MiniPlayer, PlayerState } from './MiniPlayer.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/MiniPlayer.tsx b/ts/components/MiniPlayer.tsx index ee25deda2e7..cb1b509d55d 100644 --- a/ts/components/MiniPlayer.tsx +++ b/ts/components/MiniPlayer.tsx @@ -3,11 +3,11 @@ import classnames from 'classnames'; import React, { useCallback } from 'react'; -import type { LocalizerType } from '../types/Util'; -import { durationToPlaybackText } from '../util/durationToPlaybackText'; -import { PlaybackButton } from './PlaybackButton'; -import { PlaybackRateButton } from './PlaybackRateButton'; -import { UserText } from './UserText'; +import type { LocalizerType } from '../types/Util.js'; +import { durationToPlaybackText } from '../util/durationToPlaybackText.js'; +import { PlaybackButton } from './PlaybackButton.js'; +import { PlaybackRateButton } from './PlaybackRateButton.js'; +import { UserText } from './UserText.js'; export enum PlayerState { loading = 'loading', diff --git a/ts/components/Modal.stories.tsx b/ts/components/Modal.stories.tsx index 2af506300a2..69121b46386 100644 --- a/ts/components/Modal.stories.tsx +++ b/ts/components/Modal.stories.tsx @@ -5,9 +5,9 @@ import React from 'react'; import { noop } from 'lodash'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { Button } from './Button'; -import type { ModalPropsType } from './Modal'; -import { Modal } from './Modal'; +import { Button } from './Button.js'; +import type { ModalPropsType } from './Modal.js'; +import { Modal } from './Modal.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/Modal.tsx b/ts/components/Modal.tsx index 889d32558b5..03635ef502b 100644 --- a/ts/components/Modal.tsx +++ b/ts/components/Modal.tsx @@ -8,20 +8,20 @@ import { noop } from 'lodash'; import { animated } from '@react-spring/web'; import { v4 as uuid } from 'uuid'; -import type { LocalizerType } from '../types/Util'; -import { ModalHost } from './ModalHost'; -import type { Theme } from '../util/theme'; -import { assertDev } from '../util/assert'; -import { getClassNamesFor } from '../util/getClassNamesFor'; -import { useAnimated } from '../hooks/useAnimated'; -import { useHasWrapped } from '../hooks/useHasWrapped'; -import { createLogger } from '../logging/log'; +import type { LocalizerType } from '../types/Util.js'; +import { ModalHost } from './ModalHost.js'; +import type { Theme } from '../util/theme.js'; +import { assertDev } from '../util/assert.js'; +import { getClassNamesFor } from '../util/getClassNamesFor.js'; +import { useAnimated } from '../hooks/useAnimated.js'; +import { useHasWrapped } from '../hooks/useHasWrapped.js'; +import { createLogger } from '../logging/log.js'; import { isScrollOverflowVertical, isScrollAtTop, isScrollAtBottom, useScrollObserver, -} from '../hooks/useSizeObserver'; +} from '../hooks/useSizeObserver.js'; const log = createLogger('Modal'); diff --git a/ts/components/ModalContainer.tsx b/ts/components/ModalContainer.tsx index b5adf1e9d1a..0f5590a5413 100644 --- a/ts/components/ModalContainer.tsx +++ b/ts/components/ModalContainer.tsx @@ -4,7 +4,7 @@ import React from 'react'; import type { ReactNode } from 'react'; import ReactDOM from 'react-dom'; -import { ModalContainerContext } from './ModalHost'; +import { ModalContainerContext } from './ModalHost.js'; type Props = { children: ReactNode; diff --git a/ts/components/ModalHost.tsx b/ts/components/ModalHost.tsx index 72f2c63f769..7fc6ffa49af 100644 --- a/ts/components/ModalHost.tsx +++ b/ts/components/ModalHost.tsx @@ -8,15 +8,15 @@ import { animated } from '@react-spring/web'; import classNames from 'classnames'; import { noop } from 'lodash'; import { FocusScope } from 'react-aria'; -import type { ModalConfigType } from '../hooks/useAnimated'; -import type { Theme } from '../util/theme'; -import { assertDev } from '../util/assert'; -import { getClassNamesFor } from '../util/getClassNamesFor'; -import { themeClassName } from '../util/theme'; -import { useEscapeHandling } from '../hooks/useEscapeHandling'; -import { usePrevious } from '../hooks/usePrevious'; -import { handleOutsideClick } from '../util/handleOutsideClick'; -import { createLogger } from '../logging/log'; +import type { ModalConfigType } from '../hooks/useAnimated.js'; +import type { Theme } from '../util/theme.js'; +import { assertDev } from '../util/assert.js'; +import { getClassNamesFor } from '../util/getClassNamesFor.js'; +import { themeClassName } from '../util/theme.js'; +import { useEscapeHandling } from '../hooks/useEscapeHandling.js'; +import { usePrevious } from '../hooks/usePrevious.js'; +import { handleOutsideClick } from '../util/handleOutsideClick.js'; +import { createLogger } from '../logging/log.js'; const log = createLogger('ModalHost'); diff --git a/ts/components/MyStories.stories.tsx b/ts/components/MyStories.stories.tsx index 7243df64c01..773511f80ce 100644 --- a/ts/components/MyStories.stories.tsx +++ b/ts/components/MyStories.stories.tsx @@ -8,13 +8,13 @@ import { v4 as uuid } from 'uuid'; import { expect, fn, within, userEvent } from '@storybook/test'; import { action } from '@storybook/addon-actions'; -import type { PropsType } from './MyStories'; -import { MY_STORY_ID } from '../types/Stories'; -import { MyStories } from './MyStories'; -import { SendStatus } from '../messages/MessageSendState'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation'; -import { getFakeMyStory } from '../test-helpers/getFakeStory'; -import { sleep } from '../util/sleep'; +import type { PropsType } from './MyStories.js'; +import { MY_STORY_ID } from '../types/Stories.js'; +import { MyStories } from './MyStories.js'; +import { SendStatus } from '../messages/MessageSendState.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; +import { getFakeMyStory } from '../test-helpers/getFakeStory.js'; +import { sleep } from '../util/sleep.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/MyStories.tsx b/ts/components/MyStories.tsx index 4535a4905d3..26398452dbe 100644 --- a/ts/components/MyStories.tsx +++ b/ts/components/MyStories.tsx @@ -2,26 +2,26 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { useState } from 'react'; -import type { MyStoryType, StoryViewType } from '../types/Stories'; +import type { MyStoryType, StoryViewType } from '../types/Stories.js'; import { ResolvedSendStatus, StoryViewTargetType, StoryViewModeType, -} from '../types/Stories'; -import type { LocalizerType } from '../types/Util'; -import { ThemeType } from '../types/Util'; -import type { ViewStoryActionCreatorType } from '../state/ducks/stories'; -import { ConfirmationDialog } from './ConfirmationDialog'; -import { ContextMenu } from './ContextMenu'; -import { MessageTimestamp } from './conversation/MessageTimestamp'; -import { StoryDistributionListName } from './StoryDistributionListName'; -import { StoryImage } from './StoryImage'; -import { Theme } from '../util/theme'; -import { resolveStorySendStatus } from '../util/resolveStorySendStatus'; -import { useRetryStorySend } from '../hooks/useRetryStorySend'; -import { NavSidebar } from './NavSidebar'; -import type { WidthBreakpoint } from './_util'; -import type { UnreadStats } from '../util/countUnreadStats'; +} from '../types/Stories.js'; +import type { LocalizerType } from '../types/Util.js'; +import { ThemeType } from '../types/Util.js'; +import type { ViewStoryActionCreatorType } from '../state/ducks/stories.js'; +import { ConfirmationDialog } from './ConfirmationDialog.js'; +import { ContextMenu } from './ContextMenu.js'; +import { MessageTimestamp } from './conversation/MessageTimestamp.js'; +import { StoryDistributionListName } from './StoryDistributionListName.js'; +import { StoryImage } from './StoryImage.js'; +import { Theme } from '../util/theme.js'; +import { resolveStorySendStatus } from '../util/resolveStorySendStatus.js'; +import { useRetryStorySend } from '../hooks/useRetryStorySend.js'; +import { NavSidebar } from './NavSidebar.js'; +import type { WidthBreakpoint } from './_util.js'; +import type { UnreadStats } from '../util/countUnreadStats.js'; export type PropsType = { i18n: LocalizerType; diff --git a/ts/components/MyStoryButton.stories.tsx b/ts/components/MyStoryButton.stories.tsx index e10df0d9d99..ac245954b62 100644 --- a/ts/components/MyStoryButton.stories.tsx +++ b/ts/components/MyStoryButton.stories.tsx @@ -7,12 +7,12 @@ import React from 'react'; import { expect, fn, within, userEvent } from '@storybook/test'; import { action } from '@storybook/addon-actions'; -import type { PropsType } from './MyStoryButton'; -import { MyStoryButton } from './MyStoryButton'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation'; -import { getFakeMyStory } from '../test-helpers/getFakeStory'; -import { SendStatus } from '../messages/MessageSendState'; -import { ResolvedSendStatus } from '../types/Stories'; +import type { PropsType } from './MyStoryButton.js'; +import { MyStoryButton } from './MyStoryButton.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; +import { getFakeMyStory } from '../test-helpers/getFakeStory.js'; +import { SendStatus } from '../messages/MessageSendState.js'; +import { ResolvedSendStatus } from '../types/Stories.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/MyStoryButton.tsx b/ts/components/MyStoryButton.tsx index 53e6e0ed725..030530fbe88 100644 --- a/ts/components/MyStoryButton.tsx +++ b/ts/components/MyStoryButton.tsx @@ -3,17 +3,17 @@ import React, { useState } from 'react'; import classNames from 'classnames'; -import type { ConversationType } from '../state/ducks/conversations'; -import type { LocalizerType } from '../types/Util'; -import type { MyStoryType, StoryViewType } from '../types/Stories'; -import type { ShowToastAction } from '../state/ducks/toast'; -import { Avatar, AvatarSize } from './Avatar'; -import { HasStories, ResolvedSendStatus } from '../types/Stories'; -import { MessageTimestamp } from './conversation/MessageTimestamp'; -import { StoriesAddStoryButton } from './StoriesAddStoryButton'; -import { StoryImage } from './StoryImage'; -import { getAvatarColor } from '../types/Colors'; -import { reduceStorySendStatus } from '../util/resolveStorySendStatus'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import type { LocalizerType } from '../types/Util.js'; +import type { MyStoryType, StoryViewType } from '../types/Stories.js'; +import type { ShowToastAction } from '../state/ducks/toast.js'; +import { Avatar, AvatarSize } from './Avatar.js'; +import { HasStories, ResolvedSendStatus } from '../types/Stories.js'; +import { MessageTimestamp } from './conversation/MessageTimestamp.js'; +import { StoriesAddStoryButton } from './StoriesAddStoryButton.js'; +import { StoryImage } from './StoryImage.js'; +import { getAvatarColor } from '../types/Colors.js'; +import { reduceStorySendStatus } from '../util/resolveStorySendStatus.js'; export type PropsType = { i18n: LocalizerType; diff --git a/ts/components/NavSidebar.tsx b/ts/components/NavSidebar.tsx index d6aad51d890..df2df4c6293 100644 --- a/ts/components/NavSidebar.tsx +++ b/ts/components/NavSidebar.tsx @@ -5,16 +5,16 @@ import type { KeyboardEventHandler, MouseEventHandler, ReactNode } from 'react'; import React, { useEffect, useState } from 'react'; import classNames from 'classnames'; import { useMove } from 'react-aria'; -import { NavTabsToggle } from './NavTabs'; -import type { LocalizerType } from '../types/I18N'; +import { NavTabsToggle } from './NavTabs.js'; +import type { LocalizerType } from '../types/I18N.js'; import { MAX_WIDTH, MIN_FULL_WIDTH, MIN_WIDTH, getWidthFromPreferredWidth, -} from '../util/leftPaneWidth'; -import { WidthBreakpoint, getNavSidebarWidthBreakpoint } from './_util'; -import type { UnreadStats } from '../util/countUnreadStats'; +} from '../util/leftPaneWidth.js'; +import { WidthBreakpoint, getNavSidebarWidthBreakpoint } from './_util.js'; +import type { UnreadStats } from '../util/countUnreadStats.js'; type NavSidebarActionButtonProps = { icon: ReactNode; diff --git a/ts/components/NavTabs.stories.tsx b/ts/components/NavTabs.stories.tsx index 51a2c94e3df..6b4663e4747 100644 --- a/ts/components/NavTabs.stories.tsx +++ b/ts/components/NavTabs.stories.tsx @@ -5,11 +5,11 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { NavTabsProps } from './NavTabs'; -import { NavTabs } from './NavTabs'; -import { NavTab } from '../types/Nav'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation'; -import { ThemeType } from '../types/Util'; +import type { NavTabsProps } from './NavTabs.js'; +import { NavTabs } from './NavTabs.js'; +import { NavTab } from '../types/Nav.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; +import { ThemeType } from '../types/Util.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/NavTabs.tsx b/ts/components/NavTabs.tsx index 304dcc2170c..7dbc0ef1c47 100644 --- a/ts/components/NavTabs.tsx +++ b/ts/components/NavTabs.tsx @@ -5,16 +5,16 @@ import type { Key, ReactNode } from 'react'; import React, { useState } from 'react'; import { Tabs, TabList, Tab, TabPanel } from 'react-aria-components'; import classNames from 'classnames'; -import { Avatar, AvatarSize } from './Avatar'; -import type { LocalizerType, ThemeType } from '../types/Util'; -import type { ConversationType } from '../state/ducks/conversations'; -import type { BadgeType } from '../badges/types'; -import { NavTab, ProfileEditorPage, SettingsPage } from '../types/Nav'; -import type { Location } from '../types/Nav'; -import { Tooltip, TooltipPlacement } from './Tooltip'; -import { Theme } from '../util/theme'; -import type { UnreadStats } from '../util/countUnreadStats'; -import { ProfileMovedModal } from './ProfileMovedModal'; +import { Avatar, AvatarSize } from './Avatar.js'; +import type { LocalizerType, ThemeType } from '../types/Util.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import type { BadgeType } from '../badges/types.js'; +import { NavTab, ProfileEditorPage, SettingsPage } from '../types/Nav.js'; +import type { Location } from '../types/Nav.js'; +import { Tooltip, TooltipPlacement } from './Tooltip.js'; +import { Theme } from '../util/theme.js'; +import type { UnreadStats } from '../util/countUnreadStats.js'; +import { ProfileMovedModal } from './ProfileMovedModal.js'; type NavTabsItemBadgesProps = Readonly<{ i18n: LocalizerType; diff --git a/ts/components/NeedsScreenRecordingPermissionsModal.tsx b/ts/components/NeedsScreenRecordingPermissionsModal.tsx index 7968affcee2..e9044b3e397 100644 --- a/ts/components/NeedsScreenRecordingPermissionsModal.tsx +++ b/ts/components/NeedsScreenRecordingPermissionsModal.tsx @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import type { LocalizerType } from '../types/Util'; -import { Theme } from '../util/theme'; -import { Modal } from './Modal'; -import { Button, ButtonVariant } from './Button'; +import type { LocalizerType } from '../types/Util.js'; +import { Theme } from '../util/theme.js'; +import { Modal } from './Modal.js'; +import { Button, ButtonVariant } from './Button.js'; type PropsType = { i18n: LocalizerType; diff --git a/ts/components/NewlyCreatedGroupInvitedContactsDialog.stories.tsx b/ts/components/NewlyCreatedGroupInvitedContactsDialog.stories.tsx index a2c5c707c60..d81f4462103 100644 --- a/ts/components/NewlyCreatedGroupInvitedContactsDialog.stories.tsx +++ b/ts/components/NewlyCreatedGroupInvitedContactsDialog.stories.tsx @@ -6,11 +6,11 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './NewlyCreatedGroupInvitedContactsDialog'; -import { NewlyCreatedGroupInvitedContactsDialog } from './NewlyCreatedGroupInvitedContactsDialog'; -import type { ConversationType } from '../state/ducks/conversations'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation'; -import { ThemeType } from '../types/Util'; +import type { PropsType } from './NewlyCreatedGroupInvitedContactsDialog.js'; +import { NewlyCreatedGroupInvitedContactsDialog } from './NewlyCreatedGroupInvitedContactsDialog.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; +import { ThemeType } from '../types/Util.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/NewlyCreatedGroupInvitedContactsDialog.tsx b/ts/components/NewlyCreatedGroupInvitedContactsDialog.tsx index 91334566b8c..ea04e02fb04 100644 --- a/ts/components/NewlyCreatedGroupInvitedContactsDialog.tsx +++ b/ts/components/NewlyCreatedGroupInvitedContactsDialog.tsx @@ -4,13 +4,13 @@ import type { ReactNode } from 'react'; import React from 'react'; -import type { LocalizerType, ThemeType } from '../types/Util'; -import type { ConversationType } from '../state/ducks/conversations'; -import type { PreferredBadgeSelectorType } from '../state/selectors/badges'; -import { I18n } from './I18n'; -import { ContactName } from './conversation/ContactName'; -import { GroupDialog } from './GroupDialog'; -import { openLinkInWebBrowser } from '../util/openLinkInWebBrowser'; +import type { LocalizerType, ThemeType } from '../types/Util.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import type { PreferredBadgeSelectorType } from '../state/selectors/badges.js'; +import { I18n } from './I18n.js'; +import { ContactName } from './conversation/ContactName.js'; +import { GroupDialog } from './GroupDialog.js'; +import { openLinkInWebBrowser } from '../util/openLinkInWebBrowser.js'; export type PropsType = { contacts: Array; diff --git a/ts/components/NotePreviewModal.stories.tsx b/ts/components/NotePreviewModal.stories.tsx index f1de0847d08..50b65c2c4bd 100644 --- a/ts/components/NotePreviewModal.stories.tsx +++ b/ts/components/NotePreviewModal.stories.tsx @@ -2,12 +2,12 @@ // SPDX-License-Identifier: AGPL-3.0-only import { action } from '@storybook/addon-actions'; import * as React from 'react'; -import type { ComponentMeta } from '../storybook/types'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation'; +import type { ComponentMeta } from '../storybook/types.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; import { NotePreviewModal, type NotePreviewModalProps, -} from './NotePreviewModal'; +} from './NotePreviewModal.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/NotePreviewModal.tsx b/ts/components/NotePreviewModal.tsx index db7239a203e..9783b856ee0 100644 --- a/ts/components/NotePreviewModal.tsx +++ b/ts/components/NotePreviewModal.tsx @@ -2,13 +2,13 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import type { ConversationType } from '../state/ducks/conversations'; -import type { LocalizerType } from '../types/I18N'; -import { Button, ButtonVariant } from './Button'; -import { Modal } from './Modal'; -import { Linkify } from './conversation/Linkify'; -import type { RenderTextCallbackType } from '../types/Util'; -import { Emojify } from './conversation/Emojify'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import type { LocalizerType } from '../types/I18N.js'; +import { Button, ButtonVariant } from './Button.js'; +import { Modal } from './Modal.js'; +import { Linkify } from './conversation/Linkify.js'; +import type { RenderTextCallbackType } from '../types/Util.js'; +import { Emojify } from './conversation/Emojify.js'; export type NotePreviewModalProps = Readonly<{ conversation: ConversationType; diff --git a/ts/components/OutgoingGiftBadgeModal.stories.tsx b/ts/components/OutgoingGiftBadgeModal.stories.tsx index 71634ce50dd..8971a1a006b 100644 --- a/ts/components/OutgoingGiftBadgeModal.stories.tsx +++ b/ts/components/OutgoingGiftBadgeModal.stories.tsx @@ -4,9 +4,9 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './OutgoingGiftBadgeModal'; -import { OutgoingGiftBadgeModal } from './OutgoingGiftBadgeModal'; -import { BadgeCategory } from '../badges/BadgeCategory'; +import type { PropsType } from './OutgoingGiftBadgeModal.js'; +import { OutgoingGiftBadgeModal } from './OutgoingGiftBadgeModal.js'; +import { BadgeCategory } from '../badges/BadgeCategory.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/OutgoingGiftBadgeModal.tsx b/ts/components/OutgoingGiftBadgeModal.tsx index 5cfa9a0fd1e..c4efa48dac3 100644 --- a/ts/components/OutgoingGiftBadgeModal.tsx +++ b/ts/components/OutgoingGiftBadgeModal.tsx @@ -4,12 +4,12 @@ import React from 'react'; import classNames from 'classnames'; -import { getBadgeImageFileLocalPath } from '../badges/getBadgeImageFileLocalPath'; -import { Modal } from './Modal'; -import { BadgeImageTheme } from '../badges/BadgeImageTheme'; +import { getBadgeImageFileLocalPath } from '../badges/getBadgeImageFileLocalPath.js'; +import { Modal } from './Modal.js'; +import { BadgeImageTheme } from '../badges/BadgeImageTheme.js'; -import type { PreferredBadgeSelectorType } from '../state/selectors/badges'; -import type { LocalizerType } from '../types/Util'; +import type { PreferredBadgeSelectorType } from '../state/selectors/badges.js'; +import type { LocalizerType } from '../types/Util.js'; const CLASS_NAME = 'OutgoingGiftBadgeModal'; diff --git a/ts/components/PermissionsPopup.tsx b/ts/components/PermissionsPopup.tsx index 8e531bc5faf..dbd5fc25c01 100644 --- a/ts/components/PermissionsPopup.tsx +++ b/ts/components/PermissionsPopup.tsx @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import { Button, ButtonVariant } from './Button'; -import type { LocalizerType } from '../types/Util'; -import { useEscapeHandling } from '../hooks/useEscapeHandling'; +import { Button, ButtonVariant } from './Button.js'; +import type { LocalizerType } from '../types/Util.js'; +import { useEscapeHandling } from '../hooks/useEscapeHandling.js'; export type PropsType = { i18n: LocalizerType; diff --git a/ts/components/PlaybackButton.stories.tsx b/ts/components/PlaybackButton.stories.tsx index f75685ab2a7..352db9f140f 100644 --- a/ts/components/PlaybackButton.stories.tsx +++ b/ts/components/PlaybackButton.stories.tsx @@ -5,11 +5,11 @@ import React, { useContext } from 'react'; import type { CSSProperties } from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { ButtonProps } from './PlaybackButton'; -import { PlaybackButton } from './PlaybackButton'; -import { StorybookThemeContext } from '../../.storybook/StorybookThemeContext'; -import { ThemeType } from '../types/Util'; -import { AUDIO_MP3 } from '../types/MIME'; +import type { ButtonProps } from './PlaybackButton.js'; +import { PlaybackButton } from './PlaybackButton.js'; +import { StorybookThemeContext } from '../../.storybook/StorybookThemeContext.js'; +import { ThemeType } from '../types/Util.js'; +import { AUDIO_MP3 } from '../types/MIME.js'; export default { title: 'components/PlaybackButton', diff --git a/ts/components/PlaybackButton.tsx b/ts/components/PlaybackButton.tsx index db82b17f829..66d1b12094e 100644 --- a/ts/components/PlaybackButton.tsx +++ b/ts/components/PlaybackButton.tsx @@ -4,9 +4,9 @@ import { animated, useSpring } from '@react-spring/web'; import classNames from 'classnames'; import React, { useCallback } from 'react'; -import { useReducedMotion } from '../hooks/useReducedMotion'; -import type { AttachmentForUIType } from '../types/Attachment'; -import { SpinnerV2 } from './SpinnerV2'; +import { useReducedMotion } from '../hooks/useReducedMotion.js'; +import type { AttachmentForUIType } from '../types/Attachment.js'; +import { SpinnerV2 } from './SpinnerV2.js'; const SPRING_CONFIG = { mass: 0.5, diff --git a/ts/components/PlaybackRateButton.tsx b/ts/components/PlaybackRateButton.tsx index 9a25a0bb625..e3e1e74c497 100644 --- a/ts/components/PlaybackRateButton.tsx +++ b/ts/components/PlaybackRateButton.tsx @@ -4,8 +4,8 @@ import classNames from 'classnames'; import React, { useCallback, useState } from 'react'; import { animated, useSpring } from '@react-spring/web'; -import type { LocalizerType } from '../types/Util'; -import { useReducedMotion } from '../hooks/useReducedMotion'; +import type { LocalizerType } from '../types/Util.js'; +import { useReducedMotion } from '../hooks/useReducedMotion.js'; const SPRING_CONFIG = { mass: 0.5, diff --git a/ts/components/Preferences.stories.tsx b/ts/components/Preferences.stories.tsx index 936cbd468ff..4ad0bd666ec 100644 --- a/ts/components/Preferences.stories.tsx +++ b/ts/components/Preferences.stories.tsx @@ -7,43 +7,43 @@ import type { MutableRefObject } from 'react'; import { action } from '@storybook/addon-actions'; import { shuffle } from 'lodash'; -import { Preferences } from './Preferences'; -import { DEFAULT_CONVERSATION_COLOR } from '../types/Colors'; -import { PhoneNumberSharingMode } from '../util/phoneNumberSharingMode'; -import { PhoneNumberDiscoverability } from '../util/phoneNumberDiscoverability'; -import { EmojiSkinTone } from './fun/data/emojis'; -import { DAY, DurationInSeconds, WEEK } from '../util/durations'; -import { DialogUpdate } from './DialogUpdate'; -import { DialogType } from '../types/Dialogs'; -import { ThemeType } from '../types/Util'; +import { Preferences } from './Preferences.js'; +import { DEFAULT_CONVERSATION_COLOR } from '../types/Colors.js'; +import { PhoneNumberSharingMode } from '../util/phoneNumberSharingMode.js'; +import { PhoneNumberDiscoverability } from '../util/phoneNumberDiscoverability.js'; +import { EmojiSkinTone } from './fun/data/emojis.js'; +import { DAY, DurationInSeconds, WEEK } from '../util/durations/index.js'; +import { DialogUpdate } from './DialogUpdate.js'; +import { DialogType } from '../types/Dialogs.js'; +import { ThemeType } from '../types/Util.js'; import { getDefaultConversation, getDefaultGroup, -} from '../test-helpers/getDefaultConversation'; -import { ProfileEditor } from './ProfileEditor'; +} from '../test-helpers/getDefaultConversation.js'; +import { ProfileEditor } from './ProfileEditor.js'; import { UsernameEditState, UsernameLinkState, -} from '../state/ducks/usernameEnums'; -import { ProfileEditorPage, SettingsPage } from '../types/Nav'; -import { PreferencesDonations } from './PreferencesDonations'; -import { strictAssert } from '../util/assert'; +} from '../state/ducks/usernameEnums.js'; +import { ProfileEditorPage, SettingsPage } from '../types/Nav.js'; +import { PreferencesDonations } from './PreferencesDonations.js'; +import { strictAssert } from '../util/assert.js'; -import type { LocalizerType } from '../types/Util'; -import type { PropsType } from './Preferences'; -import type { WidthBreakpoint } from './_util'; -import type { MessageAttributesType } from '../model-types'; +import type { LocalizerType } from '../types/Util.js'; +import type { PropsType } from './Preferences.js'; +import type { WidthBreakpoint } from './_util.js'; +import type { MessageAttributesType } from '../model-types.js'; import type { DonationReceipt, DonationWorkflow, OneTimeDonationHumanAmounts, -} from '../types/Donations'; -import type { AnyToast } from '../types/Toast'; -import type { SmartPreferencesChatFoldersPageProps } from '../state/smart/PreferencesChatFoldersPage'; -import { PreferencesChatFoldersPage } from './preferences/chatFolders/PreferencesChatFoldersPage'; -import type { SmartPreferencesEditChatFolderPageProps } from '../state/smart/PreferencesEditChatFolderPage'; -import { PreferencesEditChatFolderPage } from './preferences/chatFolders/PreferencesEditChatFoldersPage'; -import { CHAT_FOLDER_DEFAULTS } from '../types/ChatFolder'; +} from '../types/Donations.js'; +import type { AnyToast } from '../types/Toast.js'; +import type { SmartPreferencesChatFoldersPageProps } from '../state/smart/PreferencesChatFoldersPage.js'; +import { PreferencesChatFoldersPage } from './preferences/chatFolders/PreferencesChatFoldersPage.js'; +import type { SmartPreferencesEditChatFolderPageProps } from '../state/smart/PreferencesEditChatFolderPage.js'; +import { PreferencesEditChatFolderPage } from './preferences/chatFolders/PreferencesEditChatFoldersPage.js'; +import { CHAT_FOLDER_DEFAULTS } from '../types/ChatFolder.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/Preferences.tsx b/ts/components/Preferences.tsx index bb8733dd363..a24e67e16e1 100644 --- a/ts/components/Preferences.tsx +++ b/ts/components/Preferences.tsx @@ -15,86 +15,89 @@ import classNames from 'classnames'; import * as LocaleMatcher from '@formatjs/intl-localematcher'; import type { MutableRefObject, ReactNode } from 'react'; import type { RowType } from '@signalapp/sqlcipher'; -import { Button, ButtonVariant } from './Button'; -import { ChatColorPicker } from './ChatColorPicker'; -import { Checkbox } from './Checkbox'; -import { WidthBreakpoint } from './_util'; -import { ConfirmationDialog } from './ConfirmationDialog'; -import { DisappearingTimeDialog } from './DisappearingTimeDialog'; -import { PhoneNumberDiscoverability } from '../util/phoneNumberDiscoverability'; -import { PhoneNumberSharingMode } from '../util/phoneNumberSharingMode'; -import { Select } from './Select'; -import { Spinner } from './Spinner'; -import { getCustomColorStyle } from '../util/getCustomColorStyle'; +import { Button, ButtonVariant } from './Button.js'; +import { ChatColorPicker } from './ChatColorPicker.js'; +import { Checkbox } from './Checkbox.js'; +import { WidthBreakpoint } from './_util.js'; +import { ConfirmationDialog } from './ConfirmationDialog.js'; +import { DisappearingTimeDialog } from './DisappearingTimeDialog.js'; +import { PhoneNumberDiscoverability } from '../util/phoneNumberDiscoverability.js'; +import { PhoneNumberSharingMode } from '../util/phoneNumberSharingMode.js'; +import { Select } from './Select.js'; +import { Spinner } from './Spinner.js'; +import { getCustomColorStyle } from '../util/getCustomColorStyle.js'; import { DEFAULT_DURATIONS_IN_SECONDS, DEFAULT_DURATIONS_SET, format as formatExpirationTimer, -} from '../util/expirationTimer'; -import { DurationInSeconds } from '../util/durations'; -import { focusableSelector } from '../util/focusableSelectors'; -import { Modal } from './Modal'; -import { SearchInput } from './SearchInput'; -import { removeDiacritics } from '../util/removeDiacritics'; -import { assertDev } from '../util/assert'; -import { I18n } from './I18n'; -import { FunSkinTonesList } from './fun/FunSkinTones'; -import { emojiParentKeyConstant, type EmojiSkinTone } from './fun/data/emojis'; +} from '../util/expirationTimer.js'; +import { DurationInSeconds } from '../util/durations/index.js'; +import { focusableSelector } from '../util/focusableSelectors.js'; +import { Modal } from './Modal.js'; +import { SearchInput } from './SearchInput.js'; +import { removeDiacritics } from '../util/removeDiacritics.js'; +import { assertDev } from '../util/assert.js'; +import { I18n } from './I18n.js'; +import { FunSkinTonesList } from './fun/FunSkinTones.js'; +import { + emojiParentKeyConstant, + type EmojiSkinTone, +} from './fun/data/emojis.js'; import { SettingsControl as Control, FlowingSettingsControl as FlowingControl, SettingsRadio, SettingsRow, -} from './PreferencesUtil'; -import { PreferencesBackups } from './PreferencesBackups'; -import { PreferencesInternal } from './PreferencesInternal'; -import { FunEmojiLocalizationProvider } from './fun/FunEmojiLocalizationProvider'; -import { Avatar, AvatarSize } from './Avatar'; -import { NavSidebar } from './NavSidebar'; -import { SettingsPage, ProfileEditorPage } from '../types/Nav'; +} from './PreferencesUtil.js'; +import { PreferencesBackups } from './PreferencesBackups.js'; +import { PreferencesInternal } from './PreferencesInternal.js'; +import { FunEmojiLocalizationProvider } from './fun/FunEmojiLocalizationProvider.js'; +import { Avatar, AvatarSize } from './Avatar.js'; +import { NavSidebar } from './NavSidebar.js'; +import { SettingsPage, ProfileEditorPage } from '../types/Nav.js'; -import type { MediaDeviceSettings } from '../types/Calling'; -import type { ValidationResultType as BackupValidationResultType } from '../services/backups'; +import type { MediaDeviceSettings } from '../types/Calling.js'; +import type { ValidationResultType as BackupValidationResultType } from '../services/backups/index.js'; import type { AutoDownloadAttachmentType, NotificationSettingType, SentMediaQualitySettingType, ZoomFactorType, -} from '../types/Storage.d'; -import type { ThemeSettingType } from '../types/StorageUIKeys'; -import type { AnyToast } from '../types/Toast'; -import { ToastType } from '../types/Toast'; -import type { ConversationType } from '../state/ducks/conversations'; +} from '../types/Storage.d.ts'; +import type { ThemeSettingType } from '../types/StorageUIKeys.js'; +import type { AnyToast } from '../types/Toast.js'; +import { ToastType } from '../types/Toast.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; import type { ConversationColorType, CustomColorType, DefaultConversationColorType, -} from '../types/Colors'; +} from '../types/Colors.js'; import type { LocalizerType, SentMediaQualityType, ThemeType, -} from '../types/Util'; +} from '../types/Util.js'; import type { BackupMediaDownloadStatusType, BackupsSubscriptionType, BackupStatusType, -} from '../types/backups'; -import type { UnreadStats } from '../util/countUnreadStats'; -import type { BadgeType } from '../badges/types'; -import type { MessageCountBySchemaVersionType } from '../sql/Interface'; -import type { MessageAttributesType } from '../model-types'; -import { isBackupPage } from '../types/PreferencesBackupPage'; -import type { PreferencesBackupPage } from '../types/PreferencesBackupPage'; +} from '../types/backups.js'; +import type { UnreadStats } from '../util/countUnreadStats.js'; +import type { BadgeType } from '../badges/types.js'; +import type { MessageCountBySchemaVersionType } from '../sql/Interface.js'; +import type { MessageAttributesType } from '../model-types.js'; +import { isBackupPage } from '../types/PreferencesBackupPage.js'; +import type { PreferencesBackupPage } from '../types/PreferencesBackupPage.js'; import type { PromptOSAuthReasonType, PromptOSAuthResultType, -} from '../util/os/promptOSAuthMain'; -import type { DonationReceipt } from '../types/Donations'; -import type { ChatFolderId } from '../types/ChatFolder'; -import { isChatFoldersEnabled } from '../types/ChatFolder'; -import type { SmartPreferencesEditChatFolderPageProps } from '../state/smart/PreferencesEditChatFolderPage'; -import type { SmartPreferencesChatFoldersPageProps } from '../state/smart/PreferencesChatFoldersPage'; +} from '../util/os/promptOSAuthMain.js'; +import type { DonationReceipt } from '../types/Donations.js'; +import type { ChatFolderId } from '../types/ChatFolder.js'; +import { isChatFoldersEnabled } from '../types/ChatFolder.js'; +import type { SmartPreferencesEditChatFolderPageProps } from '../state/smart/PreferencesEditChatFolderPage.js'; +import type { SmartPreferencesChatFoldersPageProps } from '../state/smart/PreferencesChatFoldersPage.js'; type CheckboxChangeHandlerType = (value: boolean) => unknown; type SelectChangeHandlerType = (value: T) => unknown; diff --git a/ts/components/PreferencesBackups.tsx b/ts/components/PreferencesBackups.tsx index fcad5975ee6..4f0a2d9a331 100644 --- a/ts/components/PreferencesBackups.tsx +++ b/ts/components/PreferencesBackups.tsx @@ -8,28 +8,28 @@ import type { BackupMediaDownloadStatusType, BackupsSubscriptionType, BackupStatusType, -} from '../types/backups'; -import type { LocalizerType } from '../types/I18N'; -import { formatTimestamp } from '../util/formatTimestamp'; +} from '../types/backups.js'; +import type { LocalizerType } from '../types/I18N.js'; +import { formatTimestamp } from '../util/formatTimestamp.js'; import { SettingsControl as Control, FlowingSettingsControl as FlowingControl, LightIconLabel, SettingsRow, -} from './PreferencesUtil'; -import { missingCaseError } from '../util/missingCaseError'; -import { Button, ButtonVariant } from './Button'; -import type { PreferencesBackupPage } from '../types/PreferencesBackupPage'; -import { SettingsPage } from '../types/Nav'; -import { I18n } from './I18n'; -import { PreferencesLocalBackups } from './PreferencesLocalBackups'; -import type { ShowToastAction } from '../state/ducks/toast'; +} from './PreferencesUtil.js'; +import { missingCaseError } from '../util/missingCaseError.js'; +import { Button, ButtonVariant } from './Button.js'; +import type { PreferencesBackupPage } from '../types/PreferencesBackupPage.js'; +import { SettingsPage } from '../types/Nav.js'; +import { I18n } from './I18n.js'; +import { PreferencesLocalBackups } from './PreferencesLocalBackups.js'; +import type { ShowToastAction } from '../state/ducks/toast.js'; import type { PromptOSAuthReasonType, PromptOSAuthResultType, -} from '../util/os/promptOSAuthMain'; -import { ConfirmationDialog } from './ConfirmationDialog'; -import { BackupMediaDownloadProgressSettings } from './BackupMediaDownloadProgressSettings'; +} from '../util/os/promptOSAuthMain.js'; +import { ConfirmationDialog } from './ConfirmationDialog.js'; +import { BackupMediaDownloadProgressSettings } from './BackupMediaDownloadProgressSettings.js'; export const SIGNAL_BACKUPS_LEARN_MORE_URL = 'https://support.signal.org/hc/articles/360007059752-Backup-and-Restore-Messages'; diff --git a/ts/components/PreferencesDonateFlow.tsx b/ts/components/PreferencesDonateFlow.tsx index 2fa37368b18..2fc92614dc4 100644 --- a/ts/components/PreferencesDonateFlow.tsx +++ b/ts/components/PreferencesDonateFlow.tsx @@ -11,26 +11,26 @@ import React, { } from 'react'; import classNames from 'classnames'; -import type { LocalizerType } from '../types/Util'; -import { useConfirmDiscard } from '../hooks/useConfirmDiscard'; -import { Button, ButtonVariant } from './Button'; +import type { LocalizerType } from '../types/Util.js'; +import { useConfirmDiscard } from '../hooks/useConfirmDiscard.js'; +import { Button, ButtonVariant } from './Button.js'; +import { + donationStateSchema, + ONE_TIME_DONATION_CONFIG_ID, +} from '../types/Donations.js'; import type { CardDetail, DonationErrorType, DonationStateType, HumanDonationAmount, -} from '../types/Donations'; -import { - donationStateSchema, - ONE_TIME_DONATION_CONFIG_ID, - type DonationWorkflow, - type OneTimeDonationHumanAmounts, -} from '../types/Donations'; + DonationWorkflow, + OneTimeDonationHumanAmounts, +} from '../types/Donations.js'; import type { CardCvcError, CardExpirationError, CardNumberError, -} from '../types/DonationsCardForm'; +} from '../types/DonationsCardForm.js'; import { cardFormToCardDetail, getCardFormSettings, @@ -39,7 +39,7 @@ import { parseCardExpiration, parseCardForm, parseCardNumber, -} from '../types/DonationsCardForm'; +} from '../types/DonationsCardForm.js'; import { brandHumanDonationAmount, type CurrencyFormatResult, @@ -48,28 +48,28 @@ import { parseCurrencyString, toHumanCurrencyString, toStripeDonationAmount, -} from '../util/currency'; -import { PreferencesContent } from './Preferences'; -import type { SubmitDonationType } from '../state/ducks/donations'; -import { Select } from './Select'; +} from '../util/currency.js'; +import { PreferencesContent } from './Preferences.js'; +import type { SubmitDonationType } from '../state/ducks/donations.js'; +import { Select } from './Select.js'; import { DonateInputCardNumber, getCardNumberErrorMessage, -} from './preferences/donations/DonateInputCardNumber'; +} from './preferences/donations/DonateInputCardNumber.js'; import { DonateInputCardExp, getCardExpirationErrorMessage, -} from './preferences/donations/DonateInputCardExp'; +} from './preferences/donations/DonateInputCardExp.js'; import { DonateInputCardCvc, getCardCvcErrorMessage, -} from './preferences/donations/DonateInputCardCvc'; -import { I18n } from './I18n'; -import { strictAssert } from '../util/assert'; -import { DonationsOfflineTooltip } from './conversation/DonationsOfflineTooltip'; -import { DonateInputAmount } from './preferences/donations/DonateInputAmount'; -import { Tooltip, TooltipPlacement } from './Tooltip'; -import { offsetDistanceModifier } from '../util/popperUtil'; +} from './preferences/donations/DonateInputCardCvc.js'; +import { I18n } from './I18n.js'; +import { strictAssert } from '../util/assert.js'; +import { DonationsOfflineTooltip } from './conversation/DonationsOfflineTooltip.js'; +import { DonateInputAmount } from './preferences/donations/DonateInputAmount.js'; +import { Tooltip, TooltipPlacement } from './Tooltip.js'; +import { offsetDistanceModifier } from '../util/popperUtil.js'; const SUPPORT_URL = 'https://support.signal.org/hc/requests/new?desktop'; diff --git a/ts/components/PreferencesDonations.tsx b/ts/components/PreferencesDonations.tsx index 10ee46b798b..fcbeb333161 100644 --- a/ts/components/PreferencesDonations.tsx +++ b/ts/components/PreferencesDonations.tsx @@ -6,54 +6,54 @@ import { groupBy, sortBy } from 'lodash'; import type { MutableRefObject, ReactNode } from 'react'; import { ListBox, ListBoxItem } from 'react-aria-components'; -import { getDateTimeFormatter } from '../util/formatTimestamp'; +import { getDateTimeFormatter } from '../util/formatTimestamp.js'; -import type { LocalizerType, ThemeType } from '../types/Util'; -import { PreferencesContent } from './Preferences'; -import { SettingsPage } from '../types/Nav'; -import { PreferencesDonateFlow } from './PreferencesDonateFlow'; +import type { LocalizerType, ThemeType } from '../types/Util.js'; +import { PreferencesContent } from './Preferences.js'; +import { SettingsPage } from '../types/Nav.js'; +import { PreferencesDonateFlow } from './PreferencesDonateFlow.js'; import type { DonationWorkflow, DonationReceipt, OneTimeDonationHumanAmounts, DonationErrorType, -} from '../types/Donations'; +} from '../types/Donations.js'; import { donationErrorTypeSchema, donationStateSchema, -} from '../types/Donations'; -import type { AvatarColorType } from '../types/Colors'; -import { Button, ButtonSize, ButtonVariant } from './Button'; -import { Modal } from './Modal'; -import { Spinner } from './Spinner'; -import type { AnyToast } from '../types/Toast'; -import { ToastType } from '../types/Toast'; -import { createLogger } from '../logging/log'; -import { toLogFormat } from '../types/errors'; -import { I18n } from './I18n'; -import { openLinkInWebBrowser } from '../util/openLinkInWebBrowser'; -import { DonationPrivacyInformationModal } from './DonationPrivacyInformationModal'; -import type { SubmitDonationType } from '../state/ducks/donations'; +} from '../types/Donations.js'; +import type { AvatarColorType } from '../types/Colors.js'; +import { Button, ButtonSize, ButtonVariant } from './Button.js'; +import { Modal } from './Modal.js'; +import { Spinner } from './Spinner.js'; +import type { AnyToast } from '../types/Toast.js'; +import { ToastType } from '../types/Toast.js'; +import { createLogger } from '../logging/log.js'; +import { toLogFormat } from '../types/errors.js'; +import { I18n } from './I18n.js'; +import { openLinkInWebBrowser } from '../util/openLinkInWebBrowser.js'; +import { DonationPrivacyInformationModal } from './DonationPrivacyInformationModal.js'; +import type { SubmitDonationType } from '../state/ducks/donations.js'; import { getHumanDonationAmount, toHumanCurrencyString, -} from '../util/currency'; -import { Avatar, AvatarSize } from './Avatar'; -import type { BadgeType } from '../badges/types'; -import { DonationInterruptedModal } from './DonationInterruptedModal'; -import { DonationErrorModal } from './DonationErrorModal'; -import { DonationVerificationModal } from './DonationVerificationModal'; -import { DonationProgressModal } from './DonationProgressModal'; -import { DonationStillProcessingModal } from './DonationStillProcessingModal'; -import { DonationThanksModal } from './DonationThanksModal'; +} from '../util/currency.js'; +import { Avatar, AvatarSize } from './Avatar.js'; +import type { BadgeType } from '../badges/types.js'; +import { DonationInterruptedModal } from './DonationInterruptedModal.js'; +import { DonationErrorModal } from './DonationErrorModal.js'; +import { DonationVerificationModal } from './DonationVerificationModal.js'; +import { DonationProgressModal } from './DonationProgressModal.js'; +import { DonationStillProcessingModal } from './DonationStillProcessingModal.js'; +import { DonationThanksModal } from './DonationThanksModal.js'; import type { ConversationType, ProfileDataType, -} from '../state/ducks/conversations'; -import type { AvatarUpdateOptionsType } from '../types/Avatar'; -import { drop } from '../util/drop'; -import { DonationsOfflineTooltip } from './conversation/DonationsOfflineTooltip'; -import { getInProgressDonation } from '../util/donations'; +} from '../state/ducks/conversations.js'; +import type { AvatarUpdateOptionsType } from '../types/Avatar.js'; +import { drop } from '../util/drop.js'; +import { DonationsOfflineTooltip } from './conversation/DonationsOfflineTooltip.js'; +import { getInProgressDonation } from '../util/donations.js'; const log = createLogger('PreferencesDonations'); diff --git a/ts/components/PreferencesInternal.tsx b/ts/components/PreferencesInternal.tsx index 8d73909be7f..4348fef42e6 100644 --- a/ts/components/PreferencesInternal.tsx +++ b/ts/components/PreferencesInternal.tsx @@ -6,21 +6,21 @@ import classNames from 'classnames'; import { v4 as uuid } from 'uuid'; import type { RowType } from '@signalapp/sqlcipher'; -import type { LocalizerType } from '../types/I18N'; -import { toLogFormat } from '../types/errors'; -import { formatFileSize } from '../util/formatFileSize'; -import { SECOND } from '../util/durations'; -import type { ValidationResultType as BackupValidationResultType } from '../services/backups'; -import { SettingsRow, FlowingSettingsControl } from './PreferencesUtil'; -import { Button, ButtonVariant } from './Button'; -import { Spinner } from './Spinner'; -import type { MessageCountBySchemaVersionType } from '../sql/Interface'; -import type { MessageAttributesType } from '../model-types'; -import type { DonationReceipt } from '../types/Donations'; -import { createLogger } from '../logging/log'; -import { isStagingServer } from '../util/isStagingServer'; -import { getHumanDonationAmount } from '../util/currency'; -import { AutoSizeTextArea } from './AutoSizeTextArea'; +import type { LocalizerType } from '../types/I18N.js'; +import { toLogFormat } from '../types/errors.js'; +import { formatFileSize } from '../util/formatFileSize.js'; +import { SECOND } from '../util/durations/index.js'; +import type { ValidationResultType as BackupValidationResultType } from '../services/backups/index.js'; +import { SettingsRow, FlowingSettingsControl } from './PreferencesUtil.js'; +import { Button, ButtonVariant } from './Button.js'; +import { Spinner } from './Spinner.js'; +import type { MessageCountBySchemaVersionType } from '../sql/Interface.js'; +import type { MessageAttributesType } from '../model-types.js'; +import type { DonationReceipt } from '../types/Donations.js'; +import { createLogger } from '../logging/log.js'; +import { isStagingServer } from '../util/isStagingServer.js'; +import { getHumanDonationAmount } from '../util/currency.js'; +import { AutoSizeTextArea } from './AutoSizeTextArea.js'; const log = createLogger('PreferencesInternal'); diff --git a/ts/components/PreferencesLocalBackups.tsx b/ts/components/PreferencesLocalBackups.tsx index 2b9deabf210..2a750f820e0 100644 --- a/ts/components/PreferencesLocalBackups.tsx +++ b/ts/components/PreferencesLocalBackups.tsx @@ -12,28 +12,28 @@ import React, { import { noop } from 'lodash'; import classNames from 'classnames'; -import type { LocalizerType } from '../types/I18N'; +import type { LocalizerType } from '../types/I18N.js'; import { FlowingSettingsControl as FlowingControl, SettingsRow, -} from './PreferencesUtil'; -import { Button, ButtonSize, ButtonVariant } from './Button'; +} from './PreferencesUtil.js'; +import { Button, ButtonSize, ButtonVariant } from './Button.js'; import { getOSAuthErrorString, SIGNAL_BACKUPS_LEARN_MORE_URL, -} from './PreferencesBackups'; -import { I18n } from './I18n'; -import type { PreferencesBackupPage } from '../types/PreferencesBackupPage'; -import { SettingsPage } from '../types/Nav'; -import { ToastType } from '../types/Toast'; -import type { ShowToastAction } from '../state/ducks/toast'; -import { Modal } from './Modal'; -import { strictAssert } from '../util/assert'; +} from './PreferencesBackups.js'; +import { I18n } from './I18n.js'; +import type { PreferencesBackupPage } from '../types/PreferencesBackupPage.js'; +import { SettingsPage } from '../types/Nav.js'; +import { ToastType } from '../types/Toast.js'; +import type { ShowToastAction } from '../state/ducks/toast.js'; +import { Modal } from './Modal.js'; +import { strictAssert } from '../util/assert.js'; import type { PromptOSAuthReasonType, PromptOSAuthResultType, -} from '../util/os/promptOSAuthMain'; -import { ConfirmationDialog } from './ConfirmationDialog'; +} from '../util/os/promptOSAuthMain.js'; +import { ConfirmationDialog } from './ConfirmationDialog.js'; export function PreferencesLocalBackups({ accountEntropyPool, diff --git a/ts/components/PreferencesUtil.tsx b/ts/components/PreferencesUtil.tsx index fdf6142a4da..d7d9d5d9f9a 100644 --- a/ts/components/PreferencesUtil.tsx +++ b/ts/components/PreferencesUtil.tsx @@ -8,7 +8,7 @@ import { noop } from 'lodash'; import { CircleCheckbox, Variant as CircleCheckboxVariant, -} from './CircleCheckbox'; +} from './CircleCheckbox.js'; export function SettingsRow({ children, diff --git a/ts/components/ProfileEditor.stories.tsx b/ts/components/ProfileEditor.stories.tsx index 43b5f982388..0bea9c2535e 100644 --- a/ts/components/ProfileEditor.stories.tsx +++ b/ts/components/ProfileEditor.stories.tsx @@ -7,19 +7,19 @@ import React, { useState } from 'react'; import casual from 'casual'; import { v4 as generateUuid } from 'uuid'; -import type { PropsType } from './ProfileEditor'; +import type { PropsType } from './ProfileEditor.js'; -import { ProfileEditorPage } from '../types/Nav'; -import { ProfileEditor } from './ProfileEditor'; -import { UsernameEditor } from './UsernameEditor'; +import { ProfileEditorPage } from '../types/Nav.js'; +import { ProfileEditor } from './ProfileEditor.js'; +import { UsernameEditor } from './UsernameEditor.js'; import { UsernameEditState, UsernameLinkState, UsernameReservationState, -} from '../state/ducks/usernameEnums'; -import { getRandomColor } from '../test-helpers/getRandomColor'; -import { SignalService as Proto } from '../protobuf'; -import { EmojiSkinTone } from './fun/data/emojis'; +} from '../state/ducks/usernameEnums.js'; +import { getRandomColor } from '../test-helpers/getRandomColor.js'; +import { SignalService as Proto } from '../protobuf/index.js'; +import { EmojiSkinTone } from './fun/data/emojis.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/ProfileEditor.tsx b/ts/components/ProfileEditor.tsx index bdb4bc9f068..6b456353b46 100644 --- a/ts/components/ProfileEditor.tsx +++ b/ts/components/ProfileEditor.tsx @@ -12,31 +12,31 @@ import { useSpring, animated } from '@react-spring/web'; import type { MutableRefObject } from 'react'; -import { AvatarColors } from '../types/Colors'; -import { AvatarEditor } from './AvatarEditor'; -import { AvatarPreview } from './AvatarPreview'; -import { Button, ButtonVariant } from './Button'; -import { EmojiButton, EmojiButtonVariant } from './emoji/EmojiButton'; -import { Input } from './Input'; -import { PanelRow } from './conversation/conversation-details/PanelRow'; -import { UsernameEditState } from '../state/ducks/usernameEnums'; -import { ToastType } from '../types/Toast'; -import { getEmojiData, unifiedToEmoji } from './emoji/lib'; -import { assertDev, strictAssert } from '../util/assert'; -import { missingCaseError } from '../util/missingCaseError'; -import { ConfirmationDialog } from './ConfirmationDialog'; -import { ContextMenu } from './ContextMenu'; -import { UsernameLinkEditor } from './UsernameLinkEditor'; +import { AvatarColors } from '../types/Colors.js'; +import { AvatarEditor } from './AvatarEditor.js'; +import { AvatarPreview } from './AvatarPreview.js'; +import { Button, ButtonVariant } from './Button.js'; +import { EmojiButton, EmojiButtonVariant } from './emoji/EmojiButton.js'; +import { Input } from './Input.js'; +import { PanelRow } from './conversation/conversation-details/PanelRow.js'; +import { UsernameEditState } from '../state/ducks/usernameEnums.js'; +import { ToastType } from '../types/Toast.js'; +import { getEmojiData, unifiedToEmoji } from './emoji/lib.js'; +import { assertDev, strictAssert } from '../util/assert.js'; +import { missingCaseError } from '../util/missingCaseError.js'; +import { ConfirmationDialog } from './ConfirmationDialog.js'; +import { ContextMenu } from './ContextMenu.js'; +import { UsernameLinkEditor } from './UsernameLinkEditor.js'; import { ConversationDetailsIcon, IconType, -} from './conversation/conversation-details/ConversationDetailsIcon'; -import { isWhitespace, trim } from '../util/whitespaceStringUtil'; -import { UserText } from './UserText'; -import { Tooltip, TooltipPlacement } from './Tooltip'; -import { offsetDistanceModifier } from '../util/popperUtil'; -import { useReducedMotion } from '../hooks/useReducedMotion'; -import { FunStaticEmoji } from './fun/FunEmoji'; +} from './conversation/conversation-details/ConversationDetailsIcon.js'; +import { isWhitespace, trim } from '../util/whitespaceStringUtil.js'; +import { UserText } from './UserText.js'; +import { Tooltip, TooltipPlacement } from './Tooltip.js'; +import { offsetDistanceModifier } from '../util/popperUtil.js'; +import { useReducedMotion } from '../hooks/useReducedMotion.js'; +import { FunStaticEmoji } from './fun/FunEmoji.js'; import { EmojiSkinTone, getEmojiParentKeyByEnglishShortName, @@ -45,35 +45,35 @@ import { getEmojiVariantKeyByValue, isEmojiEnglishShortName, isEmojiVariantValue, -} from './fun/data/emojis'; -import { FunEmojiPicker } from './fun/FunEmojiPicker'; -import { FunEmojiPickerButton } from './fun/FunButton'; -import { isFunPickerEnabled } from './fun/isFunPickerEnabled'; -import { useFunEmojiLocalizer } from './fun/useFunEmojiLocalizer'; -import { PreferencesContent } from './Preferences'; -import { ProfileEditorPage } from '../types/Nav'; +} from './fun/data/emojis.js'; +import { FunEmojiPicker } from './fun/FunEmojiPicker.js'; +import { FunEmojiPickerButton } from './fun/FunButton.js'; +import { isFunPickerEnabled } from './fun/isFunPickerEnabled.js'; +import { useFunEmojiLocalizer } from './fun/useFunEmojiLocalizer.js'; +import { PreferencesContent } from './Preferences.js'; +import { ProfileEditorPage } from '../types/Nav.js'; -import type { AvatarColorType } from '../types/Colors'; +import type { AvatarColorType } from '../types/Colors.js'; import type { AvatarDataType, AvatarUpdateOptionsType, DeleteAvatarFromDiskActionType, ReplaceAvatarActionType, SaveAvatarToDiskActionType, -} from '../types/Avatar'; -import type { Props as EmojiButtonProps } from './emoji/EmojiButton'; -import type { EmojiPickDataType } from './emoji/EmojiPicker'; -import type { LocalizerType } from '../types/Util'; +} from '../types/Avatar.js'; +import type { Props as EmojiButtonProps } from './emoji/EmojiButton.js'; +import type { EmojiPickDataType } from './emoji/EmojiPicker.js'; +import type { LocalizerType } from '../types/Util.js'; import type { ConversationType, ProfileDataType, SaveAttachmentActionCreatorType, -} from '../state/ducks/conversations'; -import type { UsernameLinkState } from '../state/ducks/usernameEnums'; -import type { ShowToastAction } from '../state/ducks/toast'; -import type { EmojiVariantKey } from './fun/data/emojis'; -import type { FunEmojiSelection } from './fun/panels/FunPanelEmojis'; -import { useConfirmDiscard } from '../hooks/useConfirmDiscard'; +} from '../state/ducks/conversations.js'; +import type { UsernameLinkState } from '../state/ducks/usernameEnums.js'; +import type { ShowToastAction } from '../state/ducks/toast.js'; +import type { EmojiVariantKey } from './fun/data/emojis.js'; +import type { FunEmojiSelection } from './fun/panels/FunPanelEmojis.js'; +import { useConfirmDiscard } from '../hooks/useConfirmDiscard.js'; type ProfileEditorData = { firstName: string; diff --git a/ts/components/ProfileMovedModal.stories.tsx b/ts/components/ProfileMovedModal.stories.tsx index bab6f27e806..3ba59cdeb89 100644 --- a/ts/components/ProfileMovedModal.stories.tsx +++ b/ts/components/ProfileMovedModal.stories.tsx @@ -7,10 +7,10 @@ import { action } from '@storybook/addon-actions'; import type { ComponentProps } from 'react'; import type { Meta } from '@storybook/react'; -import { ProfileMovedModal } from './ProfileMovedModal'; -import { ThemeType } from '../types/Util'; +import { ProfileMovedModal } from './ProfileMovedModal.js'; +import { ThemeType } from '../types/Util.js'; -import type { PropsType } from './ProfileMovedModal'; +import type { PropsType } from './ProfileMovedModal.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/ProfileMovedModal.tsx b/ts/components/ProfileMovedModal.tsx index 8a5cf66fb79..a78b5c4e3c7 100644 --- a/ts/components/ProfileMovedModal.tsx +++ b/ts/components/ProfileMovedModal.tsx @@ -3,11 +3,11 @@ import React from 'react'; -import { Modal } from './Modal'; -import { Button } from './Button'; -import { ThemeType } from '../types/Util'; +import { Modal } from './Modal.js'; +import { Button } from './Button.js'; +import { ThemeType } from '../types/Util.js'; -import type { LocalizerType } from '../types/Util'; +import type { LocalizerType } from '../types/Util.js'; export type PropsType = Readonly<{ i18n: LocalizerType; diff --git a/ts/components/Profiler.tsx b/ts/components/Profiler.tsx index 99024185cc9..4e7a3fde1db 100644 --- a/ts/components/Profiler.tsx +++ b/ts/components/Profiler.tsx @@ -3,7 +3,7 @@ import type { ProfilerOnRenderCallback, ReactNode } from 'react'; import React from 'react'; -import { createLogger } from '../logging/log'; +import { createLogger } from '../logging/log.js'; const log = createLogger('Profiler'); diff --git a/ts/components/ProgressBar.stories.tsx b/ts/components/ProgressBar.stories.tsx index 30f29564452..ca5b5afca6f 100644 --- a/ts/components/ProgressBar.stories.tsx +++ b/ts/components/ProgressBar.stories.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; -import { ProgressBar } from './ProgressBar'; -import type { ComponentMeta } from '../storybook/types'; +import { ProgressBar } from './ProgressBar.js'; +import type { ComponentMeta } from '../storybook/types.js'; type Props = React.ComponentProps; export default { diff --git a/ts/components/ProgressDialog.stories.tsx b/ts/components/ProgressDialog.stories.tsx index 5abc852a5e8..cb595aaf572 100644 --- a/ts/components/ProgressDialog.stories.tsx +++ b/ts/components/ProgressDialog.stories.tsx @@ -4,8 +4,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './ProgressDialog'; -import { ProgressDialog } from './ProgressDialog'; +import type { PropsType } from './ProgressDialog.js'; +import { ProgressDialog } from './ProgressDialog.js'; export default { title: 'Components/ProgressDialog', diff --git a/ts/components/ProgressDialog.tsx b/ts/components/ProgressDialog.tsx index eb7758c9963..6031dc1ffa1 100644 --- a/ts/components/ProgressDialog.tsx +++ b/ts/components/ProgressDialog.tsx @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import * as React from 'react'; -import type { LocalizerType } from '../types/Util'; -import { Spinner } from './Spinner'; +import type { LocalizerType } from '../types/Util.js'; +import { Spinner } from './Spinner.js'; export type PropsType = { readonly i18n: LocalizerType; diff --git a/ts/components/ProgressModal.stories.tsx b/ts/components/ProgressModal.stories.tsx index d825bbabca9..d16b30700f7 100644 --- a/ts/components/ProgressModal.stories.tsx +++ b/ts/components/ProgressModal.stories.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './ProgressModal'; -import { ProgressModal } from './ProgressModal'; +import type { PropsType } from './ProgressModal.js'; +import { ProgressModal } from './ProgressModal.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/ProgressModal.tsx b/ts/components/ProgressModal.tsx index c163cba1e46..74693701ec7 100644 --- a/ts/components/ProgressModal.tsx +++ b/ts/components/ProgressModal.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import { createPortal } from 'react-dom'; -import { ProgressDialog } from './ProgressDialog'; -import type { LocalizerType } from '../types/Util'; +import { ProgressDialog } from './ProgressDialog.js'; +import type { LocalizerType } from '../types/Util.js'; export type PropsType = { readonly i18n: LocalizerType; diff --git a/ts/components/QrCode.stories.tsx b/ts/components/QrCode.stories.tsx index 6e91594591d..2921de475dc 100644 --- a/ts/components/QrCode.stories.tsx +++ b/ts/components/QrCode.stories.tsx @@ -3,8 +3,8 @@ import React from 'react'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './QrCode'; -import { QrCode } from './QrCode'; +import type { PropsType } from './QrCode.js'; +import { QrCode } from './QrCode.js'; export default { title: 'Components/QrCode', diff --git a/ts/components/QrCode.tsx b/ts/components/QrCode.tsx index 38b846f2851..cbd0d23664c 100644 --- a/ts/components/QrCode.tsx +++ b/ts/components/QrCode.tsx @@ -4,7 +4,7 @@ import type { ReactElement } from 'react'; import React, { useMemo, useRef } from 'react'; import qrcode from 'qrcode-generator'; -import { getEnvironment, Environment } from '../environment'; +import { getEnvironment, Environment } from '../environment.js'; const AUTODETECT_TYPE_NUMBER = 0; const ERROR_CORRECTION_LEVEL = 'L'; diff --git a/ts/components/ReactionPickerPicker.tsx b/ts/components/ReactionPickerPicker.tsx index ef10f4a3e10..2e1abf0a168 100644 --- a/ts/components/ReactionPickerPicker.tsx +++ b/ts/components/ReactionPickerPicker.tsx @@ -6,14 +6,14 @@ import React, { forwardRef } from 'react'; import classNames from 'classnames'; import { Button } from 'react-aria-components'; -import type { LocalizerType } from '../types/Util'; -import { FunStaticEmoji } from './fun/FunEmoji'; -import { strictAssert } from '../util/assert'; +import type { LocalizerType } from '../types/Util.js'; +import { FunStaticEmoji } from './fun/FunEmoji.js'; +import { strictAssert } from '../util/assert.js'; import { getEmojiVariantByKey, getEmojiVariantKeyByValue, isEmojiVariantValue, -} from './fun/data/emojis'; +} from './fun/data/emojis.js'; export enum ReactionPickerPickerStyle { Picker, diff --git a/ts/components/RecordingComposer.tsx b/ts/components/RecordingComposer.tsx index 1c6d9148c58..12e0d36a166 100644 --- a/ts/components/RecordingComposer.tsx +++ b/ts/components/RecordingComposer.tsx @@ -3,8 +3,8 @@ import React from 'react'; import type { ReactNode } from 'react'; -import type { LocalizerType } from '../types/I18N'; -import { Button, ButtonSize, ButtonVariant } from './Button'; +import type { LocalizerType } from '../types/I18N.js'; +import { Button, ButtonSize, ButtonVariant } from './Button.js'; type Props = { i18n: LocalizerType; diff --git a/ts/components/SafetyNumberChangeDialog.stories.tsx b/ts/components/SafetyNumberChangeDialog.stories.tsx index 9e6054bfef1..2047c26d690 100644 --- a/ts/components/SafetyNumberChangeDialog.stories.tsx +++ b/ts/components/SafetyNumberChangeDialog.stories.tsx @@ -4,13 +4,13 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './SafetyNumberChangeDialog'; -import { SafetyNumberChangeDialog } from './SafetyNumberChangeDialog'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation'; -import { StorybookThemeContext } from '../../.storybook/StorybookThemeContext'; -import { getFakeBadge } from '../test-helpers/getFakeBadge'; -import { MY_STORY_ID } from '../types/Stories'; -import { generateStoryDistributionId } from '../types/StoryDistributionId'; +import type { Props } from './SafetyNumberChangeDialog.js'; +import { SafetyNumberChangeDialog } from './SafetyNumberChangeDialog.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; +import { StorybookThemeContext } from '../../.storybook/StorybookThemeContext.js'; +import { getFakeBadge } from '../test-helpers/getFakeBadge.js'; +import { MY_STORY_ID } from '../types/Stories.js'; +import { generateStoryDistributionId } from '../types/StoryDistributionId.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/SafetyNumberChangeDialog.tsx b/ts/components/SafetyNumberChangeDialog.tsx index 4e0dc31eb81..d2d7ec32f37 100644 --- a/ts/components/SafetyNumberChangeDialog.tsx +++ b/ts/components/SafetyNumberChangeDialog.tsx @@ -5,25 +5,25 @@ import * as React from 'react'; import { noop } from 'lodash'; import classNames from 'classnames'; -import { Avatar, AvatarSize } from './Avatar'; -import type { ActionSpec } from './ConfirmationDialog'; -import { ConfirmationDialog } from './ConfirmationDialog'; -import { InContactsIcon } from './InContactsIcon'; -import { Modal } from './Modal'; +import { Avatar, AvatarSize } from './Avatar.js'; +import type { ActionSpec } from './ConfirmationDialog.js'; +import { ConfirmationDialog } from './ConfirmationDialog.js'; +import { InContactsIcon } from './InContactsIcon.js'; +import { Modal } from './Modal.js'; -import type { ConversationType } from '../state/ducks/conversations'; -import type { PreferredBadgeSelectorType } from '../state/selectors/badges'; -import type { LocalizerType } from '../types/Util'; -import { ThemeType } from '../types/Util'; -import { isInSystemContacts } from '../util/isInSystemContacts'; -import { missingCaseError } from '../util/missingCaseError'; -import { ContextMenu } from './ContextMenu'; -import { Theme } from '../util/theme'; -import { isNotNil } from '../util/isNotNil'; -import { MY_STORY_ID } from '../types/Stories'; -import type { ServiceIdString } from '../types/ServiceId'; -import type { StoryDistributionIdString } from '../types/StoryDistributionId'; -import { UserText } from './UserText'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import type { PreferredBadgeSelectorType } from '../state/selectors/badges.js'; +import type { LocalizerType } from '../types/Util.js'; +import { ThemeType } from '../types/Util.js'; +import { isInSystemContacts } from '../util/isInSystemContacts.js'; +import { missingCaseError } from '../util/missingCaseError.js'; +import { ContextMenu } from './ContextMenu.js'; +import { Theme } from '../util/theme.js'; +import { isNotNil } from '../util/isNotNil.js'; +import { MY_STORY_ID } from '../types/Stories.js'; +import type { ServiceIdString } from '../types/ServiceId.js'; +import type { StoryDistributionIdString } from '../types/StoryDistributionId.js'; +import { UserText } from './UserText.js'; export enum SafetyNumberChangeSource { InitiateCall = 'InitiateCall', diff --git a/ts/components/SafetyNumberModal.tsx b/ts/components/SafetyNumberModal.tsx index 17fc3e8cab2..dec9a36f096 100644 --- a/ts/components/SafetyNumberModal.tsx +++ b/ts/components/SafetyNumberModal.tsx @@ -3,11 +3,11 @@ import React from 'react'; -import { isSafetyNumberNotAvailable } from '../util/isSafetyNumberNotAvailable'; -import { Modal } from './Modal'; -import type { PropsType as SafetyNumberViewerPropsType } from './SafetyNumberViewer'; -import { SafetyNumberViewer } from './SafetyNumberViewer'; -import { SafetyNumberNotReady } from './SafetyNumberNotReady'; +import { isSafetyNumberNotAvailable } from '../util/isSafetyNumberNotAvailable.js'; +import { Modal } from './Modal.js'; +import type { PropsType as SafetyNumberViewerPropsType } from './SafetyNumberViewer.js'; +import { SafetyNumberViewer } from './SafetyNumberViewer.js'; +import { SafetyNumberNotReady } from './SafetyNumberNotReady.js'; type PropsType = { toggleSafetyNumberModal: () => unknown; diff --git a/ts/components/SafetyNumberNotReady.stories.tsx b/ts/components/SafetyNumberNotReady.stories.tsx index e1c1b3a0c8b..f234c1a08eb 100644 --- a/ts/components/SafetyNumberNotReady.stories.tsx +++ b/ts/components/SafetyNumberNotReady.stories.tsx @@ -4,8 +4,8 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './SafetyNumberNotReady'; -import { SafetyNumberNotReady } from './SafetyNumberNotReady'; +import type { PropsType } from './SafetyNumberNotReady.js'; +import { SafetyNumberNotReady } from './SafetyNumberNotReady.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/SafetyNumberNotReady.tsx b/ts/components/SafetyNumberNotReady.tsx index 01fb3646d4c..65d1a2fdd5e 100644 --- a/ts/components/SafetyNumberNotReady.tsx +++ b/ts/components/SafetyNumberNotReady.tsx @@ -3,12 +3,12 @@ import React from 'react'; -import { Button, ButtonVariant } from './Button'; -import { Modal } from './Modal'; -import { I18n } from './I18n'; -import { openLinkInWebBrowser } from '../util/openLinkInWebBrowser'; -import type { LocalizerType } from '../types/Util'; -import { SAFETY_NUMBER_URL } from '../types/support'; +import { Button, ButtonVariant } from './Button.js'; +import { Modal } from './Modal.js'; +import { I18n } from './I18n.js'; +import { openLinkInWebBrowser } from '../util/openLinkInWebBrowser.js'; +import type { LocalizerType } from '../types/Util.js'; +import { SAFETY_NUMBER_URL } from '../types/support.js'; export type PropsType = { i18n: LocalizerType; diff --git a/ts/components/SafetyNumberViewer.stories.tsx b/ts/components/SafetyNumberViewer.stories.tsx index d7f16c6c556..51afddf16d9 100644 --- a/ts/components/SafetyNumberViewer.stories.tsx +++ b/ts/components/SafetyNumberViewer.stories.tsx @@ -4,9 +4,9 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './SafetyNumberViewer'; -import { SafetyNumberViewer } from './SafetyNumberViewer'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation'; +import type { PropsType } from './SafetyNumberViewer.js'; +import { SafetyNumberViewer } from './SafetyNumberViewer.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; function generateQRData() { const data = new Uint8Array(128); diff --git a/ts/components/SafetyNumberViewer.tsx b/ts/components/SafetyNumberViewer.tsx index 109c1d01418..8815017ec32 100644 --- a/ts/components/SafetyNumberViewer.tsx +++ b/ts/components/SafetyNumberViewer.tsx @@ -3,14 +3,14 @@ import React from 'react'; -import { Button, ButtonVariant } from './Button'; -import { QrCode } from './QrCode'; -import type { ConversationType } from '../state/ducks/conversations'; -import { I18n } from './I18n'; -import { Emojify } from './conversation/Emojify'; -import type { LocalizerType } from '../types/Util'; -import type { SafetyNumberType } from '../types/safetyNumber'; -import { SAFETY_NUMBER_URL } from '../types/support'; +import { Button, ButtonVariant } from './Button.js'; +import { QrCode } from './QrCode.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import { I18n } from './I18n.js'; +import { Emojify } from './conversation/Emojify.js'; +import type { LocalizerType } from '../types/Util.js'; +import type { SafetyNumberType } from '../types/safetyNumber.js'; +import { SAFETY_NUMBER_URL } from '../types/support.js'; export type PropsType = { contact: ConversationType; diff --git a/ts/components/SafetyTipsModal.stories.tsx b/ts/components/SafetyTipsModal.stories.tsx index e30c5dbd156..75bf086d7ca 100644 --- a/ts/components/SafetyTipsModal.stories.tsx +++ b/ts/components/SafetyTipsModal.stories.tsx @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { ComponentMeta } from '../storybook/types'; -import type { SafetyTipsModalProps } from './SafetyTipsModal'; -import { SafetyTipsModal } from './SafetyTipsModal'; +import type { ComponentMeta } from '../storybook/types.js'; +import type { SafetyTipsModalProps } from './SafetyTipsModal.js'; +import { SafetyTipsModal } from './SafetyTipsModal.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/SafetyTipsModal.tsx b/ts/components/SafetyTipsModal.tsx index 04a6b8f39cf..08720087ec6 100644 --- a/ts/components/SafetyTipsModal.tsx +++ b/ts/components/SafetyTipsModal.tsx @@ -3,10 +3,10 @@ import type { UIEvent } from 'react'; import React, { useEffect, useMemo, useRef, useState } from 'react'; import { v4 as uuid } from 'uuid'; -import type { LocalizerType } from '../types/I18N'; -import { Modal } from './Modal'; -import { Button, ButtonVariant } from './Button'; -import { useReducedMotion } from '../hooks/useReducedMotion'; +import type { LocalizerType } from '../types/I18N.js'; +import { Modal } from './Modal.js'; +import { Button, ButtonVariant } from './Button.js'; +import { useReducedMotion } from '../hooks/useReducedMotion.js'; export type SafetyTipsModalProps = Readonly<{ i18n: LocalizerType; diff --git a/ts/components/SampleMessageBubbles.tsx b/ts/components/SampleMessageBubbles.tsx index 2d61d2e64bc..571a4b33213 100644 --- a/ts/components/SampleMessageBubbles.tsx +++ b/ts/components/SampleMessageBubbles.tsx @@ -3,9 +3,9 @@ import type { CSSProperties } from 'react'; import React from 'react'; -import type { ConversationColorType } from '../types/Colors'; -import type { LocalizerType } from '../types/Util'; -import { formatTime } from '../util/timestamp'; +import type { ConversationColorType } from '../types/Colors.js'; +import type { LocalizerType } from '../types/Util.js'; +import { formatTime } from '../util/timestamp.js'; export type PropsType = { backgroundStyle?: CSSProperties; diff --git a/ts/components/SearchInput.tsx b/ts/components/SearchInput.tsx index 13010df7212..58a03131376 100644 --- a/ts/components/SearchInput.tsx +++ b/ts/components/SearchInput.tsx @@ -9,8 +9,8 @@ import type { } from 'react'; import React, { forwardRef } from 'react'; import classNames from 'classnames'; -import type { LocalizerType } from '../types/Util'; -import { getClassNamesFor } from '../util/getClassNamesFor'; +import type { LocalizerType } from '../types/Util.js'; +import { getClassNamesFor } from '../util/getClassNamesFor.js'; export type PropTypes = Readonly<{ children?: ReactNode; diff --git a/ts/components/Select.stories.tsx b/ts/components/Select.stories.tsx index d137fdd7159..c9faaa4c446 100644 --- a/ts/components/Select.stories.tsx +++ b/ts/components/Select.stories.tsx @@ -4,8 +4,8 @@ import React, { useState } from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './Select'; -import { Select } from './Select'; +import type { PropsType } from './Select.js'; +import { Select } from './Select.js'; export default { title: 'Components/Select', diff --git a/ts/components/SendStoryModal.stories.tsx b/ts/components/SendStoryModal.stories.tsx index a40ede7c2d1..0998ab214a1 100644 --- a/ts/components/SendStoryModal.stories.tsx +++ b/ts/components/SendStoryModal.stories.tsx @@ -5,18 +5,18 @@ import type { Meta } from '@storybook/react'; import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { PropsType } from './SendStoryModal'; -import { SendStoryModal } from './SendStoryModal'; +import type { PropsType } from './SendStoryModal.js'; +import { SendStoryModal } from './SendStoryModal.js'; import { getDefaultConversation, getDefaultGroup, -} from '../test-helpers/getDefaultConversation'; +} from '../test-helpers/getDefaultConversation.js'; import { getMyStories, getFakeDistributionListsWithMembers, -} from '../test-helpers/getFakeDistributionLists'; -import { VIDEO_MP4 } from '../types/MIME'; -import type { StoryDistributionIdString } from '../types/StoryDistributionId'; +} from '../test-helpers/getFakeDistributionLists.js'; +import { VIDEO_MP4 } from '../types/MIME.js'; +import type { StoryDistributionIdString } from '../types/StoryDistributionId.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/SendStoryModal.tsx b/ts/components/SendStoryModal.tsx index d035d808f16..899430a58e9 100644 --- a/ts/components/SendStoryModal.tsx +++ b/ts/components/SendStoryModal.tsx @@ -4,15 +4,15 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react'; import { noop, sortBy } from 'lodash'; -import { SearchInput } from './SearchInput'; -import { filterAndSortConversations } from '../util/filterAndSortConversations'; +import { SearchInput } from './SearchInput.js'; +import { filterAndSortConversations } from '../util/filterAndSortConversations.js'; -import type { ConversationType } from '../state/ducks/conversations'; -import type { ConversationWithStoriesType } from '../state/selectors/conversations'; -import type { LocalizerType } from '../types/Util'; -import { ThemeType } from '../types/Util'; -import type { PreferredBadgeSelectorType } from '../state/selectors/badges'; -import type { PropsType as StoriesSettingsModalPropsType } from './StoriesSettingsModal'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import type { ConversationWithStoriesType } from '../state/selectors/conversations.js'; +import type { LocalizerType } from '../types/Util.js'; +import { ThemeType } from '../types/Util.js'; +import type { PreferredBadgeSelectorType } from '../state/selectors/badges.js'; +import type { PropsType as StoriesSettingsModalPropsType } from './StoriesSettingsModal.js'; import { getI18nForMyStory, getListViewers, @@ -20,29 +20,29 @@ import { EditDistributionListModal, EditMyStoryPrivacy, Page as StoriesSettingsPage, -} from './StoriesSettingsModal'; -import type { StoryDistributionListWithMembersDataType } from '../types/Stories'; -import type { StoryDistributionIdString } from '../types/StoryDistributionId'; -import type { ServiceIdString } from '../types/ServiceId'; -import { Alert } from './Alert'; -import { Avatar, AvatarSize } from './Avatar'; -import { Button, ButtonSize, ButtonVariant } from './Button'; -import { Checkbox } from './Checkbox'; -import { ConfirmationDialog } from './ConfirmationDialog'; -import { ContextMenu } from './ContextMenu'; +} from './StoriesSettingsModal.js'; +import type { StoryDistributionListWithMembersDataType } from '../types/Stories.js'; +import type { StoryDistributionIdString } from '../types/StoryDistributionId.js'; +import type { ServiceIdString } from '../types/ServiceId.js'; +import { Alert } from './Alert.js'; +import { Avatar, AvatarSize } from './Avatar.js'; +import { Button, ButtonSize, ButtonVariant } from './Button.js'; +import { Checkbox } from './Checkbox.js'; +import { ConfirmationDialog } from './ConfirmationDialog.js'; +import { ContextMenu } from './ContextMenu.js'; -import { MY_STORY_ID, getStoryDistributionListName } from '../types/Stories'; -import type { RenderModalPage, ModalPropsType } from './Modal'; -import { PagedModal, ModalPage } from './Modal'; -import { StoryDistributionListName } from './StoryDistributionListName'; -import { isNotNil } from '../util/isNotNil'; -import { StoryImage } from './StoryImage'; -import type { AttachmentType } from '../types/Attachment'; -import { useConfirmDiscard } from '../hooks/useConfirmDiscard'; -import { getStoryBackground } from '../util/getStoryBackground'; -import { makeObjectUrl, revokeObjectUrl } from '../types/VisualAttachment'; -import { UserText } from './UserText'; -import { Theme } from '../util/theme'; +import { MY_STORY_ID, getStoryDistributionListName } from '../types/Stories.js'; +import type { RenderModalPage, ModalPropsType } from './Modal.js'; +import { PagedModal, ModalPage } from './Modal.js'; +import { StoryDistributionListName } from './StoryDistributionListName.js'; +import { isNotNil } from '../util/isNotNil.js'; +import { StoryImage } from './StoryImage.js'; +import type { AttachmentType } from '../types/Attachment.js'; +import { useConfirmDiscard } from '../hooks/useConfirmDiscard.js'; +import { getStoryBackground } from '../util/getStoryBackground.js'; +import { makeObjectUrl, revokeObjectUrl } from '../types/VisualAttachment.js'; +import { UserText } from './UserText.js'; +import { Theme } from '../util/theme.js'; export type PropsType = { draftAttachment: AttachmentType; diff --git a/ts/components/ServerAlerts.tsx b/ts/components/ServerAlerts.tsx index 2c730adca1f..c5f88072056 100644 --- a/ts/components/ServerAlerts.tsx +++ b/ts/components/ServerAlerts.tsx @@ -6,12 +6,12 @@ import { getServerAlertToShow, ServerAlert, type ServerAlertsType, -} from '../util/handleServerAlerts'; -import type { WidthBreakpoint } from './_util'; -import type { LocalizerType } from '../types/I18N'; -import { CriticalIdlePrimaryDeviceDialog } from './CriticalIdlePrimaryDeviceDialog'; -import { strictAssert } from '../util/assert'; -import { WarningIdlePrimaryDeviceDialog } from './WarningIdlePrimaryDeviceDialog'; +} from '../util/handleServerAlerts.js'; +import type { WidthBreakpoint } from './_util.js'; +import type { LocalizerType } from '../types/I18N.js'; +import { CriticalIdlePrimaryDeviceDialog } from './CriticalIdlePrimaryDeviceDialog.js'; +import { strictAssert } from '../util/assert.js'; +import { WarningIdlePrimaryDeviceDialog } from './WarningIdlePrimaryDeviceDialog.js'; export function getServerAlertDialog( alerts: ServerAlertsType | undefined, diff --git a/ts/components/SharedGroupNames.tsx b/ts/components/SharedGroupNames.tsx index 16be25470dd..3498db5ce18 100644 --- a/ts/components/SharedGroupNames.tsx +++ b/ts/components/SharedGroupNames.tsx @@ -4,9 +4,9 @@ import React from 'react'; import { take } from 'lodash'; -import { I18n } from './I18n'; -import type { LocalizerType } from '../types/Util'; -import { UserText } from './UserText'; +import { I18n } from './I18n.js'; +import type { LocalizerType } from '../types/Util.js'; +import { UserText } from './UserText.js'; type PropsType = { i18n: LocalizerType; diff --git a/ts/components/ShortcutGuide.stories.tsx b/ts/components/ShortcutGuide.stories.tsx index c2f86ef848b..c65d5a639d2 100644 --- a/ts/components/ShortcutGuide.stories.tsx +++ b/ts/components/ShortcutGuide.stories.tsx @@ -4,8 +4,8 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './ShortcutGuide'; -import { ShortcutGuide } from './ShortcutGuide'; +import type { Props } from './ShortcutGuide.js'; +import { ShortcutGuide } from './ShortcutGuide.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/ShortcutGuide.tsx b/ts/components/ShortcutGuide.tsx index 03090e2ea4d..d4ed21998e8 100644 --- a/ts/components/ShortcutGuide.tsx +++ b/ts/components/ShortcutGuide.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import classNames from 'classnames'; -import { useRestoreFocus } from '../hooks/useRestoreFocus'; -import type { LocalizerType } from '../types/Util'; +import { useRestoreFocus } from '../hooks/useRestoreFocus.js'; +import type { LocalizerType } from '../types/Util.js'; export type Props = { hasInstalledStickers: boolean; diff --git a/ts/components/ShortcutGuideModal.tsx b/ts/components/ShortcutGuideModal.tsx index aee6f89fb77..7ff30a8ed1b 100644 --- a/ts/components/ShortcutGuideModal.tsx +++ b/ts/components/ShortcutGuideModal.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import { createPortal } from 'react-dom'; -import type { LocalizerType } from '../types/Util'; -import { ShortcutGuide } from './ShortcutGuide'; +import type { LocalizerType } from '../types/Util.js'; +import { ShortcutGuide } from './ShortcutGuide.js'; export type PropsType = { hasInstalledStickers: boolean; diff --git a/ts/components/SignalConnectionsModal.stories.tsx b/ts/components/SignalConnectionsModal.stories.tsx index 6a48d76b160..0da94fd5f30 100644 --- a/ts/components/SignalConnectionsModal.stories.tsx +++ b/ts/components/SignalConnectionsModal.stories.tsx @@ -5,8 +5,8 @@ import type { Meta, StoryFn } from '@storybook/react'; import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { PropsType } from './SignalConnectionsModal'; -import { SignalConnectionsModal } from './SignalConnectionsModal'; +import type { PropsType } from './SignalConnectionsModal.js'; +import { SignalConnectionsModal } from './SignalConnectionsModal.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/SignalConnectionsModal.tsx b/ts/components/SignalConnectionsModal.tsx index 6b89af7808e..3e0db55c36c 100644 --- a/ts/components/SignalConnectionsModal.tsx +++ b/ts/components/SignalConnectionsModal.tsx @@ -3,9 +3,9 @@ import React from 'react'; -import type { LocalizerType } from '../types/Util'; -import { I18n } from './I18n'; -import { Modal } from './Modal'; +import type { LocalizerType } from '../types/Util.js'; +import { I18n } from './I18n.js'; +import { Modal } from './Modal.js'; export type PropsType = Readonly<{ i18n: LocalizerType; diff --git a/ts/components/Slider.stories.tsx b/ts/components/Slider.stories.tsx index c998aae130f..dbb559a180e 100644 --- a/ts/components/Slider.stories.tsx +++ b/ts/components/Slider.stories.tsx @@ -6,8 +6,8 @@ import React, { useState } from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './Slider'; -import { Slider } from './Slider'; +import type { PropsType } from './Slider.js'; +import { Slider } from './Slider.js'; export default { title: 'Components/Slider', diff --git a/ts/components/Slider.tsx b/ts/components/Slider.tsx index 966b8094cd2..5674bf2d1af 100644 --- a/ts/components/Slider.tsx +++ b/ts/components/Slider.tsx @@ -3,8 +3,8 @@ import type { CSSProperties, KeyboardEvent } from 'react'; import React, { useRef } from 'react'; -import { getClassNamesFor } from '../util/getClassNamesFor'; -import { arrow } from '../util/keyboard'; +import { getClassNamesFor } from '../util/getClassNamesFor.js'; +import { arrow } from '../util/keyboard.js'; export type PropsType = { containerStyle?: CSSProperties; diff --git a/ts/components/Spinner.stories.tsx b/ts/components/Spinner.stories.tsx index eeda1987657..bd9fd0c76ab 100644 --- a/ts/components/Spinner.stories.tsx +++ b/ts/components/Spinner.stories.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { Props } from './Spinner'; -import { Spinner, SpinnerDirections, SpinnerSvgSizes } from './Spinner'; +import type { Props } from './Spinner.js'; +import { Spinner, SpinnerDirections, SpinnerSvgSizes } from './Spinner.js'; export default { title: 'Components/Spinner', diff --git a/ts/components/Spinner.tsx b/ts/components/Spinner.tsx index 151e2b20d38..f5f29819bd6 100644 --- a/ts/components/Spinner.tsx +++ b/ts/components/Spinner.tsx @@ -4,7 +4,7 @@ import React from 'react'; import classNames from 'classnames'; -import { getClassNamesFor } from '../util/getClassNamesFor'; +import { getClassNamesFor } from '../util/getClassNamesFor.js'; export const SpinnerSvgSizes = ['small', 'normal'] as const; export type SpinnerSvgSize = (typeof SpinnerSvgSizes)[number]; diff --git a/ts/components/SpinnerV2.stories.tsx b/ts/components/SpinnerV2.stories.tsx index 60615c6de50..3feec9a1968 100644 --- a/ts/components/SpinnerV2.stories.tsx +++ b/ts/components/SpinnerV2.stories.tsx @@ -3,11 +3,11 @@ import React, { useEffect, useState } from 'react'; -import { SpinnerV2 } from './SpinnerV2'; -import { tw } from '../axo/tw'; +import { SpinnerV2 } from './SpinnerV2.js'; +import { tw } from '../axo/tw.js'; -import type { ComponentMeta } from '../storybook/types'; -import type { Props } from './SpinnerV2'; +import type { ComponentMeta } from '../storybook/types.js'; +import type { Props } from './SpinnerV2.js'; export default { title: 'Components/SpinnerV2', diff --git a/ts/components/SpinnerV2.tsx b/ts/components/SpinnerV2.tsx index 031923bfb8b..e536cb92786 100644 --- a/ts/components/SpinnerV2.tsx +++ b/ts/components/SpinnerV2.tsx @@ -3,8 +3,8 @@ import React from 'react'; -import { tw, type TailwindStyles } from '../axo/tw'; -import { roundFractionForProgressBar } from '../util/numbers'; +import { tw, type TailwindStyles } from '../axo/tw.js'; +import { roundFractionForProgressBar } from '../util/numbers.js'; export type Props = { value?: number | 'indeterminate'; // default: 'indeterminate' diff --git a/ts/components/StandaloneRegistration.stories.tsx b/ts/components/StandaloneRegistration.stories.tsx index 8dd5be5f5ca..9beef4a78ad 100644 --- a/ts/components/StandaloneRegistration.stories.tsx +++ b/ts/components/StandaloneRegistration.stories.tsx @@ -5,10 +5,10 @@ import React from 'react'; import type { Meta, StoryFn } from '@storybook/react'; import { fn } from '@storybook/test'; -import { StandaloneRegistration } from './StandaloneRegistration'; -import type { PropsType } from './StandaloneRegistration'; -import { SECOND } from '../util/durations'; -import { sleep } from '../util/sleep'; +import { StandaloneRegistration } from './StandaloneRegistration.js'; +import type { PropsType } from './StandaloneRegistration.js'; +import { SECOND } from '../util/durations/index.js'; +import { sleep } from '../util/sleep.js'; export default { title: 'Components/StandaloneRegistration', diff --git a/ts/components/StandaloneRegistration.tsx b/ts/components/StandaloneRegistration.tsx index 4f2b44784be..35fd482f9d8 100644 --- a/ts/components/StandaloneRegistration.tsx +++ b/ts/components/StandaloneRegistration.tsx @@ -6,10 +6,10 @@ import React, { useState, useEffect, useCallback, useRef } from 'react'; import type { Iti } from 'intl-tel-input'; import intlTelInput from 'intl-tel-input'; -import { strictAssert } from '../util/assert'; -import { parseNumber } from '../util/libphonenumberUtil'; -import { missingCaseError } from '../util/missingCaseError'; -import { VerificationTransport } from '../types/VerificationTransport'; +import { strictAssert } from '../util/assert.js'; +import { parseNumber } from '../util/libphonenumberUtil.js'; +import { missingCaseError } from '../util/missingCaseError.js'; +import { VerificationTransport } from '../types/VerificationTransport.js'; function PhoneInput({ initialValue, diff --git a/ts/components/StoriesAddStoryButton.tsx b/ts/components/StoriesAddStoryButton.tsx index fe300dc411e..7ebadd77db2 100644 --- a/ts/components/StoriesAddStoryButton.tsx +++ b/ts/components/StoriesAddStoryButton.tsx @@ -4,15 +4,15 @@ import type { ReactNode } from 'react'; import React, { useState, useCallback } from 'react'; -import type { LocalizerType } from '../types/Util'; -import type { ShowToastAction } from '../state/ducks/toast'; -import { ContextMenu } from './ContextMenu'; -import { ToastType } from '../types/Toast'; +import type { LocalizerType } from '../types/Util.js'; +import type { ShowToastAction } from '../state/ducks/toast.js'; +import { ContextMenu } from './ContextMenu.js'; +import { ToastType } from '../types/Toast.js'; import { isVideoGoodForStories, ReasonVideoNotGood, -} from '../util/isVideoGoodForStories'; -import { ConfirmationDialog } from './ConfirmationDialog'; +} from '../util/isVideoGoodForStories.js'; +import { ConfirmationDialog } from './ConfirmationDialog.js'; export type PropsType = { children?: ReactNode; diff --git a/ts/components/StoriesPane.tsx b/ts/components/StoriesPane.tsx index f672c8ae814..8e88f557e71 100644 --- a/ts/components/StoriesPane.tsx +++ b/ts/components/StoriesPane.tsx @@ -8,17 +8,17 @@ import classNames from 'classnames'; import type { ConversationType, ShowConversationType, -} from '../state/ducks/conversations'; -import type { ConversationStoryType, MyStoryType } from '../types/Stories'; -import type { LocalizerType, ThemeType } from '../types/Util'; -import type { PreferredBadgeSelectorType } from '../state/selectors/badges'; -import type { ShowToastAction } from '../state/ducks/toast'; -import type { ViewUserStoriesActionCreatorType } from '../state/ducks/stories'; -import { MyStoryButton } from './MyStoryButton'; -import { SearchInput } from './SearchInput'; -import { StoryListItem } from './StoryListItem'; -import { isNotNil } from '../util/isNotNil'; -import { NavSidebarSearchHeader, NavSidebarEmpty } from './NavSidebar'; +} from '../state/ducks/conversations.js'; +import type { ConversationStoryType, MyStoryType } from '../types/Stories.js'; +import type { LocalizerType, ThemeType } from '../types/Util.js'; +import type { PreferredBadgeSelectorType } from '../state/selectors/badges.js'; +import type { ShowToastAction } from '../state/ducks/toast.js'; +import type { ViewUserStoriesActionCreatorType } from '../state/ducks/stories.js'; +import { MyStoryButton } from './MyStoryButton.js'; +import { SearchInput } from './SearchInput.js'; +import { StoryListItem } from './StoryListItem.js'; +import { isNotNil } from '../util/isNotNil.js'; +import { NavSidebarSearchHeader, NavSidebarEmpty } from './NavSidebar.js'; const FUSE_OPTIONS: Fuse.IFuseOptions = { getFn: (story, path) => { diff --git a/ts/components/StoriesSettingsModal.stories.tsx b/ts/components/StoriesSettingsModal.stories.tsx index 34470286c15..c86156c0120 100644 --- a/ts/components/StoriesSettingsModal.stories.tsx +++ b/ts/components/StoriesSettingsModal.stories.tsx @@ -5,16 +5,16 @@ import type { Meta, StoryFn } from '@storybook/react'; import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { PropsType } from './StoriesSettingsModal'; -import { StoriesSettingsModal } from './StoriesSettingsModal'; +import type { PropsType } from './StoriesSettingsModal.js'; +import { StoriesSettingsModal } from './StoriesSettingsModal.js'; import { getDefaultConversation, getDefaultGroup, -} from '../test-helpers/getDefaultConversation'; +} from '../test-helpers/getDefaultConversation.js'; import { getMyStories, getFakeDistributionList, -} from '../test-helpers/getFakeDistributionLists'; +} from '../test-helpers/getFakeDistributionLists.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/StoriesSettingsModal.tsx b/ts/components/StoriesSettingsModal.tsx index 8159f5c6d9c..8a3390092ac 100644 --- a/ts/components/StoriesSettingsModal.tsx +++ b/ts/components/StoriesSettingsModal.tsx @@ -11,39 +11,39 @@ import React, { } from 'react'; import { noop } from 'lodash'; -import type { ConversationType } from '../state/ducks/conversations'; -import type { ConversationWithStoriesType } from '../state/selectors/conversations'; -import type { LocalizerType, ThemeType } from '../types/Util'; -import type { PreferredBadgeSelectorType } from '../state/selectors/badges'; -import type { Row } from './ConversationList'; -import type { StoryDistributionListWithMembersDataType } from '../types/Stories'; -import type { StoryDistributionIdString } from '../types/StoryDistributionId'; -import type { ServiceIdString } from '../types/ServiceId'; -import type { RenderModalPage, ModalPropsType } from './Modal'; -import { Avatar, AvatarSize } from './Avatar'; -import { Button, ButtonVariant } from './Button'; -import { Checkbox } from './Checkbox'; -import { ConfirmationDialog } from './ConfirmationDialog'; -import { ContactPills } from './ContactPills'; -import { ContactPill } from './ContactPill'; -import { ConversationList, RowType } from './ConversationList'; -import { Input } from './Input'; -import { I18n } from './I18n'; -import { MY_STORY_ID, getStoryDistributionListName } from '../types/Stories'; -import { PagedModal, ModalPage } from './Modal'; -import { SearchInput } from './SearchInput'; -import { StoryDistributionListName } from './StoryDistributionListName'; -import { filterAndSortConversations } from '../util/filterAndSortConversations'; -import { isNotNil } from '../util/isNotNil'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import type { ConversationWithStoriesType } from '../state/selectors/conversations.js'; +import type { LocalizerType, ThemeType } from '../types/Util.js'; +import type { PreferredBadgeSelectorType } from '../state/selectors/badges.js'; +import type { Row } from './ConversationList.js'; +import type { StoryDistributionListWithMembersDataType } from '../types/Stories.js'; +import type { StoryDistributionIdString } from '../types/StoryDistributionId.js'; +import type { ServiceIdString } from '../types/ServiceId.js'; +import type { RenderModalPage, ModalPropsType } from './Modal.js'; +import { Avatar, AvatarSize } from './Avatar.js'; +import { Button, ButtonVariant } from './Button.js'; +import { Checkbox } from './Checkbox.js'; +import { ConfirmationDialog } from './ConfirmationDialog.js'; +import { ContactPills } from './ContactPills.js'; +import { ContactPill } from './ContactPill.js'; +import { ConversationList, RowType } from './ConversationList.js'; +import { Input } from './Input.js'; +import { I18n } from './I18n.js'; +import { MY_STORY_ID, getStoryDistributionListName } from '../types/Stories.js'; +import { PagedModal, ModalPage } from './Modal.js'; +import { SearchInput } from './SearchInput.js'; +import { StoryDistributionListName } from './StoryDistributionListName.js'; +import { filterAndSortConversations } from '../util/filterAndSortConversations.js'; +import { isNotNil } from '../util/isNotNil.js'; import { shouldNeverBeCalled, asyncShouldNeverBeCalled, -} from '../util/shouldNeverBeCalled'; -import { useConfirmDiscard } from '../hooks/useConfirmDiscard'; -import { getGroupMemberships } from '../util/getGroupMemberships'; -import { strictAssert } from '../util/assert'; -import { UserText } from './UserText'; -import { SizeObserver } from '../hooks/useSizeObserver'; +} from '../util/shouldNeverBeCalled.js'; +import { useConfirmDiscard } from '../hooks/useConfirmDiscard.js'; +import { getGroupMemberships } from '../util/getGroupMemberships.js'; +import { strictAssert } from '../util/assert.js'; +import { UserText } from './UserText.js'; +import { SizeObserver } from '../hooks/useSizeObserver.js'; export type PropsType = { candidateConversations: Array; diff --git a/ts/components/StoriesTab.stories.tsx b/ts/components/StoriesTab.stories.tsx index e54625ba756..cfbf3065725 100644 --- a/ts/components/StoriesTab.stories.tsx +++ b/ts/components/StoriesTab.stories.tsx @@ -5,11 +5,11 @@ import type { Meta, StoryFn } from '@storybook/react'; import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { PropsType } from './StoriesTab'; -import { StoriesTab } from './StoriesTab'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation'; -import { getFakeMyStory, getFakeStory } from '../test-helpers/getFakeStory'; -import * as durations from '../util/durations'; +import type { PropsType } from './StoriesTab.js'; +import { StoriesTab } from './StoriesTab.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; +import { getFakeMyStory, getFakeStory } from '../test-helpers/getFakeStory.js'; +import * as durations from '../util/durations/index.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/StoriesTab.tsx b/ts/components/StoriesTab.tsx index 5aee282f51e..640affdd768 100644 --- a/ts/components/StoriesTab.tsx +++ b/ts/components/StoriesTab.tsx @@ -5,28 +5,28 @@ import React, { useState } from 'react'; import type { ConversationType, ShowConversationType, -} from '../state/ducks/conversations'; +} from '../state/ducks/conversations.js'; import type { ConversationStoryType, MyStoryType, StoryViewType, -} from '../types/Stories'; -import type { LocalizerType, ThemeType } from '../types/Util'; -import type { PreferredBadgeSelectorType } from '../state/selectors/badges'; -import type { ShowToastAction } from '../state/ducks/toast'; +} from '../types/Stories.js'; +import type { LocalizerType, ThemeType } from '../types/Util.js'; +import type { PreferredBadgeSelectorType } from '../state/selectors/badges.js'; +import type { ShowToastAction } from '../state/ducks/toast.js'; import type { AddStoryData, ViewUserStoriesActionCreatorType, ViewStoryActionCreatorType, -} from '../state/ducks/stories'; -import { MyStories } from './MyStories'; -import { StoriesPane } from './StoriesPane'; -import { NavSidebar, NavSidebarActionButton } from './NavSidebar'; -import { StoriesAddStoryButton } from './StoriesAddStoryButton'; -import { ContextMenu } from './ContextMenu'; -import { I18n } from './I18n'; -import type { WidthBreakpoint } from './_util'; -import type { UnreadStats } from '../util/countUnreadStats'; +} from '../state/ducks/stories.js'; +import { MyStories } from './MyStories.js'; +import { StoriesPane } from './StoriesPane.js'; +import { NavSidebar, NavSidebarActionButton } from './NavSidebar.js'; +import { StoriesAddStoryButton } from './StoriesAddStoryButton.js'; +import { ContextMenu } from './ContextMenu.js'; +import { I18n } from './I18n.js'; +import type { WidthBreakpoint } from './_util.js'; +import type { UnreadStats } from '../util/countUnreadStats.js'; export type PropsType = { addStoryData: AddStoryData; diff --git a/ts/components/StoryCreator.stories.tsx b/ts/components/StoryCreator.stories.tsx index 6fdf5bf4e9c..aea5e3c06df 100644 --- a/ts/components/StoryCreator.stories.tsx +++ b/ts/components/StoryCreator.stories.tsx @@ -5,15 +5,15 @@ import type { Meta, StoryFn } from '@storybook/react'; import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { PropsType } from './StoryCreator'; -import { StoryCreator } from './StoryCreator'; -import { fakeAttachment } from '../test-helpers/fakeAttachment'; +import type { PropsType } from './StoryCreator.js'; +import { StoryCreator } from './StoryCreator.js'; +import { fakeAttachment } from '../test-helpers/fakeAttachment.js'; import { getDefaultConversation, getDefaultGroup, -} from '../test-helpers/getDefaultConversation'; -import { getFakeDistributionListsWithMembers } from '../test-helpers/getFakeDistributionLists'; -import { EmojiSkinTone } from './fun/data/emojis'; +} from '../test-helpers/getDefaultConversation.js'; +import { getFakeDistributionListsWithMembers } from '../test-helpers/getFakeDistributionLists.js'; +import { EmojiSkinTone } from './fun/data/emojis.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/StoryCreator.tsx b/ts/components/StoryCreator.tsx index 4658a4ddbcb..ad2ab62b7a5 100644 --- a/ts/components/StoryCreator.tsx +++ b/ts/components/StoryCreator.tsx @@ -5,25 +5,25 @@ import React, { useEffect, useState } from 'react'; import { get, has } from 'lodash'; import { createPortal } from 'react-dom'; -import type { AttachmentType } from '../types/Attachment'; -import type { LinkPreviewSourceType } from '../types/LinkPreview'; -import type { LinkPreviewForUIType } from '../types/message/LinkPreviews'; -import type { LocalizerType, ThemeType } from '../types/Util'; -import type { Props as StickerButtonProps } from './stickers/StickerButton'; -import type { PropsType as SendStoryModalPropsType } from './SendStoryModal'; -import type { StoryDistributionIdString } from '../types/StoryDistributionId'; -import type { imageToBlurHash } from '../util/imageToBlurHash'; -import type { PropsType as TextStoryCreatorPropsType } from './TextStoryCreator'; -import type { PropsType as MediaEditorPropsType } from './MediaEditor'; +import type { AttachmentType } from '../types/Attachment.js'; +import type { LinkPreviewSourceType } from '../types/LinkPreview.js'; +import type { LinkPreviewForUIType } from '../types/message/LinkPreviews.js'; +import type { LocalizerType, ThemeType } from '../types/Util.js'; +import type { Props as StickerButtonProps } from './stickers/StickerButton.js'; +import type { PropsType as SendStoryModalPropsType } from './SendStoryModal.js'; +import type { StoryDistributionIdString } from '../types/StoryDistributionId.js'; +import type { imageToBlurHash } from '../util/imageToBlurHash.js'; +import type { PropsType as TextStoryCreatorPropsType } from './TextStoryCreator.js'; +import type { PropsType as MediaEditorPropsType } from './MediaEditor.js'; -import { TEXT_ATTACHMENT } from '../types/MIME'; -import { isVideoAttachment } from '../types/Attachment'; -import { SendStoryModal } from './SendStoryModal'; +import { TEXT_ATTACHMENT } from '../types/MIME.js'; +import { isVideoAttachment } from '../types/Attachment.js'; +import { SendStoryModal } from './SendStoryModal.js'; -import { MediaEditor } from './MediaEditor'; -import { TextStoryCreator } from './TextStoryCreator'; -import type { DraftBodyRanges } from '../types/BodyRange'; -import type { processAttachment } from '../util/processAttachment'; +import { MediaEditor } from './MediaEditor.js'; +import { TextStoryCreator } from './TextStoryCreator.js'; +import type { DraftBodyRanges } from '../types/BodyRange.js'; +import type { processAttachment } from '../util/processAttachment.js'; function usePortalElement(testid: string): HTMLDivElement | null { const [element, setElement] = useState(null); diff --git a/ts/components/StoryDetailsModal.stories.tsx b/ts/components/StoryDetailsModal.stories.tsx index b73ebdcdd48..c08a6bc7268 100644 --- a/ts/components/StoryDetailsModal.stories.tsx +++ b/ts/components/StoryDetailsModal.stories.tsx @@ -6,10 +6,10 @@ import React from 'react'; import casual from 'casual'; import { action } from '@storybook/addon-actions'; -import type { PropsType } from './StoryDetailsModal'; -import { SendStatus } from '../messages/MessageSendState'; -import { StoryDetailsModal } from './StoryDetailsModal'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation'; +import type { PropsType } from './StoryDetailsModal.js'; +import { SendStatus } from '../messages/MessageSendState.js'; +import { StoryDetailsModal } from './StoryDetailsModal.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/StoryDetailsModal.tsx b/ts/components/StoryDetailsModal.tsx index 5360458bbf9..1b1f85443f0 100644 --- a/ts/components/StoryDetailsModal.tsx +++ b/ts/components/StoryDetailsModal.tsx @@ -2,25 +2,25 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import type { LocalizerType } from '../types/Util'; -import type { PreferredBadgeSelectorType } from '../state/selectors/badges'; -import type { StorySendStateType, StoryViewType } from '../types/Stories'; -import { Avatar, AvatarSize } from './Avatar'; -import { ContactName } from './conversation/ContactName'; -import { ContextMenu } from './ContextMenu'; -import { I18n } from './I18n'; -import { Modal } from './Modal'; -import { SendStatus } from '../messages/MessageSendState'; -import { Theme } from '../util/theme'; -import { formatDateTimeLong } from '../util/timestamp'; -import { DurationInSeconds } from '../util/durations'; -import type { SaveAttachmentActionCreatorType } from '../state/ducks/conversations'; -import type { AttachmentType } from '../types/Attachment'; -import { ThemeType } from '../types/Util'; -import { Time } from './Time'; -import { groupBy } from '../util/mapUtil'; -import { format as formatRelativeTime } from '../util/expirationTimer'; -import { formatFileSize } from '../util/formatFileSize'; +import type { LocalizerType } from '../types/Util.js'; +import type { PreferredBadgeSelectorType } from '../state/selectors/badges.js'; +import type { StorySendStateType, StoryViewType } from '../types/Stories.js'; +import { Avatar, AvatarSize } from './Avatar.js'; +import { ContactName } from './conversation/ContactName.js'; +import { ContextMenu } from './ContextMenu.js'; +import { I18n } from './I18n.js'; +import { Modal } from './Modal.js'; +import { SendStatus } from '../messages/MessageSendState.js'; +import { Theme } from '../util/theme.js'; +import { formatDateTimeLong } from '../util/timestamp.js'; +import { DurationInSeconds } from '../util/durations/index.js'; +import type { SaveAttachmentActionCreatorType } from '../state/ducks/conversations.js'; +import type { AttachmentType } from '../types/Attachment.js'; +import { ThemeType } from '../types/Util.js'; +import { Time } from './Time.js'; +import { groupBy } from '../util/mapUtil.js'; +import { format as formatRelativeTime } from '../util/expirationTimer.js'; +import { formatFileSize } from '../util/formatFileSize.js'; export type PropsType = { getPreferredBadge: PreferredBadgeSelectorType; diff --git a/ts/components/StoryDistributionListName.tsx b/ts/components/StoryDistributionListName.tsx index 8301aaf6983..3a52c1d9444 100644 --- a/ts/components/StoryDistributionListName.tsx +++ b/ts/components/StoryDistributionListName.tsx @@ -3,10 +3,10 @@ import React from 'react'; -import type { LocalizerType } from '../types/Util'; -import { getStoryDistributionListName } from '../types/Stories'; -import type { StoryDistributionIdString } from '../types/StoryDistributionId'; -import { UserText } from './UserText'; +import type { LocalizerType } from '../types/Util.js'; +import { getStoryDistributionListName } from '../types/Stories.js'; +import type { StoryDistributionIdString } from '../types/StoryDistributionId.js'; +import { UserText } from './UserText.js'; type PropsType = { i18n: LocalizerType; diff --git a/ts/components/StoryImage.stories.tsx b/ts/components/StoryImage.stories.tsx index ae2103ca2f3..bbf8653d81e 100644 --- a/ts/components/StoryImage.stories.tsx +++ b/ts/components/StoryImage.stories.tsx @@ -7,10 +7,13 @@ import { action } from '@storybook/addon-actions'; import { noop } from 'lodash'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './StoryImage'; -import { StoryImage } from './StoryImage'; -import { fakeAttachment, fakeThumbnail } from '../test-helpers/fakeAttachment'; -import { VIDEO_MP4 } from '../types/MIME'; +import type { PropsType } from './StoryImage.js'; +import { StoryImage } from './StoryImage.js'; +import { + fakeAttachment, + fakeThumbnail, +} from '../test-helpers/fakeAttachment.js'; +import { VIDEO_MP4 } from '../types/MIME.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/StoryImage.tsx b/ts/components/StoryImage.tsx index 01dd3cdfbe8..e49506923a0 100644 --- a/ts/components/StoryImage.tsx +++ b/ts/components/StoryImage.tsx @@ -6,11 +6,11 @@ import React, { useEffect, useRef, useState } from 'react'; import classNames from 'classnames'; import { Blurhash } from 'react-blurhash'; -import type { AttachmentType } from '../types/Attachment'; -import type { LocalizerType } from '../types/Util'; -import { Spinner } from './Spinner'; -import { TextAttachment } from './TextAttachment'; -import { ThemeType } from '../types/Util'; +import type { AttachmentType } from '../types/Attachment.js'; +import type { LocalizerType } from '../types/Util.js'; +import { Spinner } from './Spinner.js'; +import { TextAttachment } from './TextAttachment.js'; +import { ThemeType } from '../types/Util.js'; import { defaultBlurHash, hasFailed, @@ -18,12 +18,12 @@ import { isDownloaded, isDownloading, isGIF, -} from '../types/Attachment'; -import { getClassNamesFor } from '../util/getClassNamesFor'; -import { isVideoTypeSupported } from '../util/GoogleChrome'; -import { createLogger } from '../logging/log'; -import * as Errors from '../types/errors'; -import { isAbortError } from '../util/isAbortError'; +} from '../types/Attachment.js'; +import { getClassNamesFor } from '../util/getClassNamesFor.js'; +import { isVideoTypeSupported } from '../util/GoogleChrome.js'; +import { createLogger } from '../logging/log.js'; +import * as Errors from '../types/errors.js'; +import { isAbortError } from '../util/isAbortError.js'; const log = createLogger('StoryImage'); diff --git a/ts/components/StoryLinkPreview.stories.tsx b/ts/components/StoryLinkPreview.stories.tsx index 54a014fcc03..eecc44fef17 100644 --- a/ts/components/StoryLinkPreview.stories.tsx +++ b/ts/components/StoryLinkPreview.stories.tsx @@ -4,10 +4,10 @@ import type { Meta, StoryFn } from '@storybook/react'; import React from 'react'; -import type { Props } from './StoryLinkPreview'; -import { StoryLinkPreview } from './StoryLinkPreview'; -import { fakeAttachment } from '../test-helpers/fakeAttachment'; -import { IMAGE_JPEG } from '../types/MIME'; +import type { Props } from './StoryLinkPreview.js'; +import { StoryLinkPreview } from './StoryLinkPreview.js'; +import { fakeAttachment } from '../test-helpers/fakeAttachment.js'; +import { IMAGE_JPEG } from '../types/MIME.js'; const LONG_TITLE = "This is a super-sweet site. And it's got some really amazing content in store for you if you just click that link. Can you click that link for me?"; diff --git a/ts/components/StoryLinkPreview.tsx b/ts/components/StoryLinkPreview.tsx index f31583fded5..044a963b9c0 100644 --- a/ts/components/StoryLinkPreview.tsx +++ b/ts/components/StoryLinkPreview.tsx @@ -5,11 +5,11 @@ import React from 'react'; import classNames from 'classnames'; import { unescape } from 'lodash'; -import type { LinkPreviewForUIType } from '../types/message/LinkPreviews'; -import type { LocalizerType } from '../types/Util'; -import { CurveType, Image } from './conversation/Image'; -import { isImageAttachment } from '../types/Attachment'; -import { getSafeDomain } from '../types/LinkPreview'; +import type { LinkPreviewForUIType } from '../types/message/LinkPreviews.js'; +import type { LocalizerType } from '../types/Util.js'; +import { CurveType, Image } from './conversation/Image.js'; +import { isImageAttachment } from '../types/Attachment.js'; +import { getSafeDomain } from '../types/LinkPreview.js'; export type Props = LinkPreviewForUIType & { forceCompactMode?: boolean; diff --git a/ts/components/StoryListItem.stories.tsx b/ts/components/StoryListItem.stories.tsx index ea4f26175cd..33b7462a214 100644 --- a/ts/components/StoryListItem.stories.tsx +++ b/ts/components/StoryListItem.stories.tsx @@ -5,10 +5,13 @@ import type { Meta, StoryFn } from '@storybook/react'; import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { PropsType } from './StoryListItem'; -import { StoryListItem } from './StoryListItem'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation'; -import { fakeAttachment, fakeThumbnail } from '../test-helpers/fakeAttachment'; +import type { PropsType } from './StoryListItem.js'; +import { StoryListItem } from './StoryListItem.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; +import { + fakeAttachment, + fakeThumbnail, +} from '../test-helpers/fakeAttachment.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/StoryListItem.tsx b/ts/components/StoryListItem.tsx index 8b01984a785..c4411477e19 100644 --- a/ts/components/StoryListItem.tsx +++ b/ts/components/StoryListItem.tsx @@ -3,20 +3,20 @@ import React, { useState } from 'react'; import classNames from 'classnames'; -import type { ConversationStoryType, StoryViewType } from '../types/Stories'; -import type { ConversationType } from '../state/ducks/conversations'; -import type { LocalizerType, ThemeType } from '../types/Util'; -import type { PreferredBadgeSelectorType } from '../state/selectors/badges'; -import type { ViewUserStoriesActionCreatorType } from '../state/ducks/stories'; -import { Avatar, AvatarSize } from './Avatar'; -import { ConfirmationDialog } from './ConfirmationDialog'; -import { ContextMenu } from './ContextMenu'; -import { SIGNAL_ACI } from '../types/SignalConversation'; -import { StoryViewTargetType, HasStories } from '../types/Stories'; +import type { ConversationStoryType, StoryViewType } from '../types/Stories.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import type { LocalizerType, ThemeType } from '../types/Util.js'; +import type { PreferredBadgeSelectorType } from '../state/selectors/badges.js'; +import type { ViewUserStoriesActionCreatorType } from '../state/ducks/stories.js'; +import { Avatar, AvatarSize } from './Avatar.js'; +import { ConfirmationDialog } from './ConfirmationDialog.js'; +import { ContextMenu } from './ContextMenu.js'; +import { SIGNAL_ACI } from '../types/SignalConversation.js'; +import { StoryViewTargetType, HasStories } from '../types/Stories.js'; -import { MessageTimestamp } from './conversation/MessageTimestamp'; -import { StoryImage } from './StoryImage'; -import { getAvatarColor } from '../types/Colors'; +import { MessageTimestamp } from './conversation/MessageTimestamp.js'; +import { StoryImage } from './StoryImage.js'; +import { getAvatarColor } from '../types/Colors.js'; export type PropsType = Pick & { conversationId: string; diff --git a/ts/components/StoryViewer.stories.tsx b/ts/components/StoryViewer.stories.tsx index 8997c18f1ad..3693afec22a 100644 --- a/ts/components/StoryViewer.stories.tsx +++ b/ts/components/StoryViewer.stories.tsx @@ -4,17 +4,17 @@ import type { Meta } from '@storybook/react'; import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { PropsType } from './StoryViewer'; -import { SendStatus } from '../messages/MessageSendState'; -import { StoryViewModeType } from '../types/Stories'; -import { generateStoryDistributionId } from '../types/StoryDistributionId'; -import { StoryViewer } from './StoryViewer'; -import { VIDEO_MP4 } from '../types/MIME'; -import { fakeAttachment } from '../test-helpers/fakeAttachment'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation'; -import { getFakeStoryView } from '../test-helpers/getFakeStory'; -import { DEFAULT_PREFERRED_REACTION_EMOJI } from '../reactions/constants'; -import { EmojiSkinTone } from './fun/data/emojis'; +import type { PropsType } from './StoryViewer.js'; +import { SendStatus } from '../messages/MessageSendState.js'; +import { StoryViewModeType } from '../types/Stories.js'; +import { generateStoryDistributionId } from '../types/StoryDistributionId.js'; +import { StoryViewer } from './StoryViewer.js'; +import { VIDEO_MP4 } from '../types/MIME.js'; +import { fakeAttachment } from '../test-helpers/fakeAttachment.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; +import { getFakeStoryView } from '../test-helpers/getFakeStory.js'; +import { DEFAULT_PREFERRED_REACTION_EMOJI } from '../reactions/constants.js'; +import { EmojiSkinTone } from './fun/data/emojis.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/StoryViewer.tsx b/ts/components/StoryViewer.tsx index fe1e4bab397..88e09bcb050 100644 --- a/ts/components/StoryViewer.tsx +++ b/ts/components/StoryViewer.tsx @@ -5,55 +5,55 @@ import { FocusScope } from 'react-aria'; import type { UIEvent } from 'react'; import React, { useCallback, useEffect, useMemo, useState } from 'react'; import classNames from 'classnames'; -import type { DraftBodyRanges } from '../types/BodyRange'; -import type { LocalizerType } from '../types/Util'; -import type { ContextMenuOptionType } from './ContextMenu'; +import type { DraftBodyRanges } from '../types/BodyRange.js'; +import type { LocalizerType } from '../types/Util.js'; +import type { ContextMenuOptionType } from './ContextMenu.js'; import type { ConversationType, SaveAttachmentActionCreatorType, -} from '../state/ducks/conversations'; -import type { EmojiPickDataType } from './emoji/EmojiPicker'; -import type { PreferredBadgeSelectorType } from '../state/selectors/badges'; -import type { RenderEmojiPickerProps } from './conversation/ReactionPicker'; -import type { ReplyStateType, StoryViewType } from '../types/Stories'; -import type { StoryDistributionIdString } from '../types/StoryDistributionId'; -import type { ShowToastAction } from '../state/ducks/toast'; -import type { ViewStoryActionCreatorType } from '../state/ducks/stories'; -import { createLogger } from '../logging/log'; -import { AnimatedEmojiGalore } from './AnimatedEmojiGalore'; -import { Avatar, AvatarSize } from './Avatar'; -import { ConfirmationDialog } from './ConfirmationDialog'; -import { ContextMenu } from './ContextMenu'; -import { I18n } from './I18n'; -import { MessageTimestamp } from './conversation/MessageTimestamp'; -import { SendStatus } from '../messages/MessageSendState'; -import { Spinner } from './Spinner'; -import { StoryDetailsModal } from './StoryDetailsModal'; -import { StoryDistributionListName } from './StoryDistributionListName'; -import { StoryImage } from './StoryImage'; +} from '../state/ducks/conversations.js'; +import type { EmojiPickDataType } from './emoji/EmojiPicker.js'; +import type { PreferredBadgeSelectorType } from '../state/selectors/badges.js'; +import type { RenderEmojiPickerProps } from './conversation/ReactionPicker.js'; +import type { ReplyStateType, StoryViewType } from '../types/Stories.js'; +import type { StoryDistributionIdString } from '../types/StoryDistributionId.js'; +import type { ShowToastAction } from '../state/ducks/toast.js'; +import type { ViewStoryActionCreatorType } from '../state/ducks/stories.js'; +import { createLogger } from '../logging/log.js'; +import { AnimatedEmojiGalore } from './AnimatedEmojiGalore.js'; +import { Avatar, AvatarSize } from './Avatar.js'; +import { ConfirmationDialog } from './ConfirmationDialog.js'; +import { ContextMenu } from './ContextMenu.js'; +import { I18n } from './I18n.js'; +import { MessageTimestamp } from './conversation/MessageTimestamp.js'; +import { SendStatus } from '../messages/MessageSendState.js'; +import { Spinner } from './Spinner.js'; +import { StoryDetailsModal } from './StoryDetailsModal.js'; +import { StoryDistributionListName } from './StoryDistributionListName.js'; +import { StoryImage } from './StoryImage.js'; import { ResolvedSendStatus, StoryViewDirectionType, StoryViewModeType, StoryViewTargetType, -} from '../types/Stories'; -import { StoryViewsNRepliesModal } from './StoryViewsNRepliesModal'; -import { Theme } from '../util/theme'; -import { ToastType } from '../types/Toast'; -import { getAvatarColor } from '../types/Colors'; -import { getStoryBackground } from '../util/getStoryBackground'; -import { getStoryDuration } from '../util/getStoryDuration'; -import { isVideoAttachment } from '../types/Attachment'; -import { graphemeAndLinkAwareSlice } from '../util/graphemeAndLinkAwareSlice'; -import { useEscapeHandling } from '../hooks/useEscapeHandling'; -import { useRetryStorySend } from '../hooks/useRetryStorySend'; -import { resolveStorySendStatus } from '../util/resolveStorySendStatus'; -import { strictAssert } from '../util/assert'; -import { MessageBody } from './conversation/MessageBody'; -import { RenderLocation } from './conversation/MessageTextRenderer'; -import { arrow } from '../util/keyboard'; -import { StoryProgressSegment } from './StoryProgressSegment'; -import type { EmojiSkinTone } from './fun/data/emojis'; +} from '../types/Stories.js'; +import { StoryViewsNRepliesModal } from './StoryViewsNRepliesModal.js'; +import { Theme } from '../util/theme.js'; +import { ToastType } from '../types/Toast.js'; +import { getAvatarColor } from '../types/Colors.js'; +import { getStoryBackground } from '../util/getStoryBackground.js'; +import { getStoryDuration } from '../util/getStoryDuration.js'; +import { isVideoAttachment } from '../types/Attachment.js'; +import { graphemeAndLinkAwareSlice } from '../util/graphemeAndLinkAwareSlice.js'; +import { useEscapeHandling } from '../hooks/useEscapeHandling.js'; +import { useRetryStorySend } from '../hooks/useRetryStorySend.js'; +import { resolveStorySendStatus } from '../util/resolveStorySendStatus.js'; +import { strictAssert } from '../util/assert.js'; +import { MessageBody } from './conversation/MessageBody.js'; +import { RenderLocation } from './conversation/MessageTextRenderer.js'; +import { arrow } from '../util/keyboard.js'; +import { StoryProgressSegment } from './StoryProgressSegment.js'; +import type { EmojiSkinTone } from './fun/data/emojis.js'; const log = createLogger('StoryViewer'); diff --git a/ts/components/StoryViewsNRepliesModal.stories.tsx b/ts/components/StoryViewsNRepliesModal.stories.tsx index 04d2212d840..60e3dae8d65 100644 --- a/ts/components/StoryViewsNRepliesModal.stories.tsx +++ b/ts/components/StoryViewsNRepliesModal.stories.tsx @@ -6,13 +6,13 @@ import React, { useState } from 'react'; import { v4 as generateUuid } from 'uuid'; import { action } from '@storybook/addon-actions'; -import type { PropsType } from './StoryViewsNRepliesModal'; -import * as durations from '../util/durations'; -import { SendStatus } from '../messages/MessageSendState'; -import { StoryViewsNRepliesModal } from './StoryViewsNRepliesModal'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation'; -import { StoryViewTargetType } from '../types/Stories'; -import { DEFAULT_PREFERRED_REACTION_EMOJI } from '../reactions/constants'; +import type { PropsType } from './StoryViewsNRepliesModal.js'; +import * as durations from '../util/durations/index.js'; +import { SendStatus } from '../messages/MessageSendState.js'; +import { StoryViewsNRepliesModal } from './StoryViewsNRepliesModal.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; +import { StoryViewTargetType } from '../types/Stories.js'; +import { DEFAULT_PREFERRED_REACTION_EMOJI } from '../reactions/constants.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/StoryViewsNRepliesModal.tsx b/ts/components/StoryViewsNRepliesModal.tsx index 87e707eefca..4e517b8eeef 100644 --- a/ts/components/StoryViewsNRepliesModal.tsx +++ b/ts/components/StoryViewsNRepliesModal.tsx @@ -10,38 +10,38 @@ import React, { } from 'react'; import classNames from 'classnames'; import { noop, orderBy } from 'lodash'; -import type { DraftBodyRanges } from '../types/BodyRange'; -import type { LocalizerType } from '../types/Util'; -import type { ConversationType } from '../state/ducks/conversations'; -import type { EmojiPickDataType } from './emoji/EmojiPicker'; -import type { InputApi } from './CompositionInput'; -import type { PreferredBadgeSelectorType } from '../state/selectors/badges'; -import type { RenderEmojiPickerProps } from './conversation/ReactionPicker'; -import type { ReplyType, StorySendStateType } from '../types/Stories'; -import { StoryViewTargetType } from '../types/Stories'; -import { Avatar, AvatarSize } from './Avatar'; -import { CompositionInput } from './CompositionInput'; -import { ContactName } from './conversation/ContactName'; -import { EmojiButton } from './emoji/EmojiButton'; -import { Emojify } from './conversation/Emojify'; -import { Message, TextDirection } from './conversation/Message'; -import { MessageTimestamp } from './conversation/MessageTimestamp'; -import { Modal } from './Modal'; -import { ReactionPicker } from './conversation/ReactionPicker'; -import { Tabs } from './Tabs'; -import { Theme } from '../util/theme'; -import { ThemeType } from '../types/Util'; -import { WidthBreakpoint } from './_util'; -import { getAvatarColor } from '../types/Colors'; -import { shouldNeverBeCalled } from '../util/shouldNeverBeCalled'; -import { ContextMenu } from './ContextMenu'; -import { ConfirmationDialog } from './ConfirmationDialog'; -import type { EmojiSkinTone } from './fun/data/emojis'; -import { isFunPickerEnabled } from './fun/isFunPickerEnabled'; -import { FunEmojiPicker } from './fun/FunEmojiPicker'; -import { FunEmojiPickerButton } from './fun/FunButton'; -import type { FunEmojiSelection } from './fun/panels/FunPanelEmojis'; -import { useConfirmDiscard } from '../hooks/useConfirmDiscard'; +import type { DraftBodyRanges } from '../types/BodyRange.js'; +import type { LocalizerType } from '../types/Util.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import type { EmojiPickDataType } from './emoji/EmojiPicker.js'; +import type { InputApi } from './CompositionInput.js'; +import type { PreferredBadgeSelectorType } from '../state/selectors/badges.js'; +import type { RenderEmojiPickerProps } from './conversation/ReactionPicker.js'; +import type { ReplyType, StorySendStateType } from '../types/Stories.js'; +import { StoryViewTargetType } from '../types/Stories.js'; +import { Avatar, AvatarSize } from './Avatar.js'; +import { CompositionInput } from './CompositionInput.js'; +import { ContactName } from './conversation/ContactName.js'; +import { EmojiButton } from './emoji/EmojiButton.js'; +import { Emojify } from './conversation/Emojify.js'; +import { Message, TextDirection } from './conversation/Message.js'; +import { MessageTimestamp } from './conversation/MessageTimestamp.js'; +import { Modal } from './Modal.js'; +import { ReactionPicker } from './conversation/ReactionPicker.js'; +import { Tabs } from './Tabs.js'; +import { Theme } from '../util/theme.js'; +import { ThemeType } from '../types/Util.js'; +import { WidthBreakpoint } from './_util.js'; +import { getAvatarColor } from '../types/Colors.js'; +import { shouldNeverBeCalled } from '../util/shouldNeverBeCalled.js'; +import { ContextMenu } from './ContextMenu.js'; +import { ConfirmationDialog } from './ConfirmationDialog.js'; +import type { EmojiSkinTone } from './fun/data/emojis.js'; +import { isFunPickerEnabled } from './fun/isFunPickerEnabled.js'; +import { FunEmojiPicker } from './fun/FunEmojiPicker.js'; +import { FunEmojiPickerButton } from './fun/FunButton.js'; +import type { FunEmojiSelection } from './fun/panels/FunPanelEmojis.js'; +import { useConfirmDiscard } from '../hooks/useConfirmDiscard.js'; // Menu is disabled so these actions are inaccessible. We also don't support // link previews, tap to view messages, attachments, or gifts. Just regular diff --git a/ts/components/Tabs.tsx b/ts/components/Tabs.tsx index 2226a6258fd..6631b8ec2dc 100644 --- a/ts/components/Tabs.tsx +++ b/ts/components/Tabs.tsx @@ -4,8 +4,8 @@ import type { ReactNode } from 'react'; import React from 'react'; -import type { TabsOptionsType } from '../hooks/useTabs'; -import { useTabs } from '../hooks/useTabs'; +import type { TabsOptionsType } from '../hooks/useTabs.js'; +import { useTabs } from '../hooks/useTabs.js'; type PropsType = { children: (renderProps: { selectedTab: string }) => ReactNode; diff --git a/ts/components/TapToViewNotAvailableModal.stories.tsx b/ts/components/TapToViewNotAvailableModal.stories.tsx index 95acf5019b5..50719d0e7ea 100644 --- a/ts/components/TapToViewNotAvailableModal.stories.tsx +++ b/ts/components/TapToViewNotAvailableModal.stories.tsx @@ -3,12 +3,12 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { PropsType } from './TapToViewNotAvailableModal'; +import type { PropsType } from './TapToViewNotAvailableModal.js'; import { TapToViewNotAvailableModal, TapToViewNotAvailableType, -} from './TapToViewNotAvailableModal'; -import type { ComponentMeta } from '../storybook/types'; +} from './TapToViewNotAvailableModal.js'; +import type { ComponentMeta } from '../storybook/types.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/TapToViewNotAvailableModal.tsx b/ts/components/TapToViewNotAvailableModal.tsx index 3463c658838..baa8a6606ae 100644 --- a/ts/components/TapToViewNotAvailableModal.tsx +++ b/ts/components/TapToViewNotAvailableModal.tsx @@ -3,9 +3,9 @@ import * as React from 'react'; -import type { LocalizerType } from '../types/Util'; -import { Modal } from './Modal'; -import { Button, ButtonVariant } from './Button'; +import type { LocalizerType } from '../types/Util.js'; +import { Modal } from './Modal.js'; +import { Button, ButtonVariant } from './Button.js'; export type DataPropsType = { parameters: { diff --git a/ts/components/TextAttachment.stories.tsx b/ts/components/TextAttachment.stories.tsx index 6c1aa827bf8..603521c6823 100644 --- a/ts/components/TextAttachment.stories.tsx +++ b/ts/components/TextAttachment.stories.tsx @@ -4,8 +4,8 @@ import React from 'react'; import type { Meta } from '@storybook/react'; -import { TextAttachment } from './TextAttachment'; -import type { PropsType } from './TextAttachment'; +import { TextAttachment } from './TextAttachment.js'; +import type { PropsType } from './TextAttachment.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/TextAttachment.tsx b/ts/components/TextAttachment.tsx index c314f5110c5..0975b56f461 100644 --- a/ts/components/TextAttachment.tsx +++ b/ts/components/TextAttachment.tsx @@ -4,23 +4,23 @@ import React, { forwardRef, useEffect, useRef, useState } from 'react'; import classNames from 'classnames'; -import type { LocalizerType, RenderTextCallbackType } from '../types/Util'; -import type { TextAttachmentType } from '../types/Attachment'; -import { AddNewLines } from './conversation/AddNewLines'; -import { Emojify } from './conversation/Emojify'; -import { StoryLinkPreview } from './StoryLinkPreview'; -import { TextAttachmentStyleType } from '../types/Attachment'; -import { count } from '../util/grapheme'; -import { isValidLink, getSafeDomain } from '../types/LinkPreview'; -import { getFontNameByTextScript } from '../util/getFontNameByTextScript'; +import type { LocalizerType, RenderTextCallbackType } from '../types/Util.js'; +import type { TextAttachmentType } from '../types/Attachment.js'; +import { AddNewLines } from './conversation/AddNewLines.js'; +import { Emojify } from './conversation/Emojify.js'; +import { StoryLinkPreview } from './StoryLinkPreview.js'; +import { TextAttachmentStyleType } from '../types/Attachment.js'; +import { count } from '../util/grapheme.js'; +import { isValidLink, getSafeDomain } from '../types/LinkPreview.js'; +import { getFontNameByTextScript } from '../util/getFontNameByTextScript.js'; import { COLOR_WHITE_INT, getHexFromNumber, getBackgroundColor, -} from '../util/getStoryBackground'; -import { SECOND } from '../util/durations'; -import { useRefMerger } from '../hooks/useRefMerger'; -import { useSizeObserver } from '../hooks/useSizeObserver'; +} from '../util/getStoryBackground.js'; +import { SECOND } from '../util/durations/index.js'; +import { useRefMerger } from '../hooks/useRefMerger.js'; +import { useSizeObserver } from '../hooks/useSizeObserver.js'; const renderNewLines: RenderTextCallbackType = ({ text: textWithNewLines, diff --git a/ts/components/TextStoryCreator.tsx b/ts/components/TextStoryCreator.tsx index f0ad94a918a..dad13ca6837 100644 --- a/ts/components/TextStoryCreator.tsx +++ b/ts/components/TextStoryCreator.tsx @@ -5,37 +5,37 @@ import classNames from 'classnames'; import { noop } from 'lodash'; import { usePopper } from 'react-popper'; import { FocusScope } from 'react-aria'; -import type { EmojiPickDataType } from './emoji/EmojiPicker'; -import type { LinkPreviewForUIType } from '../types/message/LinkPreviews'; -import { ThemeType, type LocalizerType } from '../types/Util'; -import type { Props as EmojiButtonPropsType } from './emoji/EmojiButton'; -import type { TextAttachmentType } from '../types/Attachment'; -import { Button, ButtonVariant } from './Button'; -import { ContextMenu } from './ContextMenu'; -import { EmojiButton } from './emoji/EmojiButton'; -import { LinkPreviewSourceType, findLinks } from '../types/LinkPreview'; -import type { MaybeGrabLinkPreviewOptionsType } from '../types/LinkPreview'; -import { Input } from './Input'; -import { Slider } from './Slider'; -import { StoryLinkPreview } from './StoryLinkPreview'; -import { TextAttachment } from './TextAttachment'; -import { Theme, themeClassName } from '../util/theme'; -import { getRGBA, getRGBANumber } from '../mediaEditor/util/color'; +import type { EmojiPickDataType } from './emoji/EmojiPicker.js'; +import type { LinkPreviewForUIType } from '../types/message/LinkPreviews.js'; +import { ThemeType, type LocalizerType } from '../types/Util.js'; +import type { Props as EmojiButtonPropsType } from './emoji/EmojiButton.js'; +import type { TextAttachmentType } from '../types/Attachment.js'; +import { Button, ButtonVariant } from './Button.js'; +import { ContextMenu } from './ContextMenu.js'; +import { EmojiButton } from './emoji/EmojiButton.js'; +import { LinkPreviewSourceType, findLinks } from '../types/LinkPreview.js'; +import type { MaybeGrabLinkPreviewOptionsType } from '../types/LinkPreview.js'; +import { Input } from './Input.js'; +import { Slider } from './Slider.js'; +import { StoryLinkPreview } from './StoryLinkPreview.js'; +import { TextAttachment } from './TextAttachment.js'; +import { Theme, themeClassName } from '../util/theme.js'; +import { getRGBA, getRGBANumber } from '../mediaEditor/util/color.js'; import { COLOR_BLACK_INT, COLOR_WHITE_INT, getBackgroundColor, -} from '../util/getStoryBackground'; -import { convertShortName } from './emoji/lib'; -import { objectMap } from '../util/objectMap'; -import { handleOutsideClick } from '../util/handleOutsideClick'; -import { Spinner } from './Spinner'; -import { FunEmojiPicker } from './fun/FunEmojiPicker'; -import type { FunEmojiSelection } from './fun/panels/FunPanelEmojis'; -import { getEmojiVariantByKey } from './fun/data/emojis'; -import { FunEmojiPickerButton } from './fun/FunButton'; -import { isFunPickerEnabled } from './fun/isFunPickerEnabled'; -import { useConfirmDiscard } from '../hooks/useConfirmDiscard'; +} from '../util/getStoryBackground.js'; +import { convertShortName } from './emoji/lib.js'; +import { objectMap } from '../util/objectMap.js'; +import { handleOutsideClick } from '../util/handleOutsideClick.js'; +import { Spinner } from './Spinner.js'; +import { FunEmojiPicker } from './fun/FunEmojiPicker.js'; +import type { FunEmojiSelection } from './fun/panels/FunPanelEmojis.js'; +import { getEmojiVariantByKey } from './fun/data/emojis.js'; +import { FunEmojiPickerButton } from './fun/FunButton.js'; +import { isFunPickerEnabled } from './fun/isFunPickerEnabled.js'; +import { useConfirmDiscard } from '../hooks/useConfirmDiscard.js'; export type PropsType = { debouncedMaybeGrabLinkPreview: ( diff --git a/ts/components/Time.tsx b/ts/components/Time.tsx index 7cc157f99f2..bad41c797a5 100644 --- a/ts/components/Time.tsx +++ b/ts/components/Time.tsx @@ -6,7 +6,7 @@ import type { ReactElement, TimeHTMLAttributes } from 'react'; import moment from 'moment'; import React from 'react'; -import { toBoundedDate } from '../util/timestamp'; +import { toBoundedDate } from '../util/timestamp.js'; export function Time({ children, diff --git a/ts/components/Toast.stories.tsx b/ts/components/Toast.stories.tsx index 5700dfb30a2..b82c235735f 100644 --- a/ts/components/Toast.stories.tsx +++ b/ts/components/Toast.stories.tsx @@ -3,9 +3,9 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { PropsType } from './Toast'; -import { Toast } from './Toast'; -import { type ComponentMeta, argPresets } from '../storybook/types'; +import type { PropsType } from './Toast.js'; +import { Toast } from './Toast.js'; +import { type ComponentMeta, argPresets } from '../storybook/types.js'; export default { title: 'Components/Toast', diff --git a/ts/components/Toast.tsx b/ts/components/Toast.tsx index b7116ea30a4..b5da8d06b61 100644 --- a/ts/components/Toast.tsx +++ b/ts/components/Toast.tsx @@ -4,8 +4,8 @@ import type { KeyboardEvent, MouseEvent, ReactNode } from 'react'; import React, { memo, useEffect } from 'react'; import classNames from 'classnames'; -import { useRestoreFocus } from '../hooks/useRestoreFocus'; -import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary'; +import { useRestoreFocus } from '../hooks/useRestoreFocus.js'; +import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary.js'; export type PropsType = { autoDismissDisabled?: boolean; diff --git a/ts/components/ToastManager.stories.tsx b/ts/components/ToastManager.stories.tsx index ee7cdd3f52f..5041ec651ab 100644 --- a/ts/components/ToastManager.stories.tsx +++ b/ts/components/ToastManager.stories.tsx @@ -5,13 +5,13 @@ import type { Meta, StoryFn } from '@storybook/react'; import React from 'react'; import { action } from '@storybook/addon-actions'; -import { ToastManager } from './ToastManager'; -import type { AnyToast } from '../types/Toast'; -import { ToastType } from '../types/Toast'; -import type { AnyActionableMegaphone } from '../types/Megaphone'; -import { MegaphoneType } from '../types/Megaphone'; -import { missingCaseError } from '../util/missingCaseError'; -import type { PropsType } from './ToastManager'; +import { ToastManager } from './ToastManager.js'; +import type { AnyToast } from '../types/Toast.js'; +import { ToastType } from '../types/Toast.js'; +import type { AnyActionableMegaphone } from '../types/Megaphone.js'; +import { MegaphoneType } from '../types/Megaphone.js'; +import { missingCaseError } from '../util/missingCaseError.js'; +import type { PropsType } from './ToastManager.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/ToastManager.tsx b/ts/components/ToastManager.tsx index 8f4fdc7a562..95bda157a74 100644 --- a/ts/components/ToastManager.tsx +++ b/ts/components/ToastManager.tsx @@ -5,20 +5,20 @@ import classNames from 'classnames'; import React from 'react'; import { createPortal } from 'react-dom'; -import { SECOND } from '../util/durations'; -import { Toast } from './Toast'; -import { WidthBreakpoint } from './_util'; -import { UsernameMegaphone } from './UsernameMegaphone'; -import { assertDev } from '../util/assert'; -import { missingCaseError } from '../util/missingCaseError'; -import { ToastType } from '../types/Toast'; -import { MegaphoneType } from '../types/Megaphone'; -import { NavTab, SettingsPage } from '../types/Nav'; +import { SECOND } from '../util/durations/index.js'; +import { Toast } from './Toast.js'; +import { WidthBreakpoint } from './_util.js'; +import { UsernameMegaphone } from './UsernameMegaphone.js'; +import { assertDev } from '../util/assert.js'; +import { missingCaseError } from '../util/missingCaseError.js'; +import { ToastType } from '../types/Toast.js'; +import { MegaphoneType } from '../types/Megaphone.js'; +import { NavTab, SettingsPage } from '../types/Nav.js'; -import type { LocalizerType } from '../types/Util'; -import type { AnyToast } from '../types/Toast'; -import type { AnyActionableMegaphone } from '../types/Megaphone'; -import type { Location } from '../types/Nav'; +import type { LocalizerType } from '../types/Util.js'; +import type { AnyToast } from '../types/Toast.js'; +import type { AnyActionableMegaphone } from '../types/Megaphone.js'; +import type { Location } from '../types/Nav.js'; export type PropsType = { changeLocation: (newLocation: Location) => unknown; diff --git a/ts/components/Tooltip.stories.tsx b/ts/components/Tooltip.stories.tsx index 6a941564982..9899b40e80c 100644 --- a/ts/components/Tooltip.stories.tsx +++ b/ts/components/Tooltip.stories.tsx @@ -3,9 +3,9 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './Tooltip'; -import { Tooltip, TooltipPlacement } from './Tooltip'; -import { Theme } from '../util/theme'; +import type { PropsType } from './Tooltip.js'; +import { Tooltip, TooltipPlacement } from './Tooltip.js'; +import { Theme } from '../util/theme.js'; export default { title: 'Components/Tooltip', diff --git a/ts/components/Tooltip.tsx b/ts/components/Tooltip.tsx index aacedb82e71..20881381cc2 100644 --- a/ts/components/Tooltip.tsx +++ b/ts/components/Tooltip.tsx @@ -7,11 +7,11 @@ import { noop } from 'lodash'; import { Manager, Reference, Popper } from 'react-popper'; import type { StrictModifiers } from '@popperjs/core'; import { createPortal } from 'react-dom'; -import type { Theme } from '../util/theme'; -import { themeClassName } from '../util/theme'; -import { refMerger } from '../util/refMerger'; -import { offsetDistanceModifier } from '../util/popperUtil'; -import { getInteractionMode } from '../services/InteractionMode'; +import type { Theme } from '../util/theme.js'; +import { themeClassName } from '../util/theme.js'; +import { refMerger } from '../util/refMerger.js'; +import { offsetDistanceModifier } from '../util/popperUtil.js'; +import { getInteractionMode } from '../services/InteractionMode.js'; type EventWrapperPropsType = { className?: string; diff --git a/ts/components/UnsupportedOSDialog.stories.tsx b/ts/components/UnsupportedOSDialog.stories.tsx index a136c65b377..6e513dc8357 100644 --- a/ts/components/UnsupportedOSDialog.stories.tsx +++ b/ts/components/UnsupportedOSDialog.stories.tsx @@ -3,11 +3,11 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import { UnsupportedOSDialog } from './UnsupportedOSDialog'; -import type { PropsType } from './UnsupportedOSDialog'; -import { DAY } from '../util/durations'; -import { WidthBreakpoint } from './_util'; -import { FakeLeftPaneContainer } from '../test-helpers/FakeLeftPaneContainer'; +import { UnsupportedOSDialog } from './UnsupportedOSDialog.js'; +import type { PropsType } from './UnsupportedOSDialog.js'; +import { DAY } from '../util/durations/index.js'; +import { WidthBreakpoint } from './_util.js'; +import { FakeLeftPaneContainer } from '../test-helpers/FakeLeftPaneContainer.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/UnsupportedOSDialog.tsx b/ts/components/UnsupportedOSDialog.tsx index 592e3cb8764..77e9ede513b 100644 --- a/ts/components/UnsupportedOSDialog.tsx +++ b/ts/components/UnsupportedOSDialog.tsx @@ -4,13 +4,13 @@ import React from 'react'; import moment from 'moment'; -import type { LocalizerType } from '../types/Util'; -import { UNSUPPORTED_OS_URL } from '../types/support'; -import { missingCaseError } from '../util/missingCaseError'; -import type { WidthBreakpoint } from './_util'; -import { I18n } from './I18n'; +import type { LocalizerType } from '../types/Util.js'; +import { UNSUPPORTED_OS_URL } from '../types/support.js'; +import { missingCaseError } from '../util/missingCaseError.js'; +import type { WidthBreakpoint } from './_util.js'; +import { I18n } from './I18n.js'; -import { LeftPaneDialog } from './LeftPaneDialog'; +import { LeftPaneDialog } from './LeftPaneDialog.js'; export type PropsType = { containerWidthBreakpoint: WidthBreakpoint; diff --git a/ts/components/UserText.tsx b/ts/components/UserText.tsx index 00b7e5ffb8b..9ce344f5684 100644 --- a/ts/components/UserText.tsx +++ b/ts/components/UserText.tsx @@ -1,8 +1,8 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import React, { useMemo } from 'react'; -import { Emojify } from './conversation/Emojify'; -import { bidiIsolate } from '../util/unicodeBidi'; +import { Emojify } from './conversation/Emojify.js'; +import { bidiIsolate } from '../util/unicodeBidi.js'; export type UserTextProps = Readonly<{ text: string; diff --git a/ts/components/UsernameEditor.stories.tsx b/ts/components/UsernameEditor.stories.tsx index 852fcc3adb3..16a4808cf14 100644 --- a/ts/components/UsernameEditor.stories.tsx +++ b/ts/components/UsernameEditor.stories.tsx @@ -5,14 +5,14 @@ import React from 'react'; import type { Meta, StoryFn } from '@storybook/react'; import { action } from '@storybook/addon-actions'; -import type { UsernameReservationType } from '../types/Username'; +import type { UsernameReservationType } from '../types/Username.js'; -import type { PropsType } from './UsernameEditor'; -import { UsernameEditor } from './UsernameEditor'; +import type { PropsType } from './UsernameEditor.js'; +import { UsernameEditor } from './UsernameEditor.js'; import { UsernameReservationState as State, UsernameReservationError, -} from '../state/ducks/usernameEnums'; +} from '../state/ducks/usernameEnums.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/UsernameEditor.tsx b/ts/components/UsernameEditor.tsx index cfdb5c0ed52..47b20957c94 100644 --- a/ts/components/UsernameEditor.tsx +++ b/ts/components/UsernameEditor.tsx @@ -11,25 +11,29 @@ import React, { import classNames from 'classnames'; import { noop } from 'lodash'; -import type { LocalizerType } from '../types/Util'; -import type { UsernameReservationType } from '../types/Username'; -import { ToastType } from '../types/Toast'; -import { missingCaseError } from '../util/missingCaseError'; -import { getNickname, getDiscriminator, isCaseChange } from '../types/Username'; +import type { LocalizerType } from '../types/Util.js'; +import type { UsernameReservationType } from '../types/Username.js'; +import { ToastType } from '../types/Toast.js'; +import { missingCaseError } from '../util/missingCaseError.js'; +import { + getNickname, + getDiscriminator, + isCaseChange, +} from '../types/Username.js'; import { UsernameReservationState, UsernameReservationError, -} from '../state/ducks/usernameEnums'; -import type { ReserveUsernameOptionsType } from '../state/ducks/username'; -import type { ShowToastAction } from '../state/ducks/toast'; +} from '../state/ducks/usernameEnums.js'; +import type { ReserveUsernameOptionsType } from '../state/ducks/username.js'; +import type { ShowToastAction } from '../state/ducks/toast.js'; -import { AutoSizeInput } from './AutoSizeInput'; -import { ConfirmationDialog } from './ConfirmationDialog'; -import { Input } from './Input'; -import { Spinner } from './Spinner'; -import { Modal } from './Modal'; -import { Button, ButtonVariant } from './Button'; -import { useConfirmDiscard } from '../hooks/useConfirmDiscard'; +import { AutoSizeInput } from './AutoSizeInput.js'; +import { ConfirmationDialog } from './ConfirmationDialog.js'; +import { Input } from './Input.js'; +import { Spinner } from './Spinner.js'; +import { Modal } from './Modal.js'; +import { Button, ButtonVariant } from './Button.js'; +import { useConfirmDiscard } from '../hooks/useConfirmDiscard.js'; export type PropsDataType = Readonly<{ i18n: LocalizerType; diff --git a/ts/components/UsernameLinkEditor.stories.tsx b/ts/components/UsernameLinkEditor.stories.tsx index 86ba36fa706..5b7e9fdc17b 100644 --- a/ts/components/UsernameLinkEditor.stories.tsx +++ b/ts/components/UsernameLinkEditor.stories.tsx @@ -5,16 +5,16 @@ import React, { useCallback, useState } from 'react'; import type { Meta, StoryFn } from '@storybook/react'; import { action } from '@storybook/addon-actions'; -import { UsernameLinkState } from '../state/ducks/usernameEnums'; -import { SignalService as Proto } from '../protobuf'; +import { UsernameLinkState } from '../state/ducks/usernameEnums.js'; +import { SignalService as Proto } from '../protobuf/index.js'; -import type { PropsType } from './UsernameLinkEditor'; +import type { PropsType } from './UsernameLinkEditor.js'; import { UsernameLinkEditor, PRINT_WIDTH, PRINT_HEIGHT, -} from './UsernameLinkEditor'; -import { Modal } from './Modal'; +} from './UsernameLinkEditor.js'; +import { Modal } from './Modal.js'; const ColorEnum = Proto.AccountRecord.UsernameLink.Color; diff --git a/ts/components/UsernameLinkEditor.tsx b/ts/components/UsernameLinkEditor.tsx index fc223ff61c3..0f5c75f10ce 100644 --- a/ts/components/UsernameLinkEditor.tsx +++ b/ts/components/UsernameLinkEditor.tsx @@ -7,22 +7,22 @@ import classnames from 'classnames'; import { changeDpiBlob } from 'changedpi'; import { noop } from 'lodash'; -import { SignalService as Proto } from '../protobuf'; -import type { SaveAttachmentActionCreatorType } from '../state/ducks/conversations'; -import { UsernameLinkState } from '../state/ducks/usernameEnums'; -import { ToastType } from '../types/Toast'; -import type { ShowToastAction } from '../state/ducks/toast'; -import type { LocalizerType } from '../types/Util'; -import { IMAGE_PNG } from '../types/MIME'; -import { strictAssert } from '../util/assert'; -import { drop } from '../util/drop'; -import { splitText } from '../util/splitText'; -import { loadImage } from '../util/loadImage'; -import { Button, ButtonVariant } from './Button'; -import { ConfirmationDialog } from './ConfirmationDialog'; -import { Spinner } from './Spinner'; -import { BrandedQRCode } from './BrandedQRCode'; -import { useConfirmDiscard } from '../hooks/useConfirmDiscard'; +import { SignalService as Proto } from '../protobuf/index.js'; +import type { SaveAttachmentActionCreatorType } from '../state/ducks/conversations.js'; +import { UsernameLinkState } from '../state/ducks/usernameEnums.js'; +import { ToastType } from '../types/Toast.js'; +import type { ShowToastAction } from '../state/ducks/toast.js'; +import type { LocalizerType } from '../types/Util.js'; +import { IMAGE_PNG } from '../types/MIME.js'; +import { strictAssert } from '../util/assert.js'; +import { drop } from '../util/drop.js'; +import { splitText } from '../util/splitText.js'; +import { loadImage } from '../util/loadImage.js'; +import { Button, ButtonVariant } from './Button.js'; +import { ConfirmationDialog } from './ConfirmationDialog.js'; +import { Spinner } from './Spinner.js'; +import { BrandedQRCode } from './BrandedQRCode.js'; +import { useConfirmDiscard } from '../hooks/useConfirmDiscard.js'; export type PropsType = Readonly<{ i18n: LocalizerType; diff --git a/ts/components/UsernameMegaphone.stories.tsx b/ts/components/UsernameMegaphone.stories.tsx index 251c31ed6a0..3832490003c 100644 --- a/ts/components/UsernameMegaphone.stories.tsx +++ b/ts/components/UsernameMegaphone.stories.tsx @@ -3,9 +3,9 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { PropsType } from './UsernameMegaphone'; -import { UsernameMegaphone } from './UsernameMegaphone'; -import { type ComponentMeta } from '../storybook/types'; +import type { PropsType } from './UsernameMegaphone.js'; +import { UsernameMegaphone } from './UsernameMegaphone.js'; +import { type ComponentMeta } from '../storybook/types.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/UsernameMegaphone.tsx b/ts/components/UsernameMegaphone.tsx index b7f14738f10..40e4b5988b7 100644 --- a/ts/components/UsernameMegaphone.tsx +++ b/ts/components/UsernameMegaphone.tsx @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import type { LocalizerType } from '../types/Util'; -import type { UsernameOnboardingActionableMegaphoneType } from '../types/Megaphone'; -import { Button, ButtonSize, ButtonVariant } from './Button'; +import type { LocalizerType } from '../types/Util.js'; +import type { UsernameOnboardingActionableMegaphoneType } from '../types/Megaphone.js'; +import { Button, ButtonSize, ButtonVariant } from './Button.js'; export type PropsType = { i18n: LocalizerType; diff --git a/ts/components/UsernameOnboardingModal.stories.tsx b/ts/components/UsernameOnboardingModal.stories.tsx index 1d967923eb3..b3fa92cbc32 100644 --- a/ts/components/UsernameOnboardingModal.stories.tsx +++ b/ts/components/UsernameOnboardingModal.stories.tsx @@ -5,8 +5,8 @@ import React from 'react'; import type { Meta, StoryFn } from '@storybook/react'; import { action } from '@storybook/addon-actions'; -import type { PropsType } from './UsernameOnboardingModal'; -import { UsernameOnboardingModal } from './UsernameOnboardingModal'; +import type { PropsType } from './UsernameOnboardingModal.js'; +import { UsernameOnboardingModal } from './UsernameOnboardingModal.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/UsernameOnboardingModal.tsx b/ts/components/UsernameOnboardingModal.tsx index ece1db1aadb..2f88b9b2025 100644 --- a/ts/components/UsernameOnboardingModal.tsx +++ b/ts/components/UsernameOnboardingModal.tsx @@ -3,9 +3,9 @@ import React from 'react'; -import type { LocalizerType } from '../types/Util'; -import { Button, ButtonVariant } from './Button'; -import { Modal } from './Modal'; +import type { LocalizerType } from '../types/Util.js'; +import { Button, ButtonVariant } from './Button.js'; +import { Modal } from './Modal.js'; export type PropsType = Readonly<{ i18n: LocalizerType; diff --git a/ts/components/VoiceNotesPlaybackContext.tsx b/ts/components/VoiceNotesPlaybackContext.tsx index 62d40367fca..23c596f95e4 100644 --- a/ts/components/VoiceNotesPlaybackContext.tsx +++ b/ts/components/VoiceNotesPlaybackContext.tsx @@ -5,9 +5,8 @@ import * as React from 'react'; import PQueue from 'p-queue'; import { LRUCache } from 'lru-cache'; -import type { WaveformCache } from '../types/Audio'; -import { createLogger } from '../logging/log'; -import { redactAttachmentUrl } from '../util/privacy'; +import type { WaveformCache } from '../types/Audio.js'; +import { createLogger } from '../logging/log.js'; const log = createLogger('VoiceNotesPlaybackContext'); @@ -40,13 +39,9 @@ const computeQueue = new PQueue({ concurrency: MAX_PARALLEL_COMPUTE, }); -async function getAudioDuration( - url: string, - buffer: ArrayBuffer -): Promise { +async function getAudioDuration(buffer: ArrayBuffer): Promise { const blob = new Blob([buffer]); const blobURL = URL.createObjectURL(blob); - const urlForLogging = redactAttachmentUrl(url); const audio = new Audio(); audio.muted = true; audio.src = blobURL; @@ -58,14 +53,14 @@ async function getAudioDuration( audio.addEventListener('error', event => { const error = new Error( - `Failed to load audio from: ${urlForLogging} due to error: ${event.type}` + `Failed to load audio from due to error: ${event.type}` ); reject(error); }); }); if (Number.isNaN(audio.duration)) { - throw new Error(`Invalid audio duration for: ${urlForLogging}`); + throw new Error('Invalid audio duration'); } return audio.duration; } @@ -86,9 +81,8 @@ async function doComputePeaks( ): Promise { const cacheKey = `${url}:${barCount}`; const existing = waveformCache.get(cacheKey); - const urlForLogging = redactAttachmentUrl(url); - const logId = `GlobalAudioContext(${urlForLogging})`; + const logId = 'GlobalAudioContext'; if (existing) { log.info(`${logId}: waveform cache hit`); return Promise.resolve(existing); @@ -100,7 +94,7 @@ async function doComputePeaks( const response = await fetch(url); const raw = await response.arrayBuffer(); - const duration = await getAudioDuration(url, raw); + const duration = await getAudioDuration(raw); const peaks = new Array(barCount).fill(0); if (duration > MAX_AUDIO_DURATION) { @@ -157,7 +151,7 @@ export async function computePeaks( barCount: number ): Promise { const computeKey = `${url}:${barCount}`; - const logId = `VoiceNotesPlaybackContext(${redactAttachmentUrl(url)})`; + const logId = 'VoiceNotesPlaybackContext'; const pending = inProgressMap.get(computeKey); if (pending) { diff --git a/ts/components/WarningIdlePrimaryDeviceDialog.tsx b/ts/components/WarningIdlePrimaryDeviceDialog.tsx index e9c704ec645..019bc118a92 100644 --- a/ts/components/WarningIdlePrimaryDeviceDialog.tsx +++ b/ts/components/WarningIdlePrimaryDeviceDialog.tsx @@ -7,10 +7,10 @@ import { LeftPaneDialog, LeftPaneDialogIcon, LeftPaneDialogIconBackground, -} from './LeftPaneDialog'; -import { WidthBreakpoint } from './_util'; -import type { LocalizerType } from '../types/I18N'; -import { openLinkInWebBrowser } from '../util/openLinkInWebBrowser'; +} from './LeftPaneDialog.js'; +import { WidthBreakpoint } from './_util.js'; +import type { LocalizerType } from '../types/I18N.js'; +import { openLinkInWebBrowser } from '../util/openLinkInWebBrowser.js'; export type Props = { containerWidthBreakpoint: WidthBreakpoint; diff --git a/ts/components/WhatsNewLink.tsx b/ts/components/WhatsNewLink.tsx index 6f5f65d979e..a7b546e6184 100644 --- a/ts/components/WhatsNewLink.tsx +++ b/ts/components/WhatsNewLink.tsx @@ -3,9 +3,9 @@ import React from 'react'; -import { I18n } from './I18n'; +import { I18n } from './I18n.js'; -import type { LocalizerType } from '../types/Util'; +import type { LocalizerType } from '../types/Util.js'; export type PropsType = { i18n: LocalizerType; diff --git a/ts/components/WhatsNewModal.stories.tsx b/ts/components/WhatsNewModal.stories.tsx index 155799829ea..3576bc0b671 100644 --- a/ts/components/WhatsNewModal.stories.tsx +++ b/ts/components/WhatsNewModal.stories.tsx @@ -4,8 +4,8 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './WhatsNewModal'; -import { WhatsNewModal } from './WhatsNewModal'; +import type { PropsType } from './WhatsNewModal.js'; +import { WhatsNewModal } from './WhatsNewModal.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/WhatsNewModal.tsx b/ts/components/WhatsNewModal.tsx index 385b3dc4230..543625a1fb3 100644 --- a/ts/components/WhatsNewModal.tsx +++ b/ts/components/WhatsNewModal.tsx @@ -5,10 +5,10 @@ import type { ReactNode } from 'react'; import React from 'react'; import moment from 'moment'; -import { Modal } from './Modal'; -import { I18n } from './I18n'; -import type { LocalizerType } from '../types/Util'; -import { tw } from '../axo/tw'; +import { Modal } from './Modal.js'; +import { I18n } from './I18n.js'; +import type { LocalizerType } from '../types/Util.js'; +import { tw } from '../axo/tw.js'; export type PropsType = { hideWhatsNewModal: () => unknown; diff --git a/ts/components/conversation/About.tsx b/ts/components/conversation/About.tsx index dab6d39fe7b..09942796a0b 100644 --- a/ts/components/conversation/About.tsx +++ b/ts/components/conversation/About.tsx @@ -3,7 +3,7 @@ import React from 'react'; -import { Emojify } from './Emojify'; +import { Emojify } from './Emojify.js'; export type PropsType = { className?: string; diff --git a/ts/components/conversation/AboutContactModal.stories.tsx b/ts/components/conversation/AboutContactModal.stories.tsx index 7e6b74f305a..75759f3f36b 100644 --- a/ts/components/conversation/AboutContactModal.stories.tsx +++ b/ts/components/conversation/AboutContactModal.stories.tsx @@ -3,10 +3,10 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { PropsType } from './AboutContactModal'; -import { AboutContactModal } from './AboutContactModal'; -import { type ComponentMeta } from '../../storybook/types'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation'; +import type { PropsType } from './AboutContactModal.js'; +import { AboutContactModal } from './AboutContactModal.js'; +import { type ComponentMeta } from '../../storybook/types.js'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/AboutContactModal.tsx b/ts/components/conversation/AboutContactModal.tsx index 256a9247d9d..11a0daab6d2 100644 --- a/ts/components/conversation/AboutContactModal.tsx +++ b/ts/components/conversation/AboutContactModal.tsx @@ -2,17 +2,17 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { type ReactNode, useCallback, useEffect, useMemo } from 'react'; -import type { ConversationType } from '../../state/ducks/conversations'; -import type { LocalizerType } from '../../types/Util'; -import { isInSystemContacts } from '../../util/isInSystemContacts'; -import { Avatar, AvatarBlur, AvatarSize } from '../Avatar'; -import { Modal } from '../Modal'; -import { UserText } from '../UserText'; -import { SharedGroupNames } from '../SharedGroupNames'; -import { About } from './About'; -import { I18n } from '../I18n'; -import { canHaveNicknameAndNote } from '../../util/nicknames'; -import { Tooltip, TooltipPlacement } from '../Tooltip'; +import type { ConversationType } from '../../state/ducks/conversations.js'; +import type { LocalizerType } from '../../types/Util.js'; +import { isInSystemContacts } from '../../util/isInSystemContacts.js'; +import { Avatar, AvatarBlur, AvatarSize } from '../Avatar.js'; +import { Modal } from '../Modal.js'; +import { UserText } from '../UserText.js'; +import { SharedGroupNames } from '../SharedGroupNames.js'; +import { About } from './About.js'; +import { I18n } from '../I18n.js'; +import { canHaveNicknameAndNote } from '../../util/nicknames.js'; +import { Tooltip, TooltipPlacement } from '../Tooltip.js'; function muted(parts: Array) { return ( diff --git a/ts/components/conversation/AddNewLines.stories.tsx b/ts/components/conversation/AddNewLines.stories.tsx index 0f0545f3e58..f4600f6ad2d 100644 --- a/ts/components/conversation/AddNewLines.stories.tsx +++ b/ts/components/conversation/AddNewLines.stories.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { Props } from './AddNewLines'; -import { AddNewLines } from './AddNewLines'; +import type { Props } from './AddNewLines.js'; +import { AddNewLines } from './AddNewLines.js'; export default { title: 'Components/Conversation/AddNewLines', diff --git a/ts/components/conversation/AddNewLines.tsx b/ts/components/conversation/AddNewLines.tsx index 7ab27d37497..d3458dd7c65 100644 --- a/ts/components/conversation/AddNewLines.tsx +++ b/ts/components/conversation/AddNewLines.tsx @@ -3,7 +3,7 @@ import React from 'react'; -import type { RenderTextCallbackType } from '../../types/Util'; +import type { RenderTextCallbackType } from '../../types/Util.js'; export type Props = { text: string; diff --git a/ts/components/conversation/AtMention.tsx b/ts/components/conversation/AtMention.tsx index 7129e5d5946..0d5377bdecf 100644 --- a/ts/components/conversation/AtMention.tsx +++ b/ts/components/conversation/AtMention.tsx @@ -4,7 +4,7 @@ import classNames from 'classnames'; import type { KeyboardEventHandler } from 'react'; import React from 'react'; -import { Emojify } from './Emojify'; +import { Emojify } from './Emojify.js'; export function AtMention({ direction, diff --git a/ts/components/conversation/AtMentionify.stories.tsx b/ts/components/conversation/AtMentionify.stories.tsx index 513ed61e7f8..25b4cc28cfa 100644 --- a/ts/components/conversation/AtMentionify.stories.tsx +++ b/ts/components/conversation/AtMentionify.stories.tsx @@ -4,9 +4,9 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { generateAci } from '../../types/ServiceId'; -import type { Props } from './AtMentionify'; -import { AtMentionify } from './AtMentionify'; +import { generateAci } from '../../types/ServiceId.js'; +import type { Props } from './AtMentionify.js'; +import { AtMentionify } from './AtMentionify.js'; const SERVICE_ID_1 = generateAci(); const SERVICE_ID_2 = generateAci(); diff --git a/ts/components/conversation/AtMentionify.tsx b/ts/components/conversation/AtMentionify.tsx index 9b17b495e56..c8acd68a5b4 100644 --- a/ts/components/conversation/AtMentionify.tsx +++ b/ts/components/conversation/AtMentionify.tsx @@ -6,8 +6,8 @@ import { sortBy } from 'lodash'; import type { HydratedBodyRangeMention, BodyRange, -} from '../../types/BodyRange'; -import { AtMention } from './AtMention'; +} from '../../types/BodyRange.js'; +import { AtMention } from './AtMention.js'; export type Props = { mentions?: ReadonlyArray; diff --git a/ts/components/conversation/AttachmentDetailPill.stories.tsx b/ts/components/conversation/AttachmentDetailPill.stories.tsx index 2894e94d428..8c7b18d95df 100644 --- a/ts/components/conversation/AttachmentDetailPill.stories.tsx +++ b/ts/components/conversation/AttachmentDetailPill.stories.tsx @@ -3,9 +3,12 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; -import { type PropsType, AttachmentDetailPill } from './AttachmentDetailPill'; -import { type ComponentMeta } from '../../storybook/types'; -import { fakeAttachment } from '../../test-helpers/fakeAttachment'; +import { + type PropsType, + AttachmentDetailPill, +} from './AttachmentDetailPill.js'; +import { type ComponentMeta } from '../../storybook/types.js'; +import { fakeAttachment } from '../../test-helpers/fakeAttachment.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/AttachmentDetailPill.tsx b/ts/components/conversation/AttachmentDetailPill.tsx index 3e56f6c4685..065f92e84ac 100644 --- a/ts/components/conversation/AttachmentDetailPill.tsx +++ b/ts/components/conversation/AttachmentDetailPill.tsx @@ -4,12 +4,12 @@ import React from 'react'; import classNames from 'classnames'; -import { formatFileSize } from '../../util/formatFileSize'; -import { SpinnerV2 } from '../SpinnerV2'; +import { formatFileSize } from '../../util/formatFileSize.js'; +import { SpinnerV2 } from '../SpinnerV2.js'; -import type { AttachmentForUIType } from '../../types/Attachment'; -import type { LocalizerType } from '../../types/I18N'; -import { isKeyboardActivation } from '../../hooks/useKeyboardShortcuts'; +import type { AttachmentForUIType } from '../../types/Attachment.js'; +import type { LocalizerType } from '../../types/I18N.js'; +import { isKeyboardActivation } from '../../hooks/useKeyboardShortcuts.js'; export type PropsType = { attachments: ReadonlyArray; diff --git a/ts/components/conversation/AttachmentList.stories.tsx b/ts/components/conversation/AttachmentList.stories.tsx index 21073fa2a0e..5361f1e28f9 100644 --- a/ts/components/conversation/AttachmentList.stories.tsx +++ b/ts/components/conversation/AttachmentList.stories.tsx @@ -7,17 +7,17 @@ import type { Meta } from '@storybook/react'; import type { AttachmentDraftType, AttachmentForUIType, -} from '../../types/Attachment'; -import type { Props } from './AttachmentList'; -import { AttachmentList } from './AttachmentList'; +} from '../../types/Attachment.js'; +import type { Props } from './AttachmentList.js'; +import { AttachmentList } from './AttachmentList.js'; import { AUDIO_MP3, IMAGE_GIF, IMAGE_JPEG, VIDEO_MP4, stringToMIMEType, -} from '../../types/MIME'; -import { fakeDraftAttachment } from '../../test-helpers/fakeAttachment'; +} from '../../types/MIME.js'; +import { fakeDraftAttachment } from '../../test-helpers/fakeAttachment.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/AttachmentList.tsx b/ts/components/conversation/AttachmentList.tsx index 5dfe1bcc5a5..37835b30dca 100644 --- a/ts/components/conversation/AttachmentList.tsx +++ b/ts/components/conversation/AttachmentList.tsx @@ -3,20 +3,20 @@ import React, { useMemo } from 'react'; -import { CurveType, Image } from './Image'; -import { StagedGenericAttachment } from './StagedGenericAttachment'; -import { StagedPlaceholderAttachment } from './StagedPlaceholderAttachment'; -import type { LocalizerType } from '../../types/Util'; +import { CurveType, Image } from './Image.js'; +import { StagedGenericAttachment } from './StagedGenericAttachment.js'; +import { StagedPlaceholderAttachment } from './StagedPlaceholderAttachment.js'; +import type { LocalizerType } from '../../types/Util.js'; import type { AttachmentForUIType, AttachmentDraftType, -} from '../../types/Attachment'; +} from '../../types/Attachment.js'; import { areAllAttachmentsVisual, canDisplayImage, isImageAttachment, isVideoAttachment, -} from '../../types/Attachment'; +} from '../../types/Attachment.js'; export type Props = Readonly<{ diff --git a/ts/components/conversation/AttachmentStatusIcon.stories.tsx b/ts/components/conversation/AttachmentStatusIcon.stories.tsx index 40895aeb029..f4d5ad4005c 100644 --- a/ts/components/conversation/AttachmentStatusIcon.stories.tsx +++ b/ts/components/conversation/AttachmentStatusIcon.stories.tsx @@ -3,9 +3,9 @@ import React, { useCallback, useRef, useState } from 'react'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './AttachmentStatusIcon'; -import { AttachmentStatusIcon } from './AttachmentStatusIcon'; -import { fakeAttachment } from '../../test-helpers/fakeAttachment'; +import type { PropsType } from './AttachmentStatusIcon.js'; +import { AttachmentStatusIcon } from './AttachmentStatusIcon.js'; +import { fakeAttachment } from '../../test-helpers/fakeAttachment.js'; export default { title: 'Components/Conversation/AttachmentStatusIcon', diff --git a/ts/components/conversation/AttachmentStatusIcon.tsx b/ts/components/conversation/AttachmentStatusIcon.tsx index 0d637c3a122..fab9112d960 100644 --- a/ts/components/conversation/AttachmentStatusIcon.tsx +++ b/ts/components/conversation/AttachmentStatusIcon.tsx @@ -4,10 +4,10 @@ import React, { useRef, useState, type ReactNode } from 'react'; import classNames from 'classnames'; -import { SpinnerV2 } from '../SpinnerV2'; -import { usePrevious } from '../../hooks/usePrevious'; +import { SpinnerV2 } from '../SpinnerV2.js'; +import { usePrevious } from '../../hooks/usePrevious.js'; -import type { AttachmentForUIType } from '../../types/Attachment'; +import type { AttachmentForUIType } from '../../types/Attachment.js'; const TRANSITION_DELAY = 200; diff --git a/ts/components/conversation/AudioCapture.tsx b/ts/components/conversation/AudioCapture.tsx index 372fa5399d7..62d58f78b9c 100644 --- a/ts/components/conversation/AudioCapture.tsx +++ b/ts/components/conversation/AudioCapture.tsx @@ -3,14 +3,14 @@ import React, { useCallback } from 'react'; -import type { ShowToastAction } from '../../state/ducks/toast'; -import type { AttachmentDraftType } from '../../types/Attachment'; -import type { LocalizerType } from '../../types/Util'; -import { ToastType } from '../../types/Toast'; +import type { ShowToastAction } from '../../state/ducks/toast.js'; +import type { AttachmentDraftType } from '../../types/Attachment.js'; +import type { LocalizerType } from '../../types/Util.js'; +import { ToastType } from '../../types/Toast.js'; import { useStartRecordingShortcut, useKeyboardShortcuts, -} from '../../hooks/useKeyboardShortcuts'; +} from '../../hooks/useKeyboardShortcuts.js'; export type PropsType = { conversationId: string; diff --git a/ts/components/conversation/CallingNotification.stories.tsx b/ts/components/conversation/CallingNotification.stories.tsx index 5adcde0845f..9d366e4201e 100644 --- a/ts/components/conversation/CallingNotification.stories.tsx +++ b/ts/components/conversation/CallingNotification.stories.tsx @@ -10,15 +10,15 @@ import { CallDirection, GroupCallStatus, DirectCallStatus, -} from '../../types/CallDisposition'; -import { generateAci } from '../../types/ServiceId'; -import { CallingNotification, type PropsType } from './CallingNotification'; +} from '../../types/CallDisposition.js'; +import { generateAci } from '../../types/ServiceId.js'; +import { CallingNotification, type PropsType } from './CallingNotification.js'; import { getDefaultConversation, getDefaultGroup, -} from '../../test-helpers/getDefaultConversation'; -import type { CallStatus } from '../../types/CallDisposition'; -import type { ConversationType } from '../../state/ducks/conversations'; +} from '../../test-helpers/getDefaultConversation.js'; +import type { CallStatus } from '../../types/CallDisposition.js'; +import type { ConversationType } from '../../state/ducks/conversations.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/CallingNotification.tsx b/ts/components/conversation/CallingNotification.tsx index feef90fdd23..d3bd5ea4a33 100644 --- a/ts/components/conversation/CallingNotification.tsx +++ b/ts/components/conversation/CallingNotification.tsx @@ -6,39 +6,39 @@ import React from 'react'; import { noop } from 'lodash'; import { ContextMenuTrigger } from 'react-contextmenu'; -import { SystemMessage, SystemMessageKind } from './SystemMessage'; -import { Button, ButtonSize, ButtonVariant } from '../Button'; -import { MessageTimestamp } from './MessageTimestamp'; -import type { LocalizerType } from '../../types/Util'; +import { SystemMessage, SystemMessageKind } from './SystemMessage.js'; +import { Button, ButtonSize, ButtonVariant } from '../Button.js'; +import { MessageTimestamp } from './MessageTimestamp.js'; +import type { LocalizerType } from '../../types/Util.js'; import { CallMode, CallDirection, CallType, DirectCallStatus, GroupCallStatus, -} from '../../types/CallDisposition'; -import type { CallingNotificationType } from '../../util/callingNotification'; +} from '../../types/CallDisposition.js'; +import type { CallingNotificationType } from '../../util/callingNotification.js'; import { getCallingIcon, getCallingNotificationText, -} from '../../util/callingNotification'; -import { missingCaseError } from '../../util/missingCaseError'; -import { Tooltip, TooltipPlacement } from '../Tooltip'; -import { createLogger } from '../../logging/log'; +} from '../../util/callingNotification.js'; +import { missingCaseError } from '../../util/missingCaseError.js'; +import { Tooltip, TooltipPlacement } from '../Tooltip.js'; +import { createLogger } from '../../logging/log.js'; import { type ContextMenuTriggerType, MessageContextMenu, useHandleMessageContextMenu, -} from './MessageContextMenu'; -import type { DeleteMessagesPropsType } from '../../state/ducks/globalModals'; +} from './MessageContextMenu.js'; +import type { DeleteMessagesPropsType } from '../../state/ducks/globalModals.js'; import { useKeyboardShortcutsConditionally, useOpenContextMenu, -} from '../../hooks/useKeyboardShortcuts'; -import { MINUTE } from '../../util/durations'; -import { isMoreRecentThan } from '../../util/timestamp'; -import { InAnotherCallTooltip } from './InAnotherCallTooltip'; -import type { InteractionModeType } from '../../state/ducks/conversations'; +} from '../../hooks/useKeyboardShortcuts.js'; +import { MINUTE } from '../../util/durations/index.js'; +import { isMoreRecentThan } from '../../util/timestamp.js'; +import { InAnotherCallTooltip } from './InAnotherCallTooltip.js'; +import type { InteractionModeType } from '../../state/ducks/conversations.js'; const log = createLogger('CallingNotification'); diff --git a/ts/components/conversation/ChangeNumberNotification.stories.tsx b/ts/components/conversation/ChangeNumberNotification.stories.tsx index 34203fd0c01..8313bf0040c 100644 --- a/ts/components/conversation/ChangeNumberNotification.stories.tsx +++ b/ts/components/conversation/ChangeNumberNotification.stories.tsx @@ -3,9 +3,9 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation'; -import type { Props } from './ChangeNumberNotification'; -import { ChangeNumberNotification } from './ChangeNumberNotification'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; +import type { Props } from './ChangeNumberNotification.js'; +import { ChangeNumberNotification } from './ChangeNumberNotification.js'; export default { title: 'Components/Conversation/ChangeNumberNotification', diff --git a/ts/components/conversation/ChangeNumberNotification.tsx b/ts/components/conversation/ChangeNumberNotification.tsx index 084f21d5a95..a845e2cd19d 100644 --- a/ts/components/conversation/ChangeNumberNotification.tsx +++ b/ts/components/conversation/ChangeNumberNotification.tsx @@ -3,13 +3,13 @@ import React from 'react'; -import type { ConversationType } from '../../state/ducks/conversations'; -import type { LocalizerType } from '../../types/Util'; -import { I18n } from '../I18n'; +import type { ConversationType } from '../../state/ducks/conversations.js'; +import type { LocalizerType } from '../../types/Util.js'; +import { I18n } from '../I18n.js'; -import { SystemMessage } from './SystemMessage'; -import { MessageTimestamp } from './MessageTimestamp'; -import { UserText } from '../UserText'; +import { SystemMessage } from './SystemMessage.js'; +import { MessageTimestamp } from './MessageTimestamp.js'; +import { UserText } from '../UserText.js'; export type PropsData = { sender: ConversationType; diff --git a/ts/components/conversation/ChatSessionRefreshedDialog.stories.tsx b/ts/components/conversation/ChatSessionRefreshedDialog.stories.tsx index 8b74be715a5..86e4b752873 100644 --- a/ts/components/conversation/ChatSessionRefreshedDialog.stories.tsx +++ b/ts/components/conversation/ChatSessionRefreshedDialog.stories.tsx @@ -4,8 +4,8 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './ChatSessionRefreshedDialog'; -import { ChatSessionRefreshedDialog } from './ChatSessionRefreshedDialog'; +import type { PropsType } from './ChatSessionRefreshedDialog.js'; +import { ChatSessionRefreshedDialog } from './ChatSessionRefreshedDialog.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/ChatSessionRefreshedDialog.tsx b/ts/components/conversation/ChatSessionRefreshedDialog.tsx index 492896b617a..e3bf51e2ccc 100644 --- a/ts/components/conversation/ChatSessionRefreshedDialog.tsx +++ b/ts/components/conversation/ChatSessionRefreshedDialog.tsx @@ -3,12 +3,12 @@ import * as React from 'react'; -import { Modal } from '../Modal'; +import { Modal } from '../Modal.js'; -import { useRestoreFocus } from '../../hooks/useRestoreFocus'; +import { useRestoreFocus } from '../../hooks/useRestoreFocus.js'; -import type { LocalizerType } from '../../types/Util'; -import { Button, ButtonSize, ButtonVariant } from '../Button'; +import type { LocalizerType } from '../../types/Util.js'; +import { Button, ButtonSize, ButtonVariant } from '../Button.js'; export type PropsType = { i18n: LocalizerType; diff --git a/ts/components/conversation/ChatSessionRefreshedNotification.stories.tsx b/ts/components/conversation/ChatSessionRefreshedNotification.stories.tsx index bc189d10fab..654a395fd92 100644 --- a/ts/components/conversation/ChatSessionRefreshedNotification.stories.tsx +++ b/ts/components/conversation/ChatSessionRefreshedNotification.stories.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './ChatSessionRefreshedNotification'; -import { ChatSessionRefreshedNotification } from './ChatSessionRefreshedNotification'; +import type { PropsType } from './ChatSessionRefreshedNotification.js'; +import { ChatSessionRefreshedNotification } from './ChatSessionRefreshedNotification.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/ChatSessionRefreshedNotification.tsx b/ts/components/conversation/ChatSessionRefreshedNotification.tsx index 4c4733d661f..41cbd4f5616 100644 --- a/ts/components/conversation/ChatSessionRefreshedNotification.tsx +++ b/ts/components/conversation/ChatSessionRefreshedNotification.tsx @@ -4,12 +4,12 @@ import type { ReactElement } from 'react'; import React, { useCallback, useState } from 'react'; -import type { LocalizerType } from '../../types/Util'; +import type { LocalizerType } from '../../types/Util.js'; -import { Button, ButtonSize, ButtonVariant } from '../Button'; -import { SystemMessage } from './SystemMessage'; -import { ChatSessionRefreshedDialog } from './ChatSessionRefreshedDialog'; -import { openLinkInWebBrowser } from '../../util/openLinkInWebBrowser'; +import { Button, ButtonSize, ButtonVariant } from '../Button.js'; +import { SystemMessage } from './SystemMessage.js'; +import { ChatSessionRefreshedDialog } from './ChatSessionRefreshedDialog.js'; +import { openLinkInWebBrowser } from '../../util/openLinkInWebBrowser.js'; type PropsHousekeepingType = { i18n: LocalizerType; diff --git a/ts/components/conversation/ContactDetail.stories.tsx b/ts/components/conversation/ContactDetail.stories.tsx index fc0ee13f0c5..cd67e63da59 100644 --- a/ts/components/conversation/ContactDetail.stories.tsx +++ b/ts/components/conversation/ContactDetail.stories.tsx @@ -4,11 +4,11 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './ContactDetail'; -import { ContactDetail } from './ContactDetail'; -import { AddressType, ContactFormType } from '../../types/EmbeddedContact'; -import { IMAGE_GIF } from '../../types/MIME'; -import { fakeAttachment } from '../../test-helpers/fakeAttachment'; +import type { Props } from './ContactDetail.js'; +import { ContactDetail } from './ContactDetail.js'; +import { AddressType, ContactFormType } from '../../types/EmbeddedContact.js'; +import { IMAGE_GIF } from '../../types/MIME.js'; +import { fakeAttachment } from '../../test-helpers/fakeAttachment.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/ContactDetail.tsx b/ts/components/conversation/ContactDetail.tsx index 051d7ce6669..2d6d2d10b85 100644 --- a/ts/components/conversation/ContactDetail.tsx +++ b/ts/components/conversation/ContactDetail.tsx @@ -6,21 +6,21 @@ import classNames from 'classnames'; import type { ReadonlyDeep } from 'type-fest'; -import { AddressType, ContactFormType } from '../../types/EmbeddedContact'; -import { missingCaseError } from '../../util/missingCaseError'; +import { AddressType, ContactFormType } from '../../types/EmbeddedContact.js'; +import { missingCaseError } from '../../util/missingCaseError.js'; import { renderAvatar, renderContactShorthand, renderName, -} from './contactUtil'; +} from './contactUtil.js'; import type { EmbeddedContactForUIType, Email, Phone, PostalAddress, -} from '../../types/EmbeddedContact'; -import type { LocalizerType } from '../../types/Util'; +} from '../../types/EmbeddedContact.js'; +import type { LocalizerType } from '../../types/Util.js'; export type Props = { cancelAttachmentDownload: (options: { messageId: string }) => void; diff --git a/ts/components/conversation/ContactModal.stories.tsx b/ts/components/conversation/ContactModal.stories.tsx index 2c4692a51e6..ba99a675bb3 100644 --- a/ts/components/conversation/ContactModal.stories.tsx +++ b/ts/components/conversation/ContactModal.stories.tsx @@ -5,13 +5,13 @@ import type { Meta, StoryFn } from '@storybook/react'; import * as React from 'react'; import casual from 'casual'; import { action } from '@storybook/addon-actions'; -import type { ConversationType } from '../../state/ducks/conversations'; -import type { PropsType } from './ContactModal'; -import { ContactModal } from './ContactModal'; -import { HasStories } from '../../types/Stories'; -import { ThemeType } from '../../types/Util'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation'; -import { getFakeBadges } from '../../test-helpers/getFakeBadge'; +import type { ConversationType } from '../../state/ducks/conversations.js'; +import type { PropsType } from './ContactModal.js'; +import { ContactModal } from './ContactModal.js'; +import { HasStories } from '../../types/Stories.js'; +import { ThemeType } from '../../types/Util.js'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; +import { getFakeBadges } from '../../test-helpers/getFakeBadge.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/ContactModal.tsx b/ts/components/conversation/ContactModal.tsx index 88b511988ff..9fba657d797 100644 --- a/ts/components/conversation/ContactModal.tsx +++ b/ts/components/conversation/ContactModal.tsx @@ -7,30 +7,30 @@ import type { ReactNode } from 'react'; import type { ConversationType, ShowConversationType, -} from '../../state/ducks/conversations'; -import type { BadgeType } from '../../badges/types'; -import type { HasStories } from '../../types/Stories'; -import type { LocalizerType, ThemeType } from '../../types/Util'; -import type { ViewUserStoriesActionCreatorType } from '../../state/ducks/stories'; -import { StoryViewModeType } from '../../types/Stories'; -import { createLogger } from '../../logging/log'; -import { Avatar, AvatarBlur, AvatarSize } from '../Avatar'; -import { AvatarLightbox } from '../AvatarLightbox'; -import { BadgeDialog } from '../BadgeDialog'; -import { ConfirmationDialog } from '../ConfirmationDialog'; -import { Modal } from '../Modal'; -import { RemoveGroupMemberConfirmationDialog } from './RemoveGroupMemberConfirmationDialog'; -import { missingCaseError } from '../../util/missingCaseError'; -import { UserText } from '../UserText'; -import { Button, ButtonIconType, ButtonVariant } from '../Button'; -import { isInSystemContacts } from '../../util/isInSystemContacts'; -import { InContactsIcon } from '../InContactsIcon'; -import { canHaveNicknameAndNote } from '../../util/nicknames'; -import { getThemeByThemeType } from '../../util/theme'; +} from '../../state/ducks/conversations.js'; +import type { BadgeType } from '../../badges/types.js'; +import type { HasStories } from '../../types/Stories.js'; +import type { LocalizerType, ThemeType } from '../../types/Util.js'; +import type { ViewUserStoriesActionCreatorType } from '../../state/ducks/stories.js'; +import { StoryViewModeType } from '../../types/Stories.js'; +import { createLogger } from '../../logging/log.js'; +import { Avatar, AvatarBlur, AvatarSize } from '../Avatar.js'; +import { AvatarLightbox } from '../AvatarLightbox.js'; +import { BadgeDialog } from '../BadgeDialog.js'; +import { ConfirmationDialog } from '../ConfirmationDialog.js'; +import { Modal } from '../Modal.js'; +import { RemoveGroupMemberConfirmationDialog } from './RemoveGroupMemberConfirmationDialog.js'; +import { missingCaseError } from '../../util/missingCaseError.js'; +import { UserText } from '../UserText.js'; +import { Button, ButtonIconType, ButtonVariant } from '../Button.js'; +import { isInSystemContacts } from '../../util/isInSystemContacts.js'; +import { InContactsIcon } from '../InContactsIcon.js'; +import { canHaveNicknameAndNote } from '../../util/nicknames.js'; +import { getThemeByThemeType } from '../../util/theme.js'; import { InAnotherCallTooltip, getTooltipContent, -} from './InAnotherCallTooltip'; +} from './InAnotherCallTooltip.js'; const log = createLogger('ContactModal'); diff --git a/ts/components/conversation/ContactName.stories.tsx b/ts/components/conversation/ContactName.stories.tsx index 33ce1d3f5b3..64c425ad972 100644 --- a/ts/components/conversation/ContactName.stories.tsx +++ b/ts/components/conversation/ContactName.stories.tsx @@ -3,9 +3,9 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './ContactName'; -import { ContactName } from './ContactName'; -import { ContactNameColors } from '../../types/Colors'; +import type { PropsType } from './ContactName.js'; +import { ContactName } from './ContactName.js'; +import { ContactNameColors } from '../../types/Colors.js'; export default { title: 'Components/Conversation/ContactName', diff --git a/ts/components/conversation/ContactName.tsx b/ts/components/conversation/ContactName.tsx index fff9133883d..31fb70d3f24 100644 --- a/ts/components/conversation/ContactName.tsx +++ b/ts/components/conversation/ContactName.tsx @@ -4,11 +4,11 @@ import React, { useMemo } from 'react'; import classNames from 'classnames'; -import { Emojify } from './Emojify'; -import type { ContactNameColorType } from '../../types/Colors'; -import { getClassNamesFor } from '../../util/getClassNamesFor'; -import type { ConversationType } from '../../state/ducks/conversations'; -import { isSignalConversation as getIsSignalConversation } from '../../util/isSignalConversation'; +import { Emojify } from './Emojify.js'; +import type { ContactNameColorType } from '../../types/Colors.js'; +import { getClassNamesFor } from '../../util/getClassNamesFor.js'; +import type { ConversationType } from '../../state/ducks/conversations.js'; +import { isSignalConversation as getIsSignalConversation } from '../../util/isSignalConversation.js'; export type ContactNameData = { contactNameColor?: ContactNameColorType; diff --git a/ts/components/conversation/ContactSpoofingReviewDialog.stories.tsx b/ts/components/conversation/ContactSpoofingReviewDialog.stories.tsx index e56d72d095c..f03259304b6 100644 --- a/ts/components/conversation/ContactSpoofingReviewDialog.stories.tsx +++ b/ts/components/conversation/ContactSpoofingReviewDialog.stories.tsx @@ -5,11 +5,11 @@ import React from 'react'; import { times } from 'lodash'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation'; -import type { PropsType } from './ContactSpoofingReviewDialog'; -import { ContactSpoofingReviewDialog } from './ContactSpoofingReviewDialog'; -import { ContactSpoofingType } from '../../util/contactSpoofing'; -import { ThemeType } from '../../types/Util'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; +import type { PropsType } from './ContactSpoofingReviewDialog.js'; +import { ContactSpoofingReviewDialog } from './ContactSpoofingReviewDialog.js'; +import { ContactSpoofingType } from '../../util/contactSpoofing.js'; +import { ThemeType } from '../../types/Util.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/ContactSpoofingReviewDialog.tsx b/ts/components/conversation/ContactSpoofingReviewDialog.tsx index 16ce5ad7f59..785ead1a9a0 100644 --- a/ts/components/conversation/ContactSpoofingReviewDialog.tsx +++ b/ts/components/conversation/ContactSpoofingReviewDialog.tsx @@ -4,22 +4,22 @@ import type { ReactChild, ReactNode } from 'react'; import React, { useState } from 'react'; -import type { LocalizerType, ThemeType } from '../../types/Util'; -import type { ConversationType } from '../../state/ducks/conversations'; -import type { PreferredBadgeSelectorType } from '../../state/selectors/badges'; +import type { LocalizerType, ThemeType } from '../../types/Util.js'; +import type { ConversationType } from '../../state/ducks/conversations.js'; +import type { PreferredBadgeSelectorType } from '../../state/selectors/badges.js'; import { MessageRequestActionsConfirmation, MessageRequestState, -} from './MessageRequestActionsConfirmation'; -import { ContactSpoofingType } from '../../util/contactSpoofing'; +} from './MessageRequestActionsConfirmation.js'; +import { ContactSpoofingType } from '../../util/contactSpoofing.js'; -import { Modal } from '../Modal'; -import { RemoveGroupMemberConfirmationDialog } from './RemoveGroupMemberConfirmationDialog'; -import { ContactSpoofingReviewDialogPerson } from './ContactSpoofingReviewDialogPerson'; -import { Button, ButtonVariant } from '../Button'; -import { assertDev } from '../../util/assert'; -import { missingCaseError } from '../../util/missingCaseError'; -import { isInSystemContacts } from '../../util/isInSystemContacts'; +import { Modal } from '../Modal.js'; +import { RemoveGroupMemberConfirmationDialog } from './RemoveGroupMemberConfirmationDialog.js'; +import { ContactSpoofingReviewDialogPerson } from './ContactSpoofingReviewDialogPerson.js'; +import { Button, ButtonVariant } from '../Button.js'; +import { assertDev } from '../../util/assert.js'; +import { missingCaseError } from '../../util/missingCaseError.js'; +import { isInSystemContacts } from '../../util/isInSystemContacts.js'; export type ReviewPropsType = Readonly< | { diff --git a/ts/components/conversation/ContactSpoofingReviewDialogPerson.stories.tsx b/ts/components/conversation/ContactSpoofingReviewDialogPerson.stories.tsx index b16fe83fb51..24e7c9de4ea 100644 --- a/ts/components/conversation/ContactSpoofingReviewDialogPerson.stories.tsx +++ b/ts/components/conversation/ContactSpoofingReviewDialogPerson.stories.tsx @@ -5,11 +5,11 @@ import React from 'react'; import type { Meta, StoryFn } from '@storybook/react'; import { action } from '@storybook/addon-actions'; -import { ThemeType } from '../../types/Util'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation'; +import { ThemeType } from '../../types/Util.js'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; -import type { PropsType } from './ContactSpoofingReviewDialogPerson'; -import { ContactSpoofingReviewDialogPerson } from './ContactSpoofingReviewDialogPerson'; +import type { PropsType } from './ContactSpoofingReviewDialogPerson.js'; +import { ContactSpoofingReviewDialogPerson } from './ContactSpoofingReviewDialogPerson.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/ContactSpoofingReviewDialogPerson.tsx b/ts/components/conversation/ContactSpoofingReviewDialogPerson.tsx index b4e7c5b3557..ad4b64fc44b 100644 --- a/ts/components/conversation/ContactSpoofingReviewDialogPerson.tsx +++ b/ts/components/conversation/ContactSpoofingReviewDialogPerson.tsx @@ -4,16 +4,16 @@ import type { ReactNode } from 'react'; import React, { useEffect } from 'react'; -import type { ConversationType } from '../../state/ducks/conversations'; -import type { LocalizerType, ThemeType } from '../../types/Util'; -import type { PreferredBadgeSelectorType } from '../../state/selectors/badges'; -import { assertDev } from '../../util/assert'; +import type { ConversationType } from '../../state/ducks/conversations.js'; +import type { LocalizerType, ThemeType } from '../../types/Util.js'; +import type { PreferredBadgeSelectorType } from '../../state/selectors/badges.js'; +import { assertDev } from '../../util/assert.js'; -import { Avatar, AvatarSize } from '../Avatar'; -import { ContactName } from './ContactName'; -import { SharedGroupNames } from '../SharedGroupNames'; -import { UserText } from '../UserText'; -import { I18n } from '../I18n'; +import { Avatar, AvatarSize } from '../Avatar.js'; +import { ContactName } from './ContactName.js'; +import { SharedGroupNames } from '../SharedGroupNames.js'; +import { UserText } from '../UserText.js'; +import { I18n } from '../I18n.js'; export type PropsType = Readonly<{ children?: ReactNode; diff --git a/ts/components/conversation/ConversationHeader.stories.tsx b/ts/components/conversation/ConversationHeader.stories.tsx index 6080d99a4ca..88d9628919a 100644 --- a/ts/components/conversation/ConversationHeader.stories.tsx +++ b/ts/components/conversation/ConversationHeader.stories.tsx @@ -8,17 +8,17 @@ import type { Meta } from '@storybook/react'; import { getDefaultConversation, getDefaultGroup, -} from '../../test-helpers/getDefaultConversation'; -import { getRandomColor } from '../../test-helpers/getRandomColor'; -import { DurationInSeconds } from '../../util/durations'; -import { StorybookThemeContext } from '../../../.storybook/StorybookThemeContext'; -import type { PropsType } from './ConversationHeader'; +} from '../../test-helpers/getDefaultConversation.js'; +import { getRandomColor } from '../../test-helpers/getRandomColor.js'; +import { DurationInSeconds } from '../../util/durations/index.js'; +import { StorybookThemeContext } from '../../../.storybook/StorybookThemeContext.js'; +import type { PropsType } from './ConversationHeader.js'; import { ConversationHeader, OutgoingCallButtonStyle, -} from './ConversationHeader'; -import { gifUrl } from '../../storybook/Fixtures'; -import { ThemeType } from '../../types/Util'; +} from './ConversationHeader.js'; +import { gifUrl } from '../../storybook/Fixtures.js'; +import { ThemeType } from '../../types/Util.js'; export default { title: 'Components/Conversation/ConversationHeader', diff --git a/ts/components/conversation/ConversationHeader.tsx b/ts/components/conversation/ConversationHeader.tsx index 42f8def8349..be30d755381 100644 --- a/ts/components/conversation/ConversationHeader.tsx +++ b/ts/components/conversation/ConversationHeader.tsx @@ -11,35 +11,35 @@ import { SubMenu, } from 'react-contextmenu'; import { createPortal } from 'react-dom'; -import type { BadgeType } from '../../badges/types'; +import type { BadgeType } from '../../badges/types.js'; import { useKeyboardShortcuts, useStartCallShortcuts, -} from '../../hooks/useKeyboardShortcuts'; -import { SizeObserver } from '../../hooks/useSizeObserver'; -import type { ConversationTypeType } from '../../state/ducks/conversations'; -import type { HasStories } from '../../types/Stories'; -import type { LocalizerType, ThemeType } from '../../types/Util'; -import { DurationInSeconds } from '../../util/durations'; -import * as expirationTimer from '../../util/expirationTimer'; -import { getMuteOptions } from '../../util/getMuteOptions'; -import { isConversationMuted } from '../../util/isConversationMuted'; -import { isInSystemContacts } from '../../util/isInSystemContacts'; -import { missingCaseError } from '../../util/missingCaseError'; -import { Alert } from '../Alert'; -import { Avatar, AvatarSize } from '../Avatar'; -import { ConfirmationDialog } from '../ConfirmationDialog'; -import { DisappearingTimeDialog } from '../DisappearingTimeDialog'; -import { InContactsIcon } from '../InContactsIcon'; -import { UserText } from '../UserText'; -import type { ContactNameData } from './ContactName'; +} from '../../hooks/useKeyboardShortcuts.js'; +import { SizeObserver } from '../../hooks/useSizeObserver.js'; +import type { ConversationTypeType } from '../../state/ducks/conversations.js'; +import type { HasStories } from '../../types/Stories.js'; +import type { LocalizerType, ThemeType } from '../../types/Util.js'; +import { DurationInSeconds } from '../../util/durations/index.js'; +import * as expirationTimer from '../../util/expirationTimer.js'; +import { getMuteOptions } from '../../util/getMuteOptions.js'; +import { isConversationMuted } from '../../util/isConversationMuted.js'; +import { isInSystemContacts } from '../../util/isInSystemContacts.js'; +import { missingCaseError } from '../../util/missingCaseError.js'; +import { Alert } from '../Alert.js'; +import { Avatar, AvatarSize } from '../Avatar.js'; +import { ConfirmationDialog } from '../ConfirmationDialog.js'; +import { DisappearingTimeDialog } from '../DisappearingTimeDialog.js'; +import { InContactsIcon } from '../InContactsIcon.js'; +import { UserText } from '../UserText.js'; +import type { ContactNameData } from './ContactName.js'; import { MessageRequestActionsConfirmation, MessageRequestState, -} from './MessageRequestActionsConfirmation'; -import type { MinimalConversation } from '../../hooks/useMinimalConversation'; -import { LocalDeleteWarningModal } from '../LocalDeleteWarningModal'; -import { InAnotherCallTooltip } from './InAnotherCallTooltip'; +} from './MessageRequestActionsConfirmation.js'; +import type { MinimalConversation } from '../../hooks/useMinimalConversation.js'; +import { LocalDeleteWarningModal } from '../LocalDeleteWarningModal.js'; +import { InAnotherCallTooltip } from './InAnotherCallTooltip.js'; function HeaderInfoTitle({ name, diff --git a/ts/components/conversation/ConversationHero.stories.tsx b/ts/components/conversation/ConversationHero.stories.tsx index 09644001ee8..c20f4ab9927 100644 --- a/ts/components/conversation/ConversationHero.stories.tsx +++ b/ts/components/conversation/ConversationHero.stories.tsx @@ -5,13 +5,13 @@ import type { Meta, StoryFn } from '@storybook/react'; import React, { useContext } from 'react'; import casual from 'casual'; import { action } from '@storybook/addon-actions'; -import type { Props } from './ConversationHero'; -import { ConversationHero } from './ConversationHero'; -import { HasStories } from '../../types/Stories'; -import { StorybookThemeContext } from '../../../.storybook/StorybookThemeContext'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation'; -import { ThemeType } from '../../types/Util'; -import type { GroupV2Membership } from './conversation-details/ConversationDetailsMembershipList'; +import type { Props } from './ConversationHero.js'; +import { ConversationHero } from './ConversationHero.js'; +import { HasStories } from '../../types/Stories.js'; +import { StorybookThemeContext } from '../../../.storybook/StorybookThemeContext.js'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; +import { ThemeType } from '../../types/Util.js'; +import type { GroupV2Membership } from './conversation-details/ConversationDetailsMembershipList.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/ConversationHero.tsx b/ts/components/conversation/ConversationHero.tsx index 938ef9d00fc..3500e4091dc 100644 --- a/ts/components/conversation/ConversationHero.tsx +++ b/ts/components/conversation/ConversationHero.tsx @@ -3,21 +3,21 @@ import React, { type ReactNode, useEffect, useState } from 'react'; import classNames from 'classnames'; -import type { Props as AvatarProps } from '../Avatar'; -import { Avatar, AvatarSize, AvatarBlur } from '../Avatar'; -import { ContactName } from './ContactName'; -import { About } from './About'; -import { GroupDescription } from './GroupDescription'; -import { SharedGroupNames } from '../SharedGroupNames'; -import { GroupMembersNames } from '../GroupMembersNames'; -import type { LocalizerType, ThemeType } from '../../types/Util'; -import type { HasStories } from '../../types/Stories'; -import type { ViewUserStoriesActionCreatorType } from '../../state/ducks/stories'; -import type { GroupV2Membership } from './conversation-details/ConversationDetailsMembershipList'; -import { StoryViewModeType } from '../../types/Stories'; -import { Button, ButtonVariant } from '../Button'; -import { SafetyTipsModal } from '../SafetyTipsModal'; -import { I18n } from '../I18n'; +import type { Props as AvatarProps } from '../Avatar.js'; +import { Avatar, AvatarSize, AvatarBlur } from '../Avatar.js'; +import { ContactName } from './ContactName.js'; +import { About } from './About.js'; +import { GroupDescription } from './GroupDescription.js'; +import { SharedGroupNames } from '../SharedGroupNames.js'; +import { GroupMembersNames } from '../GroupMembersNames.js'; +import type { LocalizerType, ThemeType } from '../../types/Util.js'; +import type { HasStories } from '../../types/Stories.js'; +import type { ViewUserStoriesActionCreatorType } from '../../state/ducks/stories.js'; +import type { GroupV2Membership } from './conversation-details/ConversationDetailsMembershipList.js'; +import { StoryViewModeType } from '../../types/Stories.js'; +import { Button, ButtonVariant } from '../Button.js'; +import { SafetyTipsModal } from '../SafetyTipsModal.js'; +import { I18n } from '../I18n.js'; export type Props = { about?: string; diff --git a/ts/components/conversation/ConversationMergeNotification.stories.tsx b/ts/components/conversation/ConversationMergeNotification.stories.tsx index b2445e90674..6d21e719be0 100644 --- a/ts/components/conversation/ConversationMergeNotification.stories.tsx +++ b/ts/components/conversation/ConversationMergeNotification.stories.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './ConversationMergeNotification'; -import { ConversationMergeNotification } from './ConversationMergeNotification'; +import type { PropsType } from './ConversationMergeNotification.js'; +import { ConversationMergeNotification } from './ConversationMergeNotification.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/ConversationMergeNotification.tsx b/ts/components/conversation/ConversationMergeNotification.tsx index af99a3e95ef..1bcc7cebc08 100644 --- a/ts/components/conversation/ConversationMergeNotification.tsx +++ b/ts/components/conversation/ConversationMergeNotification.tsx @@ -3,13 +3,13 @@ import React from 'react'; -import type { LocalizerType } from '../../types/Util'; -import { getStringForConversationMerge } from '../../util/getStringForConversationMerge'; -import { Button, ButtonSize, ButtonVariant } from '../Button'; -import { SystemMessage } from './SystemMessage'; -import { Emojify } from './Emojify'; -import { Modal } from '../Modal'; -import { I18n } from '../I18n'; +import type { LocalizerType } from '../../types/Util.js'; +import { getStringForConversationMerge } from '../../util/getStringForConversationMerge.js'; +import { Button, ButtonSize, ButtonVariant } from '../Button.js'; +import { SystemMessage } from './SystemMessage.js'; +import { Emojify } from './Emojify.js'; +import { Modal } from '../Modal.js'; +import { I18n } from '../I18n.js'; export type PropsDataType = { conversationTitle: string; diff --git a/ts/components/conversation/ConversationView.tsx b/ts/components/conversation/ConversationView.tsx index 06a2d18f1be..bf6a14ec90e 100644 --- a/ts/components/conversation/ConversationView.tsx +++ b/ts/components/conversation/ConversationView.tsx @@ -3,9 +3,9 @@ import React from 'react'; import classNames from 'classnames'; -import { useEscapeHandling } from '../../hooks/useEscapeHandling'; -import { getSuggestedFilename } from '../../types/Attachment'; -import { IMAGE_PNG, type MIMEType } from '../../types/MIME'; +import { useEscapeHandling } from '../../hooks/useEscapeHandling.js'; +import { getSuggestedFilename } from '../../types/Attachment.js'; +import { IMAGE_PNG, type MIMEType } from '../../types/MIME.js'; export type PropsType = { conversationId: string; diff --git a/ts/components/conversation/DeliveryIssueDialog.stories.tsx b/ts/components/conversation/DeliveryIssueDialog.stories.tsx index e699303ba57..a9f0fa65aac 100644 --- a/ts/components/conversation/DeliveryIssueDialog.stories.tsx +++ b/ts/components/conversation/DeliveryIssueDialog.stories.tsx @@ -4,9 +4,9 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './DeliveryIssueDialog'; -import { DeliveryIssueDialog } from './DeliveryIssueDialog'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation'; +import type { PropsType } from './DeliveryIssueDialog.js'; +import { DeliveryIssueDialog } from './DeliveryIssueDialog.js'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; const { i18n } = window.SignalContext; const sender = getDefaultConversation(); diff --git a/ts/components/conversation/DeliveryIssueDialog.tsx b/ts/components/conversation/DeliveryIssueDialog.tsx index e3804a491b0..6bbad43e8f8 100644 --- a/ts/components/conversation/DeliveryIssueDialog.tsx +++ b/ts/components/conversation/DeliveryIssueDialog.tsx @@ -3,16 +3,16 @@ import * as React from 'react'; -import { Button, ButtonSize, ButtonVariant } from '../Button'; -import type { ConversationType } from '../../state/ducks/conversations'; -import { Modal } from '../Modal'; -import { I18n } from '../I18n'; -import { Emojify } from './Emojify'; +import { Button, ButtonSize, ButtonVariant } from '../Button.js'; +import type { ConversationType } from '../../state/ducks/conversations.js'; +import { Modal } from '../Modal.js'; +import { I18n } from '../I18n.js'; +import { Emojify } from './Emojify.js'; -import { useRestoreFocus } from '../../hooks/useRestoreFocus'; +import { useRestoreFocus } from '../../hooks/useRestoreFocus.js'; -import type { LocalizerType } from '../../types/Util'; -import { openLinkInWebBrowser } from '../../util/openLinkInWebBrowser'; +import type { LocalizerType } from '../../types/Util.js'; +import { openLinkInWebBrowser } from '../../util/openLinkInWebBrowser.js'; export type PropsType = { i18n: LocalizerType; diff --git a/ts/components/conversation/DeliveryIssueNotification.stories.tsx b/ts/components/conversation/DeliveryIssueNotification.stories.tsx index 479bb57b8f1..aface52e95a 100644 --- a/ts/components/conversation/DeliveryIssueNotification.stories.tsx +++ b/ts/components/conversation/DeliveryIssueNotification.stories.tsx @@ -3,9 +3,9 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './DeliveryIssueNotification'; -import { DeliveryIssueNotification } from './DeliveryIssueNotification'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation'; +import type { PropsType } from './DeliveryIssueNotification.js'; +import { DeliveryIssueNotification } from './DeliveryIssueNotification.js'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; export default { title: 'Components/Conversation/DeliveryIssueNotification', diff --git a/ts/components/conversation/DeliveryIssueNotification.tsx b/ts/components/conversation/DeliveryIssueNotification.tsx index 7fbe6c0f357..8062e0d2a22 100644 --- a/ts/components/conversation/DeliveryIssueNotification.tsx +++ b/ts/components/conversation/DeliveryIssueNotification.tsx @@ -4,14 +4,14 @@ import type { ReactElement } from 'react'; import React, { useCallback, useState } from 'react'; -import { Button, ButtonSize, ButtonVariant } from '../Button'; -import { SystemMessage } from './SystemMessage'; -import type { ConversationType } from '../../state/ducks/conversations'; -import type { LocalizerType } from '../../types/Util'; -import { I18n } from '../I18n'; +import { Button, ButtonSize, ButtonVariant } from '../Button.js'; +import { SystemMessage } from './SystemMessage.js'; +import type { ConversationType } from '../../state/ducks/conversations.js'; +import type { LocalizerType } from '../../types/Util.js'; +import { I18n } from '../I18n.js'; -import { DeliveryIssueDialog } from './DeliveryIssueDialog'; -import { UserText } from '../UserText'; +import { DeliveryIssueDialog } from './DeliveryIssueDialog.js'; +import { UserText } from '../UserText.js'; export type PropsDataType = { sender?: ConversationType; diff --git a/ts/components/conversation/DonationsOfflineTooltip.tsx b/ts/components/conversation/DonationsOfflineTooltip.tsx index aab25a9a6b0..a3aa91ab6f8 100644 --- a/ts/components/conversation/DonationsOfflineTooltip.tsx +++ b/ts/components/conversation/DonationsOfflineTooltip.tsx @@ -3,10 +3,10 @@ import React from 'react'; -import { offsetDistanceModifier } from '../../util/popperUtil'; -import { Tooltip, TooltipPlacement } from '../Tooltip'; +import { offsetDistanceModifier } from '../../util/popperUtil.js'; +import { Tooltip, TooltipPlacement } from '../Tooltip.js'; -import type { LocalizerType } from '../../types/I18N'; +import type { LocalizerType } from '../../types/I18N.js'; type Props = { i18n: LocalizerType; diff --git a/ts/components/conversation/EmbeddedContact.tsx b/ts/components/conversation/EmbeddedContact.tsx index 5c2715a4d8b..69d3f7c2107 100644 --- a/ts/components/conversation/EmbeddedContact.tsx +++ b/ts/components/conversation/EmbeddedContact.tsx @@ -5,14 +5,14 @@ import React from 'react'; import classNames from 'classnames'; import type { ReadonlyDeep } from 'type-fest'; -import type { EmbeddedContactForUIType } from '../../types/EmbeddedContact'; +import type { EmbeddedContactForUIType } from '../../types/EmbeddedContact.js'; -import type { LocalizerType } from '../../types/Util'; +import type { LocalizerType } from '../../types/Util.js'; import { renderAvatar, renderContactShorthand, renderName, -} from './contactUtil'; +} from './contactUtil.js'; export type Props = { contact: ReadonlyDeep; diff --git a/ts/components/conversation/Emojify.stories.tsx b/ts/components/conversation/Emojify.stories.tsx index 82a0bc4716e..7a4d28d0aec 100644 --- a/ts/components/conversation/Emojify.stories.tsx +++ b/ts/components/conversation/Emojify.stories.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { Props } from './Emojify'; -import { Emojify } from './Emojify'; +import type { Props } from './Emojify.js'; +import { Emojify } from './Emojify.js'; export default { title: 'Components/Conversation/Emojify', diff --git a/ts/components/conversation/Emojify.tsx b/ts/components/conversation/Emojify.tsx index aa9c3f74c56..25a30972751 100644 --- a/ts/components/conversation/Emojify.tsx +++ b/ts/components/conversation/Emojify.tsx @@ -1,18 +1,18 @@ // Copyright 2018 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import type { RenderTextCallbackType } from '../../types/Util'; -import { splitByEmoji } from '../../util/emoji'; -import { missingCaseError } from '../../util/missingCaseError'; -import { FunInlineEmoji } from '../fun/FunEmoji'; +import type { RenderTextCallbackType } from '../../types/Util.js'; +import { splitByEmoji } from '../../util/emoji.js'; +import { missingCaseError } from '../../util/missingCaseError.js'; +import { FunInlineEmoji } from '../fun/FunEmoji.js'; import { getEmojiVariantByKey, getEmojiVariantKeyByValue, isEmojiVariantValue, isEmojiVariantValueNonQualified, -} from '../fun/data/emojis'; -import { createLogger } from '../../logging/log'; -import { useFunEmojiLocalizer } from '../fun/useFunEmojiLocalizer'; +} from '../fun/data/emojis.js'; +import { createLogger } from '../../logging/log.js'; +import { useFunEmojiLocalizer } from '../fun/useFunEmojiLocalizer.js'; const log = createLogger('Emojify'); diff --git a/ts/components/conversation/ErrorBoundary.stories.tsx b/ts/components/conversation/ErrorBoundary.stories.tsx index 9f2b59d1e23..2f466bb0b5b 100644 --- a/ts/components/conversation/ErrorBoundary.stories.tsx +++ b/ts/components/conversation/ErrorBoundary.stories.tsx @@ -4,8 +4,8 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './ErrorBoundary'; -import { ErrorBoundary } from './ErrorBoundary'; +import type { Props } from './ErrorBoundary.js'; +import { ErrorBoundary } from './ErrorBoundary.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/ErrorBoundary.tsx b/ts/components/conversation/ErrorBoundary.tsx index 122cd38c1ef..016602be0dd 100644 --- a/ts/components/conversation/ErrorBoundary.tsx +++ b/ts/components/conversation/ErrorBoundary.tsx @@ -4,9 +4,9 @@ import type { ReactNode } from 'react'; import React from 'react'; -import type { LocalizerType } from '../../types/Util'; -import * as Errors from '../../types/errors'; -import { createLogger } from '../../logging/log'; +import type { LocalizerType } from '../../types/Util.js'; +import * as Errors from '../../types/errors.js'; +import { createLogger } from '../../logging/log.js'; const log = createLogger('ErrorBoundary'); diff --git a/ts/components/conversation/ExpireTimer.stories.tsx b/ts/components/conversation/ExpireTimer.stories.tsx index ecff5453b66..7bdb16231a4 100644 --- a/ts/components/conversation/ExpireTimer.stories.tsx +++ b/ts/components/conversation/ExpireTimer.stories.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { Props } from './ExpireTimer'; -import { ExpireTimer } from './ExpireTimer'; +import type { Props } from './ExpireTimer.js'; +import { ExpireTimer } from './ExpireTimer.js'; export default { title: 'Components/Conversation/ExpireTimer', diff --git a/ts/components/conversation/ExpireTimer.tsx b/ts/components/conversation/ExpireTimer.tsx index 7252c3c9f97..f0971e4781c 100644 --- a/ts/components/conversation/ExpireTimer.tsx +++ b/ts/components/conversation/ExpireTimer.tsx @@ -4,7 +4,7 @@ import React, { useEffect, useReducer } from 'react'; import classNames from 'classnames'; -import { getIncrement, getTimerBucket } from '../../util/timer'; +import { getIncrement, getTimerBucket } from '../../util/timer.js'; export type Props = { direction?: 'incoming' | 'outgoing'; diff --git a/ts/components/conversation/GIF.tsx b/ts/components/conversation/GIF.tsx index 2361c560f2c..25d97c3621f 100644 --- a/ts/components/conversation/GIF.tsx +++ b/ts/components/conversation/GIF.tsx @@ -5,22 +5,22 @@ import React, { useCallback, useEffect, useRef, useState } from 'react'; import classNames from 'classnames'; import { Blurhash } from 'react-blurhash'; -import type { LocalizerType, ThemeType } from '../../types/Util'; +import type { LocalizerType, ThemeType } from '../../types/Util.js'; -import type { AttachmentForUIType } from '../../types/Attachment'; +import type { AttachmentForUIType } from '../../types/Attachment.js'; import { hasNotResolved, getImageDimensionsForTimeline, defaultBlurHash, isDownloadable, -} from '../../types/Attachment'; -import * as Errors from '../../types/errors'; -import { createLogger } from '../../logging/log'; -import { useReducedMotion } from '../../hooks/useReducedMotion'; -import { AttachmentDetailPill } from './AttachmentDetailPill'; -import { getSpinner } from './Image'; -import { useUndownloadableMediaHandler } from '../../hooks/useUndownloadableMediaHandler'; -import { isAbortError } from '../../util/isAbortError'; +} from '../../types/Attachment.js'; +import * as Errors from '../../types/errors.js'; +import { createLogger } from '../../logging/log.js'; +import { useReducedMotion } from '../../hooks/useReducedMotion.js'; +import { AttachmentDetailPill } from './AttachmentDetailPill.js'; +import { getSpinner } from './Image.js'; +import { useUndownloadableMediaHandler } from '../../hooks/useUndownloadableMediaHandler.js'; +import { isAbortError } from '../../util/isAbortError.js'; const log = createLogger('GIF'); diff --git a/ts/components/conversation/GroupDescription.stories.tsx b/ts/components/conversation/GroupDescription.stories.tsx index 7c3a0465c65..550bcc762c9 100644 --- a/ts/components/conversation/GroupDescription.stories.tsx +++ b/ts/components/conversation/GroupDescription.stories.tsx @@ -3,8 +3,8 @@ import React from 'react'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './GroupDescription'; -import { GroupDescription } from './GroupDescription'; +import type { PropsType } from './GroupDescription.js'; +import { GroupDescription } from './GroupDescription.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/GroupDescription.tsx b/ts/components/conversation/GroupDescription.tsx index b7c0de81b9b..90f6e96b792 100644 --- a/ts/components/conversation/GroupDescription.tsx +++ b/ts/components/conversation/GroupDescription.tsx @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { useEffect, useRef, useState } from 'react'; -import { Modal } from '../Modal'; -import type { LocalizerType } from '../../types/Util'; -import { GroupDescriptionText } from '../GroupDescriptionText'; +import { Modal } from '../Modal.js'; +import type { LocalizerType } from '../../types/Util.js'; +import { GroupDescriptionText } from '../GroupDescriptionText.js'; // Emojification can cause the scroll height to be *slightly* larger than the client // height, so we add a little wiggle room. diff --git a/ts/components/conversation/GroupNotification.stories.tsx b/ts/components/conversation/GroupNotification.stories.tsx index 23b0979fb95..c85c66faffd 100644 --- a/ts/components/conversation/GroupNotification.stories.tsx +++ b/ts/components/conversation/GroupNotification.stories.tsx @@ -3,9 +3,9 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { Props } from './GroupNotification'; -import { GroupNotification } from './GroupNotification'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation'; +import type { Props } from './GroupNotification.js'; +import { GroupNotification } from './GroupNotification.js'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; export default { title: 'Components/Conversation', diff --git a/ts/components/conversation/GroupNotification.tsx b/ts/components/conversation/GroupNotification.tsx index 7e25f6bf041..7acef32e428 100644 --- a/ts/components/conversation/GroupNotification.tsx +++ b/ts/components/conversation/GroupNotification.tsx @@ -5,13 +5,13 @@ import type { ReactNode } from 'react'; import React from 'react'; import { compact, flatten } from 'lodash'; -import { ContactName } from './ContactName'; -import { SystemMessage } from './SystemMessage'; -import { I18n } from '../I18n'; -import type { LocalizerType } from '../../types/Util'; +import { ContactName } from './ContactName.js'; +import { SystemMessage } from './SystemMessage.js'; +import { I18n } from '../I18n.js'; +import type { LocalizerType } from '../../types/Util.js'; -import { missingCaseError } from '../../util/missingCaseError'; -import type { ConversationType } from '../../state/ducks/conversations'; +import { missingCaseError } from '../../util/missingCaseError.js'; +import type { ConversationType } from '../../state/ducks/conversations.js'; export type ChangeType = 'add' | 'remove' | 'name' | 'avatar' | 'general'; diff --git a/ts/components/conversation/GroupV1DisabledActions.stories.tsx b/ts/components/conversation/GroupV1DisabledActions.stories.tsx index 60c8677632a..9e4cae3b90f 100644 --- a/ts/components/conversation/GroupV1DisabledActions.stories.tsx +++ b/ts/components/conversation/GroupV1DisabledActions.stories.tsx @@ -4,8 +4,8 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType as GroupV1DisabledActionsPropsType } from './GroupV1DisabledActions'; -import { GroupV1DisabledActions } from './GroupV1DisabledActions'; +import type { PropsType as GroupV1DisabledActionsPropsType } from './GroupV1DisabledActions.js'; +import { GroupV1DisabledActions } from './GroupV1DisabledActions.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/GroupV1DisabledActions.tsx b/ts/components/conversation/GroupV1DisabledActions.tsx index 19f73aec843..c95b856f56e 100644 --- a/ts/components/conversation/GroupV1DisabledActions.tsx +++ b/ts/components/conversation/GroupV1DisabledActions.tsx @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import * as React from 'react'; -import { I18n } from '../I18n'; -import type { LocalizerType } from '../../types/Util'; +import { I18n } from '../I18n.js'; +import type { LocalizerType } from '../../types/Util.js'; export type PropsType = { conversationId: string; diff --git a/ts/components/conversation/GroupV1Migration.stories.tsx b/ts/components/conversation/GroupV1Migration.stories.tsx index 21e85c19c58..4961f6e9ff5 100644 --- a/ts/components/conversation/GroupV1Migration.stories.tsx +++ b/ts/components/conversation/GroupV1Migration.stories.tsx @@ -3,10 +3,10 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation'; -import type { PropsType } from './GroupV1Migration'; -import { GroupV1Migration } from './GroupV1Migration'; -import { ThemeType } from '../../types/Util'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; +import type { PropsType } from './GroupV1Migration.js'; +import { GroupV1Migration } from './GroupV1Migration.js'; +import { ThemeType } from '../../types/Util.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/GroupV1Migration.tsx b/ts/components/conversation/GroupV1Migration.tsx index 04c2249b28c..a21caf9a04b 100644 --- a/ts/components/conversation/GroupV1Migration.tsx +++ b/ts/components/conversation/GroupV1Migration.tsx @@ -3,15 +3,15 @@ import * as React from 'react'; -import { Button, ButtonSize, ButtonVariant } from '../Button'; -import { SystemMessage } from './SystemMessage'; -import type { LocalizerType, ThemeType } from '../../types/Util'; -import type { ConversationType } from '../../state/ducks/conversations'; -import type { PreferredBadgeSelectorType } from '../../state/selectors/badges'; -import { I18n } from '../I18n'; -import { ContactName } from './ContactName'; -import { GroupV1MigrationDialog } from '../GroupV1MigrationDialog'; -import { createLogger } from '../../logging/log'; +import { Button, ButtonSize, ButtonVariant } from '../Button.js'; +import { SystemMessage } from './SystemMessage.js'; +import type { LocalizerType, ThemeType } from '../../types/Util.js'; +import type { ConversationType } from '../../state/ducks/conversations.js'; +import type { PreferredBadgeSelectorType } from '../../state/selectors/badges.js'; +import { I18n } from '../I18n.js'; +import { ContactName } from './ContactName.js'; +import { GroupV1MigrationDialog } from '../GroupV1MigrationDialog.js'; +import { createLogger } from '../../logging/log.js'; const log = createLogger('GroupV1Migration'); diff --git a/ts/components/conversation/GroupV2Change.stories.tsx b/ts/components/conversation/GroupV2Change.stories.tsx index 8b4e666b46c..e4cdddeec50 100644 --- a/ts/components/conversation/GroupV2Change.stories.tsx +++ b/ts/components/conversation/GroupV2Change.stories.tsx @@ -4,13 +4,13 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { generateAci, generatePni } from '../../types/ServiceId'; -import type { ServiceIdString, AciString } from '../../types/ServiceId'; -import type { GroupV2ChangeType } from '../../groups'; -import { SignalService as Proto } from '../../protobuf'; -import type { SmartContactRendererType } from '../../groupChange'; -import type { PropsType } from './GroupV2Change'; -import { GroupV2Change } from './GroupV2Change'; +import { generateAci, generatePni } from '../../types/ServiceId.js'; +import type { ServiceIdString, AciString } from '../../types/ServiceId.js'; +import type { GroupV2ChangeType } from '../../groups.js'; +import { SignalService as Proto } from '../../protobuf/index.js'; +import type { SmartContactRendererType } from '../../groupChange.js'; +import type { PropsType } from './GroupV2Change.js'; +import { GroupV2Change } from './GroupV2Change.js'; // Note: this should be kept up to date with backup_groupv2_notifications_test.ts, to // maintain the comprehensive set of GroupV2 notifications we need to handle diff --git a/ts/components/conversation/GroupV2Change.tsx b/ts/components/conversation/GroupV2Change.tsx index 82c2f8fe1b5..20e61668e18 100644 --- a/ts/components/conversation/GroupV2Change.tsx +++ b/ts/components/conversation/GroupV2Change.tsx @@ -6,27 +6,30 @@ import React, { useState } from 'react'; import { get } from 'lodash'; import type { ReadonlyDeep } from 'type-fest'; -import { createLogger } from '../../logging/log'; -import { I18n } from '../I18n'; +import { createLogger } from '../../logging/log.js'; +import { I18n } from '../I18n.js'; import type { LocalizerType, ICUJSXMessageParamsByKeyType, -} from '../../types/Util'; +} from '../../types/Util.js'; import type { AciString, PniString, ServiceIdString, -} from '../../types/ServiceId'; -import { GroupDescriptionText } from '../GroupDescriptionText'; -import { Button, ButtonSize, ButtonVariant } from '../Button'; -import { SystemMessage } from './SystemMessage'; +} from '../../types/ServiceId.js'; +import { GroupDescriptionText } from '../GroupDescriptionText.js'; +import { Button, ButtonSize, ButtonVariant } from '../Button.js'; +import { SystemMessage } from './SystemMessage.js'; -import type { GroupV2ChangeType, GroupV2ChangeDetailType } from '../../groups'; +import type { + GroupV2ChangeType, + GroupV2ChangeDetailType, +} from '../../groups.js'; -import type { SmartContactRendererType } from '../../groupChange'; -import { renderChange } from '../../groupChange'; -import { Modal } from '../Modal'; -import { ConfirmationDialog } from '../ConfirmationDialog'; +import type { SmartContactRendererType } from '../../groupChange.js'; +import { renderChange } from '../../groupChange.js'; +import { Modal } from '../Modal.js'; +import { ConfirmationDialog } from '../ConfirmationDialog.js'; const log = createLogger('GroupV2Change'); diff --git a/ts/components/conversation/GroupV2PendingApprovalActions.stories.tsx b/ts/components/conversation/GroupV2PendingApprovalActions.stories.tsx index 3ad71ffe37e..3a116f8721d 100644 --- a/ts/components/conversation/GroupV2PendingApprovalActions.stories.tsx +++ b/ts/components/conversation/GroupV2PendingApprovalActions.stories.tsx @@ -4,8 +4,8 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType as GroupV2PendingApprovalActionsPropsType } from './GroupV2PendingApprovalActions'; -import { GroupV2PendingApprovalActions } from './GroupV2PendingApprovalActions'; +import type { PropsType as GroupV2PendingApprovalActionsPropsType } from './GroupV2PendingApprovalActions.js'; +import { GroupV2PendingApprovalActions } from './GroupV2PendingApprovalActions.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/GroupV2PendingApprovalActions.tsx b/ts/components/conversation/GroupV2PendingApprovalActions.tsx index ab5d9c6e154..15e286ae386 100644 --- a/ts/components/conversation/GroupV2PendingApprovalActions.tsx +++ b/ts/components/conversation/GroupV2PendingApprovalActions.tsx @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import * as React from 'react'; -import type { LocalizerType } from '../../types/Util'; -import { ConfirmationDialog } from '../ConfirmationDialog'; +import type { LocalizerType } from '../../types/Util.js'; +import { ConfirmationDialog } from '../ConfirmationDialog.js'; export type PropsType = { conversationId: string; diff --git a/ts/components/conversation/Image.stories.tsx b/ts/components/conversation/Image.stories.tsx index 6a49a4bac57..6ed6d78ed8f 100644 --- a/ts/components/conversation/Image.stories.tsx +++ b/ts/components/conversation/Image.stories.tsx @@ -4,14 +4,14 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { pngUrl } from '../../storybook/Fixtures'; -import type { Props } from './Image'; -import { CurveType, Image } from './Image'; -import { IMAGE_PNG } from '../../types/MIME'; -import type { ThemeType } from '../../types/Util'; -import { StorybookThemeContext } from '../../../.storybook/StorybookThemeContext'; +import { pngUrl } from '../../storybook/Fixtures.js'; +import type { Props } from './Image.js'; +import { CurveType, Image } from './Image.js'; +import { IMAGE_PNG } from '../../types/MIME.js'; +import type { ThemeType } from '../../types/Util.js'; +import { StorybookThemeContext } from '../../../.storybook/StorybookThemeContext.js'; -import { fakeAttachment } from '../../test-helpers/fakeAttachment'; +import { fakeAttachment } from '../../test-helpers/fakeAttachment.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/Image.tsx b/ts/components/conversation/Image.tsx index 6a3a3e54983..482e63eb2a4 100644 --- a/ts/components/conversation/Image.tsx +++ b/ts/components/conversation/Image.tsx @@ -5,16 +5,16 @@ import type { CSSProperties } from 'react'; import React, { useCallback } from 'react'; import classNames from 'classnames'; -import { ImageOrBlurhash } from '../ImageOrBlurhash'; -import type { LocalizerType, ThemeType } from '../../types/Util'; -import type { AttachmentForUIType } from '../../types/Attachment'; +import { ImageOrBlurhash } from '../ImageOrBlurhash.js'; +import type { LocalizerType, ThemeType } from '../../types/Util.js'; +import type { AttachmentForUIType } from '../../types/Attachment.js'; import { defaultBlurHash, isIncremental, isReadyToView, -} from '../../types/Attachment'; -import { SpinnerV2 } from '../SpinnerV2'; -import { useUndownloadableMediaHandler } from '../../hooks/useUndownloadableMediaHandler'; +} from '../../types/Attachment.js'; +import { SpinnerV2 } from '../SpinnerV2.js'; +import { useUndownloadableMediaHandler } from '../../hooks/useUndownloadableMediaHandler.js'; export enum CurveType { None = 0, diff --git a/ts/components/conversation/ImageGrid.stories.tsx b/ts/components/conversation/ImageGrid.stories.tsx index 0db0181e489..4f2ac04f7d5 100644 --- a/ts/components/conversation/ImageGrid.stories.tsx +++ b/ts/components/conversation/ImageGrid.stories.tsx @@ -4,8 +4,8 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './ImageGrid'; -import { ImageGrid } from './ImageGrid'; +import type { Props } from './ImageGrid.js'; +import { ImageGrid } from './ImageGrid.js'; import { AUDIO_MP3, IMAGE_JPEG, @@ -13,23 +13,18 @@ import { IMAGE_WEBP, VIDEO_MP4, stringToMIMEType, -} from '../../types/MIME'; -import { pngUrl, squareStickerUrl } from '../../storybook/Fixtures'; -import { fakeAttachment } from '../../test-helpers/fakeAttachment'; -import { strictAssert } from '../../util/assert'; -import { isDownloadable } from '../../types/Attachment'; -import { toBase64 } from '../../Bytes'; -import { DIGEST_LENGTH, KEY_SET_LENGTH } from '../../types/Crypto'; +} from '../../types/MIME.js'; +import { pngUrl, squareStickerUrl } from '../../storybook/Fixtures.js'; +import { fakeAttachment } from '../../test-helpers/fakeAttachment.js'; +import { strictAssert } from '../../util/assert.js'; +import { isDownloadable } from '../../types/Attachment.js'; const { i18n } = window.SignalContext; -const getRandomBytes = (length: number): Uint8Array => { - const arr = new Uint8Array(length); - return window.crypto.getRandomValues(arr); -}; - -const MOCK_KEY = toBase64(getRandomBytes(KEY_SET_LENGTH)); -const MOCK_DIGEST = toBase64(getRandomBytes(DIGEST_LENGTH)); +const MOCK_KEY = + '+R9hNIYmxBakQ3jMe/sdIXkDKQewidDcgLp2Q74Y1gyxU/hPA2Kyz8oHtc40Gtd3' + + 'Bp8hPOIS4/V5W/XkIl/bIg=='; +const MOCK_DIGEST = 'HvbPFfuq1WNQEbSBVI310b2WKJGtI5/Ih1kdOBJC7vU='; export default { title: 'Components/Conversation/ImageGrid', diff --git a/ts/components/conversation/ImageGrid.tsx b/ts/components/conversation/ImageGrid.tsx index 3e90f4352ee..e03d26857cc 100644 --- a/ts/components/conversation/ImageGrid.tsx +++ b/ts/components/conversation/ImageGrid.tsx @@ -7,7 +7,7 @@ import classNames from 'classnames'; import type { AttachmentForUIType, AttachmentType, -} from '../../types/Attachment'; +} from '../../types/Attachment.js'; import { areAllAttachmentsVisual, getAlt, @@ -17,12 +17,12 @@ import { isDownloadable, isIncremental, isVideoAttachment, -} from '../../types/Attachment'; +} from '../../types/Attachment.js'; -import { Image, CurveType } from './Image'; +import { Image, CurveType } from './Image.js'; -import type { LocalizerType, ThemeType } from '../../types/Util'; -import { AttachmentDetailPill } from './AttachmentDetailPill'; +import type { LocalizerType, ThemeType } from '../../types/Util.js'; +import { AttachmentDetailPill } from './AttachmentDetailPill.js'; export type DirectionType = 'incoming' | 'outgoing'; diff --git a/ts/components/conversation/InAnotherCallTooltip.tsx b/ts/components/conversation/InAnotherCallTooltip.tsx index ac24ba8cb82..5df138d9ca7 100644 --- a/ts/components/conversation/InAnotherCallTooltip.tsx +++ b/ts/components/conversation/InAnotherCallTooltip.tsx @@ -3,10 +3,10 @@ import React from 'react'; -import { offsetDistanceModifier } from '../../util/popperUtil'; -import { Tooltip, TooltipPlacement } from '../Tooltip'; +import { offsetDistanceModifier } from '../../util/popperUtil.js'; +import { Tooltip, TooltipPlacement } from '../Tooltip.js'; -import type { LocalizerType } from '../../types/I18N'; +import type { LocalizerType } from '../../types/I18N.js'; type Props = { i18n: LocalizerType; diff --git a/ts/components/conversation/InlineNotificationWrapper.tsx b/ts/components/conversation/InlineNotificationWrapper.tsx index 2b8f827735c..977b6773e9e 100644 --- a/ts/components/conversation/InlineNotificationWrapper.tsx +++ b/ts/components/conversation/InlineNotificationWrapper.tsx @@ -3,7 +3,7 @@ import type { ReactNode } from 'react'; import React, { useCallback, useEffect, useRef } from 'react'; -import { getInteractionMode } from '../../services/InteractionMode'; +import { getInteractionMode } from '../../services/InteractionMode.js'; type PropsType = { id: string; diff --git a/ts/components/conversation/JoinedSignalNotification.stories.tsx b/ts/components/conversation/JoinedSignalNotification.stories.tsx index 51fba3e8d89..c6fcb54afe1 100644 --- a/ts/components/conversation/JoinedSignalNotification.stories.tsx +++ b/ts/components/conversation/JoinedSignalNotification.stories.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { Props } from './JoinedSignalNotification'; -import { JoinedSignalNotification } from './JoinedSignalNotification'; +import type { Props } from './JoinedSignalNotification.js'; +import { JoinedSignalNotification } from './JoinedSignalNotification.js'; export default { title: 'Components/Conversation/JoinedSignalNotification', diff --git a/ts/components/conversation/JoinedSignalNotification.tsx b/ts/components/conversation/JoinedSignalNotification.tsx index 198eecb68a0..42a354041b1 100644 --- a/ts/components/conversation/JoinedSignalNotification.tsx +++ b/ts/components/conversation/JoinedSignalNotification.tsx @@ -3,11 +3,11 @@ import React from 'react'; -import type { LocalizerType } from '../../types/Util'; -import { I18n } from '../I18n'; +import type { LocalizerType } from '../../types/Util.js'; +import { I18n } from '../I18n.js'; -import { SystemMessage } from './SystemMessage'; -import { MessageTimestamp } from './MessageTimestamp'; +import { SystemMessage } from './SystemMessage.js'; +import { MessageTimestamp } from './MessageTimestamp.js'; export type PropsData = { timestamp: number; diff --git a/ts/components/conversation/LastSeenIndicator.stories.tsx b/ts/components/conversation/LastSeenIndicator.stories.tsx index 87006783d2e..77fb39691b2 100644 --- a/ts/components/conversation/LastSeenIndicator.stories.tsx +++ b/ts/components/conversation/LastSeenIndicator.stories.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { Props } from './LastSeenIndicator'; -import { LastSeenIndicator } from './LastSeenIndicator'; +import type { Props } from './LastSeenIndicator.js'; +import { LastSeenIndicator } from './LastSeenIndicator.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/LastSeenIndicator.tsx b/ts/components/conversation/LastSeenIndicator.tsx index 14918d5d5d6..e21b302c71a 100644 --- a/ts/components/conversation/LastSeenIndicator.tsx +++ b/ts/components/conversation/LastSeenIndicator.tsx @@ -3,7 +3,7 @@ import React, { forwardRef } from 'react'; -import type { LocalizerType } from '../../types/Util'; +import type { LocalizerType } from '../../types/Util.js'; export type Props = { count: number; diff --git a/ts/components/conversation/LinkPreviewDate.tsx b/ts/components/conversation/LinkPreviewDate.tsx index 90c11a8733d..5f04a448466 100644 --- a/ts/components/conversation/LinkPreviewDate.tsx +++ b/ts/components/conversation/LinkPreviewDate.tsx @@ -4,7 +4,7 @@ import * as React from 'react'; import type { Moment } from 'moment'; import moment from 'moment'; -import { isLinkPreviewDateValid } from '../../linkPreviews/isLinkPreviewDateValid'; +import { isLinkPreviewDateValid } from '../../linkPreviews/isLinkPreviewDateValid.js'; type Props = { date?: null | number; diff --git a/ts/components/conversation/Linkify.stories.tsx b/ts/components/conversation/Linkify.stories.tsx index 46b7eae8a85..40669cfb543 100644 --- a/ts/components/conversation/Linkify.stories.tsx +++ b/ts/components/conversation/Linkify.stories.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { Props } from './Linkify'; -import { Linkify } from './Linkify'; +import type { Props } from './Linkify.js'; +import { Linkify } from './Linkify.js'; export default { title: 'Components/Conversation/Linkify', diff --git a/ts/components/conversation/Linkify.tsx b/ts/components/conversation/Linkify.tsx index 78f1c7d12ef..d46f49b298f 100644 --- a/ts/components/conversation/Linkify.tsx +++ b/ts/components/conversation/Linkify.tsx @@ -5,10 +5,10 @@ import React from 'react'; import LinkifyIt from 'linkify-it'; -import type { RenderTextCallbackType } from '../../types/Util'; -import { isLinkSneaky, shouldLinkifyMessage } from '../../types/LinkPreview'; -import { splitByEmoji } from '../../util/emoji'; -import { missingCaseError } from '../../util/missingCaseError'; +import type { RenderTextCallbackType } from '../../types/Util.js'; +import { isLinkSneaky, shouldLinkifyMessage } from '../../types/LinkPreview.js'; +import { splitByEmoji } from '../../util/emoji.js'; +import { missingCaseError } from '../../util/missingCaseError.js'; export const linkify = new LinkifyIt() // This is all TLDs in place in 2010, according to [IANA's root zone database][0] diff --git a/ts/components/conversation/MandatoryProfileSharingActions.stories.tsx b/ts/components/conversation/MandatoryProfileSharingActions.stories.tsx index 619e3d4bdf2..e7e5f43bdc8 100644 --- a/ts/components/conversation/MandatoryProfileSharingActions.stories.tsx +++ b/ts/components/conversation/MandatoryProfileSharingActions.stories.tsx @@ -4,12 +4,12 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './MandatoryProfileSharingActions'; -import { MandatoryProfileSharingActions } from './MandatoryProfileSharingActions'; +import type { Props } from './MandatoryProfileSharingActions.js'; +import { MandatoryProfileSharingActions } from './MandatoryProfileSharingActions.js'; import { getDefaultConversation, getDefaultGroup, -} from '../../test-helpers/getDefaultConversation'; +} from '../../test-helpers/getDefaultConversation.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/MandatoryProfileSharingActions.tsx b/ts/components/conversation/MandatoryProfileSharingActions.tsx index f258d54ae4e..ac3f402dbd0 100644 --- a/ts/components/conversation/MandatoryProfileSharingActions.tsx +++ b/ts/components/conversation/MandatoryProfileSharingActions.tsx @@ -2,15 +2,15 @@ // SPDX-License-Identifier: AGPL-3.0-only import * as React from 'react'; -import { ContactName } from './ContactName'; -import { Button, ButtonVariant } from '../Button'; -import type { MessageRequestActionsConfirmationProps } from './MessageRequestActionsConfirmation'; +import { ContactName } from './ContactName.js'; +import { Button, ButtonVariant } from '../Button.js'; +import type { MessageRequestActionsConfirmationProps } from './MessageRequestActionsConfirmation.js'; import { MessageRequestActionsConfirmation, MessageRequestState, -} from './MessageRequestActionsConfirmation'; -import { I18n } from '../I18n'; -import type { LocalizerType } from '../../types/Util'; +} from './MessageRequestActionsConfirmation.js'; +import { I18n } from '../I18n.js'; +import type { LocalizerType } from '../../types/Util.js'; export type Props = { i18n: LocalizerType; diff --git a/ts/components/conversation/Message.tsx b/ts/components/conversation/Message.tsx index 2b93e1d73a6..fa15822d9c9 100644 --- a/ts/components/conversation/Message.tsx +++ b/ts/components/conversation/Message.tsx @@ -25,37 +25,37 @@ import type { SaveAttachmentActionCreatorType, SaveAttachmentsActionCreatorType, ShowConversationType, -} from '../../state/ducks/conversations'; -import type { ViewStoryActionCreatorType } from '../../state/ducks/stories'; -import { ReadStatus } from '../../messages/MessageReadStatus'; -import { Avatar, AvatarSize } from '../Avatar'; -import { AvatarSpacer } from '../AvatarSpacer'; -import { MessageBodyReadMore } from './MessageBodyReadMore'; -import { MessageMetadata } from './MessageMetadata'; -import { MessageTextMetadataSpacer } from './MessageTextMetadataSpacer'; -import { ImageGrid } from './ImageGrid'; -import { GIF } from './GIF'; -import { CurveType, Image } from './Image'; -import { ContactName } from './ContactName'; -import type { QuotedAttachmentForUIType } from './Quote'; -import { Quote } from './Quote'; -import { EmbeddedContact } from './EmbeddedContact'; +} from '../../state/ducks/conversations.js'; +import type { ViewStoryActionCreatorType } from '../../state/ducks/stories.js'; +import { ReadStatus } from '../../messages/MessageReadStatus.js'; +import { Avatar, AvatarSize } from '../Avatar.js'; +import { AvatarSpacer } from '../AvatarSpacer.js'; +import { MessageBodyReadMore } from './MessageBodyReadMore.js'; +import { MessageMetadata } from './MessageMetadata.js'; +import { MessageTextMetadataSpacer } from './MessageTextMetadataSpacer.js'; +import { ImageGrid } from './ImageGrid.js'; +import { GIF } from './GIF.js'; +import { CurveType, Image } from './Image.js'; +import { ContactName } from './ContactName.js'; +import type { QuotedAttachmentForUIType } from './Quote.js'; +import { Quote } from './Quote.js'; +import { EmbeddedContact } from './EmbeddedContact.js'; import type { OwnProps as ReactionViewerProps, Reaction, -} from './ReactionViewer'; -import { ReactionViewer } from './ReactionViewer'; -import { LinkPreviewDate } from './LinkPreviewDate'; -import type { LinkPreviewForUIType } from '../../types/message/LinkPreviews'; -import { shouldUseFullSizeLinkPreviewImage } from '../../linkPreviews/shouldUseFullSizeLinkPreviewImage'; -import type { WidthBreakpoint } from '../_util'; -import { OutgoingGiftBadgeModal } from '../OutgoingGiftBadgeModal'; -import { createLogger } from '../../logging/log'; -import { StoryViewModeType } from '../../types/Stories'; +} from './ReactionViewer.js'; +import { ReactionViewer } from './ReactionViewer.js'; +import { LinkPreviewDate } from './LinkPreviewDate.js'; +import type { LinkPreviewForUIType } from '../../types/message/LinkPreviews.js'; +import { shouldUseFullSizeLinkPreviewImage } from '../../linkPreviews/shouldUseFullSizeLinkPreviewImage.js'; +import type { WidthBreakpoint } from '../_util.js'; +import { OutgoingGiftBadgeModal } from '../OutgoingGiftBadgeModal.js'; +import { createLogger } from '../../logging/log.js'; +import { StoryViewModeType } from '../../types/Stories.js'; import type { AttachmentForUIType, AttachmentType, -} from '../../types/Attachment'; +} from '../../types/Attachment.js'; import { canDisplayImage, getGridDimensions, @@ -70,45 +70,45 @@ import { isImageAttachment, isPlayed, isVideo, -} from '../../types/Attachment'; -import type { EmbeddedContactForUIType } from '../../types/EmbeddedContact'; +} from '../../types/Attachment.js'; +import type { EmbeddedContactForUIType } from '../../types/EmbeddedContact.js'; -import { getIncrement } from '../../util/timer'; -import { clearTimeoutIfNecessary } from '../../util/clearTimeoutIfNecessary'; -import { missingCaseError } from '../../util/missingCaseError'; -import type { HydratedBodyRangesType } from '../../types/BodyRange'; -import type { LocalizerType, ThemeType } from '../../types/Util'; +import { getIncrement } from '../../util/timer.js'; +import { clearTimeoutIfNecessary } from '../../util/clearTimeoutIfNecessary.js'; +import { missingCaseError } from '../../util/missingCaseError.js'; +import type { HydratedBodyRangesType } from '../../types/BodyRange.js'; +import type { LocalizerType, ThemeType } from '../../types/Util.js'; -import type { PreferredBadgeSelectorType } from '../../state/selectors/badges'; +import type { PreferredBadgeSelectorType } from '../../state/selectors/badges.js'; import type { ContactNameColorType, ConversationColorType, CustomColorType, -} from '../../types/Colors'; -import { createRefMerger } from '../../util/refMerger'; -import { getCustomColorStyle } from '../../util/getCustomColorStyle'; -import type { ServiceIdString } from '../../types/ServiceId'; -import { DAY, HOUR, MINUTE, SECOND } from '../../util/durations'; -import { BadgeImageTheme } from '../../badges/BadgeImageTheme'; -import { getBadgeImageFileLocalPath } from '../../badges/getBadgeImageFileLocalPath'; -import { handleOutsideClick } from '../../util/handleOutsideClick'; -import { isPaymentNotificationEvent } from '../../types/Payment'; -import type { AnyPaymentEvent } from '../../types/Payment'; -import { getPaymentEventDescription } from '../../messages/helpers'; -import { PanelType } from '../../types/Panels'; -import { openLinkInWebBrowser } from '../../util/openLinkInWebBrowser'; -import { RenderLocation } from './MessageTextRenderer'; -import { UserText } from '../UserText'; -import { getColorForCallLink } from '../../util/getColorForCallLink'; -import { getKeyFromCallLink } from '../../util/callLinks'; -import { InAnotherCallTooltip } from './InAnotherCallTooltip'; -import { formatFileSize } from '../../util/formatFileSize'; -import { assertDev, strictAssert } from '../../util/assert'; -import { AttachmentStatusIcon } from './AttachmentStatusIcon'; -import { TapToViewNotAvailableType } from '../TapToViewNotAvailableModal'; -import type { DataPropsType as TapToViewNotAvailablePropsType } from '../TapToViewNotAvailableModal'; -import { FileThumbnail } from '../FileThumbnail'; -import { FunStaticEmoji } from '../fun/FunEmoji'; +} from '../../types/Colors.js'; +import { createRefMerger } from '../../util/refMerger.js'; +import { getCustomColorStyle } from '../../util/getCustomColorStyle.js'; +import type { ServiceIdString } from '../../types/ServiceId.js'; +import { DAY, HOUR, MINUTE, SECOND } from '../../util/durations/index.js'; +import { BadgeImageTheme } from '../../badges/BadgeImageTheme.js'; +import { getBadgeImageFileLocalPath } from '../../badges/getBadgeImageFileLocalPath.js'; +import { handleOutsideClick } from '../../util/handleOutsideClick.js'; +import { isPaymentNotificationEvent } from '../../types/Payment.js'; +import type { AnyPaymentEvent } from '../../types/Payment.js'; +import { getPaymentEventDescription } from '../../messages/helpers.js'; +import { PanelType } from '../../types/Panels.js'; +import { openLinkInWebBrowser } from '../../util/openLinkInWebBrowser.js'; +import { RenderLocation } from './MessageTextRenderer.js'; +import { UserText } from '../UserText.js'; +import { getColorForCallLink } from '../../util/getColorForCallLink.js'; +import { getKeyFromCallLink } from '../../util/callLinks.js'; +import { InAnotherCallTooltip } from './InAnotherCallTooltip.js'; +import { formatFileSize } from '../../util/formatFileSize.js'; +import { assertDev, strictAssert } from '../../util/assert.js'; +import { AttachmentStatusIcon } from './AttachmentStatusIcon.js'; +import { TapToViewNotAvailableType } from '../TapToViewNotAvailableModal.js'; +import type { DataPropsType as TapToViewNotAvailablePropsType } from '../TapToViewNotAvailableModal.js'; +import { FileThumbnail } from '../FileThumbnail.js'; +import { FunStaticEmoji } from '../fun/FunEmoji.js'; import { type EmojifyData, getEmojifyData, @@ -117,8 +117,8 @@ import { getEmojiVariantByKey, getEmojiVariantKeyByValue, isEmojiVariantValue, -} from '../fun/data/emojis'; -import { useGroupedAndOrderedReactions } from '../../util/groupAndOrderReactions'; +} from '../fun/data/emojis.js'; +import { useGroupedAndOrderedReactions } from '../../util/groupAndOrderReactions.js'; const log = createLogger('Message'); diff --git a/ts/components/conversation/MessageAudio.tsx b/ts/components/conversation/MessageAudio.tsx index 59a1b9f0e69..0091dbe8518 100644 --- a/ts/components/conversation/MessageAudio.tsx +++ b/ts/components/conversation/MessageAudio.tsx @@ -7,23 +7,23 @@ import classNames from 'classnames'; import { noop } from 'lodash'; import { animated, useSpring } from '@react-spring/web'; -import type { LocalizerType } from '../../types/Util'; -import type { AttachmentForUIType } from '../../types/Attachment'; -import type { PushPanelForConversationActionType } from '../../state/ducks/conversations'; -import { isDownloaded } from '../../types/Attachment'; -import type { DirectionType, MessageStatusType } from './Message'; +import type { LocalizerType } from '../../types/Util.js'; +import type { AttachmentForUIType } from '../../types/Attachment.js'; +import type { PushPanelForConversationActionType } from '../../state/ducks/conversations.js'; +import { isDownloaded } from '../../types/Attachment.js'; +import type { DirectionType, MessageStatusType } from './Message.js'; -import type { ComputePeaksResult } from '../VoiceNotesPlaybackContext'; -import { MessageMetadata } from './MessageMetadata'; -import { createLogger } from '../../logging/log'; -import type { ActiveAudioPlayerStateType } from '../../state/ducks/audioPlayer'; -import { PlaybackRateButton } from '../PlaybackRateButton'; -import { PlaybackButton } from '../PlaybackButton'; -import { WaveformScrubber } from './WaveformScrubber'; -import { useComputePeaks } from '../../hooks/useComputePeaks'; -import { durationToPlaybackText } from '../../util/durationToPlaybackText'; -import { shouldNeverBeCalled } from '../../util/shouldNeverBeCalled'; -import { formatFileSize } from '../../util/formatFileSize'; +import type { ComputePeaksResult } from '../VoiceNotesPlaybackContext.js'; +import { MessageMetadata } from './MessageMetadata.js'; +import { createLogger } from '../../logging/log.js'; +import type { ActiveAudioPlayerStateType } from '../../state/ducks/audioPlayer.js'; +import { PlaybackRateButton } from '../PlaybackRateButton.js'; +import { PlaybackButton } from '../PlaybackButton.js'; +import { WaveformScrubber } from './WaveformScrubber.js'; +import { useComputePeaks } from '../../hooks/useComputePeaks.js'; +import { durationToPlaybackText } from '../../util/durationToPlaybackText.js'; +import { shouldNeverBeCalled } from '../../util/shouldNeverBeCalled.js'; +import { formatFileSize } from '../../util/formatFileSize.js'; const log = createLogger('MessageAudio'); diff --git a/ts/components/conversation/MessageBody.stories.tsx b/ts/components/conversation/MessageBody.stories.tsx index 90f27527398..8bc0e3b433b 100644 --- a/ts/components/conversation/MessageBody.stories.tsx +++ b/ts/components/conversation/MessageBody.stories.tsx @@ -4,11 +4,11 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './MessageBody'; -import { MessageBody } from './MessageBody'; -import { BodyRange } from '../../types/BodyRange'; -import { generateAci } from '../../types/ServiceId'; -import { RenderLocation } from './MessageTextRenderer'; +import type { Props } from './MessageBody.js'; +import { MessageBody } from './MessageBody.js'; +import { BodyRange } from '../../types/BodyRange.js'; +import { generateAci } from '../../types/ServiceId.js'; +import { RenderLocation } from './MessageTextRenderer.js'; const SERVICE_ID_1 = generateAci(); const SERVICE_ID_2 = generateAci(); diff --git a/ts/components/conversation/MessageBody.tsx b/ts/components/conversation/MessageBody.tsx index 007549fab16..d8cd971dc62 100644 --- a/ts/components/conversation/MessageBody.tsx +++ b/ts/components/conversation/MessageBody.tsx @@ -3,17 +3,17 @@ import type { KeyboardEvent } from 'react'; import React from 'react'; -import type { AttachmentType } from '../../types/Attachment'; -import { canBeDownloaded, isDownloaded } from '../../types/Attachment'; -import type { ShowConversationType } from '../../state/ducks/conversations'; -import type { HydratedBodyRangesType } from '../../types/BodyRange'; -import type { LocalizerType } from '../../types/Util'; -import { MessageTextRenderer } from './MessageTextRenderer'; -import type { RenderLocation } from './MessageTextRenderer'; -import { UserText } from '../UserText'; -import { shouldLinkifyMessage } from '../../types/LinkPreview'; -import { FunJumboEmojiSize } from '../fun/FunEmoji'; -import { getEmojifyData } from '../fun/data/emojis'; +import type { AttachmentType } from '../../types/Attachment.js'; +import { canBeDownloaded, isDownloaded } from '../../types/Attachment.js'; +import type { ShowConversationType } from '../../state/ducks/conversations.js'; +import type { HydratedBodyRangesType } from '../../types/BodyRange.js'; +import type { LocalizerType } from '../../types/Util.js'; +import { MessageTextRenderer } from './MessageTextRenderer.js'; +import type { RenderLocation } from './MessageTextRenderer.js'; +import { UserText } from '../UserText.js'; +import { shouldLinkifyMessage } from '../../types/LinkPreview.js'; +import { FunJumboEmojiSize } from '../fun/FunEmoji.js'; +import { getEmojifyData } from '../fun/data/emojis.js'; function getSizeClass(str: string): FunJumboEmojiSize | null { const emojifyData = getEmojifyData(str); diff --git a/ts/components/conversation/MessageBodyReadMore.stories.tsx b/ts/components/conversation/MessageBodyReadMore.stories.tsx index 871f03dcc56..7ddbd4e5532 100644 --- a/ts/components/conversation/MessageBodyReadMore.stories.tsx +++ b/ts/components/conversation/MessageBodyReadMore.stories.tsx @@ -4,12 +4,12 @@ import React, { useState } from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './MessageBodyReadMore'; -import { MessageBodyReadMore } from './MessageBodyReadMore'; -import type { HydratedBodyRangesType } from '../../types/BodyRange'; -import { BodyRange } from '../../types/BodyRange'; -import { generateAci } from '../../types/ServiceId'; -import { RenderLocation } from './MessageTextRenderer'; +import type { Props } from './MessageBodyReadMore.js'; +import { MessageBodyReadMore } from './MessageBodyReadMore.js'; +import type { HydratedBodyRangesType } from '../../types/BodyRange.js'; +import { BodyRange } from '../../types/BodyRange.js'; +import { generateAci } from '../../types/ServiceId.js'; +import { RenderLocation } from './MessageTextRenderer.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/MessageBodyReadMore.tsx b/ts/components/conversation/MessageBodyReadMore.tsx index 87170eb8dfc..f386cf68849 100644 --- a/ts/components/conversation/MessageBodyReadMore.tsx +++ b/ts/components/conversation/MessageBodyReadMore.tsx @@ -3,10 +3,10 @@ import React from 'react'; -import type { Props as MessageBodyPropsType } from './MessageBody'; -import { MessageBody } from './MessageBody'; -import { graphemeAndLinkAwareSlice } from '../../util/graphemeAndLinkAwareSlice'; -import { shouldLinkifyMessage } from '../../types/LinkPreview'; +import type { Props as MessageBodyPropsType } from './MessageBody.js'; +import { MessageBody } from './MessageBody.js'; +import { graphemeAndLinkAwareSlice } from '../../util/graphemeAndLinkAwareSlice.js'; +import { shouldLinkifyMessage } from '../../types/LinkPreview.js'; export type Props = Pick< MessageBodyPropsType, diff --git a/ts/components/conversation/MessageContextMenu.tsx b/ts/components/conversation/MessageContextMenu.tsx index 688c1cbe9c1..9f1966b6286 100644 --- a/ts/components/conversation/MessageContextMenu.tsx +++ b/ts/components/conversation/MessageContextMenu.tsx @@ -4,8 +4,8 @@ import React, { type RefObject } from 'react'; import { ContextMenu, MenuItem } from 'react-contextmenu'; import ReactDOM from 'react-dom'; -import type { LocalizerType } from '../../types/I18N'; -import type { InteractionModeType } from '../../state/ducks/conversations'; +import type { LocalizerType } from '../../types/I18N.js'; +import type { InteractionModeType } from '../../state/ducks/conversations.js'; export type ContextMenuTriggerType = { handleContextClick: ( diff --git a/ts/components/conversation/MessageDetail.stories.tsx b/ts/components/conversation/MessageDetail.stories.tsx index 3bac02ec06d..927771bca3b 100644 --- a/ts/components/conversation/MessageDetail.stories.tsx +++ b/ts/components/conversation/MessageDetail.stories.tsx @@ -4,15 +4,15 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsData as MessageDataPropsType } from './Message'; -import { TextDirection } from './Message'; -import type { Props } from './MessageDetail'; -import { MessageDetail } from './MessageDetail'; -import { SendStatus } from '../../messages/MessageSendState'; -import { ReadStatus } from '../../messages/MessageReadStatus'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation'; -import { getFakeBadge } from '../../test-helpers/getFakeBadge'; -import { ThemeType } from '../../types/Util'; +import type { PropsData as MessageDataPropsType } from './Message.js'; +import { TextDirection } from './Message.js'; +import type { Props } from './MessageDetail.js'; +import { MessageDetail } from './MessageDetail.js'; +import { SendStatus } from '../../messages/MessageSendState.js'; +import { ReadStatus } from '../../messages/MessageReadStatus.js'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; +import { getFakeBadge } from '../../test-helpers/getFakeBadge.js'; +import { ThemeType } from '../../types/Util.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/MessageDetail.tsx b/ts/components/conversation/MessageDetail.tsx index 8297de1f517..6f05540d978 100644 --- a/ts/components/conversation/MessageDetail.tsx +++ b/ts/components/conversation/MessageDetail.tsx @@ -6,36 +6,36 @@ import React, { useRef } from 'react'; import classNames from 'classnames'; import { noop } from 'lodash'; -import { Avatar, AvatarSize } from '../Avatar'; -import { ContactName } from './ContactName'; -import { ContextMenu } from '../ContextMenu'; -import { Time } from '../Time'; +import { Avatar, AvatarSize } from '../Avatar.js'; +import { ContactName } from './ContactName.js'; +import { ContextMenu } from '../ContextMenu.js'; +import { Time } from '../Time.js'; import type { Props as MessagePropsType, PropsData as MessagePropsDataType, -} from './Message'; -import { Message } from './Message'; -import type { LocalizerType, ThemeType } from '../../types/Util'; -import type { ConversationType } from '../../state/ducks/conversations'; -import type { PreferredBadgeSelectorType } from '../../state/selectors/badges'; -import { groupBy } from '../../util/mapUtil'; -import type { ContactNameColorType } from '../../types/Colors'; +} from './Message.js'; +import { Message } from './Message.js'; +import type { LocalizerType, ThemeType } from '../../types/Util.js'; +import type { ConversationType } from '../../state/ducks/conversations.js'; +import type { PreferredBadgeSelectorType } from '../../state/selectors/badges.js'; +import { groupBy } from '../../util/mapUtil.js'; +import type { ContactNameColorType } from '../../types/Colors.js'; import { SendStatus, type VisibleSendStatus, -} from '../../messages/MessageSendState'; -import { WidthBreakpoint } from '../_util'; -import { createLogger } from '../../logging/log'; -import { formatDateTimeLong } from '../../util/timestamp'; -import { DurationInSeconds } from '../../util/durations'; -import { format as formatRelativeTime } from '../../util/expirationTimer'; -import { missingCaseError } from '../../util/missingCaseError'; -import { PanelRow } from './conversation-details/PanelRow'; -import { PanelSection } from './conversation-details/PanelSection'; +} from '../../messages/MessageSendState.js'; +import { WidthBreakpoint } from '../_util.js'; +import { createLogger } from '../../logging/log.js'; +import { formatDateTimeLong } from '../../util/timestamp.js'; +import { DurationInSeconds } from '../../util/durations/index.js'; +import { format as formatRelativeTime } from '../../util/expirationTimer.js'; +import { missingCaseError } from '../../util/missingCaseError.js'; +import { PanelRow } from './conversation-details/PanelRow.js'; +import { PanelSection } from './conversation-details/PanelSection.js'; import { ConversationDetailsIcon, IconType, -} from './conversation-details/ConversationDetailsIcon'; +} from './conversation-details/ConversationDetailsIcon.js'; const log = createLogger('MessageDetail'); diff --git a/ts/components/conversation/MessageMetadata.tsx b/ts/components/conversation/MessageMetadata.tsx index 339e34ff2d9..0be9798de08 100644 --- a/ts/components/conversation/MessageMetadata.tsx +++ b/ts/components/conversation/MessageMetadata.tsx @@ -5,18 +5,18 @@ import type { ReactChild } from 'react'; import React, { forwardRef, useCallback, useState } from 'react'; import classNames from 'classnames'; -import type { LocalizerType } from '../../types/Util'; -import type { DirectionType, MessageStatusType } from './Message'; -import type { PushPanelForConversationActionType } from '../../state/ducks/conversations'; -import { missingCaseError } from '../../util/missingCaseError'; -import { ExpireTimer } from './ExpireTimer'; -import { MessageTimestamp } from './MessageTimestamp'; -import { PanelType } from '../../types/Panels'; -import { Spinner } from '../Spinner'; -import { ConfirmationDialog } from '../ConfirmationDialog'; -import { refMerger } from '../../util/refMerger'; -import type { Size } from '../../hooks/useSizeObserver'; -import { SizeObserver } from '../../hooks/useSizeObserver'; +import type { LocalizerType } from '../../types/Util.js'; +import type { DirectionType, MessageStatusType } from './Message.js'; +import type { PushPanelForConversationActionType } from '../../state/ducks/conversations.js'; +import { missingCaseError } from '../../util/missingCaseError.js'; +import { ExpireTimer } from './ExpireTimer.js'; +import { MessageTimestamp } from './MessageTimestamp.js'; +import { PanelType } from '../../types/Panels.js'; +import { Spinner } from '../Spinner.js'; +import { ConfirmationDialog } from '../ConfirmationDialog.js'; +import { refMerger } from '../../util/refMerger.js'; +import type { Size } from '../../hooks/useSizeObserver.js'; +import { SizeObserver } from '../../hooks/useSizeObserver.js'; type PropsType = { deletedForEveryone?: boolean; diff --git a/ts/components/conversation/MessageRequestActions.stories.tsx b/ts/components/conversation/MessageRequestActions.stories.tsx index a5e4b16c9d8..76185cce83e 100644 --- a/ts/components/conversation/MessageRequestActions.stories.tsx +++ b/ts/components/conversation/MessageRequestActions.stories.tsx @@ -4,11 +4,11 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { MessageRequestActions } from './MessageRequestActions'; +import { MessageRequestActions } from './MessageRequestActions.js'; import { getDefaultConversation, getDefaultGroup, -} from '../../test-helpers/getDefaultConversation'; +} from '../../test-helpers/getDefaultConversation.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/MessageRequestActions.tsx b/ts/components/conversation/MessageRequestActions.tsx index 974b826ea69..61a18fd1407 100644 --- a/ts/components/conversation/MessageRequestActions.tsx +++ b/ts/components/conversation/MessageRequestActions.tsx @@ -2,16 +2,16 @@ // SPDX-License-Identifier: AGPL-3.0-only import * as React from 'react'; -import { ContactName } from './ContactName'; -import { Button, ButtonVariant } from '../Button'; -import type { MessageRequestActionsConfirmationProps } from './MessageRequestActionsConfirmation'; +import { ContactName } from './ContactName.js'; +import { Button, ButtonVariant } from '../Button.js'; +import type { MessageRequestActionsConfirmationProps } from './MessageRequestActionsConfirmation.js'; import { MessageRequestActionsConfirmation, MessageRequestState, -} from './MessageRequestActionsConfirmation'; -import { I18n } from '../I18n'; -import type { LocalizerType } from '../../types/Util'; -import { strictAssert } from '../../util/assert'; +} from './MessageRequestActionsConfirmation.js'; +import { I18n } from '../I18n.js'; +import type { LocalizerType } from '../../types/Util.js'; +import { strictAssert } from '../../util/assert.js'; export type Props = { i18n: LocalizerType; diff --git a/ts/components/conversation/MessageRequestActionsConfirmation.tsx b/ts/components/conversation/MessageRequestActionsConfirmation.tsx index 86399dcedbd..53e33d7c071 100644 --- a/ts/components/conversation/MessageRequestActionsConfirmation.tsx +++ b/ts/components/conversation/MessageRequestActionsConfirmation.tsx @@ -2,11 +2,11 @@ // SPDX-License-Identifier: AGPL-3.0-only import * as React from 'react'; -import type { ContactNameData } from './ContactName'; -import { ContactName } from './ContactName'; -import { ConfirmationDialog } from '../ConfirmationDialog'; -import { I18n } from '../I18n'; -import type { LocalizerType } from '../../types/Util'; +import type { ContactNameData } from './ContactName.js'; +import { ContactName } from './ContactName.js'; +import { ConfirmationDialog } from '../ConfirmationDialog.js'; +import { I18n } from '../I18n.js'; +import type { LocalizerType } from '../../types/Util.js'; export enum MessageRequestState { blocking, diff --git a/ts/components/conversation/MessageRequestResponseNotification.tsx b/ts/components/conversation/MessageRequestResponseNotification.tsx index 9af023c4688..2c89ae6384a 100644 --- a/ts/components/conversation/MessageRequestResponseNotification.tsx +++ b/ts/components/conversation/MessageRequestResponseNotification.tsx @@ -1,12 +1,12 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import React, { useState } from 'react'; -import type { LocalizerType } from '../../types/I18N'; -import { SystemMessage } from './SystemMessage'; -import { Button, ButtonSize, ButtonVariant } from '../Button'; -import { MessageRequestState } from './MessageRequestActionsConfirmation'; -import { SafetyTipsModal } from '../SafetyTipsModal'; -import { MessageRequestResponseEvent } from '../../types/MessageRequestResponseEvent'; +import type { LocalizerType } from '../../types/I18N.js'; +import { SystemMessage } from './SystemMessage.js'; +import { Button, ButtonSize, ButtonVariant } from '../Button.js'; +import { MessageRequestState } from './MessageRequestActionsConfirmation.js'; +import { SafetyTipsModal } from '../SafetyTipsModal.js'; +import { MessageRequestResponseEvent } from '../../types/MessageRequestResponseEvent.js'; export type MessageRequestResponseNotificationData = { messageRequestResponseEvent: MessageRequestResponseEvent; diff --git a/ts/components/conversation/MessageTextRenderer.tsx b/ts/components/conversation/MessageTextRenderer.tsx index 4356c0cc398..b89c5ade2e7 100644 --- a/ts/components/conversation/MessageTextRenderer.tsx +++ b/ts/components/conversation/MessageTextRenderer.tsx @@ -7,25 +7,25 @@ import classNames from 'classnames'; import emojiRegex from 'emoji-regex'; import { sortBy } from 'lodash'; -import { linkify, SUPPORTED_PROTOCOLS } from './Linkify'; +import { linkify, SUPPORTED_PROTOCOLS } from './Linkify.js'; import type { BodyRangesForDisplayType, DisplayNode, HydratedBodyRangeMention, RangeNode, -} from '../../types/BodyRange'; +} from '../../types/BodyRange.js'; import { BodyRange, insertRange, collapseRangeTree, groupContiguousSpoilers, -} from '../../types/BodyRange'; -import { AtMention } from './AtMention'; -import { isLinkSneaky } from '../../types/LinkPreview'; -import { Emojify } from './Emojify'; -import { AddNewLines } from './AddNewLines'; -import type { LocalizerType } from '../../types/Util'; -import type { FunJumboEmojiSize } from '../fun/FunEmoji'; +} from '../../types/BodyRange.js'; +import { AtMention } from './AtMention.js'; +import { isLinkSneaky } from '../../types/LinkPreview.js'; +import { Emojify } from './Emojify.js'; +import { AddNewLines } from './AddNewLines.js'; +import type { LocalizerType } from '../../types/Util.js'; +import type { FunJumboEmojiSize } from '../fun/FunEmoji.js'; const EMOJI_REGEXP = emojiRegex(); export enum RenderLocation { diff --git a/ts/components/conversation/MessageTimestamp.stories.tsx b/ts/components/conversation/MessageTimestamp.stories.tsx index a412f15592b..3fc0c5ebf32 100644 --- a/ts/components/conversation/MessageTimestamp.stories.tsx +++ b/ts/components/conversation/MessageTimestamp.stories.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { Props } from './MessageTimestamp'; -import { MessageTimestamp } from './MessageTimestamp'; +import type { Props } from './MessageTimestamp.js'; +import { MessageTimestamp } from './MessageTimestamp.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/MessageTimestamp.tsx b/ts/components/conversation/MessageTimestamp.tsx index 0bfd444534f..279f126ea77 100644 --- a/ts/components/conversation/MessageTimestamp.tsx +++ b/ts/components/conversation/MessageTimestamp.tsx @@ -5,11 +5,11 @@ import type { ReactElement } from 'react'; import React from 'react'; import classNames from 'classnames'; -import { formatTime } from '../../util/timestamp'; +import { formatTime } from '../../util/timestamp.js'; -import type { LocalizerType } from '../../types/Util'; -import { Time } from '../Time'; -import { useNowThatUpdatesEveryMinute } from '../../hooks/useNowThatUpdatesEveryMinute'; +import type { LocalizerType } from '../../types/Util.js'; +import { Time } from '../Time.js'; +import { useNowThatUpdatesEveryMinute } from '../../hooks/useNowThatUpdatesEveryMinute.js'; export type Props = { direction?: 'incoming' | 'outgoing'; diff --git a/ts/components/conversation/PaymentEventNotification.tsx b/ts/components/conversation/PaymentEventNotification.tsx index 67bffa7a2a7..05a0bd627ed 100644 --- a/ts/components/conversation/PaymentEventNotification.tsx +++ b/ts/components/conversation/PaymentEventNotification.tsx @@ -3,12 +3,12 @@ import React from 'react'; -import type { LocalizerType } from '../../types/Util'; -import type { ConversationType } from '../../state/ducks/conversations'; -import { SystemMessage } from './SystemMessage'; -import { Emojify } from './Emojify'; -import type { AnyPaymentEvent } from '../../types/Payment'; -import { getPaymentEventDescription } from '../../messages/helpers'; +import type { LocalizerType } from '../../types/Util.js'; +import type { ConversationType } from '../../state/ducks/conversations.js'; +import { SystemMessage } from './SystemMessage.js'; +import { Emojify } from './Emojify.js'; +import type { AnyPaymentEvent } from '../../types/Payment.js'; +import { getPaymentEventDescription } from '../../messages/helpers.js'; export type PropsType = { event: AnyPaymentEvent; diff --git a/ts/components/conversation/PhoneNumberDiscoveryNotification.stories.tsx b/ts/components/conversation/PhoneNumberDiscoveryNotification.stories.tsx index 369f74a284c..ca44bb60c66 100644 --- a/ts/components/conversation/PhoneNumberDiscoveryNotification.stories.tsx +++ b/ts/components/conversation/PhoneNumberDiscoveryNotification.stories.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './PhoneNumberDiscoveryNotification'; -import { PhoneNumberDiscoveryNotification } from './PhoneNumberDiscoveryNotification'; +import type { PropsType } from './PhoneNumberDiscoveryNotification.js'; +import { PhoneNumberDiscoveryNotification } from './PhoneNumberDiscoveryNotification.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/PhoneNumberDiscoveryNotification.tsx b/ts/components/conversation/PhoneNumberDiscoveryNotification.tsx index 9bc24762185..12a4605b8e1 100644 --- a/ts/components/conversation/PhoneNumberDiscoveryNotification.tsx +++ b/ts/components/conversation/PhoneNumberDiscoveryNotification.tsx @@ -3,10 +3,10 @@ import React from 'react'; -import type { LocalizerType } from '../../types/Util'; -import { SystemMessage } from './SystemMessage'; -import { Emojify } from './Emojify'; -import { getStringForPhoneNumberDiscovery } from '../../util/getStringForPhoneNumberDiscovery'; +import type { LocalizerType } from '../../types/Util.js'; +import { SystemMessage } from './SystemMessage.js'; +import { Emojify } from './Emojify.js'; +import { getStringForPhoneNumberDiscovery } from '../../util/getStringForPhoneNumberDiscovery.js'; export type PropsDataType = { conversationTitle: string; diff --git a/ts/components/conversation/ProfileChangeNotification.stories.tsx b/ts/components/conversation/ProfileChangeNotification.stories.tsx index 81ffd9ab829..6fa4cf51ebf 100644 --- a/ts/components/conversation/ProfileChangeNotification.stories.tsx +++ b/ts/components/conversation/ProfileChangeNotification.stories.tsx @@ -4,9 +4,9 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; import { action } from '@storybook/addon-actions'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation'; -import type { PropsType } from './ProfileChangeNotification'; -import { ProfileChangeNotification } from './ProfileChangeNotification'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; +import type { PropsType } from './ProfileChangeNotification.js'; +import { ProfileChangeNotification } from './ProfileChangeNotification.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/ProfileChangeNotification.tsx b/ts/components/conversation/ProfileChangeNotification.tsx index cb5d9845ba2..0a9523e3bff 100644 --- a/ts/components/conversation/ProfileChangeNotification.tsx +++ b/ts/components/conversation/ProfileChangeNotification.tsx @@ -3,13 +3,13 @@ import React, { useCallback } from 'react'; -import type { LocalizerType } from '../../types/Util'; -import type { ConversationType } from '../../state/ducks/conversations'; -import { SystemMessage } from './SystemMessage'; -import { Emojify } from './Emojify'; -import type { ProfileNameChangeType } from '../../util/getStringForProfileChange'; -import { getStringForProfileChange } from '../../util/getStringForProfileChange'; -import { Button, ButtonSize, ButtonVariant } from '../Button'; +import type { LocalizerType } from '../../types/Util.js'; +import type { ConversationType } from '../../state/ducks/conversations.js'; +import { SystemMessage } from './SystemMessage.js'; +import { Emojify } from './Emojify.js'; +import type { ProfileNameChangeType } from '../../util/getStringForProfileChange.js'; +import { getStringForProfileChange } from '../../util/getStringForProfileChange.js'; +import { Button, ButtonSize, ButtonVariant } from '../Button.js'; export type PropsType = { change: ProfileNameChangeType; diff --git a/ts/components/conversation/ProfileNameWarningModal.stories.tsx b/ts/components/conversation/ProfileNameWarningModal.stories.tsx index 7f6c0d1e42e..7be347fe6be 100644 --- a/ts/components/conversation/ProfileNameWarningModal.stories.tsx +++ b/ts/components/conversation/ProfileNameWarningModal.stories.tsx @@ -3,10 +3,10 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { PropsType } from './ProfileNameWarningModal'; -import { ProfileNameWarningModal } from './ProfileNameWarningModal'; -import { type ComponentMeta } from '../../storybook/types'; -import { setupI18n } from '../../util/setupI18n'; +import type { PropsType } from './ProfileNameWarningModal.js'; +import { ProfileNameWarningModal } from './ProfileNameWarningModal.js'; +import { type ComponentMeta } from '../../storybook/types.js'; +import { setupI18n } from '../../util/setupI18n.js'; import enMessages from '../../../_locales/en/messages.json'; const i18n = setupI18n('en', enMessages); diff --git a/ts/components/conversation/ProfileNameWarningModal.tsx b/ts/components/conversation/ProfileNameWarningModal.tsx index fa2f925523f..4222220eae6 100644 --- a/ts/components/conversation/ProfileNameWarningModal.tsx +++ b/ts/components/conversation/ProfileNameWarningModal.tsx @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import { Modal } from '../Modal'; -import type { LocalizerType } from '../../types/Util'; +import { Modal } from '../Modal.js'; +import type { LocalizerType } from '../../types/Util.js'; export type PropsType = Readonly<{ conversationType: 'group' | 'direct'; diff --git a/ts/components/conversation/Quote.stories.tsx b/ts/components/conversation/Quote.stories.tsx index ffcbf94f453..23e463ca1c1 100644 --- a/ts/components/conversation/Quote.stories.tsx +++ b/ts/components/conversation/Quote.stories.tsx @@ -6,11 +6,11 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; -import { ConversationColors } from '../../types/Colors'; -import { pngUrl } from '../../storybook/Fixtures'; -import type { Props as TimelineMessagesProps } from './TimelineMessage'; -import { TimelineMessage } from './TimelineMessage'; -import { TextDirection } from './Message'; +import { ConversationColors } from '../../types/Colors.js'; +import { pngUrl } from '../../storybook/Fixtures.js'; +import type { Props as TimelineMessagesProps } from './TimelineMessage.js'; +import { TimelineMessage } from './TimelineMessage.js'; +import { TextDirection } from './Message.js'; import { AUDIO_MP3, IMAGE_PNG, @@ -18,14 +18,14 @@ import { LONG_MESSAGE, VIDEO_MP4, stringToMIMEType, -} from '../../types/MIME'; -import type { Props } from './Quote'; -import { Quote } from './Quote'; -import { ReadStatus } from '../../messages/MessageReadStatus'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation'; -import { WidthBreakpoint } from '../_util'; -import { ThemeType } from '../../types/Util'; -import { PaymentEventKind } from '../../types/Payment'; +} from '../../types/MIME.js'; +import type { Props } from './Quote.js'; +import { Quote } from './Quote.js'; +import { ReadStatus } from '../../messages/MessageReadStatus.js'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; +import { WidthBreakpoint } from '../_util.js'; +import { ThemeType } from '../../types/Util.js'; +import { PaymentEventKind } from '../../types/Payment.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/Quote.tsx b/ts/components/conversation/Quote.tsx index 3692e262c4c..a39c882a202 100644 --- a/ts/components/conversation/Quote.tsx +++ b/ts/components/conversation/Quote.tsx @@ -6,30 +6,30 @@ import React, { useRef, useState, useEffect } from 'react'; import { noop } from 'lodash'; import classNames from 'classnames'; -import * as MIME from '../../types/MIME'; -import * as GoogleChrome from '../../util/GoogleChrome'; +import * as MIME from '../../types/MIME.js'; +import * as GoogleChrome from '../../util/GoogleChrome.js'; -import { MessageBody } from './MessageBody'; -import type { AttachmentType, ThumbnailType } from '../../types/Attachment'; -import type { HydratedBodyRangesType } from '../../types/BodyRange'; -import type { LocalizerType } from '../../types/Util'; +import { MessageBody } from './MessageBody.js'; +import type { AttachmentType, ThumbnailType } from '../../types/Attachment.js'; +import type { HydratedBodyRangesType } from '../../types/BodyRange.js'; +import type { LocalizerType } from '../../types/Util.js'; import type { ConversationColorType, CustomColorType, -} from '../../types/Colors'; -import { ContactName } from './ContactName'; -import { Emojify } from './Emojify'; -import { TextAttachment } from '../TextAttachment'; -import { getClassNamesFor } from '../../util/getClassNamesFor'; -import { getCustomColorStyle } from '../../util/getCustomColorStyle'; -import type { AnyPaymentEvent } from '../../types/Payment'; -import { PaymentEventKind } from '../../types/Payment'; +} from '../../types/Colors.js'; +import { ContactName } from './ContactName.js'; +import { Emojify } from './Emojify.js'; +import { TextAttachment } from '../TextAttachment.js'; +import { getClassNamesFor } from '../../util/getClassNamesFor.js'; +import { getCustomColorStyle } from '../../util/getCustomColorStyle.js'; +import type { AnyPaymentEvent } from '../../types/Payment.js'; +import { PaymentEventKind } from '../../types/Payment.js'; import { getPaymentEventNotificationText, shouldTryToCopyFromQuotedMessage, -} from '../../messages/helpers'; -import { RenderLocation } from './MessageTextRenderer'; -import type { QuotedAttachmentType } from '../../model-types'; +} from '../../messages/helpers.js'; +import { RenderLocation } from './MessageTextRenderer.js'; +import type { QuotedAttachmentType } from '../../model-types.js'; const EMPTY_OBJECT = Object.freeze(Object.create(null)); diff --git a/ts/components/conversation/ReactionPicker.stories.tsx b/ts/components/conversation/ReactionPicker.stories.tsx index 86566c20eb4..8e1a8472b7a 100644 --- a/ts/components/conversation/ReactionPicker.stories.tsx +++ b/ts/components/conversation/ReactionPicker.stories.tsx @@ -4,11 +4,11 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props as ReactionPickerProps } from './ReactionPicker'; -import { ReactionPicker } from './ReactionPicker'; -import { EmojiPicker } from '../emoji/EmojiPicker'; -import { DEFAULT_PREFERRED_REACTION_EMOJI } from '../../reactions/constants'; -import { EmojiSkinTone } from '../fun/data/emojis'; +import type { Props as ReactionPickerProps } from './ReactionPicker.js'; +import { ReactionPicker } from './ReactionPicker.js'; +import { EmojiPicker } from '../emoji/EmojiPicker.js'; +import { DEFAULT_PREFERRED_REACTION_EMOJI } from '../../reactions/constants.js'; +import { EmojiSkinTone } from '../fun/data/emojis.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/ReactionPicker.tsx b/ts/components/conversation/ReactionPicker.tsx index 205627c85ce..4edea148956 100644 --- a/ts/components/conversation/ReactionPicker.tsx +++ b/ts/components/conversation/ReactionPicker.tsx @@ -3,21 +3,21 @@ import React, { useCallback, useState, useEffect } from 'react'; import { Button } from 'react-aria-components'; -import { convertShortName } from '../emoji/lib'; -import type { Props as EmojiPickerProps } from '../emoji/EmojiPicker'; -import { useDelayedRestoreFocus } from '../../hooks/useRestoreFocus'; -import type { LocalizerType, ThemeType } from '../../types/Util'; +import { convertShortName } from '../emoji/lib.js'; +import type { Props as EmojiPickerProps } from '../emoji/EmojiPicker.js'; +import { useDelayedRestoreFocus } from '../../hooks/useRestoreFocus.js'; +import type { LocalizerType, ThemeType } from '../../types/Util.js'; import { ReactionPickerPicker, ReactionPickerPickerEmojiButton, ReactionPickerPickerMoreButton, ReactionPickerPickerStyle, -} from '../ReactionPickerPicker'; -import type { EmojiSkinTone, EmojiVariantKey } from '../fun/data/emojis'; -import { getEmojiVariantByKey } from '../fun/data/emojis'; -import { FunEmojiPicker } from '../fun/FunEmojiPicker'; -import type { FunEmojiSelection } from '../fun/panels/FunPanelEmojis'; -import { isFunPickerEnabled } from '../fun/isFunPickerEnabled'; +} from '../ReactionPickerPicker.js'; +import type { EmojiSkinTone, EmojiVariantKey } from '../fun/data/emojis.js'; +import { getEmojiVariantByKey } from '../fun/data/emojis.js'; +import { FunEmojiPicker } from '../fun/FunEmojiPicker.js'; +import type { FunEmojiSelection } from '../fun/panels/FunPanelEmojis.js'; +import { isFunPickerEnabled } from '../fun/isFunPickerEnabled.js'; export type RenderEmojiPickerProps = Pick & Pick< diff --git a/ts/components/conversation/ReactionViewer.stories.tsx b/ts/components/conversation/ReactionViewer.stories.tsx index 265368713eb..13e3adeca0a 100644 --- a/ts/components/conversation/ReactionViewer.stories.tsx +++ b/ts/components/conversation/ReactionViewer.stories.tsx @@ -4,10 +4,10 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './ReactionViewer'; -import { ReactionViewer } from './ReactionViewer'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation'; -import { ThemeType } from '../../types/Util'; +import type { Props } from './ReactionViewer.js'; +import { ReactionViewer } from './ReactionViewer.js'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; +import { ThemeType } from '../../types/Util.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/ReactionViewer.tsx b/ts/components/conversation/ReactionViewer.tsx index 81131c38e14..f46af3aaa21 100644 --- a/ts/components/conversation/ReactionViewer.tsx +++ b/ts/components/conversation/ReactionViewer.tsx @@ -4,24 +4,24 @@ import * as React from 'react'; import { groupBy, mapValues, orderBy } from 'lodash'; import classNames from 'classnames'; -import { ContactName } from './ContactName'; -import type { Props as AvatarProps } from '../Avatar'; -import { Avatar } from '../Avatar'; -import { useRestoreFocus } from '../../hooks/useRestoreFocus'; -import type { ConversationType } from '../../state/ducks/conversations'; -import type { PreferredBadgeSelectorType } from '../../state/selectors/badges'; -import type { EmojiData } from '../emoji/lib'; -import { emojiToData } from '../emoji/lib'; -import { useEscapeHandling } from '../../hooks/useEscapeHandling'; -import type { ThemeType } from '../../types/Util'; +import { ContactName } from './ContactName.js'; +import type { Props as AvatarProps } from '../Avatar.js'; +import { Avatar } from '../Avatar.js'; +import { useRestoreFocus } from '../../hooks/useRestoreFocus.js'; +import type { ConversationType } from '../../state/ducks/conversations.js'; +import type { PreferredBadgeSelectorType } from '../../state/selectors/badges.js'; +import type { EmojiData } from '../emoji/lib.js'; +import { emojiToData } from '../emoji/lib.js'; +import { useEscapeHandling } from '../../hooks/useEscapeHandling.js'; +import type { ThemeType } from '../../types/Util.js'; import { getEmojiVariantByKey, getEmojiVariantKeyByValue, isEmojiVariantValue, -} from '../fun/data/emojis'; -import { strictAssert } from '../../util/assert'; -import { FunStaticEmoji } from '../fun/FunEmoji'; -import { useFunEmojiLocalizer } from '../fun/useFunEmojiLocalizer'; +} from '../fun/data/emojis.js'; +import { strictAssert } from '../../util/assert.js'; +import { FunStaticEmoji } from '../fun/FunEmoji.js'; +import { useFunEmojiLocalizer } from '../fun/useFunEmojiLocalizer.js'; export type Reaction = { emoji: string; diff --git a/ts/components/conversation/RemoveGroupMemberConfirmationDialog.tsx b/ts/components/conversation/RemoveGroupMemberConfirmationDialog.tsx index a03bda107cd..a3d8ff4bcb9 100644 --- a/ts/components/conversation/RemoveGroupMemberConfirmationDialog.tsx +++ b/ts/components/conversation/RemoveGroupMemberConfirmationDialog.tsx @@ -3,13 +3,13 @@ import React from 'react'; -import type { ConversationType } from '../../state/ducks/conversations'; -import type { LocalizerType } from '../../types/Util'; -import { isAccessControlEnabled } from '../../groups/util'; +import type { ConversationType } from '../../state/ducks/conversations.js'; +import type { LocalizerType } from '../../types/Util.js'; +import { isAccessControlEnabled } from '../../groups/util.js'; -import { ConfirmationDialog } from '../ConfirmationDialog'; -import { I18n } from '../I18n'; -import { ContactName } from './ContactName'; +import { ConfirmationDialog } from '../ConfirmationDialog.js'; +import { I18n } from '../I18n.js'; +import { ContactName } from './ContactName.js'; type PropsType = { group: ConversationType; diff --git a/ts/components/conversation/ResetSessionNotification.stories.tsx b/ts/components/conversation/ResetSessionNotification.stories.tsx index 6e6a9badf7f..02f2472032e 100644 --- a/ts/components/conversation/ResetSessionNotification.stories.tsx +++ b/ts/components/conversation/ResetSessionNotification.stories.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { Props } from './ResetSessionNotification'; -import { ResetSessionNotification } from './ResetSessionNotification'; +import type { Props } from './ResetSessionNotification.js'; +import { ResetSessionNotification } from './ResetSessionNotification.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/ResetSessionNotification.tsx b/ts/components/conversation/ResetSessionNotification.tsx index 0777b000772..c3945382a06 100644 --- a/ts/components/conversation/ResetSessionNotification.tsx +++ b/ts/components/conversation/ResetSessionNotification.tsx @@ -3,8 +3,8 @@ import React from 'react'; -import type { LocalizerType } from '../../types/Util'; -import { SystemMessage } from './SystemMessage'; +import type { LocalizerType } from '../../types/Util.js'; +import { SystemMessage } from './SystemMessage.js'; export type Props = { i18n: LocalizerType; diff --git a/ts/components/conversation/SafetyNumberNotification.stories.tsx b/ts/components/conversation/SafetyNumberNotification.stories.tsx index 7ba2435d5eb..3fb8e754d6f 100644 --- a/ts/components/conversation/SafetyNumberNotification.stories.tsx +++ b/ts/components/conversation/SafetyNumberNotification.stories.tsx @@ -4,8 +4,8 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { ContactType, Props } from './SafetyNumberNotification'; -import { SafetyNumberNotification } from './SafetyNumberNotification'; +import type { ContactType, Props } from './SafetyNumberNotification.js'; +import { SafetyNumberNotification } from './SafetyNumberNotification.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/SafetyNumberNotification.tsx b/ts/components/conversation/SafetyNumberNotification.tsx index 1c8a2f1e692..344bd1cc759 100644 --- a/ts/components/conversation/SafetyNumberNotification.tsx +++ b/ts/components/conversation/SafetyNumberNotification.tsx @@ -3,11 +3,11 @@ import React from 'react'; -import { Button, ButtonSize, ButtonVariant } from '../Button'; -import { SystemMessage } from './SystemMessage'; -import { ContactName } from './ContactName'; -import { I18n } from '../I18n'; -import type { LocalizerType } from '../../types/Util'; +import { Button, ButtonSize, ButtonVariant } from '../Button.js'; +import { SystemMessage } from './SystemMessage.js'; +import { ContactName } from './ContactName.js'; +import { I18n } from '../I18n.js'; +import type { LocalizerType } from '../../types/Util.js'; export type ContactType = { id: string; diff --git a/ts/components/conversation/ScrollDownButton.stories.tsx b/ts/components/conversation/ScrollDownButton.stories.tsx index 0748686d108..81c322e2413 100644 --- a/ts/components/conversation/ScrollDownButton.stories.tsx +++ b/ts/components/conversation/ScrollDownButton.stories.tsx @@ -5,8 +5,11 @@ import * as React from 'react'; import type { Meta, StoryFn } from '@storybook/react'; import { action } from '@storybook/addon-actions'; -import type { ScrollDownButtonPropsType } from './ScrollDownButton'; -import { ScrollDownButton, ScrollDownButtonVariant } from './ScrollDownButton'; +import type { ScrollDownButtonPropsType } from './ScrollDownButton.js'; +import { + ScrollDownButton, + ScrollDownButtonVariant, +} from './ScrollDownButton.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/ScrollDownButton.tsx b/ts/components/conversation/ScrollDownButton.tsx index cadaf037d52..05164058468 100644 --- a/ts/components/conversation/ScrollDownButton.tsx +++ b/ts/components/conversation/ScrollDownButton.tsx @@ -4,8 +4,8 @@ import classNames from 'classnames'; import React from 'react'; -import type { LocalizerType } from '../../types/Util'; -import { getClassNamesFor } from '../../util/getClassNamesFor'; +import type { LocalizerType } from '../../types/Util.js'; +import { getClassNamesFor } from '../../util/getClassNamesFor.js'; export enum ScrollDownButtonVariant { UNREAD_MESSAGES = 'unread-messages', diff --git a/ts/components/conversation/SelectModeActions.tsx b/ts/components/conversation/SelectModeActions.tsx index 01cf650026c..7f2b1389513 100644 --- a/ts/components/conversation/SelectModeActions.tsx +++ b/ts/components/conversation/SelectModeActions.tsx @@ -3,9 +3,9 @@ import classNames from 'classnames'; import React from 'react'; -import type { ShowToastAction } from '../../state/ducks/toast'; -import { ToastType } from '../../types/Toast'; -import type { LocalizerType } from '../../types/Util'; +import type { ShowToastAction } from '../../state/ducks/toast.js'; +import { ToastType } from '../../types/Toast.js'; +import type { LocalizerType } from '../../types/Util.js'; // Keep this in sync with iOS and Android const MAX_FORWARD_COUNT = 30; diff --git a/ts/components/conversation/SignalConversationMuteToggle.tsx b/ts/components/conversation/SignalConversationMuteToggle.tsx index e8a44711585..d8f36e8b7b4 100644 --- a/ts/components/conversation/SignalConversationMuteToggle.tsx +++ b/ts/components/conversation/SignalConversationMuteToggle.tsx @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import type { LocalizerType } from '../../types/I18N'; +import type { LocalizerType } from '../../types/I18N.js'; type Props = { isMuted: boolean; diff --git a/ts/components/conversation/StagedGenericAttachment.stories.tsx b/ts/components/conversation/StagedGenericAttachment.stories.tsx index d7f7fcac4ab..bf9430616b1 100644 --- a/ts/components/conversation/StagedGenericAttachment.stories.tsx +++ b/ts/components/conversation/StagedGenericAttachment.stories.tsx @@ -4,10 +4,10 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { AttachmentType } from '../../types/Attachment'; -import { stringToMIMEType } from '../../types/MIME'; -import type { Props } from './StagedGenericAttachment'; -import { StagedGenericAttachment } from './StagedGenericAttachment'; +import type { AttachmentType } from '../../types/Attachment.js'; +import { stringToMIMEType } from '../../types/MIME.js'; +import type { Props } from './StagedGenericAttachment.js'; +import { StagedGenericAttachment } from './StagedGenericAttachment.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/StagedGenericAttachment.tsx b/ts/components/conversation/StagedGenericAttachment.tsx index 35555322bf6..c73ec0d9e28 100644 --- a/ts/components/conversation/StagedGenericAttachment.tsx +++ b/ts/components/conversation/StagedGenericAttachment.tsx @@ -3,9 +3,9 @@ import React from 'react'; -import type { AttachmentType } from '../../types/Attachment'; -import type { LocalizerType } from '../../types/Util'; -import { FileThumbnail } from '../FileThumbnail'; +import type { AttachmentType } from '../../types/Attachment.js'; +import type { LocalizerType } from '../../types/Util.js'; +import { FileThumbnail } from '../FileThumbnail.js'; export type Props = { attachment: AttachmentType; diff --git a/ts/components/conversation/StagedLinkPreview.stories.tsx b/ts/components/conversation/StagedLinkPreview.stories.tsx index 9037b30d76e..749bf84f93b 100644 --- a/ts/components/conversation/StagedLinkPreview.stories.tsx +++ b/ts/components/conversation/StagedLinkPreview.stories.tsx @@ -5,10 +5,10 @@ import type { Meta, StoryFn } from '@storybook/react'; import * as React from 'react'; import { action } from '@storybook/addon-actions'; -import type { Props } from './StagedLinkPreview'; -import { StagedLinkPreview } from './StagedLinkPreview'; -import { fakeAttachment } from '../../test-helpers/fakeAttachment'; -import { IMAGE_JPEG } from '../../types/MIME'; +import type { Props } from './StagedLinkPreview.js'; +import { StagedLinkPreview } from './StagedLinkPreview.js'; +import { fakeAttachment } from '../../test-helpers/fakeAttachment.js'; +import { IMAGE_JPEG } from '../../types/MIME.js'; const LONG_TITLE = "This is a super-sweet site. And it's got some really amazing content in store for you if you just click that link. Can you click that link for me?"; diff --git a/ts/components/conversation/StagedLinkPreview.tsx b/ts/components/conversation/StagedLinkPreview.tsx index 36de21c7386..bcf91f21502 100644 --- a/ts/components/conversation/StagedLinkPreview.tsx +++ b/ts/components/conversation/StagedLinkPreview.tsx @@ -5,17 +5,17 @@ import React from 'react'; import classNames from 'classnames'; import { unescape } from 'lodash'; -import { CurveType, Image } from './Image'; -import { LinkPreviewDate } from './LinkPreviewDate'; +import { CurveType, Image } from './Image.js'; +import { LinkPreviewDate } from './LinkPreviewDate.js'; -import type { LinkPreviewForUIType } from '../../types/message/LinkPreviews'; -import type { LocalizerType } from '../../types/Util'; -import { getClassNamesFor } from '../../util/getClassNamesFor'; -import { isImageAttachment } from '../../types/Attachment'; -import { isCallLink } from '../../types/LinkPreview'; -import { Avatar } from '../Avatar'; -import { getColorForCallLink } from '../../util/getColorForCallLink'; -import { getKeyFromCallLink } from '../../util/callLinks'; +import type { LinkPreviewForUIType } from '../../types/message/LinkPreviews.js'; +import type { LocalizerType } from '../../types/Util.js'; +import { getClassNamesFor } from '../../util/getClassNamesFor.js'; +import { isImageAttachment } from '../../types/Attachment.js'; +import { isCallLink } from '../../types/LinkPreview.js'; +import { Avatar } from '../Avatar.js'; +import { getColorForCallLink } from '../../util/getColorForCallLink.js'; +import { getKeyFromCallLink } from '../../util/callLinks.js'; export type Props = LinkPreviewForUIType & { i18n: LocalizerType; diff --git a/ts/components/conversation/StagedPlaceholderAttachment.stories.tsx b/ts/components/conversation/StagedPlaceholderAttachment.stories.tsx index 5bb4a9b69f9..c4d55273fe1 100644 --- a/ts/components/conversation/StagedPlaceholderAttachment.stories.tsx +++ b/ts/components/conversation/StagedPlaceholderAttachment.stories.tsx @@ -4,8 +4,8 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './StagedPlaceholderAttachment'; -import { StagedPlaceholderAttachment } from './StagedPlaceholderAttachment'; +import type { Props } from './StagedPlaceholderAttachment.js'; +import { StagedPlaceholderAttachment } from './StagedPlaceholderAttachment.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/StagedPlaceholderAttachment.tsx b/ts/components/conversation/StagedPlaceholderAttachment.tsx index 09cc114c5c4..bf8b0234726 100644 --- a/ts/components/conversation/StagedPlaceholderAttachment.tsx +++ b/ts/components/conversation/StagedPlaceholderAttachment.tsx @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import type { LocalizerType } from '../../types/Util'; +import type { LocalizerType } from '../../types/Util.js'; export type Props = { onClick: () => void; diff --git a/ts/components/conversation/SystemMessage.stories.tsx b/ts/components/conversation/SystemMessage.stories.tsx index e04e2bc1642..b38fd926fe1 100644 --- a/ts/components/conversation/SystemMessage.stories.tsx +++ b/ts/components/conversation/SystemMessage.stories.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './SystemMessage'; -import { SystemMessage, SystemMessageKind } from './SystemMessage'; +import type { PropsType } from './SystemMessage.js'; +import { SystemMessage, SystemMessageKind } from './SystemMessage.js'; export default { title: 'Components/Conversation/SystemMessage', diff --git a/ts/components/conversation/Timeline.stories.tsx b/ts/components/conversation/Timeline.stories.tsx index 866f6adf977..733251b738b 100644 --- a/ts/components/conversation/Timeline.stories.tsx +++ b/ts/components/conversation/Timeline.stories.tsx @@ -6,23 +6,23 @@ import { times } from 'lodash'; import { v4 as uuid } from 'uuid'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { DurationInSeconds } from '../../util/durations'; -import type { PropsType } from './Timeline'; -import { Timeline } from './Timeline'; -import type { TimelineItemType } from './TimelineItem'; -import { TimelineItem } from './TimelineItem'; -import { StorybookThemeContext } from '../../../.storybook/StorybookThemeContext'; -import { ConversationHero } from './ConversationHero'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation'; -import { TypingBubble } from './TypingBubble'; -import { ContactSpoofingType } from '../../util/contactSpoofing'; -import { ReadStatus } from '../../messages/MessageReadStatus'; -import type { WidthBreakpoint } from '../_util'; -import { ThemeType } from '../../types/Util'; -import { TextDirection } from './Message'; -import { PaymentEventKind } from '../../types/Payment'; -import type { PropsData as TimelineMessageProps } from './TimelineMessage'; -import { CollidingAvatars } from '../CollidingAvatars'; +import { DurationInSeconds } from '../../util/durations/index.js'; +import type { PropsType } from './Timeline.js'; +import { Timeline } from './Timeline.js'; +import type { TimelineItemType } from './TimelineItem.js'; +import { TimelineItem } from './TimelineItem.js'; +import { StorybookThemeContext } from '../../../.storybook/StorybookThemeContext.js'; +import { ConversationHero } from './ConversationHero.js'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; +import { TypingBubble } from './TypingBubble.js'; +import { ContactSpoofingType } from '../../util/contactSpoofing.js'; +import { ReadStatus } from '../../messages/MessageReadStatus.js'; +import type { WidthBreakpoint } from '../_util.js'; +import { ThemeType } from '../../types/Util.js'; +import { TextDirection } from './Message.js'; +import { PaymentEventKind } from '../../types/Payment.js'; +import type { PropsData as TimelineMessageProps } from './TimelineMessage.js'; +import { CollidingAvatars } from '../CollidingAvatars.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/Timeline.tsx b/ts/components/conversation/Timeline.tsx index db2b99fba91..d50206d8bb1 100644 --- a/ts/components/conversation/Timeline.tsx +++ b/ts/components/conversation/Timeline.tsx @@ -7,45 +7,48 @@ import type { ReactChild, ReactNode, RefObject, UIEvent } from 'react'; import React from 'react'; import type { ReadonlyDeep } from 'type-fest'; -import { ScrollDownButton, ScrollDownButtonVariant } from './ScrollDownButton'; +import { + ScrollDownButton, + ScrollDownButtonVariant, +} from './ScrollDownButton.js'; -import type { LocalizerType, ThemeType } from '../../types/Util'; -import type { ConversationType } from '../../state/ducks/conversations'; -import type { PreferredBadgeSelectorType } from '../../state/selectors/badges'; -import { assertDev, strictAssert } from '../../util/assert'; -import { missingCaseError } from '../../util/missingCaseError'; -import { clearTimeoutIfNecessary } from '../../util/clearTimeoutIfNecessary'; -import { WidthBreakpoint } from '../_util'; +import type { LocalizerType, ThemeType } from '../../types/Util.js'; +import type { ConversationType } from '../../state/ducks/conversations.js'; +import type { PreferredBadgeSelectorType } from '../../state/selectors/badges.js'; +import { assertDev, strictAssert } from '../../util/assert.js'; +import { missingCaseError } from '../../util/missingCaseError.js'; +import { clearTimeoutIfNecessary } from '../../util/clearTimeoutIfNecessary.js'; +import { WidthBreakpoint } from '../_util.js'; -import { ErrorBoundary } from './ErrorBoundary'; -import { I18n } from '../I18n'; -import { TimelineWarning } from './TimelineWarning'; -import { TimelineWarnings } from './TimelineWarnings'; -import { NewlyCreatedGroupInvitedContactsDialog } from '../NewlyCreatedGroupInvitedContactsDialog'; -import { ContactSpoofingType } from '../../util/contactSpoofing'; -import type { PropsType as SmartContactSpoofingReviewDialogPropsType } from '../../state/smart/ContactSpoofingReviewDialog'; -import type { GroupNameCollisionsWithIdsByTitle } from '../../util/groupMemberNameCollisions'; -import { hasUnacknowledgedCollisions } from '../../util/groupMemberNameCollisions'; -import { TimelineFloatingHeader } from './TimelineFloatingHeader'; +import { ErrorBoundary } from './ErrorBoundary.js'; +import { I18n } from '../I18n.js'; +import { TimelineWarning } from './TimelineWarning.js'; +import { TimelineWarnings } from './TimelineWarnings.js'; +import { NewlyCreatedGroupInvitedContactsDialog } from '../NewlyCreatedGroupInvitedContactsDialog.js'; +import { ContactSpoofingType } from '../../util/contactSpoofing.js'; +import type { PropsType as SmartContactSpoofingReviewDialogPropsType } from '../../state/smart/ContactSpoofingReviewDialog.js'; +import type { GroupNameCollisionsWithIdsByTitle } from '../../util/groupMemberNameCollisions.js'; +import { hasUnacknowledgedCollisions } from '../../util/groupMemberNameCollisions.js'; +import { TimelineFloatingHeader } from './TimelineFloatingHeader.js'; import { getScrollAnchorBeforeUpdate, getWidthBreakpoint, ScrollAnchor, TimelineMessageLoadingState, UnreadIndicatorPlacement, -} from '../../util/timelineUtil'; +} from '../../util/timelineUtil.js'; import { getScrollBottom, scrollToBottom, setScrollBottom, -} from '../../util/scrollUtil'; -import { LastSeenIndicator } from './LastSeenIndicator'; -import { MINUTE, SECOND } from '../../util/durations'; -import { SizeObserver } from '../../hooks/useSizeObserver'; +} from '../../util/scrollUtil.js'; +import { LastSeenIndicator } from './LastSeenIndicator.js'; +import { MINUTE, SECOND } from '../../util/durations/index.js'; +import { SizeObserver } from '../../hooks/useSizeObserver.js'; import { createScrollerLock, ScrollerLockContext, -} from '../../hooks/useScrollLock'; +} from '../../hooks/useScrollLock.js'; const AT_BOTTOM_THRESHOLD = 15; const AT_BOTTOM_DETECTOR_STYLE = { height: AT_BOTTOM_THRESHOLD }; diff --git a/ts/components/conversation/TimelineDateHeader.tsx b/ts/components/conversation/TimelineDateHeader.tsx index 199f79eb8fd..70419545921 100644 --- a/ts/components/conversation/TimelineDateHeader.tsx +++ b/ts/components/conversation/TimelineDateHeader.tsx @@ -4,10 +4,10 @@ import type { ReactElement } from 'react'; import React, { useEffect, useState } from 'react'; import classNames from 'classnames'; -import * as durations from '../../util/durations'; -import type { LocalizerType } from '../../types/Util'; -import { formatDate } from '../../util/timestamp'; -import { Time } from '../Time'; +import * as durations from '../../util/durations/index.js'; +import type { LocalizerType } from '../../types/Util.js'; +import { formatDate } from '../../util/timestamp.js'; +import { Time } from '../Time.js'; export function TimelineDateHeader({ floating = false, diff --git a/ts/components/conversation/TimelineFloatingHeader.stories.tsx b/ts/components/conversation/TimelineFloatingHeader.stories.tsx index 99e14823c1d..fcf18acced7 100644 --- a/ts/components/conversation/TimelineFloatingHeader.stories.tsx +++ b/ts/components/conversation/TimelineFloatingHeader.stories.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './TimelineFloatingHeader'; -import { TimelineFloatingHeader } from './TimelineFloatingHeader'; +import type { PropsType } from './TimelineFloatingHeader.js'; +import { TimelineFloatingHeader } from './TimelineFloatingHeader.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/TimelineFloatingHeader.tsx b/ts/components/conversation/TimelineFloatingHeader.tsx index 540805be71a..df944ab9dc0 100644 --- a/ts/components/conversation/TimelineFloatingHeader.tsx +++ b/ts/components/conversation/TimelineFloatingHeader.tsx @@ -6,10 +6,10 @@ import type { CSSProperties, ReactElement } from 'react'; import React, { useEffect, useState } from 'react'; import { animated, useSpring } from '@react-spring/web'; -import type { LocalizerType } from '../../types/Util'; -import { drop } from '../../util/drop'; -import { TimelineDateHeader } from './TimelineDateHeader'; -import { Spinner } from '../Spinner'; +import type { LocalizerType } from '../../types/Util.js'; +import { drop } from '../../util/drop.js'; +import { TimelineDateHeader } from './TimelineDateHeader.js'; +import { Spinner } from '../Spinner.js'; export type PropsType = Readonly<{ i18n: LocalizerType; diff --git a/ts/components/conversation/TimelineItem.stories.tsx b/ts/components/conversation/TimelineItem.stories.tsx index 710f239bd8d..67a58de87ea 100644 --- a/ts/components/conversation/TimelineItem.stories.tsx +++ b/ts/components/conversation/TimelineItem.stories.tsx @@ -4,19 +4,19 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { EmojiPicker } from '../emoji/EmojiPicker'; -import { DurationInSeconds } from '../../util/durations'; -import type { PropsType as TimelineItemProps } from './TimelineItem'; -import { TimelineItem } from './TimelineItem'; -import { UniversalTimerNotification } from './UniversalTimerNotification'; -import { CallMode } from '../../types/CallDisposition'; -import { AvatarColors } from '../../types/Colors'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation'; -import { WidthBreakpoint } from '../_util'; -import { ThemeType } from '../../types/Util'; -import { PaymentEventKind } from '../../types/Payment'; -import { ErrorBoundary } from './ErrorBoundary'; -import { EmojiSkinTone } from '../fun/data/emojis'; +import { EmojiPicker } from '../emoji/EmojiPicker.js'; +import { DurationInSeconds } from '../../util/durations/index.js'; +import type { PropsType as TimelineItemProps } from './TimelineItem.js'; +import { TimelineItem } from './TimelineItem.js'; +import { UniversalTimerNotification } from './UniversalTimerNotification.js'; +import { CallMode } from '../../types/CallDisposition.js'; +import { AvatarColors } from '../../types/Colors.js'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; +import { WidthBreakpoint } from '../_util.js'; +import { ThemeType } from '../../types/Util.js'; +import { PaymentEventKind } from '../../types/Payment.js'; +import { ErrorBoundary } from './ErrorBoundary.js'; +import { EmojiSkinTone } from '../fun/data/emojis.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/TimelineItem.tsx b/ts/components/conversation/TimelineItem.tsx index 32a79401301..1e940a83639 100644 --- a/ts/components/conversation/TimelineItem.tsx +++ b/ts/components/conversation/TimelineItem.tsx @@ -4,65 +4,65 @@ import type { ReactChild, RefObject } from 'react'; import React, { memo } from 'react'; -import type { LocalizerType, ThemeType } from '../../types/Util'; +import type { LocalizerType, ThemeType } from '../../types/Util.js'; -import type { InteractionModeType } from '../../state/ducks/conversations'; -import { TimelineDateHeader } from './TimelineDateHeader'; +import type { InteractionModeType } from '../../state/ducks/conversations.js'; +import { TimelineDateHeader } from './TimelineDateHeader.js'; import type { Props as AllMessageProps, PropsData as TimelineMessageProps, PropsActions as MessageActionsType, -} from './TimelineMessage'; -import type { PropsActionsType as CallingNotificationActionsType } from './CallingNotification'; -import { CallingNotification } from './CallingNotification'; -import { ChatSessionRefreshedNotification } from './ChatSessionRefreshedNotification'; -import type { PropsDataType as DeliveryIssueProps } from './DeliveryIssueNotification'; -import { DeliveryIssueNotification } from './DeliveryIssueNotification'; -import type { PropsData as ChangeNumberNotificationProps } from './ChangeNumberNotification'; -import { ChangeNumberNotification } from './ChangeNumberNotification'; -import type { PropsData as JoinedSignalNotificationProps } from './JoinedSignalNotification'; -import { JoinedSignalNotification } from './JoinedSignalNotification'; -import type { PropsData as TitleTransitionNotificationProps } from './TitleTransitionNotification'; -import { TitleTransitionNotification } from './TitleTransitionNotification'; -import type { CallingNotificationType } from '../../util/callingNotification'; -import { InlineNotificationWrapper } from './InlineNotificationWrapper'; -import type { PropsData as UnsupportedMessageProps } from './UnsupportedMessage'; -import { UnsupportedMessage } from './UnsupportedMessage'; -import type { PropsData as TimerNotificationProps } from './TimerNotification'; -import { TimerNotification } from './TimerNotification'; +} from './TimelineMessage.js'; +import type { PropsActionsType as CallingNotificationActionsType } from './CallingNotification.js'; +import { CallingNotification } from './CallingNotification.js'; +import { ChatSessionRefreshedNotification } from './ChatSessionRefreshedNotification.js'; +import type { PropsDataType as DeliveryIssueProps } from './DeliveryIssueNotification.js'; +import { DeliveryIssueNotification } from './DeliveryIssueNotification.js'; +import type { PropsData as ChangeNumberNotificationProps } from './ChangeNumberNotification.js'; +import { ChangeNumberNotification } from './ChangeNumberNotification.js'; +import type { PropsData as JoinedSignalNotificationProps } from './JoinedSignalNotification.js'; +import { JoinedSignalNotification } from './JoinedSignalNotification.js'; +import type { PropsData as TitleTransitionNotificationProps } from './TitleTransitionNotification.js'; +import { TitleTransitionNotification } from './TitleTransitionNotification.js'; +import type { CallingNotificationType } from '../../util/callingNotification.js'; +import { InlineNotificationWrapper } from './InlineNotificationWrapper.js'; +import type { PropsData as UnsupportedMessageProps } from './UnsupportedMessage.js'; +import { UnsupportedMessage } from './UnsupportedMessage.js'; +import type { PropsData as TimerNotificationProps } from './TimerNotification.js'; +import { TimerNotification } from './TimerNotification.js'; import type { PropsActions as SafetyNumberActionsType, PropsData as SafetyNumberNotificationProps, -} from './SafetyNumberNotification'; -import { SafetyNumberNotification } from './SafetyNumberNotification'; -import type { PropsData as VerificationNotificationProps } from './VerificationNotification'; -import { VerificationNotification } from './VerificationNotification'; -import type { PropsData as GroupNotificationProps } from './GroupNotification'; -import { GroupNotification } from './GroupNotification'; +} from './SafetyNumberNotification.js'; +import { SafetyNumberNotification } from './SafetyNumberNotification.js'; +import type { PropsData as VerificationNotificationProps } from './VerificationNotification.js'; +import { VerificationNotification } from './VerificationNotification.js'; +import type { PropsData as GroupNotificationProps } from './GroupNotification.js'; +import { GroupNotification } from './GroupNotification.js'; import type { PropsDataType as GroupV2ChangeProps, PropsActionsType as GroupV2ChangeActionsType, -} from './GroupV2Change'; -import { GroupV2Change } from './GroupV2Change'; -import type { PropsDataType as GroupV1MigrationProps } from './GroupV1Migration'; -import { GroupV1Migration } from './GroupV1Migration'; -import type { SmartContactRendererType } from '../../groupChange'; -import { ResetSessionNotification } from './ResetSessionNotification'; -import type { PropsType as ProfileChangeNotificationPropsType } from './ProfileChangeNotification'; -import { ProfileChangeNotification } from './ProfileChangeNotification'; -import type { PropsType as PaymentEventNotificationPropsType } from './PaymentEventNotification'; -import { PaymentEventNotification } from './PaymentEventNotification'; -import type { PropsDataType as ConversationMergeNotificationPropsType } from './ConversationMergeNotification'; -import { ConversationMergeNotification } from './ConversationMergeNotification'; -import type { PropsDataType as PhoneNumberDiscoveryNotificationPropsType } from './PhoneNumberDiscoveryNotification'; -import { PhoneNumberDiscoveryNotification } from './PhoneNumberDiscoveryNotification'; -import { SystemMessage } from './SystemMessage'; -import { TimelineMessage } from './TimelineMessage'; +} from './GroupV2Change.js'; +import { GroupV2Change } from './GroupV2Change.js'; +import type { PropsDataType as GroupV1MigrationProps } from './GroupV1Migration.js'; +import { GroupV1Migration } from './GroupV1Migration.js'; +import type { SmartContactRendererType } from '../../groupChange.js'; +import { ResetSessionNotification } from './ResetSessionNotification.js'; +import type { PropsType as ProfileChangeNotificationPropsType } from './ProfileChangeNotification.js'; +import { ProfileChangeNotification } from './ProfileChangeNotification.js'; +import type { PropsType as PaymentEventNotificationPropsType } from './PaymentEventNotification.js'; +import { PaymentEventNotification } from './PaymentEventNotification.js'; +import type { PropsDataType as ConversationMergeNotificationPropsType } from './ConversationMergeNotification.js'; +import { ConversationMergeNotification } from './ConversationMergeNotification.js'; +import type { PropsDataType as PhoneNumberDiscoveryNotificationPropsType } from './PhoneNumberDiscoveryNotification.js'; +import { PhoneNumberDiscoveryNotification } from './PhoneNumberDiscoveryNotification.js'; +import { SystemMessage } from './SystemMessage.js'; +import { TimelineMessage } from './TimelineMessage.js'; import { MessageRequestResponseNotification, type MessageRequestResponseNotificationData, -} from './MessageRequestResponseNotification'; -import type { MessageRequestState } from './MessageRequestActionsConfirmation'; +} from './MessageRequestResponseNotification.js'; +import type { MessageRequestState } from './MessageRequestActionsConfirmation.js'; type CallHistoryType = { type: 'callHistory'; diff --git a/ts/components/conversation/TimelineMessage.stories.tsx b/ts/components/conversation/TimelineMessage.stories.tsx index 6d737b503ab..59cc6f341cd 100644 --- a/ts/components/conversation/TimelineMessage.stories.tsx +++ b/ts/components/conversation/TimelineMessage.stories.tsx @@ -7,13 +7,13 @@ import { isBoolean, noop } from 'lodash'; import { action } from '@storybook/addon-actions'; import type { Meta, StoryFn } from '@storybook/react'; -import { SignalService } from '../../protobuf'; -import { ConversationColors } from '../../types/Colors'; -import { EmojiPicker } from '../emoji/EmojiPicker'; -import type { AudioAttachmentProps } from './Message'; -import type { Props } from './TimelineMessage'; -import { TimelineMessage } from './TimelineMessage'; -import { GiftBadgeStates, TextDirection } from './Message'; +import { SignalService } from '../../protobuf/index.js'; +import { ConversationColors } from '../../types/Colors.js'; +import { EmojiPicker } from '../emoji/EmojiPicker.js'; +import type { AudioAttachmentProps } from './Message.js'; +import type { Props } from './TimelineMessage.js'; +import { TimelineMessage } from './TimelineMessage.js'; +import { GiftBadgeStates, TextDirection } from './Message.js'; import { AUDIO_MP3, IMAGE_JPEG, @@ -24,26 +24,26 @@ import { stringToMIMEType, IMAGE_GIF, VIDEO_QUICKTIME, -} from '../../types/MIME'; -import { ReadStatus } from '../../messages/MessageReadStatus'; -import { MessageAudio } from './MessageAudio'; -import { computePeaks } from '../VoiceNotesPlaybackContext'; -import { pngUrl } from '../../storybook/Fixtures'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation'; -import { WidthBreakpoint } from '../_util'; -import { DAY, HOUR, MINUTE, SECOND } from '../../util/durations'; -import { ContactFormType } from '../../types/EmbeddedContact'; -import { generateAci } from '../../types/ServiceId'; +} from '../../types/MIME.js'; +import { ReadStatus } from '../../messages/MessageReadStatus.js'; +import { MessageAudio } from './MessageAudio.js'; +import { computePeaks } from '../VoiceNotesPlaybackContext.js'; +import { pngUrl } from '../../storybook/Fixtures.js'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; +import { WidthBreakpoint } from '../_util.js'; +import { DAY, HOUR, MINUTE, SECOND } from '../../util/durations/index.js'; +import { ContactFormType } from '../../types/EmbeddedContact.js'; +import { generateAci } from '../../types/ServiceId.js'; import { fakeAttachment, fakeThumbnail, -} from '../../test-helpers/fakeAttachment'; -import { getFakeBadge } from '../../test-helpers/getFakeBadge'; -import { ThemeType } from '../../types/Util'; -import { BadgeCategory } from '../../badges/BadgeCategory'; -import { PaymentEventKind } from '../../types/Payment'; -import { EmojiSkinTone } from '../fun/data/emojis'; +} from '../../test-helpers/fakeAttachment.js'; +import { getFakeBadge } from '../../test-helpers/getFakeBadge.js'; +import { ThemeType } from '../../types/Util.js'; +import { BadgeCategory } from '../../badges/BadgeCategory.js'; +import { PaymentEventKind } from '../../types/Payment.js'; +import { EmojiSkinTone } from '../fun/data/emojis.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/TimelineMessage.tsx b/ts/components/conversation/TimelineMessage.tsx index 74c0f3830e6..8ee7a8eee80 100644 --- a/ts/components/conversation/TimelineMessage.tsx +++ b/ts/components/conversation/TimelineMessage.tsx @@ -15,42 +15,42 @@ import { ContextMenuTrigger } from 'react-contextmenu'; import { createPortal } from 'react-dom'; import { Manager, Popper, Reference } from 'react-popper'; import type { PreventOverflowModifier } from '@popperjs/core/lib/modifiers/preventOverflow'; -import { isDownloaded } from '../../types/Attachment'; -import type { LocalizerType } from '../../types/I18N'; -import { handleOutsideClick } from '../../util/handleOutsideClick'; -import { offsetDistanceModifier } from '../../util/popperUtil'; -import { StopPropagation } from '../StopPropagation'; -import { WidthBreakpoint } from '../_util'; -import { Message } from './Message'; -import type { SmartReactionPicker } from '../../state/smart/ReactionPicker'; +import { isDownloaded } from '../../types/Attachment.js'; +import type { LocalizerType } from '../../types/I18N.js'; +import { handleOutsideClick } from '../../util/handleOutsideClick.js'; +import { offsetDistanceModifier } from '../../util/popperUtil.js'; +import { StopPropagation } from '../StopPropagation.js'; +import { WidthBreakpoint } from '../_util.js'; +import { Message } from './Message.js'; +import type { SmartReactionPicker } from '../../state/smart/ReactionPicker.js'; import type { Props as MessageProps, PropsActions as MessagePropsActions, PropsData as MessagePropsData, PropsHousekeeping, -} from './Message'; -import type { PushPanelForConversationActionType } from '../../state/ducks/conversations'; -import { doesMessageBodyOverflow } from './MessageBodyReadMore'; -import type { Props as ReactionPickerProps } from './ReactionPicker'; +} from './Message.js'; +import type { PushPanelForConversationActionType } from '../../state/ducks/conversations.js'; +import { doesMessageBodyOverflow } from './MessageBodyReadMore.js'; +import type { Props as ReactionPickerProps } from './ReactionPicker.js'; import { useKeyboardShortcutsConditionally, useOpenContextMenu, useToggleReactionPicker, -} from '../../hooks/useKeyboardShortcuts'; -import { PanelType } from '../../types/Panels'; +} from '../../hooks/useKeyboardShortcuts.js'; +import { PanelType } from '../../types/Panels.js'; import type { DeleteMessagesPropsType, ForwardMessagesPayload, -} from '../../state/ducks/globalModals'; -import { useScrollerLock } from '../../hooks/useScrollLock'; +} from '../../state/ducks/globalModals.js'; +import { useScrollerLock } from '../../hooks/useScrollLock.js'; import { type ContextMenuTriggerType, MessageContextMenu, useHandleMessageContextMenu, -} from './MessageContextMenu'; -import { ForwardMessagesModalType } from '../ForwardMessagesModal'; -import { useGroupedAndOrderedReactions } from '../../util/groupAndOrderReactions'; -import { isNotNil } from '../../util/isNotNil'; +} from './MessageContextMenu.js'; +import { ForwardMessagesModalType } from '../ForwardMessagesModal.js'; +import { useGroupedAndOrderedReactions } from '../../util/groupAndOrderReactions.js'; +import { isNotNil } from '../../util/isNotNil.js'; export type PropsData = { canDownload: boolean; diff --git a/ts/components/conversation/TimelineWarning.tsx b/ts/components/conversation/TimelineWarning.tsx index 299243a5cc6..50ad1a7bb2c 100644 --- a/ts/components/conversation/TimelineWarning.tsx +++ b/ts/components/conversation/TimelineWarning.tsx @@ -4,7 +4,7 @@ import type { ReactNode } from 'react'; import React from 'react'; -import type { LocalizerType } from '../../types/Util'; +import type { LocalizerType } from '../../types/Util.js'; const CLASS_NAME = 'module-TimelineWarning'; const ICON_CONTAINER_CLASS_NAME = `${CLASS_NAME}__icon-container`; diff --git a/ts/components/conversation/TimerNotification.stories.tsx b/ts/components/conversation/TimerNotification.stories.tsx index 531d5e160fb..015cdf20fd9 100644 --- a/ts/components/conversation/TimerNotification.stories.tsx +++ b/ts/components/conversation/TimerNotification.stories.tsx @@ -3,9 +3,9 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import { DurationInSeconds } from '../../util/durations'; -import type { Props } from './TimerNotification'; -import { TimerNotification } from './TimerNotification'; +import { DurationInSeconds } from '../../util/durations/index.js'; +import type { Props } from './TimerNotification.js'; +import { TimerNotification } from './TimerNotification.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/TimerNotification.tsx b/ts/components/conversation/TimerNotification.tsx index 4b701b45ef1..5793ea7e362 100644 --- a/ts/components/conversation/TimerNotification.tsx +++ b/ts/components/conversation/TimerNotification.tsx @@ -4,13 +4,13 @@ import type { ReactNode } from 'react'; import React from 'react'; -import { ContactName } from './ContactName'; -import { SystemMessage } from './SystemMessage'; -import { I18n } from '../I18n'; -import type { LocalizerType } from '../../types/Util'; -import * as expirationTimer from '../../util/expirationTimer'; -import type { DurationInSeconds } from '../../util/durations'; -import { createLogger } from '../../logging/log'; +import { ContactName } from './ContactName.js'; +import { SystemMessage } from './SystemMessage.js'; +import { I18n } from '../I18n.js'; +import type { LocalizerType } from '../../types/Util.js'; +import * as expirationTimer from '../../util/expirationTimer.js'; +import type { DurationInSeconds } from '../../util/durations/index.js'; +import { createLogger } from '../../logging/log.js'; const log = createLogger('TimerNotification'); diff --git a/ts/components/conversation/TitleTransitionNotification.stories.tsx b/ts/components/conversation/TitleTransitionNotification.stories.tsx index 9eb47f50a29..ca3a6d9f3e0 100644 --- a/ts/components/conversation/TitleTransitionNotification.stories.tsx +++ b/ts/components/conversation/TitleTransitionNotification.stories.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { Props } from './TitleTransitionNotification'; -import { TitleTransitionNotification } from './TitleTransitionNotification'; +import type { Props } from './TitleTransitionNotification.js'; +import { TitleTransitionNotification } from './TitleTransitionNotification.js'; export default { title: 'Components/Conversation/TitleTransitionNotification', diff --git a/ts/components/conversation/TitleTransitionNotification.tsx b/ts/components/conversation/TitleTransitionNotification.tsx index 66e503d5b32..a2c5cb79c2f 100644 --- a/ts/components/conversation/TitleTransitionNotification.tsx +++ b/ts/components/conversation/TitleTransitionNotification.tsx @@ -3,11 +3,11 @@ import React from 'react'; -import type { LocalizerType } from '../../types/Util'; -import { I18n } from '../I18n'; +import type { LocalizerType } from '../../types/Util.js'; +import { I18n } from '../I18n.js'; -import { SystemMessage } from './SystemMessage'; -import { UserText } from '../UserText'; +import { SystemMessage } from './SystemMessage.js'; +import { UserText } from '../UserText.js'; export type PropsData = { oldTitle: string; diff --git a/ts/components/conversation/TypingAnimation.stories.tsx b/ts/components/conversation/TypingAnimation.stories.tsx index dddba724f22..f86eb0bc8e3 100644 --- a/ts/components/conversation/TypingAnimation.stories.tsx +++ b/ts/components/conversation/TypingAnimation.stories.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { Props } from './TypingAnimation'; -import { TypingAnimation } from './TypingAnimation'; +import type { Props } from './TypingAnimation.js'; +import { TypingAnimation } from './TypingAnimation.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/TypingAnimation.tsx b/ts/components/conversation/TypingAnimation.tsx index 2d62a0e23e1..f7999f5cdcf 100644 --- a/ts/components/conversation/TypingAnimation.tsx +++ b/ts/components/conversation/TypingAnimation.tsx @@ -4,7 +4,7 @@ import React from 'react'; import classNames from 'classnames'; -import type { LocalizerType } from '../../types/Util'; +import type { LocalizerType } from '../../types/Util.js'; export type Props = { i18n: LocalizerType; diff --git a/ts/components/conversation/TypingBubble.stories.tsx b/ts/components/conversation/TypingBubble.stories.tsx index 71c5d2090c4..a8108b6511b 100644 --- a/ts/components/conversation/TypingBubble.stories.tsx +++ b/ts/components/conversation/TypingBubble.stories.tsx @@ -5,12 +5,12 @@ import React, { useEffect, useState } from 'react'; import { times } from 'lodash'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation'; -import type { TypingBubblePropsType } from './TypingBubble'; -import { TypingBubble } from './TypingBubble'; -import { AvatarColors } from '../../types/Colors'; -import { getFakeBadge } from '../../test-helpers/getFakeBadge'; -import { ThemeType } from '../../types/Util'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; +import type { TypingBubblePropsType } from './TypingBubble.js'; +import { TypingBubble } from './TypingBubble.js'; +import { AvatarColors } from '../../types/Colors.js'; +import { getFakeBadge } from '../../test-helpers/getFakeBadge.js'; +import { ThemeType } from '../../types/Util.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/TypingBubble.tsx b/ts/components/conversation/TypingBubble.tsx index fcf13becddf..25b964277f7 100644 --- a/ts/components/conversation/TypingBubble.tsx +++ b/ts/components/conversation/TypingBubble.tsx @@ -6,14 +6,14 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react'; import classNames from 'classnames'; import { animated, useSpring } from '@react-spring/web'; -import { TypingAnimation } from './TypingAnimation'; -import { Avatar } from '../Avatar'; +import { TypingAnimation } from './TypingAnimation.js'; +import { Avatar } from '../Avatar.js'; -import type { LocalizerType, ThemeType } from '../../types/Util'; -import type { ConversationType } from '../../state/ducks/conversations'; -import type { PreferredBadgeSelectorType } from '../../state/selectors/badges'; -import { drop } from '../../util/drop'; -import { useReducedMotion } from '../../hooks/useReducedMotion'; +import type { LocalizerType, ThemeType } from '../../types/Util.js'; +import type { ConversationType } from '../../state/ducks/conversations.js'; +import type { PreferredBadgeSelectorType } from '../../state/selectors/badges.js'; +import { drop } from '../../util/drop.js'; +import { useReducedMotion } from '../../hooks/useReducedMotion.js'; const MAX_AVATARS_COUNT = 3; diff --git a/ts/components/conversation/UniversalTimerNotification.stories.tsx b/ts/components/conversation/UniversalTimerNotification.stories.tsx index 47b630e3101..095f99ec2ab 100644 --- a/ts/components/conversation/UniversalTimerNotification.stories.tsx +++ b/ts/components/conversation/UniversalTimerNotification.stories.tsx @@ -3,9 +3,9 @@ import React from 'react'; import type { Meta } from '@storybook/react'; -import type { Props } from './UniversalTimerNotification'; -import { UniversalTimerNotification } from './UniversalTimerNotification'; -import { EXPIRE_TIMERS } from '../../test-helpers/expireTimers'; +import type { Props } from './UniversalTimerNotification.js'; +import { UniversalTimerNotification } from './UniversalTimerNotification.js'; +import { EXPIRE_TIMERS } from '../../test-helpers/expireTimers.js'; export default { title: 'Components/UniversalTimerNotification', diff --git a/ts/components/conversation/UniversalTimerNotification.tsx b/ts/components/conversation/UniversalTimerNotification.tsx index 6e626de5474..be8707d3108 100644 --- a/ts/components/conversation/UniversalTimerNotification.tsx +++ b/ts/components/conversation/UniversalTimerNotification.tsx @@ -3,10 +3,10 @@ import React from 'react'; -import { SystemMessage } from './SystemMessage'; -import type { LocalizerType } from '../../types/Util'; -import * as expirationTimer from '../../util/expirationTimer'; -import type { DurationInSeconds } from '../../util/durations'; +import { SystemMessage } from './SystemMessage.js'; +import type { LocalizerType } from '../../types/Util.js'; +import * as expirationTimer from '../../util/expirationTimer.js'; +import type { DurationInSeconds } from '../../util/durations/index.js'; export type Props = { i18n: LocalizerType; diff --git a/ts/components/conversation/UnsupportedMessage.stories.tsx b/ts/components/conversation/UnsupportedMessage.stories.tsx index 05d117815b4..28f0c48160c 100644 --- a/ts/components/conversation/UnsupportedMessage.stories.tsx +++ b/ts/components/conversation/UnsupportedMessage.stories.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { ContactType, Props } from './UnsupportedMessage'; -import { UnsupportedMessage } from './UnsupportedMessage'; +import type { ContactType, Props } from './UnsupportedMessage.js'; +import { UnsupportedMessage } from './UnsupportedMessage.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/UnsupportedMessage.tsx b/ts/components/conversation/UnsupportedMessage.tsx index 5998446edab..6a131dd7fbe 100644 --- a/ts/components/conversation/UnsupportedMessage.tsx +++ b/ts/components/conversation/UnsupportedMessage.tsx @@ -3,12 +3,12 @@ import React from 'react'; -import { SystemMessage } from './SystemMessage'; -import { Button, ButtonSize, ButtonVariant } from '../Button'; -import { ContactName } from './ContactName'; -import { I18n } from '../I18n'; -import type { LocalizerType } from '../../types/Util'; -import { openLinkInWebBrowser } from '../../util/openLinkInWebBrowser'; +import { SystemMessage } from './SystemMessage.js'; +import { Button, ButtonSize, ButtonVariant } from '../Button.js'; +import { ContactName } from './ContactName.js'; +import { I18n } from '../I18n.js'; +import type { LocalizerType } from '../../types/Util.js'; +import { openLinkInWebBrowser } from '../../util/openLinkInWebBrowser.js'; export type ContactType = { id: string; diff --git a/ts/components/conversation/VerificationNotification.stories.tsx b/ts/components/conversation/VerificationNotification.stories.tsx index 38f9ced239c..3b005664c6f 100644 --- a/ts/components/conversation/VerificationNotification.stories.tsx +++ b/ts/components/conversation/VerificationNotification.stories.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { Props } from './VerificationNotification'; -import { VerificationNotification } from './VerificationNotification'; +import type { Props } from './VerificationNotification.js'; +import { VerificationNotification } from './VerificationNotification.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/VerificationNotification.tsx b/ts/components/conversation/VerificationNotification.tsx index a28ba553141..20ed18e55a0 100644 --- a/ts/components/conversation/VerificationNotification.tsx +++ b/ts/components/conversation/VerificationNotification.tsx @@ -3,12 +3,12 @@ import React from 'react'; -import { SystemMessage } from './SystemMessage'; -import { ContactName } from './ContactName'; -import { I18n } from '../I18n'; -import type { LocalizerType } from '../../types/Util'; +import { SystemMessage } from './SystemMessage.js'; +import { ContactName } from './ContactName.js'; +import { I18n } from '../I18n.js'; +import type { LocalizerType } from '../../types/Util.js'; -import { missingCaseError } from '../../util/missingCaseError'; +import { missingCaseError } from '../../util/missingCaseError.js'; type Contact = { title: string }; diff --git a/ts/components/conversation/Waveform.tsx b/ts/components/conversation/Waveform.tsx index aaa3294627e..78758926857 100644 --- a/ts/components/conversation/Waveform.tsx +++ b/ts/components/conversation/Waveform.tsx @@ -3,7 +3,7 @@ import classNames from 'classnames'; import React from 'react'; -import { assertDev } from '../../util/assert'; +import { assertDev } from '../../util/assert.js'; type Props = { peaks: ReadonlyArray; diff --git a/ts/components/conversation/WaveformScrubber.tsx b/ts/components/conversation/WaveformScrubber.tsx index a5d73aec2d6..102632077f4 100644 --- a/ts/components/conversation/WaveformScrubber.tsx +++ b/ts/components/conversation/WaveformScrubber.tsx @@ -2,11 +2,11 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { useCallback, useRef } from 'react'; -import { useRefMerger } from '../../hooks/useRefMerger'; -import type { LocalizerType } from '../../types/Util'; -import { durationToPlaybackText } from '../../util/durationToPlaybackText'; -import { Waveform } from './Waveform'; -import { arrow } from '../../util/keyboard'; +import { useRefMerger } from '../../hooks/useRefMerger.js'; +import type { LocalizerType } from '../../types/Util.js'; +import { durationToPlaybackText } from '../../util/durationToPlaybackText.js'; +import { Waveform } from './Waveform.js'; +import { arrow } from '../../util/keyboard.js'; type Props = Readonly<{ i18n: LocalizerType; diff --git a/ts/components/conversation/contactUtil.tsx b/ts/components/conversation/contactUtil.tsx index e50464a13c3..513c713f602 100644 --- a/ts/components/conversation/contactUtil.tsx +++ b/ts/components/conversation/contactUtil.tsx @@ -5,13 +5,13 @@ import React from 'react'; import classNames from 'classnames'; import type { ReadonlyDeep } from 'type-fest'; -import { Avatar, AvatarBlur } from '../Avatar'; -import { AvatarColors } from '../../types/Colors'; -import { getName } from '../../types/EmbeddedContact'; -import { AttachmentStatusIcon } from './AttachmentStatusIcon'; +import { Avatar, AvatarBlur } from '../Avatar.js'; +import { AvatarColors } from '../../types/Colors.js'; +import { getName } from '../../types/EmbeddedContact.js'; +import { AttachmentStatusIcon } from './AttachmentStatusIcon.js'; -import type { LocalizerType } from '../../types/Util'; -import type { EmbeddedContactForUIType } from '../../types/EmbeddedContact'; +import type { LocalizerType } from '../../types/Util.js'; +import type { EmbeddedContactForUIType } from '../../types/EmbeddedContact.js'; export function renderAvatar({ contact, diff --git a/ts/components/conversation/conversation-details/AddGroupMembersModal.stories.tsx b/ts/components/conversation/conversation-details/AddGroupMembersModal.stories.tsx index 6dfb1fcbf03..fa45112a7ca 100644 --- a/ts/components/conversation/conversation-details/AddGroupMembersModal.stories.tsx +++ b/ts/components/conversation/conversation-details/AddGroupMembersModal.stories.tsx @@ -6,17 +6,17 @@ import React, { useState } from 'react'; import { times } from 'lodash'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { sleep } from '../../../util/sleep'; -import { makeLookup } from '../../../util/makeLookup'; -import { deconstructLookup } from '../../../util/deconstructLookup'; -import type { ConversationType } from '../../../state/ducks/conversations'; -import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation'; -import { AddGroupMembersModal } from './AddGroupMembersModal'; -import { ChooseGroupMembersModal } from './AddGroupMembersModal/ChooseGroupMembersModal'; -import { ConfirmAdditionsModal } from './AddGroupMembersModal/ConfirmAdditionsModal'; -import { RequestState } from './util'; -import { ThemeType } from '../../../types/Util'; -import { makeFakeLookupConversationWithoutServiceId } from '../../../test-helpers/fakeLookupConversationWithoutServiceId'; +import { sleep } from '../../../util/sleep.js'; +import { makeLookup } from '../../../util/makeLookup.js'; +import { deconstructLookup } from '../../../util/deconstructLookup.js'; +import type { ConversationType } from '../../../state/ducks/conversations.js'; +import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.js'; +import { AddGroupMembersModal } from './AddGroupMembersModal.js'; +import { ChooseGroupMembersModal } from './AddGroupMembersModal/ChooseGroupMembersModal.js'; +import { ConfirmAdditionsModal } from './AddGroupMembersModal/ConfirmAdditionsModal.js'; +import { RequestState } from './util.js'; +import { ThemeType } from '../../../types/Util.js'; +import { makeFakeLookupConversationWithoutServiceId } from '../../../test-helpers/fakeLookupConversationWithoutServiceId.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/conversation-details/AddGroupMembersModal.tsx b/ts/components/conversation/conversation-details/AddGroupMembersModal.tsx index c8be4d25254..fce4b53c3cc 100644 --- a/ts/components/conversation/conversation-details/AddGroupMembersModal.tsx +++ b/ts/components/conversation/conversation-details/AddGroupMembersModal.tsx @@ -4,19 +4,19 @@ import React, { useReducer } from 'react'; import { without } from 'lodash'; -import type { LocalizerType } from '../../../types/Util'; +import type { LocalizerType } from '../../../types/Util.js'; import { AddGroupMemberErrorDialog, AddGroupMemberErrorDialogMode, -} from '../../AddGroupMemberErrorDialog'; -import type { SmartChooseGroupMembersModalPropsType } from '../../../state/smart/ChooseGroupMembersModal'; -import type { SmartConfirmAdditionsModalPropsType } from '../../../state/smart/ConfirmAdditionsModal'; +} from '../../AddGroupMemberErrorDialog.js'; +import type { SmartChooseGroupMembersModalPropsType } from '../../../state/smart/ChooseGroupMembersModal.js'; +import type { SmartConfirmAdditionsModalPropsType } from '../../../state/smart/ConfirmAdditionsModal.js'; import { toggleSelectedContactForGroupAddition, OneTimeModalState, -} from '../../../groups/toggleSelectedContactForGroupAddition'; -import { missingCaseError } from '../../../util/missingCaseError'; -import type { RequestState } from './util'; +} from '../../../groups/toggleSelectedContactForGroupAddition.js'; +import { missingCaseError } from '../../../util/missingCaseError.js'; +import type { RequestState } from './util.js'; type PropsType = { clearRequestError: () => void; diff --git a/ts/components/conversation/conversation-details/AddGroupMembersModal/ChooseGroupMembersModal.tsx b/ts/components/conversation/conversation-details/AddGroupMembersModal/ChooseGroupMembersModal.tsx index 1d48c97dd78..0e83b7d915e 100644 --- a/ts/components/conversation/conversation-details/AddGroupMembersModal/ChooseGroupMembersModal.tsx +++ b/ts/components/conversation/conversation-details/AddGroupMembersModal/ChooseGroupMembersModal.tsx @@ -11,39 +11,39 @@ import React, { import { omit } from 'lodash'; import type { ListRowProps } from 'react-virtualized'; -import type { LocalizerType, ThemeType } from '../../../../types/Util'; -import { strictAssert, assertDev } from '../../../../util/assert'; -import { refMerger } from '../../../../util/refMerger'; -import { useRestoreFocus } from '../../../../hooks/useRestoreFocus'; -import { missingCaseError } from '../../../../util/missingCaseError'; -import type { LookupConversationWithoutServiceIdActionsType } from '../../../../util/lookupConversationWithoutServiceId'; -import { parseAndFormatPhoneNumber } from '../../../../util/libphonenumberInstance'; -import type { ParsedE164Type } from '../../../../util/libphonenumberInstance'; -import { filterAndSortConversations } from '../../../../util/filterAndSortConversations'; -import type { ConversationType } from '../../../../state/ducks/conversations'; +import type { LocalizerType, ThemeType } from '../../../../types/Util.js'; +import { strictAssert, assertDev } from '../../../../util/assert.js'; +import { refMerger } from '../../../../util/refMerger.js'; +import { useRestoreFocus } from '../../../../hooks/useRestoreFocus.js'; +import { missingCaseError } from '../../../../util/missingCaseError.js'; +import type { LookupConversationWithoutServiceIdActionsType } from '../../../../util/lookupConversationWithoutServiceId.js'; +import { parseAndFormatPhoneNumber } from '../../../../util/libphonenumberInstance.js'; +import type { ParsedE164Type } from '../../../../util/libphonenumberInstance.js'; +import { filterAndSortConversations } from '../../../../util/filterAndSortConversations.js'; +import type { ConversationType } from '../../../../state/ducks/conversations.js'; import type { UUIDFetchStateKeyType, UUIDFetchStateType, -} from '../../../../util/uuidFetchState'; +} from '../../../../util/uuidFetchState.js'; import { isFetchingByE164, isFetchingByUsername, -} from '../../../../util/uuidFetchState'; -import { ModalHost } from '../../../ModalHost'; -import { ContactPills } from '../../../ContactPills'; -import { ContactPill } from '../../../ContactPill'; -import type { Row } from '../../../ConversationList'; -import { RowType } from '../../../ConversationList'; +} from '../../../../util/uuidFetchState.js'; +import { ModalHost } from '../../../ModalHost.js'; +import { ContactPills } from '../../../ContactPills.js'; +import { ContactPill } from '../../../ContactPill.js'; +import type { Row } from '../../../ConversationList.js'; +import { RowType } from '../../../ConversationList.js'; import { ContactCheckbox, ContactCheckboxDisabledReason, -} from '../../../conversationList/ContactCheckbox'; -import { Button, ButtonVariant } from '../../../Button'; -import { SearchInput } from '../../../SearchInput'; -import { ListView } from '../../../ListView'; -import { UsernameCheckbox } from '../../../conversationList/UsernameCheckbox'; -import { PhoneNumberCheckbox } from '../../../conversationList/PhoneNumberCheckbox'; -import { SizeObserver } from '../../../../hooks/useSizeObserver'; +} from '../../../conversationList/ContactCheckbox.js'; +import { Button, ButtonVariant } from '../../../Button.js'; +import { SearchInput } from '../../../SearchInput.js'; +import { ListView } from '../../../ListView.js'; +import { UsernameCheckbox } from '../../../conversationList/UsernameCheckbox.js'; +import { PhoneNumberCheckbox } from '../../../conversationList/PhoneNumberCheckbox.js'; +import { SizeObserver } from '../../../../hooks/useSizeObserver.js'; export type StatePropsType = { regionCode: string | undefined; diff --git a/ts/components/conversation/conversation-details/AddGroupMembersModal/ConfirmAdditionsModal.tsx b/ts/components/conversation/conversation-details/AddGroupMembersModal/ConfirmAdditionsModal.tsx index dab573a7163..0ca1ef4c505 100644 --- a/ts/components/conversation/conversation-details/AddGroupMembersModal/ConfirmAdditionsModal.tsx +++ b/ts/components/conversation/conversation-details/AddGroupMembersModal/ConfirmAdditionsModal.tsx @@ -4,16 +4,16 @@ import type { ReactNode } from 'react'; import React from 'react'; -import type { LocalizerType } from '../../../../types/Util'; -import { assertDev } from '../../../../util/assert'; -import { ModalHost } from '../../../ModalHost'; -import { Button, ButtonVariant } from '../../../Button'; -import { Spinner } from '../../../Spinner'; -import type { ConversationType } from '../../../../state/ducks/conversations'; -import { RequestState } from '../util'; -import { I18n } from '../../../I18n'; -import { ContactName } from '../../ContactName'; -import { UserText } from '../../../UserText'; +import type { LocalizerType } from '../../../../types/Util.js'; +import { assertDev } from '../../../../util/assert.js'; +import { ModalHost } from '../../../ModalHost.js'; +import { Button, ButtonVariant } from '../../../Button.js'; +import { Spinner } from '../../../Spinner.js'; +import type { ConversationType } from '../../../../state/ducks/conversations.js'; +import { RequestState } from '../util.js'; +import { I18n } from '../../../I18n.js'; +import { ContactName } from '../../ContactName.js'; +import { UserText } from '../../../UserText.js'; export type StatePropsType = { groupTitle: string; diff --git a/ts/components/conversation/conversation-details/CallHistoryGroupPanelSection.tsx b/ts/components/conversation/conversation-details/CallHistoryGroupPanelSection.tsx index b8b4133db98..7cd2e37127d 100644 --- a/ts/components/conversation/conversation-details/CallHistoryGroupPanelSection.tsx +++ b/ts/components/conversation/conversation-details/CallHistoryGroupPanelSection.tsx @@ -2,18 +2,20 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; import classNames from 'classnames'; -import type { CallStatus } from '../../../types/CallDisposition'; import { CallDirection, CallType, DirectCallStatus, GroupCallStatus, - type CallHistoryGroup, -} from '../../../types/CallDisposition'; -import type { LocalizerType } from '../../../types/I18N'; -import { formatDate, formatTime } from '../../../util/timestamp'; -import { PanelSection } from './PanelSection'; -import { getDirectCallNotificationText } from '../../../util/callingNotification'; +} from '../../../types/CallDisposition.js'; +import type { + CallStatus, + CallHistoryGroup, +} from '../../../types/CallDisposition.js'; +import type { LocalizerType } from '../../../types/I18N.js'; +import { formatDate, formatTime } from '../../../util/timestamp.js'; +import { PanelSection } from './PanelSection.js'; +import { getDirectCallNotificationText } from '../../../util/callingNotification.js'; function describeCallHistory( i18n: LocalizerType, diff --git a/ts/components/conversation/conversation-details/ConversationDetails.stories.tsx b/ts/components/conversation/conversation-details/ConversationDetails.stories.tsx index bf4a20e3eb2..0447fca798a 100644 --- a/ts/components/conversation/conversation-details/ConversationDetails.stories.tsx +++ b/ts/components/conversation/conversation-details/ConversationDetails.stories.tsx @@ -7,17 +7,17 @@ import { action } from '@storybook/addon-actions'; import { times } from 'lodash'; import type { Meta } from '@storybook/react'; -import type { Props } from './ConversationDetails'; -import { ConversationDetails } from './ConversationDetails'; -import { ChooseGroupMembersModal } from './AddGroupMembersModal/ChooseGroupMembersModal'; -import { ConfirmAdditionsModal } from './AddGroupMembersModal/ConfirmAdditionsModal'; -import type { ConversationType } from '../../../state/ducks/conversations'; -import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation'; -import { makeFakeLookupConversationWithoutServiceId } from '../../../test-helpers/fakeLookupConversationWithoutServiceId'; -import { ThemeType } from '../../../types/Util'; -import { DurationInSeconds } from '../../../util/durations'; -import { NavTab } from '../../../types/Nav'; -import { getFakeCallHistoryGroup } from '../../../test-helpers/getFakeCallHistoryGroup'; +import type { Props } from './ConversationDetails.js'; +import { ConversationDetails } from './ConversationDetails.js'; +import { ChooseGroupMembersModal } from './AddGroupMembersModal/ChooseGroupMembersModal.js'; +import { ConfirmAdditionsModal } from './AddGroupMembersModal/ConfirmAdditionsModal.js'; +import type { ConversationType } from '../../../state/ducks/conversations.js'; +import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.js'; +import { makeFakeLookupConversationWithoutServiceId } from '../../../test-helpers/fakeLookupConversationWithoutServiceId.js'; +import { ThemeType } from '../../../types/Util.js'; +import { DurationInSeconds } from '../../../util/durations/index.js'; +import { NavTab } from '../../../types/Nav.js'; +import { getFakeCallHistoryGroup } from '../../../test-helpers/getFakeCallHistoryGroup.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/conversation-details/ConversationDetails.tsx b/ts/components/conversation/conversation-details/ConversationDetails.tsx index 872fa059e9c..f77b56d56f8 100644 --- a/ts/components/conversation/conversation-details/ConversationDetails.tsx +++ b/ts/components/conversation/conversation-details/ConversationDetails.tsx @@ -4,62 +4,65 @@ import type { ReactNode } from 'react'; import React, { useEffect, useState, useCallback } from 'react'; -import { Button, ButtonIconType, ButtonVariant } from '../../Button'; +import { Button, ButtonIconType, ButtonVariant } from '../../Button.js'; import type { ConversationType, PushPanelForConversationActionType, ShowConversationType, -} from '../../../state/ducks/conversations'; -import type { PreferredBadgeSelectorType } from '../../../state/selectors/badges'; -import type { SmartChooseGroupMembersModalPropsType } from '../../../state/smart/ChooseGroupMembersModal'; -import type { SmartConfirmAdditionsModalPropsType } from '../../../state/smart/ConfirmAdditionsModal'; -import { assertDev } from '../../../util/assert'; -import { getMutedUntilText } from '../../../util/getMutedUntilText'; +} from '../../../state/ducks/conversations.js'; +import type { PreferredBadgeSelectorType } from '../../../state/selectors/badges.js'; +import type { SmartChooseGroupMembersModalPropsType } from '../../../state/smart/ChooseGroupMembersModal.js'; +import type { SmartConfirmAdditionsModalPropsType } from '../../../state/smart/ConfirmAdditionsModal.js'; +import { assertDev } from '../../../util/assert.js'; +import { getMutedUntilText } from '../../../util/getMutedUntilText.js'; -import type { LocalizerType, ThemeType } from '../../../types/Util'; -import type { BadgeType } from '../../../badges/types'; -import { missingCaseError } from '../../../util/missingCaseError'; -import { DurationInSeconds } from '../../../util/durations'; +import type { LocalizerType, ThemeType } from '../../../types/Util.js'; +import type { BadgeType } from '../../../badges/types.js'; +import { missingCaseError } from '../../../util/missingCaseError.js'; +import { DurationInSeconds } from '../../../util/durations/index.js'; -import { DisappearingTimerSelect } from '../../DisappearingTimerSelect'; +import { DisappearingTimerSelect } from '../../DisappearingTimerSelect.js'; -import { PanelRow } from './PanelRow'; -import { PanelSection } from './PanelSection'; -import { AddGroupMembersModal } from './AddGroupMembersModal'; -import { ConversationDetailsActions } from './ConversationDetailsActions'; -import { ConversationDetailsHeader } from './ConversationDetailsHeader'; -import { ConversationDetailsIcon, IconType } from './ConversationDetailsIcon'; -import type { GroupV2Membership } from './ConversationDetailsMembershipList'; -import { ConversationDetailsMembershipList } from './ConversationDetailsMembershipList'; +import { PanelRow } from './PanelRow.js'; +import { PanelSection } from './PanelSection.js'; +import { AddGroupMembersModal } from './AddGroupMembersModal.js'; +import { ConversationDetailsActions } from './ConversationDetailsActions.js'; +import { ConversationDetailsHeader } from './ConversationDetailsHeader.js'; +import { + ConversationDetailsIcon, + IconType, +} from './ConversationDetailsIcon.js'; +import type { GroupV2Membership } from './ConversationDetailsMembershipList.js'; +import { ConversationDetailsMembershipList } from './ConversationDetailsMembershipList.js'; import type { GroupV2PendingMembership, GroupV2RequestingMembership, -} from './PendingInvites'; -import { EditConversationAttributesModal } from './EditConversationAttributesModal'; -import { RequestState } from './util'; -import { getCustomColorStyle } from '../../../util/getCustomColorStyle'; -import { openLinkInWebBrowser } from '../../../util/openLinkInWebBrowser'; -import { ConfirmationDialog } from '../../ConfirmationDialog'; -import { ConversationNotificationsModal } from './ConversationNotificationsModal'; +} from './PendingInvites.js'; +import { EditConversationAttributesModal } from './EditConversationAttributesModal.js'; +import { RequestState } from './util.js'; +import { getCustomColorStyle } from '../../../util/getCustomColorStyle.js'; +import { openLinkInWebBrowser } from '../../../util/openLinkInWebBrowser.js'; +import { ConfirmationDialog } from '../../ConfirmationDialog.js'; +import { ConversationNotificationsModal } from './ConversationNotificationsModal.js'; import type { AvatarDataType, DeleteAvatarFromDiskActionType, ReplaceAvatarActionType, SaveAvatarToDiskActionType, -} from '../../../types/Avatar'; -import { isConversationMuted } from '../../../util/isConversationMuted'; -import { ConversationDetailsGroups } from './ConversationDetailsGroups'; -import { PanelType } from '../../../types/Panels'; -import { type CallHistoryGroup } from '../../../types/CallDisposition'; -import { NavTab } from '../../../types/Nav'; -import { ContextMenu } from '../../ContextMenu'; -import { canHaveNicknameAndNote } from '../../../util/nicknames'; -import { CallHistoryGroupPanelSection } from './CallHistoryGroupPanelSection'; +} from '../../../types/Avatar.js'; +import { isConversationMuted } from '../../../util/isConversationMuted.js'; +import { ConversationDetailsGroups } from './ConversationDetailsGroups.js'; +import { PanelType } from '../../../types/Panels.js'; +import { type CallHistoryGroup } from '../../../types/CallDisposition.js'; +import { NavTab } from '../../../types/Nav.js'; +import { ContextMenu } from '../../ContextMenu.js'; +import { canHaveNicknameAndNote } from '../../../util/nicknames.js'; +import { CallHistoryGroupPanelSection } from './CallHistoryGroupPanelSection.js'; import { InAnotherCallTooltip, getTooltipContent, -} from '../InAnotherCallTooltip'; -import { BadgeSustainerInstructionsDialog } from '../../BadgeSustainerInstructionsDialog'; +} from '../InAnotherCallTooltip.js'; +import { BadgeSustainerInstructionsDialog } from '../../BadgeSustainerInstructionsDialog.js'; enum ModalState { AddingGroupMembers, diff --git a/ts/components/conversation/conversation-details/ConversationDetailsActions.stories.tsx b/ts/components/conversation/conversation-details/ConversationDetailsActions.stories.tsx index 093c198e299..c2206245aa3 100644 --- a/ts/components/conversation/conversation-details/ConversationDetailsActions.stories.tsx +++ b/ts/components/conversation/conversation-details/ConversationDetailsActions.stories.tsx @@ -5,8 +5,8 @@ import * as React from 'react'; import { isBoolean } from 'lodash'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './ConversationDetailsActions'; -import { ConversationDetailsActions } from './ConversationDetailsActions'; +import type { Props } from './ConversationDetailsActions.js'; +import { ConversationDetailsActions } from './ConversationDetailsActions.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/conversation-details/ConversationDetailsActions.tsx b/ts/components/conversation/conversation-details/ConversationDetailsActions.tsx index dc185c8eddf..c5d2599dbe2 100644 --- a/ts/components/conversation/conversation-details/ConversationDetailsActions.tsx +++ b/ts/components/conversation/conversation-details/ConversationDetailsActions.tsx @@ -5,13 +5,16 @@ import type { ReactNode } from 'react'; import React, { useState } from 'react'; import classNames from 'classnames'; -import type { LocalizerType } from '../../../types/Util'; -import { ConfirmationDialog } from '../../ConfirmationDialog'; -import { Tooltip, TooltipPlacement } from '../../Tooltip'; +import type { LocalizerType } from '../../../types/Util.js'; +import { ConfirmationDialog } from '../../ConfirmationDialog.js'; +import { Tooltip, TooltipPlacement } from '../../Tooltip.js'; -import { PanelRow } from './PanelRow'; -import { PanelSection } from './PanelSection'; -import { ConversationDetailsIcon, IconType } from './ConversationDetailsIcon'; +import { PanelRow } from './PanelRow.js'; +import { PanelSection } from './PanelSection.js'; +import { + ConversationDetailsIcon, + IconType, +} from './ConversationDetailsIcon.js'; export type Props = { acceptConversation: (id: string) => void; diff --git a/ts/components/conversation/conversation-details/ConversationDetailsGroups.tsx b/ts/components/conversation/conversation-details/ConversationDetailsGroups.tsx index 0765989a3a6..41bc1b6e902 100644 --- a/ts/components/conversation/conversation-details/ConversationDetailsGroups.tsx +++ b/ts/components/conversation/conversation-details/ConversationDetailsGroups.tsx @@ -5,12 +5,15 @@ import React from 'react'; import type { ConversationType, ShowConversationType, -} from '../../../state/ducks/conversations'; -import type { LocalizerType } from '../../../types/Util'; -import { Avatar, AvatarSize } from '../../Avatar'; -import { ConversationDetailsIcon, IconType } from './ConversationDetailsIcon'; -import { PanelRow } from './PanelRow'; -import { PanelSection } from './PanelSection'; +} from '../../../state/ducks/conversations.js'; +import type { LocalizerType } from '../../../types/Util.js'; +import { Avatar, AvatarSize } from '../../Avatar.js'; +import { + ConversationDetailsIcon, + IconType, +} from './ConversationDetailsIcon.js'; +import { PanelRow } from './PanelRow.js'; +import { PanelSection } from './PanelSection.js'; type Props = { contactId: string; diff --git a/ts/components/conversation/conversation-details/ConversationDetailsHeader.stories.tsx b/ts/components/conversation/conversation-details/ConversationDetailsHeader.stories.tsx index d98e1c1b2f6..368062bc8fb 100644 --- a/ts/components/conversation/conversation-details/ConversationDetailsHeader.stories.tsx +++ b/ts/components/conversation/conversation-details/ConversationDetailsHeader.stories.tsx @@ -4,12 +4,12 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation'; -import { getFakeBadges } from '../../../test-helpers/getFakeBadge'; -import { StorybookThemeContext } from '../../../../.storybook/StorybookThemeContext'; -import type { ConversationType } from '../../../state/ducks/conversations'; -import type { Props } from './ConversationDetailsHeader'; -import { ConversationDetailsHeader } from './ConversationDetailsHeader'; +import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.js'; +import { getFakeBadges } from '../../../test-helpers/getFakeBadge.js'; +import { StorybookThemeContext } from '../../../../.storybook/StorybookThemeContext.js'; +import type { ConversationType } from '../../../state/ducks/conversations.js'; +import type { Props } from './ConversationDetailsHeader.js'; +import { ConversationDetailsHeader } from './ConversationDetailsHeader.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/conversation-details/ConversationDetailsHeader.tsx b/ts/components/conversation/conversation-details/ConversationDetailsHeader.tsx index 664ae67fb9c..8db6f11ed3d 100644 --- a/ts/components/conversation/conversation-details/ConversationDetailsHeader.tsx +++ b/ts/components/conversation/conversation-details/ConversationDetailsHeader.tsx @@ -4,18 +4,18 @@ import type { ReactNode } from 'react'; import React, { useState } from 'react'; -import { Avatar, AvatarBlur, AvatarSize } from '../../Avatar'; -import { AvatarLightbox } from '../../AvatarLightbox'; -import type { ConversationType } from '../../../state/ducks/conversations'; -import { GroupDescription } from '../GroupDescription'; -import { About } from '../About'; -import type { LocalizerType, ThemeType } from '../../../types/Util'; -import { assertDev } from '../../../util/assert'; -import { BadgeDialog } from '../../BadgeDialog'; -import type { BadgeType } from '../../../badges/types'; -import { UserText } from '../../UserText'; -import { isInSystemContacts } from '../../../util/isInSystemContacts'; -import { InContactsIcon } from '../../InContactsIcon'; +import { Avatar, AvatarBlur, AvatarSize } from '../../Avatar.js'; +import { AvatarLightbox } from '../../AvatarLightbox.js'; +import type { ConversationType } from '../../../state/ducks/conversations.js'; +import { GroupDescription } from '../GroupDescription.js'; +import { About } from '../About.js'; +import type { LocalizerType, ThemeType } from '../../../types/Util.js'; +import { assertDev } from '../../../util/assert.js'; +import { BadgeDialog } from '../../BadgeDialog.js'; +import type { BadgeType } from '../../../badges/types.js'; +import { UserText } from '../../UserText.js'; +import { isInSystemContacts } from '../../../util/isInSystemContacts.js'; +import { InContactsIcon } from '../../InContactsIcon.js'; export type Props = { areWeASubscriber: boolean; diff --git a/ts/components/conversation/conversation-details/ConversationDetailsIcon.stories.tsx b/ts/components/conversation/conversation-details/ConversationDetailsIcon.stories.tsx index 59da2abfb8a..290614bbb19 100644 --- a/ts/components/conversation/conversation-details/ConversationDetailsIcon.stories.tsx +++ b/ts/components/conversation/conversation-details/ConversationDetailsIcon.stories.tsx @@ -4,8 +4,11 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './ConversationDetailsIcon'; -import { ConversationDetailsIcon, IconType } from './ConversationDetailsIcon'; +import type { Props } from './ConversationDetailsIcon.js'; +import { + ConversationDetailsIcon, + IconType, +} from './ConversationDetailsIcon.js'; export default { title: 'Components/Conversation/ConversationDetails/ConversationDetailIcon', diff --git a/ts/components/conversation/conversation-details/ConversationDetailsIcon.tsx b/ts/components/conversation/conversation-details/ConversationDetailsIcon.tsx index 5f3fd2b8ff4..c725fbe6a02 100644 --- a/ts/components/conversation/conversation-details/ConversationDetailsIcon.tsx +++ b/ts/components/conversation/conversation-details/ConversationDetailsIcon.tsx @@ -4,8 +4,8 @@ import React from 'react'; import classNames from 'classnames'; -import { Spinner } from '../../Spinner'; -import { bemGenerator } from './util'; +import { Spinner } from '../../Spinner.js'; +import { bemGenerator } from './util.js'; export enum IconType { 'approveAllMembers' = 'approveAllMembers', diff --git a/ts/components/conversation/conversation-details/ConversationDetailsMembershipList.stories.tsx b/ts/components/conversation/conversation-details/ConversationDetailsMembershipList.stories.tsx index b3812744444..98050f65046 100644 --- a/ts/components/conversation/conversation-details/ConversationDetailsMembershipList.stories.tsx +++ b/ts/components/conversation/conversation-details/ConversationDetailsMembershipList.stories.tsx @@ -4,14 +4,14 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation'; -import { ThemeType } from '../../../types/Util'; +import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.js'; +import { ThemeType } from '../../../types/Util.js'; import type { Props, GroupV2Membership, -} from './ConversationDetailsMembershipList'; -import { ConversationDetailsMembershipList } from './ConversationDetailsMembershipList'; +} from './ConversationDetailsMembershipList.js'; +import { ConversationDetailsMembershipList } from './ConversationDetailsMembershipList.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/conversation-details/ConversationDetailsMembershipList.tsx b/ts/components/conversation/conversation-details/ConversationDetailsMembershipList.tsx index 8f882ca165f..66e92075cff 100644 --- a/ts/components/conversation/conversation-details/ConversationDetailsMembershipList.tsx +++ b/ts/components/conversation/conversation-details/ConversationDetailsMembershipList.tsx @@ -3,16 +3,19 @@ import React from 'react'; -import type { LocalizerType, ThemeType } from '../../../types/Util'; +import type { LocalizerType, ThemeType } from '../../../types/Util.js'; -import { Avatar, AvatarSize } from '../../Avatar'; -import { Emojify } from '../Emojify'; +import { Avatar, AvatarSize } from '../../Avatar.js'; +import { Emojify } from '../Emojify.js'; -import { ConversationDetailsIcon, IconType } from './ConversationDetailsIcon'; -import type { ConversationType } from '../../../state/ducks/conversations'; -import type { PreferredBadgeSelectorType } from '../../../state/selectors/badges'; -import { PanelRow } from './PanelRow'; -import { PanelSection } from './PanelSection'; +import { + ConversationDetailsIcon, + IconType, +} from './ConversationDetailsIcon.js'; +import type { ConversationType } from '../../../state/ducks/conversations.js'; +import type { PreferredBadgeSelectorType } from '../../../state/selectors/badges.js'; +import { PanelRow } from './PanelRow.js'; +import { PanelSection } from './PanelSection.js'; export type GroupV2Membership = { isAdmin: boolean; diff --git a/ts/components/conversation/conversation-details/ConversationNotificationsModal.tsx b/ts/components/conversation/conversation-details/ConversationNotificationsModal.tsx index 6d0b1fdbc71..ea29a3b5de1 100644 --- a/ts/components/conversation/conversation-details/ConversationNotificationsModal.tsx +++ b/ts/components/conversation/conversation-details/ConversationNotificationsModal.tsx @@ -4,12 +4,12 @@ import React, { useMemo, useState } from 'react'; import { v4 as uuid } from 'uuid'; -import type { LocalizerType } from '../../../types/Util'; -import { getMuteOptions } from '../../../util/getMuteOptions'; -import { parseIntOrThrow } from '../../../util/parseIntOrThrow'; -import { CircleCheckbox, Variant } from '../../CircleCheckbox'; -import { Modal } from '../../Modal'; -import { Button, ButtonVariant } from '../../Button'; +import type { LocalizerType } from '../../../types/Util.js'; +import { getMuteOptions } from '../../../util/getMuteOptions.js'; +import { parseIntOrThrow } from '../../../util/parseIntOrThrow.js'; +import { CircleCheckbox, Variant } from '../../CircleCheckbox.js'; +import { Modal } from '../../Modal.js'; +import { Button, ButtonVariant } from '../../Button.js'; type PropsType = { i18n: LocalizerType; diff --git a/ts/components/conversation/conversation-details/ConversationNotificationsSettings.stories.tsx b/ts/components/conversation/conversation-details/ConversationNotificationsSettings.stories.tsx index a558da73179..fa6f5ccb0b3 100644 --- a/ts/components/conversation/conversation-details/ConversationNotificationsSettings.stories.tsx +++ b/ts/components/conversation/conversation-details/ConversationNotificationsSettings.stories.tsx @@ -4,8 +4,8 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './ConversationNotificationsSettings'; -import { ConversationNotificationsSettings } from './ConversationNotificationsSettings'; +import type { PropsType } from './ConversationNotificationsSettings.js'; +import { ConversationNotificationsSettings } from './ConversationNotificationsSettings.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/conversation-details/ConversationNotificationsSettings.tsx b/ts/components/conversation/conversation-details/ConversationNotificationsSettings.tsx index c4d443f43fc..89fd57c6350 100644 --- a/ts/components/conversation/conversation-details/ConversationNotificationsSettings.tsx +++ b/ts/components/conversation/conversation-details/ConversationNotificationsSettings.tsx @@ -2,15 +2,18 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { useMemo, useId } from 'react'; -import type { ConversationTypeType } from '../../../state/ducks/conversations'; -import type { LocalizerType } from '../../../types/Util'; -import { PanelSection } from './PanelSection'; -import { PanelRow } from './PanelRow'; -import { ConversationDetailsIcon, IconType } from './ConversationDetailsIcon'; -import { Select } from '../../Select'; -import { isConversationMuted } from '../../../util/isConversationMuted'; -import { getMuteOptions } from '../../../util/getMuteOptions'; -import { parseIntOrThrow } from '../../../util/parseIntOrThrow'; +import type { ConversationTypeType } from '../../../state/ducks/conversations.js'; +import type { LocalizerType } from '../../../types/Util.js'; +import { PanelSection } from './PanelSection.js'; +import { PanelRow } from './PanelRow.js'; +import { + ConversationDetailsIcon, + IconType, +} from './ConversationDetailsIcon.js'; +import { Select } from '../../Select.js'; +import { isConversationMuted } from '../../../util/isConversationMuted.js'; +import { getMuteOptions } from '../../../util/getMuteOptions.js'; +import { parseIntOrThrow } from '../../../util/parseIntOrThrow.js'; export type PropsType = { id: string; diff --git a/ts/components/conversation/conversation-details/EditConversationAttributesModal.stories.tsx b/ts/components/conversation/conversation-details/EditConversationAttributesModal.stories.tsx index d7d42b42b61..0ccb0653988 100644 --- a/ts/components/conversation/conversation-details/EditConversationAttributesModal.stories.tsx +++ b/ts/components/conversation/conversation-details/EditConversationAttributesModal.stories.tsx @@ -5,8 +5,8 @@ import type { ComponentProps } from 'react'; import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { EditConversationAttributesModal } from './EditConversationAttributesModal'; -import { RequestState } from './util'; +import { EditConversationAttributesModal } from './EditConversationAttributesModal.js'; +import { RequestState } from './util.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/conversation-details/EditConversationAttributesModal.tsx b/ts/components/conversation/conversation-details/EditConversationAttributesModal.tsx index 1ac9aef967f..b53afa89dd9 100644 --- a/ts/components/conversation/conversation-details/EditConversationAttributesModal.tsx +++ b/ts/components/conversation/conversation-details/EditConversationAttributesModal.tsx @@ -4,23 +4,23 @@ import type { FormEventHandler } from 'react'; import React, { useCallback, useRef, useState } from 'react'; -import type { LocalizerType } from '../../../types/Util'; -import { Modal } from '../../Modal'; -import { AvatarEditor } from '../../AvatarEditor'; -import { AvatarPreview } from '../../AvatarPreview'; -import { Button, ButtonVariant } from '../../Button'; -import { Spinner } from '../../Spinner'; -import { GroupDescriptionInput } from '../../GroupDescriptionInput'; -import { GroupTitleInput } from '../../GroupTitleInput'; -import { RequestState } from './util'; +import type { LocalizerType } from '../../../types/Util.js'; +import { Modal } from '../../Modal.js'; +import { AvatarEditor } from '../../AvatarEditor.js'; +import { AvatarPreview } from '../../AvatarPreview.js'; +import { Button, ButtonVariant } from '../../Button.js'; +import { Spinner } from '../../Spinner.js'; +import { GroupDescriptionInput } from '../../GroupDescriptionInput.js'; +import { GroupTitleInput } from '../../GroupTitleInput.js'; +import { RequestState } from './util.js'; import type { AvatarDataType, DeleteAvatarFromDiskActionType, ReplaceAvatarActionType, SaveAvatarToDiskActionType, -} from '../../../types/Avatar'; -import type { AvatarColorType } from '../../../types/Colors'; -import { useConfirmDiscard } from '../../../hooks/useConfirmDiscard'; +} from '../../../types/Avatar.js'; +import type { AvatarColorType } from '../../../types/Colors.js'; +import { useConfirmDiscard } from '../../../hooks/useConfirmDiscard.js'; type PropsType = { avatarColor?: AvatarColorType; diff --git a/ts/components/conversation/conversation-details/GroupLinkManagement.stories.tsx b/ts/components/conversation/conversation-details/GroupLinkManagement.stories.tsx index 61a88a14ea0..315a8ffb79b 100644 --- a/ts/components/conversation/conversation-details/GroupLinkManagement.stories.tsx +++ b/ts/components/conversation/conversation-details/GroupLinkManagement.stories.tsx @@ -4,11 +4,11 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './GroupLinkManagement'; -import { GroupLinkManagement } from './GroupLinkManagement'; -import { SignalService as Proto } from '../../../protobuf'; -import type { ConversationType } from '../../../state/ducks/conversations'; -import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation'; +import type { PropsType } from './GroupLinkManagement.js'; +import { GroupLinkManagement } from './GroupLinkManagement.js'; +import { SignalService as Proto } from '../../../protobuf/index.js'; +import type { ConversationType } from '../../../state/ducks/conversations.js'; +import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/conversation-details/GroupLinkManagement.tsx b/ts/components/conversation/conversation-details/GroupLinkManagement.tsx index a403b56db91..f7ad017a411 100644 --- a/ts/components/conversation/conversation-details/GroupLinkManagement.tsx +++ b/ts/components/conversation/conversation-details/GroupLinkManagement.tsx @@ -1,17 +1,20 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import React, { useId, useState } from 'react'; -import type { ConversationType } from '../../../state/ducks/conversations'; -import type { LocalizerType } from '../../../types/Util'; -import { ConfirmationDialog } from '../../ConfirmationDialog'; -import { ConversationDetailsIcon, IconType } from './ConversationDetailsIcon'; -import { PanelRow } from './PanelRow'; -import { PanelSection } from './PanelSection'; -import { Select } from '../../Select'; -import { SignalService as Proto } from '../../../protobuf'; -import { copyGroupLink } from '../../../util/copyLinksWithToast'; -import { drop } from '../../../util/drop'; -import { useDelayedRestoreFocus } from '../../../hooks/useRestoreFocus'; +import type { ConversationType } from '../../../state/ducks/conversations.js'; +import type { LocalizerType } from '../../../types/Util.js'; +import { ConfirmationDialog } from '../../ConfirmationDialog.js'; +import { + ConversationDetailsIcon, + IconType, +} from './ConversationDetailsIcon.js'; +import { PanelRow } from './PanelRow.js'; +import { PanelSection } from './PanelSection.js'; +import { Select } from '../../Select.js'; +import { SignalService as Proto } from '../../../protobuf/index.js'; +import { copyGroupLink } from '../../../util/copyLinksWithToast.js'; +import { drop } from '../../../util/drop.js'; +import { useDelayedRestoreFocus } from '../../../hooks/useRestoreFocus.js'; const AccessControlEnum = Proto.AccessControl.AccessRequired; diff --git a/ts/components/conversation/conversation-details/GroupV2Permissions.stories.tsx b/ts/components/conversation/conversation-details/GroupV2Permissions.stories.tsx index d1e2fe8dc53..433cbf04c31 100644 --- a/ts/components/conversation/conversation-details/GroupV2Permissions.stories.tsx +++ b/ts/components/conversation/conversation-details/GroupV2Permissions.stories.tsx @@ -4,10 +4,10 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './GroupV2Permissions'; -import { GroupV2Permissions } from './GroupV2Permissions'; -import type { ConversationType } from '../../../state/ducks/conversations'; -import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation'; +import type { PropsType } from './GroupV2Permissions.js'; +import { GroupV2Permissions } from './GroupV2Permissions.js'; +import type { ConversationType } from '../../../state/ducks/conversations.js'; +import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/conversation-details/GroupV2Permissions.tsx b/ts/components/conversation/conversation-details/GroupV2Permissions.tsx index d260ad011cc..fe58e56c098 100644 --- a/ts/components/conversation/conversation-details/GroupV2Permissions.tsx +++ b/ts/components/conversation/conversation-details/GroupV2Permissions.tsx @@ -1,13 +1,13 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import React, { useId } from 'react'; -import type { ConversationType } from '../../../state/ducks/conversations'; -import type { LocalizerType } from '../../../types/Util'; -import { getAccessControlOptions } from '../../../util/getAccessControlOptions'; -import { SignalService as Proto } from '../../../protobuf'; -import { PanelRow } from './PanelRow'; -import { PanelSection } from './PanelSection'; -import { Select } from '../../Select'; +import type { ConversationType } from '../../../state/ducks/conversations.js'; +import type { LocalizerType } from '../../../types/Util.js'; +import { getAccessControlOptions } from '../../../util/getAccessControlOptions.js'; +import { SignalService as Proto } from '../../../protobuf/index.js'; +import { PanelRow } from './PanelRow.js'; +import { PanelSection } from './PanelSection.js'; +import { Select } from '../../Select.js'; export type PropsDataType = { conversation?: ConversationType; diff --git a/ts/components/conversation/conversation-details/PanelRow.stories.tsx b/ts/components/conversation/conversation-details/PanelRow.stories.tsx index c65e2bfc7eb..be8487be149 100644 --- a/ts/components/conversation/conversation-details/PanelRow.stories.tsx +++ b/ts/components/conversation/conversation-details/PanelRow.stories.tsx @@ -4,9 +4,12 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './PanelRow'; -import { PanelRow } from './PanelRow'; -import { ConversationDetailsIcon, IconType } from './ConversationDetailsIcon'; +import type { Props } from './PanelRow.js'; +import { PanelRow } from './PanelRow.js'; +import { + ConversationDetailsIcon, + IconType, +} from './ConversationDetailsIcon.js'; export default { title: 'Components/Conversation/ConversationDetails/PanelRow', diff --git a/ts/components/conversation/conversation-details/PanelRow.tsx b/ts/components/conversation/conversation-details/PanelRow.tsx index ce6d31e887a..cdafd4f7ddd 100644 --- a/ts/components/conversation/conversation-details/PanelRow.tsx +++ b/ts/components/conversation/conversation-details/PanelRow.tsx @@ -3,7 +3,7 @@ import React from 'react'; import classNames from 'classnames'; -import { bemGenerator } from './util'; +import { bemGenerator } from './util.js'; export type Props = { alwaysShowActions?: boolean; diff --git a/ts/components/conversation/conversation-details/PanelSection.stories.tsx b/ts/components/conversation/conversation-details/PanelSection.stories.tsx index eda85a6dbc7..85d91d85b0e 100644 --- a/ts/components/conversation/conversation-details/PanelSection.stories.tsx +++ b/ts/components/conversation/conversation-details/PanelSection.stories.tsx @@ -4,9 +4,9 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './PanelSection'; -import { PanelSection } from './PanelSection'; -import { PanelRow } from './PanelRow'; +import type { Props } from './PanelSection.js'; +import { PanelSection } from './PanelSection.js'; +import { PanelRow } from './PanelRow.js'; export default { title: 'Components/Conversation/ConversationDetails/PanelSection', diff --git a/ts/components/conversation/conversation-details/PanelSection.tsx b/ts/components/conversation/conversation-details/PanelSection.tsx index 2a0cf4500ad..d2328c0fd5c 100644 --- a/ts/components/conversation/conversation-details/PanelSection.tsx +++ b/ts/components/conversation/conversation-details/PanelSection.tsx @@ -3,7 +3,7 @@ import React from 'react'; import classNames from 'classnames'; -import { bemGenerator } from './util'; +import { bemGenerator } from './util.js'; export type Props = { actions?: React.ReactNode; diff --git a/ts/components/conversation/conversation-details/PendingInvites.stories.tsx b/ts/components/conversation/conversation-details/PendingInvites.stories.tsx index 23c4c197d84..4a3f2832e30 100644 --- a/ts/components/conversation/conversation-details/PendingInvites.stories.tsx +++ b/ts/components/conversation/conversation-details/PendingInvites.stories.tsx @@ -5,14 +5,14 @@ import * as React from 'react'; import { times } from 'lodash'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { generateAci } from '../../../types/ServiceId'; -import { StorySendMode } from '../../../types/Stories'; -import type { PropsType } from './PendingInvites'; -import { PendingInvites } from './PendingInvites'; -import type { ConversationType } from '../../../state/ducks/conversations'; -import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation'; -import { getFakeBadge } from '../../../test-helpers/getFakeBadge'; -import { StorybookThemeContext } from '../../../../.storybook/StorybookThemeContext'; +import { generateAci } from '../../../types/ServiceId.js'; +import { StorySendMode } from '../../../types/Stories.js'; +import type { PropsType } from './PendingInvites.js'; +import { PendingInvites } from './PendingInvites.js'; +import type { ConversationType } from '../../../state/ducks/conversations.js'; +import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.js'; +import { getFakeBadge } from '../../../test-helpers/getFakeBadge.js'; +import { StorybookThemeContext } from '../../../../.storybook/StorybookThemeContext.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/conversation-details/PendingInvites.tsx b/ts/components/conversation/conversation-details/PendingInvites.tsx index 86fc268b671..68fe359ac74 100644 --- a/ts/components/conversation/conversation-details/PendingInvites.tsx +++ b/ts/components/conversation/conversation-details/PendingInvites.tsx @@ -4,18 +4,21 @@ import React from 'react'; import _ from 'lodash'; -import type { ConversationType } from '../../../state/ducks/conversations'; -import type { LocalizerType, ThemeType } from '../../../types/Util'; -import type { PreferredBadgeSelectorType } from '../../../state/selectors/badges'; -import type { AciString } from '../../../types/ServiceId'; -import { Avatar, AvatarSize } from '../../Avatar'; -import { ConfirmationDialog } from '../../ConfirmationDialog'; -import { PanelSection } from './PanelSection'; -import { PanelRow } from './PanelRow'; -import { ConversationDetailsIcon, IconType } from './ConversationDetailsIcon'; -import { isAccessControlEnabled } from '../../../groups/util'; -import { Tabs } from '../../Tabs'; -import { assertDev } from '../../../util/assert'; +import type { ConversationType } from '../../../state/ducks/conversations.js'; +import type { LocalizerType, ThemeType } from '../../../types/Util.js'; +import type { PreferredBadgeSelectorType } from '../../../state/selectors/badges.js'; +import type { AciString } from '../../../types/ServiceId.js'; +import { Avatar, AvatarSize } from '../../Avatar.js'; +import { ConfirmationDialog } from '../../ConfirmationDialog.js'; +import { PanelSection } from './PanelSection.js'; +import { PanelRow } from './PanelRow.js'; +import { + ConversationDetailsIcon, + IconType, +} from './ConversationDetailsIcon.js'; +import { isAccessControlEnabled } from '../../../groups/util.js'; +import { Tabs } from '../../Tabs.js'; +import { assertDev } from '../../../util/assert.js'; export type PropsDataType = { readonly conversation?: ConversationType; diff --git a/ts/components/conversation/media-gallery/AttachmentSection.stories.tsx b/ts/components/conversation/media-gallery/AttachmentSection.stories.tsx index 321ddb599d8..42cefee062f 100644 --- a/ts/components/conversation/media-gallery/AttachmentSection.stories.tsx +++ b/ts/components/conversation/media-gallery/AttachmentSection.stories.tsx @@ -6,9 +6,13 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './AttachmentSection'; -import { AttachmentSection } from './AttachmentSection'; -import { createRandomDocuments, createRandomMedia, days } from './utils/mocks'; +import type { Props } from './AttachmentSection.js'; +import { AttachmentSection } from './AttachmentSection.js'; +import { + createRandomDocuments, + createRandomMedia, + days, +} from './utils/mocks.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/media-gallery/AttachmentSection.tsx b/ts/components/conversation/media-gallery/AttachmentSection.tsx index 141703cc840..3e5d0fa57a7 100644 --- a/ts/components/conversation/media-gallery/AttachmentSection.tsx +++ b/ts/components/conversation/media-gallery/AttachmentSection.tsx @@ -3,13 +3,13 @@ import React from 'react'; -import type { ItemClickEvent } from './types/ItemClickEvent'; -import type { LocalizerType, ThemeType } from '../../../types/Util'; -import type { MediaItemType } from '../../../types/MediaItem'; -import { DocumentListItem } from './DocumentListItem'; -import { MediaGridItem } from './MediaGridItem'; -import { missingCaseError } from '../../../util/missingCaseError'; -import { tw } from '../../../axo/tw'; +import type { ItemClickEvent } from './types/ItemClickEvent.js'; +import type { LocalizerType, ThemeType } from '../../../types/Util.js'; +import type { MediaItemType } from '../../../types/MediaItem.js'; +import { DocumentListItem } from './DocumentListItem.js'; +import { MediaGridItem } from './MediaGridItem.js'; +import { missingCaseError } from '../../../util/missingCaseError.js'; +import { tw } from '../../../axo/tw.js'; export type Props = { header?: string; diff --git a/ts/components/conversation/media-gallery/DocumentListItem.stories.tsx b/ts/components/conversation/media-gallery/DocumentListItem.stories.tsx index 5cf17acbf26..a46bb13f2a2 100644 --- a/ts/components/conversation/media-gallery/DocumentListItem.stories.tsx +++ b/ts/components/conversation/media-gallery/DocumentListItem.stories.tsx @@ -4,9 +4,12 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './DocumentListItem'; -import { DocumentListItem } from './DocumentListItem'; -import { createPreparedMediaItems, createRandomDocuments } from './utils/mocks'; +import type { Props } from './DocumentListItem.js'; +import { DocumentListItem } from './DocumentListItem.js'; +import { + createPreparedMediaItems, + createRandomDocuments, +} from './utils/mocks.js'; export default { title: 'Components/Conversation/MediaGallery/DocumentListItem', diff --git a/ts/components/conversation/media-gallery/DocumentListItem.tsx b/ts/components/conversation/media-gallery/DocumentListItem.tsx index 462563e9ff1..6e930d4e61c 100644 --- a/ts/components/conversation/media-gallery/DocumentListItem.tsx +++ b/ts/components/conversation/media-gallery/DocumentListItem.tsx @@ -4,10 +4,10 @@ import React from 'react'; import moment from 'moment'; -import { formatFileSize } from '../../../util/formatFileSize'; -import type { MediaItemType } from '../../../types/MediaItem'; -import { tw } from '../../../axo/tw'; -import { FileThumbnail } from '../../FileThumbnail'; +import { formatFileSize } from '../../../util/formatFileSize.js'; +import type { MediaItemType } from '../../../types/MediaItem.js'; +import { tw } from '../../../axo/tw.js'; +import { FileThumbnail } from '../../FileThumbnail.js'; export type Props = { // Required diff --git a/ts/components/conversation/media-gallery/EmptyState.stories.tsx b/ts/components/conversation/media-gallery/EmptyState.stories.tsx index 4031462679b..5a7e9adf0ce 100644 --- a/ts/components/conversation/media-gallery/EmptyState.stories.tsx +++ b/ts/components/conversation/media-gallery/EmptyState.stories.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { Props } from './EmptyState'; -import { EmptyState } from './EmptyState'; +import type { Props } from './EmptyState.js'; +import { EmptyState } from './EmptyState.js'; export default { title: 'Components/Conversation/MediaGallery/EmptyState', diff --git a/ts/components/conversation/media-gallery/MediaGallery.stories.tsx b/ts/components/conversation/media-gallery/MediaGallery.stories.tsx index 43d9c7d58bb..a7640b5efcb 100644 --- a/ts/components/conversation/media-gallery/MediaGallery.stories.tsx +++ b/ts/components/conversation/media-gallery/MediaGallery.stories.tsx @@ -4,14 +4,14 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './MediaGallery'; -import { MediaGallery } from './MediaGallery'; +import type { Props } from './MediaGallery.js'; +import { MediaGallery } from './MediaGallery.js'; import { createPreparedMediaItems, createRandomDocuments, createRandomMedia, days, -} from './utils/mocks'; +} from './utils/mocks.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/media-gallery/MediaGallery.tsx b/ts/components/conversation/media-gallery/MediaGallery.tsx index 9d47571a25f..89ed35c6ba5 100644 --- a/ts/components/conversation/media-gallery/MediaGallery.tsx +++ b/ts/components/conversation/media-gallery/MediaGallery.tsx @@ -5,17 +5,17 @@ import React, { useEffect, useRef } from 'react'; import moment from 'moment'; -import type { ItemClickEvent } from './types/ItemClickEvent'; -import type { LocalizerType, ThemeType } from '../../../types/Util'; -import type { MediaItemType } from '../../../types/MediaItem'; -import type { SaveAttachmentActionCreatorType } from '../../../state/ducks/conversations'; -import { AttachmentSection } from './AttachmentSection'; -import { EmptyState } from './EmptyState'; -import { Tabs } from '../../Tabs'; -import { groupMediaItemsByDate } from './groupMediaItemsByDate'; -import { missingCaseError } from '../../../util/missingCaseError'; -import { usePrevious } from '../../../hooks/usePrevious'; -import type { AttachmentType } from '../../../types/Attachment'; +import type { ItemClickEvent } from './types/ItemClickEvent.js'; +import type { LocalizerType, ThemeType } from '../../../types/Util.js'; +import type { MediaItemType } from '../../../types/MediaItem.js'; +import type { SaveAttachmentActionCreatorType } from '../../../state/ducks/conversations.js'; +import { AttachmentSection } from './AttachmentSection.js'; +import { EmptyState } from './EmptyState.js'; +import { Tabs } from '../../Tabs.js'; +import { groupMediaItemsByDate } from './groupMediaItemsByDate.js'; +import { missingCaseError } from '../../../util/missingCaseError.js'; +import { usePrevious } from '../../../hooks/usePrevious.js'; +import type { AttachmentType } from '../../../types/Attachment.js'; enum TabViews { Media = 'Media', diff --git a/ts/components/conversation/media-gallery/MediaGridItem.stories.tsx b/ts/components/conversation/media-gallery/MediaGridItem.stories.tsx index f6f4fa0b712..4c9e3df6c54 100644 --- a/ts/components/conversation/media-gallery/MediaGridItem.stories.tsx +++ b/ts/components/conversation/media-gallery/MediaGridItem.stories.tsx @@ -4,17 +4,17 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { StorybookThemeContext } from '../../../../.storybook/StorybookThemeContext'; -import type { MediaItemType } from '../../../types/MediaItem'; -import { SignalService } from '../../../protobuf'; +import { StorybookThemeContext } from '../../../../.storybook/StorybookThemeContext.js'; +import type { MediaItemType } from '../../../types/MediaItem.js'; +import { SignalService } from '../../../protobuf/index.js'; import { IMAGE_JPEG, VIDEO_MP4, APPLICATION_OCTET_STREAM, type MIMEType, -} from '../../../types/MIME'; -import type { Props } from './MediaGridItem'; -import { MediaGridItem } from './MediaGridItem'; +} from '../../../types/MIME.js'; +import type { Props } from './MediaGridItem.js'; +import { MediaGridItem } from './MediaGridItem.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/media-gallery/MediaGridItem.tsx b/ts/components/conversation/media-gallery/MediaGridItem.tsx index b03c0bcf036..f5b8c327db4 100644 --- a/ts/components/conversation/media-gallery/MediaGridItem.tsx +++ b/ts/components/conversation/media-gallery/MediaGridItem.tsx @@ -4,22 +4,22 @@ import React from 'react'; import type { ReadonlyDeep } from 'type-fest'; -import { formatFileSize } from '../../../util/formatFileSize'; -import { formatDuration } from '../../../util/formatDuration'; -import type { LocalizerType, ThemeType } from '../../../types/Util'; -import type { MediaItemType } from '../../../types/MediaItem'; -import type { AttachmentForUIType } from '../../../types/Attachment'; +import { formatFileSize } from '../../../util/formatFileSize.js'; +import { formatDuration } from '../../../util/formatDuration.js'; +import type { LocalizerType, ThemeType } from '../../../types/Util.js'; +import type { MediaItemType } from '../../../types/MediaItem.js'; +import type { AttachmentForUIType } from '../../../types/Attachment.js'; import { getAlt, getUrl, defaultBlurHash, isGIF, isVideoAttachment, -} from '../../../types/Attachment'; -import { ImageOrBlurhash } from '../../ImageOrBlurhash'; -import { SpinnerV2 } from '../../SpinnerV2'; -import { tw } from '../../../axo/tw'; -import { AxoSymbol } from '../../../axo/AxoSymbol'; +} from '../../../types/Attachment.js'; +import { ImageOrBlurhash } from '../../ImageOrBlurhash.js'; +import { SpinnerV2 } from '../../SpinnerV2.js'; +import { tw } from '../../../axo/tw.js'; +import { AxoSymbol } from '../../../axo/AxoSymbol.js'; export type Props = Readonly<{ mediaItem: ReadonlyDeep; diff --git a/ts/components/conversation/media-gallery/groupMediaItemsByDate.ts b/ts/components/conversation/media-gallery/groupMediaItemsByDate.ts index c2d956493a2..e8e79fea849 100644 --- a/ts/components/conversation/media-gallery/groupMediaItemsByDate.ts +++ b/ts/components/conversation/media-gallery/groupMediaItemsByDate.ts @@ -3,8 +3,8 @@ import moment from 'moment'; import { compact, groupBy, sortBy } from 'lodash'; -import type { MediaItemType } from '../../../types/MediaItem'; -import { missingCaseError } from '../../../util/missingCaseError'; +import type { MediaItemType } from '../../../types/MediaItem.js'; +import { missingCaseError } from '../../../util/missingCaseError.js'; type StaticSectionType = 'today' | 'yesterday' | 'thisWeek' | 'thisMonth'; type YearMonthSectionType = 'yearMonth'; diff --git a/ts/components/conversation/media-gallery/types/ItemClickEvent.ts b/ts/components/conversation/media-gallery/types/ItemClickEvent.ts index d890f6702dc..b22f849d6a7 100644 --- a/ts/components/conversation/media-gallery/types/ItemClickEvent.ts +++ b/ts/components/conversation/media-gallery/types/ItemClickEvent.ts @@ -1,7 +1,7 @@ // Copyright 2018 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AttachmentType } from '../../../../types/Attachment'; +import type { AttachmentType } from '../../../../types/Attachment.js'; export type ItemClickEvent = { message: { id: string; sentAt: number }; diff --git a/ts/components/conversation/media-gallery/utils/mocks.ts b/ts/components/conversation/media-gallery/utils/mocks.ts index ffc39712962..0df20fbc6b2 100644 --- a/ts/components/conversation/media-gallery/utils/mocks.ts +++ b/ts/components/conversation/media-gallery/utils/mocks.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import { random, range, sample, sortBy } from 'lodash'; -import { type MIMEType, IMAGE_JPEG } from '../../../../types/MIME'; -import type { MediaItemType } from '../../../../types/MediaItem'; -import { randomBlurHash } from '../../../../util/randomBlurHash'; -import { SignalService } from '../../../../protobuf'; +import { type MIMEType, IMAGE_JPEG } from '../../../../types/MIME.js'; +import type { MediaItemType } from '../../../../types/MediaItem.js'; +import { randomBlurHash } from '../../../../util/randomBlurHash.js'; +import { SignalService } from '../../../../protobuf/index.js'; const DAY_MS = 24 * 60 * 60 * 1000; export const days = (n: number): number => n * DAY_MS; diff --git a/ts/components/conversationList/BaseConversationListItem.tsx b/ts/components/conversationList/BaseConversationListItem.tsx index dd5533ba29e..32637e20a9c 100644 --- a/ts/components/conversationList/BaseConversationListItem.tsx +++ b/ts/components/conversationList/BaseConversationListItem.tsx @@ -7,16 +7,16 @@ import classNames from 'classnames'; import { isBoolean, isNumber } from 'lodash'; import { v4 as generateUuid } from 'uuid'; -import { Avatar, AvatarSize } from '../Avatar'; -import type { BadgeType } from '../../badges/types'; -import { isConversationUnread } from '../../util/isConversationUnread'; -import { cleanId } from '../_util'; -import type { LocalizerType, ThemeType } from '../../types/Util'; -import type { ConversationType } from '../../state/ducks/conversations'; -import { Spinner } from '../Spinner'; -import { Time } from '../Time'; -import { formatDateTimeShort } from '../../util/timestamp'; -import * as durations from '../../util/durations'; +import { Avatar, AvatarSize } from '../Avatar.js'; +import type { BadgeType } from '../../badges/types.js'; +import { isConversationUnread } from '../../util/isConversationUnread.js'; +import { cleanId } from '../_util.js'; +import type { LocalizerType, ThemeType } from '../../types/Util.js'; +import type { ConversationType } from '../../state/ducks/conversations.js'; +import { Spinner } from '../Spinner.js'; +import { Time } from '../Time.js'; +import { formatDateTimeShort } from '../../util/timestamp.js'; +import * as durations from '../../util/durations/index.js'; const BASE_CLASS_NAME = 'module-conversation-list__item--contact-or-conversation'; diff --git a/ts/components/conversationList/ComposeStepButton.tsx b/ts/components/conversationList/ComposeStepButton.tsx index a9c03c61fb2..8dc9efeece8 100644 --- a/ts/components/conversationList/ComposeStepButton.tsx +++ b/ts/components/conversationList/ComposeStepButton.tsx @@ -4,7 +4,7 @@ import type { FunctionComponent } from 'react'; import React from 'react'; -import { ListTile } from '../ListTile'; +import { ListTile } from '../ListTile.js'; export enum Icon { Group = 'group', diff --git a/ts/components/conversationList/ContactCheckbox.tsx b/ts/components/conversationList/ContactCheckbox.tsx index 6b07912dd2d..152e611cbed 100644 --- a/ts/components/conversationList/ContactCheckbox.tsx +++ b/ts/components/conversationList/ContactCheckbox.tsx @@ -4,14 +4,14 @@ import React from 'react'; import type { FunctionComponent } from 'react'; -import { HEADER_CONTACT_NAME_CLASS_NAME } from './BaseConversationListItem'; -import type { ConversationType } from '../../state/ducks/conversations'; -import type { BadgeType } from '../../badges/types'; -import type { LocalizerType, ThemeType } from '../../types/Util'; -import { ContactName } from '../conversation/ContactName'; -import { About } from '../conversation/About'; -import { ListTile } from '../ListTile'; -import { Avatar, AvatarSize } from '../Avatar'; +import { HEADER_CONTACT_NAME_CLASS_NAME } from './BaseConversationListItem.js'; +import type { ConversationType } from '../../state/ducks/conversations.js'; +import type { BadgeType } from '../../badges/types.js'; +import type { LocalizerType, ThemeType } from '../../types/Util.js'; +import { ContactName } from '../conversation/ContactName.js'; +import { About } from '../conversation/About.js'; +import { ListTile } from '../ListTile.js'; +import { Avatar, AvatarSize } from '../Avatar.js'; export enum ContactCheckboxDisabledReason { // We start the enum at 1 because the default starting value of 0 is falsy. diff --git a/ts/components/conversationList/ContactListItem.tsx b/ts/components/conversationList/ContactListItem.tsx index b807c6046b3..1454266097b 100644 --- a/ts/components/conversationList/ContactListItem.tsx +++ b/ts/components/conversationList/ContactListItem.tsx @@ -4,20 +4,20 @@ import type { FunctionComponent } from 'react'; import React, { useMemo, useState } from 'react'; -import { HEADER_CONTACT_NAME_CLASS_NAME } from './BaseConversationListItem'; -import type { ConversationType } from '../../state/ducks/conversations'; -import type { BadgeType } from '../../badges/types'; -import type { LocalizerType, ThemeType } from '../../types/Util'; -import { ContactName } from '../conversation/ContactName'; -import { About } from '../conversation/About'; -import { ListTile } from '../ListTile'; -import { Avatar, AvatarSize } from '../Avatar'; -import { ContextMenu } from '../ContextMenu'; -import { I18n } from '../I18n'; -import { ConfirmationDialog } from '../ConfirmationDialog'; -import { isSignalConversation } from '../../util/isSignalConversation'; -import { isInSystemContacts } from '../../util/isInSystemContacts'; -import { InContactsIcon } from '../InContactsIcon'; +import { HEADER_CONTACT_NAME_CLASS_NAME } from './BaseConversationListItem.js'; +import type { ConversationType } from '../../state/ducks/conversations.js'; +import type { BadgeType } from '../../badges/types.js'; +import type { LocalizerType, ThemeType } from '../../types/Util.js'; +import { ContactName } from '../conversation/ContactName.js'; +import { About } from '../conversation/About.js'; +import { ListTile } from '../ListTile.js'; +import { Avatar, AvatarSize } from '../Avatar.js'; +import { ContextMenu } from '../ContextMenu.js'; +import { I18n } from '../I18n.js'; +import { ConfirmationDialog } from '../ConfirmationDialog.js'; +import { isSignalConversation } from '../../util/isSignalConversation.js'; +import { isInSystemContacts } from '../../util/isInSystemContacts.js'; +import { InContactsIcon } from '../InContactsIcon.js'; export type ContactListItemConversationType = Pick< ConversationType, diff --git a/ts/components/conversationList/ConversationListItem.tsx b/ts/components/conversationList/ConversationListItem.tsx index 09dbf2f045f..01d79602b6a 100644 --- a/ts/components/conversationList/ConversationListItem.tsx +++ b/ts/components/conversationList/ConversationListItem.tsx @@ -10,16 +10,16 @@ import { HEADER_NAME_CLASS_NAME, HEADER_CONTACT_NAME_CLASS_NAME, MESSAGE_TEXT_CLASS_NAME, -} from './BaseConversationListItem'; -import { MessageBody } from '../conversation/MessageBody'; -import { ContactName } from '../conversation/ContactName'; -import { TypingAnimation } from '../conversation/TypingAnimation'; +} from './BaseConversationListItem.js'; +import { MessageBody } from '../conversation/MessageBody.js'; +import { ContactName } from '../conversation/ContactName.js'; +import { TypingAnimation } from '../conversation/TypingAnimation.js'; -import type { LocalizerType, ThemeType } from '../../types/Util'; -import type { ConversationType } from '../../state/ducks/conversations'; -import type { BadgeType } from '../../badges/types'; -import { isSignalConversation } from '../../util/isSignalConversation'; -import { RenderLocation } from '../conversation/MessageTextRenderer'; +import type { LocalizerType, ThemeType } from '../../types/Util.js'; +import type { ConversationType } from '../../state/ducks/conversations.js'; +import type { BadgeType } from '../../badges/types.js'; +import { isSignalConversation } from '../../util/isSignalConversation.js'; +import { RenderLocation } from '../conversation/MessageTextRenderer.js'; const EMPTY_OBJECT = Object.freeze(Object.create(null)); const MESSAGE_STATUS_ICON_CLASS_NAME = `${MESSAGE_TEXT_CLASS_NAME}__status-icon`; diff --git a/ts/components/conversationList/GroupListItem.tsx b/ts/components/conversationList/GroupListItem.tsx index 54ea0fe1d07..e03e41fbef1 100644 --- a/ts/components/conversationList/GroupListItem.tsx +++ b/ts/components/conversationList/GroupListItem.tsx @@ -2,12 +2,12 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import type { ConversationType } from '../../state/ducks/conversations'; -import type { LocalizerType } from '../../types/Util'; -import type { AciString } from '../../types/ServiceId'; -import { Avatar, AvatarSize } from '../Avatar'; -import { ListTile } from '../ListTile'; -import { UserText } from '../UserText'; +import type { ConversationType } from '../../state/ducks/conversations.js'; +import type { LocalizerType } from '../../types/Util.js'; +import type { AciString } from '../../types/ServiceId.js'; +import { Avatar, AvatarSize } from '../Avatar.js'; +import { ListTile } from '../ListTile.js'; +import { UserText } from '../UserText.js'; export enum DisabledReason { AlreadyMember = 'already-member', diff --git a/ts/components/conversationList/MessageSearchResult.stories.tsx b/ts/components/conversationList/MessageSearchResult.stories.tsx index 9af60d51231..ff4cfd0003f 100644 --- a/ts/components/conversationList/MessageSearchResult.stories.tsx +++ b/ts/components/conversationList/MessageSearchResult.stories.tsx @@ -4,14 +4,14 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { StorybookThemeContext } from '../../../.storybook/StorybookThemeContext'; -import { strictAssert } from '../../util/assert'; -import { getFakeBadge } from '../../test-helpers/getFakeBadge'; -import type { PropsType } from './MessageSearchResult'; -import { MessageSearchResult } from './MessageSearchResult'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation'; -import { BodyRange } from '../../types/BodyRange'; -import { generateAci } from '../../types/ServiceId'; +import { StorybookThemeContext } from '../../../.storybook/StorybookThemeContext.js'; +import { strictAssert } from '../../util/assert.js'; +import { getFakeBadge } from '../../test-helpers/getFakeBadge.js'; +import type { PropsType } from './MessageSearchResult.js'; +import { MessageSearchResult } from './MessageSearchResult.js'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; +import { BodyRange } from '../../types/BodyRange.js'; +import { generateAci } from '../../types/ServiceId.js'; const SERVICE_ID_1 = generateAci(); const SERVICE_ID_2 = generateAci(); diff --git a/ts/components/conversationList/MessageSearchResult.tsx b/ts/components/conversationList/MessageSearchResult.tsx index 70b909f60b6..4b1ff6e70ee 100644 --- a/ts/components/conversationList/MessageSearchResult.tsx +++ b/ts/components/conversationList/MessageSearchResult.tsx @@ -5,22 +5,22 @@ import type { FunctionComponent, ReactNode } from 'react'; import React, { useCallback } from 'react'; import { noop } from 'lodash'; -import { ContactName } from '../conversation/ContactName'; +import { ContactName } from '../conversation/ContactName.js'; -import type { BodyRangesForDisplayType } from '../../types/BodyRange'; -import { processBodyRangesForSearchResult } from '../../types/BodyRange'; -import type { LocalizerType, ThemeType } from '../../types/Util'; -import { BaseConversationListItem } from './BaseConversationListItem'; +import type { BodyRangesForDisplayType } from '../../types/BodyRange.js'; +import { processBodyRangesForSearchResult } from '../../types/BodyRange.js'; +import type { LocalizerType, ThemeType } from '../../types/Util.js'; +import { BaseConversationListItem } from './BaseConversationListItem.js'; import type { ConversationType, ShowConversationType, -} from '../../state/ducks/conversations'; -import type { PreferredBadgeSelectorType } from '../../state/selectors/badges'; -import { I18n } from '../I18n'; +} from '../../state/ducks/conversations.js'; +import type { PreferredBadgeSelectorType } from '../../state/selectors/badges.js'; +import { I18n } from '../I18n.js'; import { MessageTextRenderer, RenderLocation, -} from '../conversation/MessageTextRenderer'; +} from '../conversation/MessageTextRenderer.js'; const EMPTY_OBJECT = Object.freeze(Object.create(null)); diff --git a/ts/components/conversationList/PhoneNumberCheckbox.tsx b/ts/components/conversationList/PhoneNumberCheckbox.tsx index d0697a1f490..11f37646175 100644 --- a/ts/components/conversationList/PhoneNumberCheckbox.tsx +++ b/ts/components/conversationList/PhoneNumberCheckbox.tsx @@ -4,17 +4,17 @@ import type { FunctionComponent } from 'react'; import React, { useState } from 'react'; -import { ButtonVariant } from '../Button'; -import { ConfirmationDialog } from '../ConfirmationDialog'; -import { SPINNER_CLASS_NAME } from './BaseConversationListItem'; -import type { ParsedE164Type } from '../../util/libphonenumberInstance'; -import type { LocalizerType, ThemeType } from '../../types/Util'; -import { AvatarColors } from '../../types/Colors'; -import type { LookupConversationWithoutServiceIdActionsType } from '../../util/lookupConversationWithoutServiceId'; -import { ListTile } from '../ListTile'; -import { Avatar, AvatarSize } from '../Avatar'; -import { Spinner } from '../Spinner'; -import { UserText } from '../UserText'; +import { ButtonVariant } from '../Button.js'; +import { ConfirmationDialog } from '../ConfirmationDialog.js'; +import { SPINNER_CLASS_NAME } from './BaseConversationListItem.js'; +import type { ParsedE164Type } from '../../util/libphonenumberInstance.js'; +import type { LocalizerType, ThemeType } from '../../types/Util.js'; +import { AvatarColors } from '../../types/Colors.js'; +import type { LookupConversationWithoutServiceIdActionsType } from '../../util/lookupConversationWithoutServiceId.js'; +import { ListTile } from '../ListTile.js'; +import { Avatar, AvatarSize } from '../Avatar.js'; +import { Spinner } from '../Spinner.js'; +import { UserText } from '../UserText.js'; export type PropsDataType = { phoneNumber: ParsedE164Type; diff --git a/ts/components/conversationList/StartNewConversation.tsx b/ts/components/conversationList/StartNewConversation.tsx index 5e2842e7d9b..5194a7c0764 100644 --- a/ts/components/conversationList/StartNewConversation.tsx +++ b/ts/components/conversationList/StartNewConversation.tsx @@ -4,17 +4,17 @@ import type { FunctionComponent } from 'react'; import React, { useCallback, useState } from 'react'; -import { ButtonVariant } from '../Button'; -import { ConfirmationDialog } from '../ConfirmationDialog'; -import { SPINNER_CLASS_NAME } from './BaseConversationListItem'; -import { ListTile } from '../ListTile'; -import { Avatar, AvatarSize } from '../Avatar'; -import { Spinner } from '../Spinner'; +import { ButtonVariant } from '../Button.js'; +import { ConfirmationDialog } from '../ConfirmationDialog.js'; +import { SPINNER_CLASS_NAME } from './BaseConversationListItem.js'; +import { ListTile } from '../ListTile.js'; +import { Avatar, AvatarSize } from '../Avatar.js'; +import { Spinner } from '../Spinner.js'; -import type { ParsedE164Type } from '../../util/libphonenumberInstance'; -import type { LookupConversationWithoutServiceIdActionsType } from '../../util/lookupConversationWithoutServiceId'; -import type { LocalizerType } from '../../types/Util'; -import type { ShowConversationType } from '../../state/ducks/conversations'; +import type { ParsedE164Type } from '../../util/libphonenumberInstance.js'; +import type { LookupConversationWithoutServiceIdActionsType } from '../../util/lookupConversationWithoutServiceId.js'; +import type { LocalizerType } from '../../types/Util.js'; +import type { ShowConversationType } from '../../state/ducks/conversations.js'; type PropsData = { phoneNumber: ParsedE164Type; diff --git a/ts/components/conversationList/UsernameCheckbox.tsx b/ts/components/conversationList/UsernameCheckbox.tsx index a67595491f5..081a2a9478d 100644 --- a/ts/components/conversationList/UsernameCheckbox.tsx +++ b/ts/components/conversationList/UsernameCheckbox.tsx @@ -4,13 +4,13 @@ import React from 'react'; import type { FunctionComponent } from 'react'; -import type { LocalizerType, ThemeType } from '../../types/Util'; -import { AvatarColors } from '../../types/Colors'; -import type { LookupConversationWithoutServiceIdActionsType } from '../../util/lookupConversationWithoutServiceId'; -import { ListTile } from '../ListTile'; -import { Avatar, AvatarSize } from '../Avatar'; -import { Spinner } from '../Spinner'; -import { SPINNER_CLASS_NAME } from './BaseConversationListItem'; +import type { LocalizerType, ThemeType } from '../../types/Util.js'; +import { AvatarColors } from '../../types/Colors.js'; +import type { LookupConversationWithoutServiceIdActionsType } from '../../util/lookupConversationWithoutServiceId.js'; +import { ListTile } from '../ListTile.js'; +import { Avatar, AvatarSize } from '../Avatar.js'; +import { Spinner } from '../Spinner.js'; +import { SPINNER_CLASS_NAME } from './BaseConversationListItem.js'; export type PropsDataType = { username: string; diff --git a/ts/components/conversationList/UsernameSearchResultListItem.tsx b/ts/components/conversationList/UsernameSearchResultListItem.tsx index 8aab0f53a57..35b30775eb4 100644 --- a/ts/components/conversationList/UsernameSearchResultListItem.tsx +++ b/ts/components/conversationList/UsernameSearchResultListItem.tsx @@ -3,14 +3,14 @@ import React, { useCallback } from 'react'; -import { SPINNER_CLASS_NAME } from './BaseConversationListItem'; -import { ListTile } from '../ListTile'; -import { Avatar, AvatarSize } from '../Avatar'; -import { Spinner } from '../Spinner'; +import { SPINNER_CLASS_NAME } from './BaseConversationListItem.js'; +import { ListTile } from '../ListTile.js'; +import { Avatar, AvatarSize } from '../Avatar.js'; +import { Spinner } from '../Spinner.js'; -import type { LocalizerType } from '../../types/Util'; -import type { LookupConversationWithoutServiceIdActionsType } from '../../util/lookupConversationWithoutServiceId'; -import type { ShowConversationType } from '../../state/ducks/conversations'; +import type { LocalizerType } from '../../types/Util.js'; +import type { LookupConversationWithoutServiceIdActionsType } from '../../util/lookupConversationWithoutServiceId.js'; +import type { ShowConversationType } from '../../state/ducks/conversations.js'; type PropsData = { username: string; diff --git a/ts/components/emoji/EmojiButton.stories.tsx b/ts/components/emoji/EmojiButton.stories.tsx index 1890841c630..367cae7de30 100644 --- a/ts/components/emoji/EmojiButton.stories.tsx +++ b/ts/components/emoji/EmojiButton.stories.tsx @@ -4,9 +4,9 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './EmojiButton'; -import { EmojiButton } from './EmojiButton'; -import { EmojiSkinTone } from '../fun/data/emojis'; +import type { Props } from './EmojiButton.js'; +import { EmojiButton } from './EmojiButton.js'; +import { EmojiSkinTone } from '../fun/data/emojis.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/emoji/EmojiButton.tsx b/ts/components/emoji/EmojiButton.tsx index 1a6cd697fe1..f82a2bbcbc0 100644 --- a/ts/components/emoji/EmojiButton.tsx +++ b/ts/components/emoji/EmojiButton.tsx @@ -6,19 +6,19 @@ import type { MutableRefObject } from 'react'; import classNames from 'classnames'; import { get, noop } from 'lodash'; import { Manager, Popper, Reference } from 'react-popper'; -import type { Props as EmojiPickerProps } from './EmojiPicker'; -import { EmojiPicker } from './EmojiPicker'; -import type { LocalizerType } from '../../types/Util'; -import { useRefMerger } from '../../hooks/useRefMerger'; -import { handleOutsideClick } from '../../util/handleOutsideClick'; -import * as KeyboardLayout from '../../services/keyboardLayout'; -import { FunStaticEmoji } from '../fun/FunEmoji'; -import type { EmojiVariantData } from '../fun/data/emojis'; +import type { Props as EmojiPickerProps } from './EmojiPicker.js'; +import { EmojiPicker } from './EmojiPicker.js'; +import type { LocalizerType } from '../../types/Util.js'; +import { useRefMerger } from '../../hooks/useRefMerger.js'; +import { handleOutsideClick } from '../../util/handleOutsideClick.js'; +import * as KeyboardLayout from '../../services/keyboardLayout.js'; +import { FunStaticEmoji } from '../fun/FunEmoji.js'; +import type { EmojiVariantData } from '../fun/data/emojis.js'; import { getEmojiVariantByKey, getEmojiVariantKeyByValue, isEmojiVariantValue, -} from '../fun/data/emojis'; +} from '../fun/data/emojis.js'; export enum EmojiButtonVariant { Normal, diff --git a/ts/components/emoji/EmojiPicker.stories.tsx b/ts/components/emoji/EmojiPicker.stories.tsx index c9d0c494c48..6db96644dc5 100644 --- a/ts/components/emoji/EmojiPicker.stories.tsx +++ b/ts/components/emoji/EmojiPicker.stories.tsx @@ -4,9 +4,9 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './EmojiPicker'; -import { EmojiPicker } from './EmojiPicker'; -import { EmojiSkinTone } from '../fun/data/emojis'; +import type { Props } from './EmojiPicker.js'; +import { EmojiPicker } from './EmojiPicker.js'; +import { EmojiSkinTone } from '../fun/data/emojis.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/emoji/EmojiPicker.tsx b/ts/components/emoji/EmojiPicker.tsx index 35c26454e06..ece2c8a11b1 100644 --- a/ts/components/emoji/EmojiPicker.tsx +++ b/ts/components/emoji/EmojiPicker.tsx @@ -19,12 +19,12 @@ import { zipObject, } from 'lodash'; import { FocusScope } from 'react-aria'; -import { dataByCategory } from './lib'; -import type { LocalizerType } from '../../types/Util'; -import { isSingleGrapheme } from '../../util/grapheme'; -import { missingCaseError } from '../../util/missingCaseError'; -import { FunStaticEmoji } from '../fun/FunEmoji'; -import { strictAssert } from '../../util/assert'; +import { dataByCategory } from './lib.js'; +import type { LocalizerType } from '../../types/Util.js'; +import { isSingleGrapheme } from '../../util/grapheme.js'; +import { missingCaseError } from '../../util/missingCaseError.js'; +import { FunStaticEmoji } from '../fun/FunEmoji.js'; +import { strictAssert } from '../../util/assert.js'; import { EMOJI_SKIN_TONE_ORDER, emojiParentKeyConstant, @@ -35,8 +35,8 @@ import { isEmojiEnglishShortName, EMOJI_SKIN_TONE_TO_NUMBER, getEmojiParentByKey, -} from '../fun/data/emojis'; -import { useFunEmojiSearch } from '../fun/useFunEmojiSearch'; +} from '../fun/data/emojis.js'; +import { useFunEmojiSearch } from '../fun/useFunEmojiSearch.js'; export type EmojiPickDataType = { skinTone: EmojiSkinTone; diff --git a/ts/components/emoji/lib.ts b/ts/components/emoji/lib.ts index 45e1221fd7b..405260d4153 100644 --- a/ts/components/emoji/lib.ts +++ b/ts/components/emoji/lib.ts @@ -4,13 +4,13 @@ // Camelcase disabled due to emoji-datasource using snake_case /* eslint-disable camelcase */ import { groupBy, keyBy, mapValues, sortBy } from 'lodash'; -import { getOwn } from '../../util/getOwn'; +import { getOwn } from '../../util/getOwn.js'; import { EMOJI_SKIN_TONE_TO_KEY, EmojiSkinTone, KEY_TO_EMOJI_SKIN_TONE, -} from '../fun/data/emojis'; -import { strictAssert } from '../../util/assert'; +} from '../fun/data/emojis.js'; +import { strictAssert } from '../../util/assert.js'; // Import emoji-datasource dynamically to avoid costly typechecking. // eslint-disable-next-line import/no-dynamic-require, @typescript-eslint/no-var-requires diff --git a/ts/components/fun/FunButton.tsx b/ts/components/fun/FunButton.tsx index eb23167e796..2cd868cb0d9 100644 --- a/ts/components/fun/FunButton.tsx +++ b/ts/components/fun/FunButton.tsx @@ -3,10 +3,10 @@ import React, { useMemo } from 'react'; import { VisuallyHidden } from 'react-aria'; import { Button } from 'react-aria-components'; -import type { LocalizerType } from '../../types/I18N'; -import { type EmojiVariantKey, getEmojiVariantByKey } from './data/emojis'; -import { FunStaticEmoji } from './FunEmoji'; -import { useFunEmojiLocalizer } from './useFunEmojiLocalizer'; +import type { LocalizerType } from '../../types/I18N.js'; +import { type EmojiVariantKey, getEmojiVariantByKey } from './data/emojis.js'; +import { FunStaticEmoji } from './FunEmoji.js'; +import { useFunEmojiLocalizer } from './useFunEmojiLocalizer.js'; /** * Fun Picker Button diff --git a/ts/components/fun/FunEmoji.stories.tsx b/ts/components/fun/FunEmoji.stories.tsx index c1df6fb5102..34db0a18bee 100644 --- a/ts/components/fun/FunEmoji.stories.tsx +++ b/ts/components/fun/FunEmoji.stories.tsx @@ -3,16 +3,16 @@ import { useVirtualizer } from '@tanstack/react-virtual'; import { chunk } from 'lodash'; import React, { useCallback, useEffect, useRef } from 'react'; -import { type ComponentMeta } from '../../storybook/types'; -import type { FunStaticEmojiProps } from './FunEmoji'; -import { FunInlineEmoji, FunStaticEmoji } from './FunEmoji'; +import { type ComponentMeta } from '../../storybook/types.js'; +import type { FunStaticEmojiProps } from './FunEmoji.js'; +import { FunInlineEmoji, FunStaticEmoji } from './FunEmoji.js'; import { _getAllEmojiVariantKeys, emojiVariantConstant, getEmojiParentByKey, getEmojiParentKeyByVariantKey, getEmojiVariantByKey, -} from './data/emojis'; +} from './data/emojis.js'; export default { title: 'Components/Fun/FunEmoji', diff --git a/ts/components/fun/FunEmoji.tsx b/ts/components/fun/FunEmoji.tsx index 08785e8a70b..11ab10a519a 100644 --- a/ts/components/fun/FunEmoji.tsx +++ b/ts/components/fun/FunEmoji.tsx @@ -3,8 +3,8 @@ import classNames from 'classnames'; import type { CSSProperties } from 'react'; import React, { useMemo } from 'react'; -import type { EmojiVariantData } from './data/emojis'; -import type { FunImageAriaProps } from './types'; +import type { EmojiVariantData } from './data/emojis.js'; +import type { FunImageAriaProps } from './types.js'; export const FUN_STATIC_EMOJI_CLASS = 'FunStaticEmoji'; export const FUN_INLINE_EMOJI_CLASS = 'FunInlineEmoji'; diff --git a/ts/components/fun/FunEmojiLocalizationProvider.tsx b/ts/components/fun/FunEmojiLocalizationProvider.tsx index aeb70476a16..343ca380b2f 100644 --- a/ts/components/fun/FunEmojiLocalizationProvider.tsx +++ b/ts/components/fun/FunEmojiLocalizationProvider.tsx @@ -9,25 +9,25 @@ import React, { useMemo, useState, } from 'react'; -import type { LocaleEmojiListType } from '../../types/emoji'; -import { createLogger } from '../../logging/log'; -import * as Errors from '../../types/errors'; -import { drop } from '../../util/drop'; +import type { LocaleEmojiListType } from '../../types/emoji.js'; +import { createLogger } from '../../logging/log.js'; +import * as Errors from '../../types/errors.js'; +import { drop } from '../../util/drop.js'; import { getEmojiDefaultEnglishLocalizerIndex, getEmojiDefaultEnglishSearchIndex, -} from './data/emojis'; +} from './data/emojis.js'; import { createFunEmojiLocalizerIndex, type FunEmojiLocalizerIndex, -} from './useFunEmojiLocalizer'; +} from './useFunEmojiLocalizer.js'; import { createFunEmojiSearchIndex, type FunEmojiSearchIndex, -} from './useFunEmojiSearch'; -import type { LocalizerType } from '../../types/I18N'; -import { strictAssert } from '../../util/assert'; -import { isTestOrMockEnvironment } from '../../environment'; +} from './useFunEmojiSearch.js'; +import type { LocalizerType } from '../../types/I18N.js'; +import { strictAssert } from '../../util/assert.js'; +import { isTestOrMockEnvironment } from '../../environment.js'; const log = createLogger('FunEmojiLocalizationProvider'); diff --git a/ts/components/fun/FunEmojiPicker.stories.tsx b/ts/components/fun/FunEmojiPicker.stories.tsx index 9ece6ccf358..615bb4558c4 100644 --- a/ts/components/fun/FunEmojiPicker.stories.tsx +++ b/ts/components/fun/FunEmojiPicker.stories.tsx @@ -3,14 +3,14 @@ import React, { useCallback, useState } from 'react'; import { Button } from 'react-aria-components'; import { action } from '@storybook/addon-actions'; -import { type ComponentMeta } from '../../storybook/types'; -import type { FunEmojiPickerProps } from './FunEmojiPicker'; -import { FunEmojiPicker } from './FunEmojiPicker'; -import { MOCK_RECENT_EMOJIS, MOCK_THIS_MESSAGE_EMOJIS } from './mocks'; -import { FunProvider } from './FunProvider'; -import { packs, recentStickers } from '../stickers/mocks'; -import { EmojiSkinTone } from './data/emojis'; -import { Select } from '../Select'; +import { type ComponentMeta } from '../../storybook/types.js'; +import type { FunEmojiPickerProps } from './FunEmojiPicker.js'; +import { FunEmojiPicker } from './FunEmojiPicker.js'; +import { MOCK_RECENT_EMOJIS, MOCK_THIS_MESSAGE_EMOJIS } from './mocks.js'; +import { FunProvider } from './FunProvider.js'; +import { packs, recentStickers } from '../stickers/mocks.js'; +import { EmojiSkinTone } from './data/emojis.js'; +import { Select } from '../Select.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/fun/FunEmojiPicker.tsx b/ts/components/fun/FunEmojiPicker.tsx index c9a4f5aa9da..61598263665 100644 --- a/ts/components/fun/FunEmojiPicker.tsx +++ b/ts/components/fun/FunEmojiPicker.tsx @@ -4,13 +4,13 @@ import type { ReactNode } from 'react'; import React, { memo, useCallback } from 'react'; import type { Placement } from 'react-aria'; import { DialogTrigger } from 'react-aria-components'; -import { FunPopover } from './base/FunPopover'; -import type { FunEmojiSelection } from './panels/FunPanelEmojis'; -import { FunPanelEmojis } from './panels/FunPanelEmojis'; -import { useFunContext } from './FunProvider'; -import type { ThemeType } from '../../types/Util'; -import { FunErrorBoundary } from './base/FunErrorBoundary'; -import type { EmojiVariantKey } from './data/emojis'; +import { FunPopover } from './base/FunPopover.js'; +import type { FunEmojiSelection } from './panels/FunPanelEmojis.js'; +import { FunPanelEmojis } from './panels/FunPanelEmojis.js'; +import { useFunContext } from './FunProvider.js'; +import type { ThemeType } from '../../types/Util.js'; +import { FunErrorBoundary } from './base/FunErrorBoundary.js'; +import type { EmojiVariantKey } from './data/emojis.js'; export type FunEmojiPickerProps = Readonly<{ open: boolean; diff --git a/ts/components/fun/FunGif.stories.tsx b/ts/components/fun/FunGif.stories.tsx index 34cec653de9..b2c0dd2c5df 100644 --- a/ts/components/fun/FunGif.stories.tsx +++ b/ts/components/fun/FunGif.stories.tsx @@ -3,8 +3,8 @@ import React, { useEffect, useState, useId } from 'react'; import type { Meta } from '@storybook/react'; import { VisuallyHidden } from 'react-aria'; -import { FunGif, FunGifPreview } from './FunGif'; -import { LoadingState } from '../../util/loadable'; +import { FunGif, FunGifPreview } from './FunGif.js'; +import { LoadingState } from '../../util/loadable.js'; export default { title: 'Components/Fun/FunGif', diff --git a/ts/components/fun/FunGif.tsx b/ts/components/fun/FunGif.tsx index 53ed5562b15..6aecc753db8 100644 --- a/ts/components/fun/FunGif.tsx +++ b/ts/components/fun/FunGif.tsx @@ -3,14 +3,14 @@ import type { CSSProperties, ForwardedRef } from 'react'; import React, { forwardRef, useEffect, useRef, useState } from 'react'; import { useReducedMotion } from '@react-spring/web'; -import { SpinnerV2 } from '../SpinnerV2'; -import { strictAssert } from '../../util/assert'; -import type { Loadable } from '../../util/loadable'; -import { LoadingState } from '../../util/loadable'; -import { useIntent } from './base/FunImage'; -import { createLogger } from '../../logging/log'; -import * as Errors from '../../types/errors'; -import { isAbortError } from '../../util/isAbortError'; +import { SpinnerV2 } from '../SpinnerV2.js'; +import { strictAssert } from '../../util/assert.js'; +import type { Loadable } from '../../util/loadable.js'; +import { LoadingState } from '../../util/loadable.js'; +import { useIntent } from './base/FunImage.js'; +import { createLogger } from '../../logging/log.js'; +import * as Errors from '../../types/errors.js'; +import { isAbortError } from '../../util/isAbortError.js'; const log = createLogger('FunGif'); diff --git a/ts/components/fun/FunPicker.stories.tsx b/ts/components/fun/FunPicker.stories.tsx index 1f7ce1d3ba9..c82697fcc20 100644 --- a/ts/components/fun/FunPicker.stories.tsx +++ b/ts/components/fun/FunPicker.stories.tsx @@ -3,13 +3,13 @@ import React, { useCallback, useState } from 'react'; import { Button } from 'react-aria-components'; import { action } from '@storybook/addon-actions'; -import { type ComponentMeta } from '../../storybook/types'; -import { packs, recentStickers } from '../stickers/mocks'; -import type { FunPickerProps } from './FunPicker'; -import { FunPicker } from './FunPicker'; -import { FunProvider } from './FunProvider'; -import { MOCK_GIFS_PAGINATED_ONE_PAGE, MOCK_RECENT_EMOJIS } from './mocks'; -import { EmojiSkinTone } from './data/emojis'; +import { type ComponentMeta } from '../../storybook/types.js'; +import { packs, recentStickers } from '../stickers/mocks.js'; +import type { FunPickerProps } from './FunPicker.js'; +import { FunPicker } from './FunPicker.js'; +import { FunProvider } from './FunProvider.js'; +import { MOCK_GIFS_PAGINATED_ONE_PAGE, MOCK_RECENT_EMOJIS } from './mocks.js'; +import { EmojiSkinTone } from './data/emojis.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/fun/FunPicker.tsx b/ts/components/fun/FunPicker.tsx index a3eb805e040..ce8974717ce 100644 --- a/ts/components/fun/FunPicker.tsx +++ b/ts/components/fun/FunPicker.tsx @@ -5,18 +5,23 @@ import React, { memo, useCallback, useEffect } from 'react'; import type { Placement } from 'react-aria'; import { DialogTrigger } from 'react-aria-components'; import { createKeybindingsHandler } from 'tinykeys'; -import { FunPickerTabKey } from './constants'; -import { FunPopover } from './base/FunPopover'; -import { FunPickerTab, FunTabList, FunTabPanel, FunTabs } from './base/FunTabs'; -import type { FunEmojiSelection } from './panels/FunPanelEmojis'; -import { FunPanelEmojis } from './panels/FunPanelEmojis'; -import type { FunGifSelection } from './panels/FunPanelGifs'; -import { FunPanelGifs } from './panels/FunPanelGifs'; -import type { FunStickerSelection } from './panels/FunPanelStickers'; -import { FunPanelStickers } from './panels/FunPanelStickers'; -import { useFunContext } from './FunProvider'; -import type { ThemeType } from '../../types/Util'; -import { FunErrorBoundary } from './base/FunErrorBoundary'; +import { FunPickerTabKey } from './constants.js'; +import { FunPopover } from './base/FunPopover.js'; +import { + FunPickerTab, + FunTabList, + FunTabPanel, + FunTabs, +} from './base/FunTabs.js'; +import type { FunEmojiSelection } from './panels/FunPanelEmojis.js'; +import { FunPanelEmojis } from './panels/FunPanelEmojis.js'; +import type { FunGifSelection } from './panels/FunPanelGifs.js'; +import { FunPanelGifs } from './panels/FunPanelGifs.js'; +import type { FunStickerSelection } from './panels/FunPanelStickers.js'; +import { FunPanelStickers } from './panels/FunPanelStickers.js'; +import { useFunContext } from './FunProvider.js'; +import type { ThemeType } from '../../types/Util.js'; +import { FunErrorBoundary } from './base/FunErrorBoundary.js'; /** * FunPicker diff --git a/ts/components/fun/FunProvider.tsx b/ts/components/fun/FunProvider.tsx index b4c45fb4a17..41a14797d51 100644 --- a/ts/components/fun/FunProvider.tsx +++ b/ts/components/fun/FunProvider.tsx @@ -7,18 +7,20 @@ import React, { useContext, useState, } from 'react'; -import { strictAssert } from '../../util/assert'; -import type { LocalizerType } from '../../types/I18N'; -import type { StickerPackType, StickerType } from '../../state/ducks/stickers'; -import type { EmojiSkinTone } from './data/emojis'; -import { type EmojiParentKey } from './data/emojis'; -import type { FunGifSelection, GifType } from './panels/FunPanelGifs'; -import { FunPickerTabKey } from './constants'; -import type { fetchGifsFeatured, fetchGifsSearch } from './data/gifs'; -import type { tenorDownload } from './data/tenor'; -import type { FunEmojiSelection } from './panels/FunPanelEmojis'; -import type { FunStickerSelection } from './panels/FunPanelStickers'; -import { FunEmojiLocalizationProvider } from './FunEmojiLocalizationProvider'; +import { strictAssert } from '../../util/assert.js'; +import type { LocalizerType } from '../../types/I18N.js'; +import type { + StickerPackType, + StickerType, +} from '../../state/ducks/stickers.js'; +import type { EmojiSkinTone, EmojiParentKey } from './data/emojis.js'; +import type { FunGifSelection, GifType } from './panels/FunPanelGifs.js'; +import { FunPickerTabKey } from './constants.js'; +import type { fetchGifsFeatured, fetchGifsSearch } from './data/gifs.js'; +import type { tenorDownload } from './data/tenor.js'; +import type { FunEmojiSelection } from './panels/FunPanelEmojis.js'; +import type { FunStickerSelection } from './panels/FunPanelStickers.js'; +import { FunEmojiLocalizationProvider } from './FunEmojiLocalizationProvider.js'; export type FunContextSmartProps = Readonly<{ i18n: LocalizerType; diff --git a/ts/components/fun/FunSkinTones.tsx b/ts/components/fun/FunSkinTones.tsx index a1670d9337a..16254a9b9cf 100644 --- a/ts/components/fun/FunSkinTones.tsx +++ b/ts/components/fun/FunSkinTones.tsx @@ -3,14 +3,14 @@ import React, { useCallback, useMemo } from 'react'; import type { Selection } from 'react-aria-components'; import { ListBox, ListBoxItem } from 'react-aria-components'; -import type { EmojiParentKey } from './data/emojis'; +import type { EmojiParentKey } from './data/emojis.js'; import { EmojiSkinTone, getEmojiVariantByParentKeyAndSkinTone, -} from './data/emojis'; -import { strictAssert } from '../../util/assert'; -import { FunStaticEmoji } from './FunEmoji'; -import type { LocalizerType } from '../../types/I18N'; +} from './data/emojis.js'; +import { strictAssert } from '../../util/assert.js'; +import { FunStaticEmoji } from './FunEmoji.js'; +import type { LocalizerType } from '../../types/I18N.js'; export type FunSkinTonesListProps = Readonly<{ i18n: LocalizerType; diff --git a/ts/components/fun/FunSticker.stories.tsx b/ts/components/fun/FunSticker.stories.tsx index f0109636cff..7d4df793c79 100644 --- a/ts/components/fun/FunSticker.stories.tsx +++ b/ts/components/fun/FunSticker.stories.tsx @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; import type { Meta } from '@storybook/react'; -import { FunSticker, type FunStickerProps } from './FunSticker'; +import { FunSticker, type FunStickerProps } from './FunSticker.js'; export default { title: 'Components/Fun/FunSticker', diff --git a/ts/components/fun/FunSticker.tsx b/ts/components/fun/FunSticker.tsx index 281fbde2793..3d32e8b6607 100644 --- a/ts/components/fun/FunSticker.tsx +++ b/ts/components/fun/FunSticker.tsx @@ -1,8 +1,8 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import { FunImage } from './base/FunImage'; -import type { FunImageAriaProps } from './types'; +import { FunImage } from './base/FunImage.js'; +import type { FunImageAriaProps } from './types.js'; export type FunStickerProps = FunImageAriaProps & Readonly<{ diff --git a/ts/components/fun/FunStickerPicker.stories.tsx b/ts/components/fun/FunStickerPicker.stories.tsx index 30c5d4ce191..07e76aa1277 100644 --- a/ts/components/fun/FunStickerPicker.stories.tsx +++ b/ts/components/fun/FunStickerPicker.stories.tsx @@ -4,14 +4,14 @@ import React, { useCallback, useState } from 'react'; import { Button } from 'react-aria-components'; import { action } from '@storybook/addon-actions'; import enMessages from '../../../_locales/en/messages.json'; -import { type ComponentMeta } from '../../storybook/types'; -import { setupI18n } from '../../util/setupI18n'; -import type { FunStickerPickerProps } from './FunStickerPicker'; -import { FunStickerPicker } from './FunStickerPicker'; -import { MOCK_RECENT_EMOJIS } from './mocks'; -import { FunProvider } from './FunProvider'; -import { packs, recentStickers } from '../stickers/mocks'; -import { EmojiSkinTone } from './data/emojis'; +import { type ComponentMeta } from '../../storybook/types.js'; +import { setupI18n } from '../../util/setupI18n.js'; +import type { FunStickerPickerProps } from './FunStickerPicker.js'; +import { FunStickerPicker } from './FunStickerPicker.js'; +import { MOCK_RECENT_EMOJIS } from './mocks.js'; +import { FunProvider } from './FunProvider.js'; +import { packs, recentStickers } from '../stickers/mocks.js'; +import { EmojiSkinTone } from './data/emojis.js'; const i18n = setupI18n('en', enMessages); diff --git a/ts/components/fun/FunStickerPicker.tsx b/ts/components/fun/FunStickerPicker.tsx index 8de2c662050..42bb696fd93 100644 --- a/ts/components/fun/FunStickerPicker.tsx +++ b/ts/components/fun/FunStickerPicker.tsx @@ -4,13 +4,13 @@ import type { ReactNode } from 'react'; import React, { memo, useCallback } from 'react'; import type { Placement } from 'react-aria'; import { DialogTrigger } from 'react-aria-components'; -import { FunPopover } from './base/FunPopover'; -import type { FunStickerSelection } from './panels/FunPanelStickers'; -import { FunPanelStickers } from './panels/FunPanelStickers'; -import { useFunContext } from './FunProvider'; -import type { ThemeType } from '../../types/Util'; -import { FunErrorBoundary } from './base/FunErrorBoundary'; -import type { FunTimeStickerStyle } from './constants'; +import { FunPopover } from './base/FunPopover.js'; +import type { FunStickerSelection } from './panels/FunPanelStickers.js'; +import { FunPanelStickers } from './panels/FunPanelStickers.js'; +import { useFunContext } from './FunProvider.js'; +import type { ThemeType } from '../../types/Util.js'; +import { FunErrorBoundary } from './base/FunErrorBoundary.js'; +import type { FunTimeStickerStyle } from './constants.js'; export type FunStickerPickerProps = Readonly<{ open: boolean; diff --git a/ts/components/fun/base/FunErrorBoundary.tsx b/ts/components/fun/base/FunErrorBoundary.tsx index b37e095b66b..acf51265093 100644 --- a/ts/components/fun/base/FunErrorBoundary.tsx +++ b/ts/components/fun/base/FunErrorBoundary.tsx @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { ReactNode, ErrorInfo } from 'react'; import React, { Component, useCallback } from 'react'; -import { createLogger } from '../../../logging/log'; -import * as Errors from '../../../types/errors'; -import { ToastType } from '../../../types/Toast'; -import { isProduction } from '../../../util/version'; +import { createLogger } from '../../../logging/log.js'; +import * as Errors from '../../../types/errors.js'; +import { ToastType } from '../../../types/Toast.js'; +import { isProduction } from '../../../util/version.js'; const log = createLogger('FunErrorBoundary'); diff --git a/ts/components/fun/base/FunGrid.tsx b/ts/components/fun/base/FunGrid.tsx index c238a2f815f..1a59c1315b5 100644 --- a/ts/components/fun/base/FunGrid.tsx +++ b/ts/components/fun/base/FunGrid.tsx @@ -5,7 +5,7 @@ import React from 'react'; import { FocusScope } from 'react-aria'; import classNames from 'classnames'; import { Button, Dialog, Header, Popover } from 'react-aria-components'; -import { FunScrollerSection } from './FunScroller'; +import { FunScrollerSection } from './FunScroller.js'; /** * Grid Container diff --git a/ts/components/fun/base/FunImage.tsx b/ts/components/fun/base/FunImage.tsx index 50d5505e93d..05a899c18dc 100644 --- a/ts/components/fun/base/FunImage.tsx +++ b/ts/components/fun/base/FunImage.tsx @@ -4,9 +4,9 @@ import type { ForwardedRef, RefObject } from 'react'; import React, { useRef, useEffect, useState, forwardRef } from 'react'; import classNames from 'classnames'; import { isFocusable } from '@react-aria/focus'; -import { strictAssert } from '../../../util/assert'; -import { useReducedMotion } from '../../../hooks/useReducedMotion'; -import type { FunImageAriaProps } from '../types'; +import { strictAssert } from '../../../util/assert.js'; +import { useReducedMotion } from '../../../hooks/useReducedMotion.js'; +import type { FunImageAriaProps } from '../types.js'; export type FunImageProps = FunImageAriaProps & Readonly<{ diff --git a/ts/components/fun/base/FunItem.tsx b/ts/components/fun/base/FunItem.tsx index 5071152d6c9..4b69d817fd2 100644 --- a/ts/components/fun/base/FunItem.tsx +++ b/ts/components/fun/base/FunItem.tsx @@ -8,7 +8,7 @@ import type { } from 'react'; import React, { forwardRef, useCallback, useEffect, useMemo } from 'react'; import { mergeProps } from '@react-aria/utils'; -import { strictAssert } from '../../../util/assert'; +import { strictAssert } from '../../../util/assert.js'; /** * Button diff --git a/ts/components/fun/base/FunLightbox.tsx b/ts/components/fun/base/FunLightbox.tsx index 8cd67057681..9367e2b3d1d 100644 --- a/ts/components/fun/base/FunLightbox.tsx +++ b/ts/components/fun/base/FunLightbox.tsx @@ -3,7 +3,7 @@ import type { ReactNode, RefObject } from 'react'; import React, { createContext, useContext, useEffect, useState } from 'react'; import { createPortal } from 'react-dom'; -import { strictAssert } from '../../../util/assert'; +import { strictAssert } from '../../../util/assert.js'; /** * Tracks the current `data-key` that has a long-press/long-focus diff --git a/ts/components/fun/base/FunPopover.tsx b/ts/components/fun/base/FunPopover.tsx index 9a454bf1c64..83b26801e1e 100644 --- a/ts/components/fun/base/FunPopover.tsx +++ b/ts/components/fun/base/FunPopover.tsx @@ -6,7 +6,7 @@ import type { Placement } from 'react-aria'; import { Dialog, Popover } from 'react-aria-components'; import classNames from 'classnames'; import * as Tooltip from '@radix-ui/react-tooltip'; -import { ThemeType } from '../../../types/Util'; +import { ThemeType } from '../../../types/Util.js'; export type FunPopoverProps = Readonly<{ placement?: Placement; diff --git a/ts/components/fun/base/FunResults.tsx b/ts/components/fun/base/FunResults.tsx index 027356437df..400e16aeb95 100644 --- a/ts/components/fun/base/FunResults.tsx +++ b/ts/components/fun/base/FunResults.tsx @@ -3,7 +3,7 @@ import type { ReactNode } from 'react'; import React from 'react'; import { Button, Header } from 'react-aria-components'; -import { SpinnerV2 } from '../../SpinnerV2'; +import { SpinnerV2 } from '../../SpinnerV2.js'; export type FunResultsProps = Readonly<{ 'aria-busy': boolean; diff --git a/ts/components/fun/base/FunScroller.tsx b/ts/components/fun/base/FunScroller.tsx index de21f736bdf..304228959c8 100644 --- a/ts/components/fun/base/FunScroller.tsx +++ b/ts/components/fun/base/FunScroller.tsx @@ -18,8 +18,8 @@ import { isScrollAtTop, isScrollOverflowVertical, useScrollObserver, -} from '../../../hooks/useSizeObserver'; -import { strictAssert } from '../../../util/assert'; +} from '../../../hooks/useSizeObserver.js'; +import { strictAssert } from '../../../util/assert.js'; export type FunScrollerProps = Readonly<{ sectionGap: number; diff --git a/ts/components/fun/base/FunSearch.tsx b/ts/components/fun/base/FunSearch.tsx index c178a47f503..d916fc28bd5 100644 --- a/ts/components/fun/base/FunSearch.tsx +++ b/ts/components/fun/base/FunSearch.tsx @@ -4,8 +4,8 @@ import type { ChangeEvent } from 'react'; import React, { useCallback } from 'react'; import { VisuallyHidden } from 'react-aria'; import { getInteractionModality } from '@react-aria/interactions'; -import type { LocalizerType } from '../../../types/I18N'; -import { useFunContext } from '../FunProvider'; +import type { LocalizerType } from '../../../types/I18N.js'; +import { useFunContext } from '../FunProvider.js'; export type FunSearchProps = Readonly<{ i18n: LocalizerType; diff --git a/ts/components/fun/base/FunSubNav.tsx b/ts/components/fun/base/FunSubNav.tsx index 714d3b57456..d2350c0512c 100644 --- a/ts/components/fun/base/FunSubNav.tsx +++ b/ts/components/fun/base/FunSubNav.tsx @@ -21,12 +21,12 @@ import { getScrollLeftDistance, getScrollRightDistance, useScrollObserver, -} from '../../../hooks/useSizeObserver'; -import { createLogger } from '../../../logging/log'; -import * as Errors from '../../../types/errors'; -import { strictAssert } from '../../../util/assert'; -import { FunImage } from './FunImage'; -import { FunTooltip } from './FunTooltip'; +} from '../../../hooks/useSizeObserver.js'; +import { createLogger } from '../../../logging/log.js'; +import * as Errors from '../../../types/errors.js'; +import { strictAssert } from '../../../util/assert.js'; +import { FunImage } from './FunImage.js'; +import { FunTooltip } from './FunTooltip.js'; const log = createLogger('FunSubNav'); diff --git a/ts/components/fun/base/FunTabs.tsx b/ts/components/fun/base/FunTabs.tsx index 119515bc618..ca4583518db 100644 --- a/ts/components/fun/base/FunTabs.tsx +++ b/ts/components/fun/base/FunTabs.tsx @@ -6,7 +6,7 @@ import type { ReactNode } from 'react'; import React, { useCallback, useId } from 'react'; import type { Key } from 'react-aria'; import { Tab, TabList, TabPanel, Tabs } from 'react-aria-components'; -import type { FunPickerTabKey } from '../constants'; +import type { FunPickerTabKey } from '../constants.js'; export type FunTabsProps = Readonly<{ value: FunPickerTabKey; diff --git a/ts/components/fun/base/FunTooltip.tsx b/ts/components/fun/base/FunTooltip.tsx index 0dce9ade314..ef2e94f81b1 100644 --- a/ts/components/fun/base/FunTooltip.tsx +++ b/ts/components/fun/base/FunTooltip.tsx @@ -4,7 +4,7 @@ import React, { useRef, useState, type ReactNode } from 'react'; import * as Tooltip from '@radix-ui/react-tooltip'; import { useLayoutEffect } from '@react-aria/utils'; -import { strictAssert } from '../../../util/assert'; +import { strictAssert } from '../../../util/assert.js'; export type FunTooltipProps = Readonly<{ open?: boolean; diff --git a/ts/components/fun/constants.tsx b/ts/components/fun/constants.tsx index 8dbb894dae7..ff4483d64e1 100644 --- a/ts/components/fun/constants.tsx +++ b/ts/components/fun/constants.tsx @@ -1,8 +1,8 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { EmojiPickerCategory } from './data/emojis'; -import type { StickerPackType } from '../../state/ducks/stickers'; +import { EmojiPickerCategory } from './data/emojis.js'; +import type { StickerPackType } from '../../state/ducks/stickers.js'; export enum FunPickerTabKey { Emoji = 'Emoji', diff --git a/ts/components/fun/data/emojis.ts b/ts/components/fun/data/emojis.ts index f34d7f5bcf7..a4ddaa5a675 100644 --- a/ts/components/fun/data/emojis.ts +++ b/ts/components/fun/data/emojis.ts @@ -2,14 +2,14 @@ // SPDX-License-Identifier: AGPL-3.0-only import { z } from 'zod'; import emojiRegex from 'emoji-regex'; -import { strictAssert } from '../../../util/assert'; -import { parseUnknown } from '../../../util/schemas'; +import { strictAssert } from '../../../util/assert.js'; +import { parseUnknown } from '../../../util/schemas.js'; import type { FunEmojiSearchIndex, FunEmojiSearchIndexEntry, -} from '../useFunEmojiSearch'; -import type { FunEmojiLocalizerIndex } from '../useFunEmojiLocalizer'; -import { removeDiacritics } from '../../../util/removeDiacritics'; +} from '../useFunEmojiSearch.js'; +import type { FunEmojiLocalizerIndex } from '../useFunEmojiLocalizer.js'; +import { removeDiacritics } from '../../../util/removeDiacritics.js'; // Import emoji-datasource dynamically to avoid costly typechecking. // eslint-disable-next-line import/no-dynamic-require, @typescript-eslint/no-var-requires diff --git a/ts/components/fun/data/gifs.ts b/ts/components/fun/data/gifs.ts index a63e71b7e3c..15d95fa72d4 100644 --- a/ts/components/fun/data/gifs.ts +++ b/ts/components/fun/data/gifs.ts @@ -1,14 +1,14 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { strictAssert } from '../../../util/assert'; -import type { GifType } from '../panels/FunPanelGifs'; +import { strictAssert } from '../../../util/assert.js'; +import type { GifType } from '../panels/FunPanelGifs.js'; import type { TenorContentFormat, TenorNextCursor, TenorResponseResult, -} from './tenor'; -import { tenor, isTenorTailCursor } from './tenor'; +} from './tenor.js'; +import { tenor, isTenorTailCursor } from './tenor.js'; const PREVIEW_CONTENT_FORMAT: TenorContentFormat = 'tinymp4'; const ATTACHMENT_CONTENT_FORMAT: TenorContentFormat = 'mp4'; diff --git a/ts/components/fun/data/infinite.ts b/ts/components/fun/data/infinite.ts index 0e5123d3257..bbe9eb0ed5c 100644 --- a/ts/components/fun/data/infinite.ts +++ b/ts/components/fun/data/infinite.ts @@ -1,10 +1,10 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import { useCallback, useEffect, useRef, useState } from 'react'; -import { drop } from '../../../util/drop'; -import { createLogger } from '../../../logging/log'; -import * as Errors from '../../../types/errors'; -import { strictAssert } from '../../../util/assert'; +import { drop } from '../../../util/drop.js'; +import { createLogger } from '../../../logging/log.js'; +import * as Errors from '../../../types/errors.js'; +import { strictAssert } from '../../../util/assert.js'; const log = createLogger('infinite'); diff --git a/ts/components/fun/data/segments.ts b/ts/components/fun/data/segments.ts index efa87ddfea8..1eee15741cf 100644 --- a/ts/components/fun/data/segments.ts +++ b/ts/components/fun/data/segments.ts @@ -1,6 +1,6 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { strictAssert } from '../../../util/assert'; +import { strictAssert } from '../../../util/assert.js'; /** @internal Exported for testing */ export const _SEGMENT_SIZE_BUCKETS: ReadonlyArray = [ diff --git a/ts/components/fun/data/tenor.ts b/ts/components/fun/data/tenor.ts index 7ee159daf2a..791d470e414 100644 --- a/ts/components/fun/data/tenor.ts +++ b/ts/components/fun/data/tenor.ts @@ -3,9 +3,9 @@ import { z } from 'zod'; import type { Simplify } from 'type-fest'; -import { strictAssert } from '../../../util/assert'; -import { parseUnknown } from '../../../util/schemas'; -import { fetchInSegments } from './segments'; +import { strictAssert } from '../../../util/assert.js'; +import { parseUnknown } from '../../../util/schemas.js'; +import { fetchInSegments } from './segments.js'; const BASE_URL = 'https://tenor.googleapis.com/v2'; const API_KEY = 'AIzaSyBt6SUfSsCQic2P2VkNkLjsGI7HGWZI95g'; diff --git a/ts/components/fun/isFunPickerEnabled.tsx b/ts/components/fun/isFunPickerEnabled.tsx index 366ee345b74..0c7633184f6 100644 --- a/ts/components/fun/isFunPickerEnabled.tsx +++ b/ts/components/fun/isFunPickerEnabled.tsx @@ -1,6 +1,6 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import * as RemoteConfig from '../../RemoteConfig'; +import * as RemoteConfig from '../../RemoteConfig.js'; export function isFunPickerEnabled(): boolean { return RemoteConfig.isEnabled('desktop.funPicker'); diff --git a/ts/components/fun/keyboard/FunKeyboard.tsx b/ts/components/fun/keyboard/FunKeyboard.tsx index 2fb94e0281f..3507929db1b 100644 --- a/ts/components/fun/keyboard/FunKeyboard.tsx +++ b/ts/components/fun/keyboard/FunKeyboard.tsx @@ -4,7 +4,7 @@ import { focusSafely, getFocusableTreeWalker } from '@react-aria/focus'; import type { ReactNode, RefObject } from 'react'; import React, { useEffect, useRef } from 'react'; import { createKeybindingsHandler } from 'tinykeys'; -import { strictAssert } from '../../../util/assert'; +import { strictAssert } from '../../../util/assert.js'; export abstract class KeyboardDelegate { abstract scrollToState(state: State): void; diff --git a/ts/components/fun/keyboard/GridKeyboardDelegate.tsx b/ts/components/fun/keyboard/GridKeyboardDelegate.tsx index d29acede313..d67b49dfe95 100644 --- a/ts/components/fun/keyboard/GridKeyboardDelegate.tsx +++ b/ts/components/fun/keyboard/GridKeyboardDelegate.tsx @@ -2,14 +2,14 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { VirtualItem, Virtualizer } from '@tanstack/react-virtual'; import { findLast, sortBy } from 'lodash'; -import { strictAssert } from '../../../util/assert'; +import { strictAssert } from '../../../util/assert.js'; import type { CellKey, Layout, RowKey, SectionKey, -} from '../virtual/useFunVirtualGrid'; -import { KeyboardDelegate } from './FunKeyboard'; +} from '../virtual/useFunVirtualGrid.js'; +import { KeyboardDelegate } from './FunKeyboard.js'; const PAGE_MARGIN = 0.25; // % of scroll height diff --git a/ts/components/fun/keyboard/WaterfallKeyboardDelegate.tsx b/ts/components/fun/keyboard/WaterfallKeyboardDelegate.tsx index 60cf18200fc..e442442097c 100644 --- a/ts/components/fun/keyboard/WaterfallKeyboardDelegate.tsx +++ b/ts/components/fun/keyboard/WaterfallKeyboardDelegate.tsx @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { VirtualItem, Virtualizer } from '@tanstack/react-virtual'; import { findLast, maxBy } from 'lodash'; -import { strictAssert } from '../../../util/assert'; -import { KeyboardDelegate } from './FunKeyboard'; +import { strictAssert } from '../../../util/assert.js'; +import { KeyboardDelegate } from './FunKeyboard.js'; const PAGE_MARGIN = 0.25; // % of scroll height diff --git a/ts/components/fun/mocks.tsx b/ts/components/fun/mocks.tsx index 8dd0431dbbe..452ab5cf0f4 100644 --- a/ts/components/fun/mocks.tsx +++ b/ts/components/fun/mocks.tsx @@ -1,15 +1,15 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { strictAssert } from '../../util/assert'; -import type { EmojiParentKey, EmojiVariantKey } from './data/emojis'; +import { strictAssert } from '../../util/assert.js'; +import type { EmojiParentKey, EmojiVariantKey } from './data/emojis.js'; import { EmojiSkinTone, getEmojiParentKeyByEnglishShortName, getEmojiVariantKeyByParentKeyAndSkinTone, isEmojiEnglishShortName, -} from './data/emojis'; -import type { GifsPaginated } from './data/gifs'; +} from './data/emojis.js'; +import type { GifsPaginated } from './data/gifs.js'; function getEmoji(input: string): EmojiParentKey { strictAssert( diff --git a/ts/components/fun/panels/FunPanelEmojis.tsx b/ts/components/fun/panels/FunPanelEmojis.tsx index b34444f430a..f0e9423b972 100644 --- a/ts/components/fun/panels/FunPanelEmojis.tsx +++ b/ts/components/fun/panels/FunPanelEmojis.tsx @@ -11,15 +11,15 @@ import { } from 'react-aria-components'; import { VisuallyHidden } from 'react-aria'; import * as Tooltip from '@radix-ui/react-tooltip'; -import type { LocalizerType } from '../../../types/I18N'; -import { strictAssert } from '../../../util/assert'; -import { missingCaseError } from '../../../util/missingCaseError'; -import type { FunEmojisSection } from '../constants'; +import type { LocalizerType } from '../../../types/I18N.js'; +import { strictAssert } from '../../../util/assert.js'; +import { missingCaseError } from '../../../util/missingCaseError.js'; +import type { FunEmojisSection } from '../constants.js'; import { FunEmojisBase, FunEmojisSectionOrder, FunSectionCommon, -} from '../constants'; +} from '../constants.js'; import { FunGridCell, FunGridContainer, @@ -32,23 +32,23 @@ import { FunGridRow, FunGridRowGroup, FunGridScrollerSection, -} from '../base/FunGrid'; -import { FunItemButton } from '../base/FunItem'; +} from '../base/FunGrid.js'; +import { FunItemButton } from '../base/FunItem.js'; import { FunPanel, FunPanelBody, FunPanelFooter, FunPanelHeader, -} from '../base/FunPanel'; -import { FunScroller } from '../base/FunScroller'; -import { FunSearch } from '../base/FunSearch'; +} from '../base/FunPanel.js'; +import { FunScroller } from '../base/FunScroller.js'; +import { FunSearch } from '../base/FunSearch.js'; import { FunSubNav, FunSubNavIcon, FunSubNavListBox, FunSubNavListBoxItem, -} from '../base/FunSubNav'; -import type { EmojiParentKey, EmojiVariantKey } from '../data/emojis'; +} from '../base/FunSubNav.js'; +import type { EmojiParentKey, EmojiVariantKey } from '../data/emojis.js'; import { EmojiSkinTone, emojiParentKeyConstant, @@ -62,23 +62,23 @@ import { getEmojiParentKeyByVariantKey, getEmojiVariantByKey, getEmojiSkinToneByVariantKey, -} from '../data/emojis'; -import { useFunEmojiSearch } from '../useFunEmojiSearch'; -import { FunKeyboard } from '../keyboard/FunKeyboard'; -import type { GridKeyboardState } from '../keyboard/GridKeyboardDelegate'; -import { GridKeyboardDelegate } from '../keyboard/GridKeyboardDelegate'; +} from '../data/emojis.js'; +import { useFunEmojiSearch } from '../useFunEmojiSearch.js'; +import { FunKeyboard } from '../keyboard/FunKeyboard.js'; +import type { GridKeyboardState } from '../keyboard/GridKeyboardDelegate.js'; +import { GridKeyboardDelegate } from '../keyboard/GridKeyboardDelegate.js'; import type { CellKey, CellLayoutNode, GridSectionNode, -} from '../virtual/useFunVirtualGrid'; -import { useFunVirtualGrid } from '../virtual/useFunVirtualGrid'; -import { FunSkinTonesList } from '../FunSkinTones'; -import { FunStaticEmoji } from '../FunEmoji'; -import { useFunContext } from '../FunProvider'; -import { FunResults, FunResultsHeader } from '../base/FunResults'; -import { useFunEmojiLocalizer } from '../useFunEmojiLocalizer'; -import { FunTooltip } from '../base/FunTooltip'; +} from '../virtual/useFunVirtualGrid.js'; +import { useFunVirtualGrid } from '../virtual/useFunVirtualGrid.js'; +import { FunSkinTonesList } from '../FunSkinTones.js'; +import { FunStaticEmoji } from '../FunEmoji.js'; +import { useFunContext } from '../FunProvider.js'; +import { FunResults, FunResultsHeader } from '../base/FunResults.js'; +import { useFunEmojiLocalizer } from '../useFunEmojiLocalizer.js'; +import { FunTooltip } from '../base/FunTooltip.js'; function getTitleForSection( i18n: LocalizerType, diff --git a/ts/components/fun/panels/FunPanelGifs.tsx b/ts/components/fun/panels/FunPanelGifs.tsx index 46642cb664a..3e93e86935f 100644 --- a/ts/components/fun/panels/FunPanelGifs.tsx +++ b/ts/components/fun/panels/FunPanelGifs.tsx @@ -14,55 +14,58 @@ import React, { } from 'react'; import { VisuallyHidden } from 'react-aria'; import { LRUCache } from 'lru-cache'; -import { FunItemButton } from '../base/FunItem'; +import { FunItemButton } from '../base/FunItem.js'; import { FunPanel, FunPanelBody, FunPanelFooter, FunPanelHeader, -} from '../base/FunPanel'; -import { FunScroller } from '../base/FunScroller'; -import { FunSearch } from '../base/FunSearch'; +} from '../base/FunPanel.js'; +import { FunScroller } from '../base/FunScroller.js'; +import { FunSearch } from '../base/FunSearch.js'; import { FunSubNav, FunSubNavIcon, FunSubNavListBox, FunSubNavListBoxItem, -} from '../base/FunSubNav'; -import { FunWaterfallContainer, FunWaterfallItem } from '../base/FunWaterfall'; -import type { FunGifsSection } from '../constants'; -import { FunGifsCategory, FunSectionCommon } from '../constants'; -import { FunKeyboard } from '../keyboard/FunKeyboard'; -import type { WaterfallKeyboardState } from '../keyboard/WaterfallKeyboardDelegate'; -import { WaterfallKeyboardDelegate } from '../keyboard/WaterfallKeyboardDelegate'; -import { useInfiniteQuery } from '../data/infinite'; -import { missingCaseError } from '../../../util/missingCaseError'; -import { strictAssert } from '../../../util/assert'; -import type { GifsPaginated } from '../data/gifs'; -import { drop } from '../../../util/drop'; -import { useFunContext } from '../FunProvider'; +} from '../base/FunSubNav.js'; +import { + FunWaterfallContainer, + FunWaterfallItem, +} from '../base/FunWaterfall.js'; +import type { FunGifsSection } from '../constants.js'; +import { FunGifsCategory, FunSectionCommon } from '../constants.js'; +import { FunKeyboard } from '../keyboard/FunKeyboard.js'; +import type { WaterfallKeyboardState } from '../keyboard/WaterfallKeyboardDelegate.js'; +import { WaterfallKeyboardDelegate } from '../keyboard/WaterfallKeyboardDelegate.js'; +import { useInfiniteQuery } from '../data/infinite.js'; +import { missingCaseError } from '../../../util/missingCaseError.js'; +import { strictAssert } from '../../../util/assert.js'; +import type { GifsPaginated } from '../data/gifs.js'; +import { drop } from '../../../util/drop.js'; +import { useFunContext } from '../FunProvider.js'; import { FunResults, FunResultsButton, FunResultsFigure, FunResultsHeader, FunResultsSpinner, -} from '../base/FunResults'; -import { FunStaticEmoji } from '../FunEmoji'; -import { emojiVariantConstant } from '../data/emojis'; +} from '../base/FunResults.js'; +import { FunStaticEmoji } from '../FunEmoji.js'; +import { emojiVariantConstant } from '../data/emojis.js'; import { FunLightboxPortal, FunLightboxBackdrop, FunLightboxDialog, FunLightboxProvider, useFunLightboxKey, -} from '../base/FunLightbox'; -import type { tenorDownload } from '../data/tenor'; -import { FunGif } from '../FunGif'; -import type { LocalizerType } from '../../../types/I18N'; -import { isAbortError } from '../../../util/isAbortError'; -import { createLogger } from '../../../logging/log'; -import * as Errors from '../../../types/errors'; +} from '../base/FunLightbox.js'; +import type { tenorDownload } from '../data/tenor.js'; +import { FunGif } from '../FunGif.js'; +import type { LocalizerType } from '../../../types/I18N.js'; +import { isAbortError } from '../../../util/isAbortError.js'; +import { createLogger } from '../../../logging/log.js'; +import * as Errors from '../../../types/errors.js'; const log = createLogger('FunPanelGifs'); diff --git a/ts/components/fun/panels/FunPanelStickers.tsx b/ts/components/fun/panels/FunPanelStickers.tsx index b56062d384e..1fcaf13b409 100644 --- a/ts/components/fun/panels/FunPanelStickers.tsx +++ b/ts/components/fun/panels/FunPanelStickers.tsx @@ -12,20 +12,20 @@ import React, { import type { StickerPackType, StickerType, -} from '../../../state/ducks/stickers'; -import type { LocalizerType } from '../../../types/I18N'; -import { strictAssert } from '../../../util/assert'; +} from '../../../state/ducks/stickers.js'; +import type { LocalizerType } from '../../../types/I18N.js'; +import { strictAssert } from '../../../util/assert.js'; import type { FunStickersPackSection, FunStickersSection, FunTimeStickerStyle, -} from '../constants'; +} from '../constants.js'; import { FunSectionCommon, FunStickersSectionBase, FunTimeStickerStylesOrder, toFunStickersPackSection, -} from '../constants'; +} from '../constants.js'; import { FunGridCell, FunGridContainer, @@ -34,16 +34,16 @@ import { FunGridRow, FunGridRowGroup, FunGridScrollerSection, -} from '../base/FunGrid'; -import { FunItemButton } from '../base/FunItem'; +} from '../base/FunGrid.js'; +import { FunItemButton } from '../base/FunItem.js'; import { FunPanel, FunPanelBody, FunPanelFooter, FunPanelHeader, -} from '../base/FunPanel'; -import { FunScroller } from '../base/FunScroller'; -import { FunSearch } from '../base/FunSearch'; +} from '../base/FunPanel.js'; +import { FunScroller } from '../base/FunScroller.js'; +import { FunSearch } from '../base/FunSearch.js'; import { FunSubNav, FunSubNavButton, @@ -53,36 +53,36 @@ import { FunSubNavListBox, FunSubNavListBoxItem, FunSubNavScroller, -} from '../base/FunSubNav'; +} from '../base/FunSubNav.js'; import { type EmojiParentKey, emojiVariantConstant, getEmojiParentKeyByValue, isEmojiParentValue, -} from '../data/emojis'; -import { FunKeyboard } from '../keyboard/FunKeyboard'; -import type { GridKeyboardState } from '../keyboard/GridKeyboardDelegate'; -import { GridKeyboardDelegate } from '../keyboard/GridKeyboardDelegate'; +} from '../data/emojis.js'; +import { FunKeyboard } from '../keyboard/FunKeyboard.js'; +import type { GridKeyboardState } from '../keyboard/GridKeyboardDelegate.js'; +import { GridKeyboardDelegate } from '../keyboard/GridKeyboardDelegate.js'; import type { CellKey, CellLayoutNode, GridSectionNode, -} from '../virtual/useFunVirtualGrid'; -import { useFunVirtualGrid } from '../virtual/useFunVirtualGrid'; -import { useFunContext } from '../FunProvider'; -import { FunResults, FunResultsHeader } from '../base/FunResults'; -import { FunStaticEmoji } from '../FunEmoji'; +} from '../virtual/useFunVirtualGrid.js'; +import { useFunVirtualGrid } from '../virtual/useFunVirtualGrid.js'; +import { useFunContext } from '../FunProvider.js'; +import { FunResults, FunResultsHeader } from '../base/FunResults.js'; +import { FunStaticEmoji } from '../FunEmoji.js'; import { FunLightboxPortal, FunLightboxBackdrop, FunLightboxDialog, FunLightboxProvider, useFunLightboxKey, -} from '../base/FunLightbox'; -import { FunSticker } from '../FunSticker'; -import { getAnalogTime } from '../../../util/getAnalogTime'; -import { getDateTimeFormatter } from '../../../util/formatTimestamp'; -import { useFunEmojiSearch } from '../useFunEmojiSearch'; +} from '../base/FunLightbox.js'; +import { FunSticker } from '../FunSticker.js'; +import { getAnalogTime } from '../../../util/getAnalogTime.js'; +import { getDateTimeFormatter } from '../../../util/formatTimestamp.js'; +import { useFunEmojiSearch } from '../useFunEmojiSearch.js'; const STICKER_GRID_COLUMNS = 4; const STICKER_GRID_CELL_WIDTH = 80; diff --git a/ts/components/fun/useFunEmojiLocalizer.tsx b/ts/components/fun/useFunEmojiLocalizer.tsx index 6baeece5d9e..6345ab3b749 100644 --- a/ts/components/fun/useFunEmojiLocalizer.tsx +++ b/ts/components/fun/useFunEmojiLocalizer.tsx @@ -1,16 +1,16 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import { useMemo } from 'react'; -import type { EmojiParentKey, EmojiVariantKey } from './data/emojis'; +import type { EmojiParentKey, EmojiVariantKey } from './data/emojis.js'; import { getEmojiParentByKey, getEmojiParentKeyByVariantKey, getEmojiVariantKeyByValue, isEmojiVariantValue, -} from './data/emojis'; -import type { LocaleEmojiListType } from '../../types/emoji'; -import { strictAssert } from '../../util/assert'; -import { useFunEmojiLocalization } from './FunEmojiLocalizationProvider'; +} from './data/emojis.js'; +import type { LocaleEmojiListType } from '../../types/emoji.js'; +import { strictAssert } from '../../util/assert.js'; +import { useFunEmojiLocalization } from './FunEmojiLocalizationProvider.js'; export type FunEmojiLocalizerIndex = Readonly<{ parentKeyToLocaleShortName: ReadonlyMap; diff --git a/ts/components/fun/useFunEmojiSearch.tsx b/ts/components/fun/useFunEmojiSearch.tsx index d8102d2d8cf..677da2bb9c0 100644 --- a/ts/components/fun/useFunEmojiSearch.tsx +++ b/ts/components/fun/useFunEmojiSearch.tsx @@ -3,16 +3,16 @@ import Fuse from 'fuse.js'; import { sortBy } from 'lodash'; import { useMemo } from 'react'; -import type { EmojiParentKey } from './data/emojis'; +import type { EmojiParentKey } from './data/emojis.js'; import { getEmojiParentByKey, getEmojiParentKeyByValue, isEmojiParentValue, isEmojiParentValueDeprecated, normalizeShortNameCompletionQuery, -} from './data/emojis'; -import type { LocaleEmojiListType } from '../../types/emoji'; -import { useFunEmojiLocalization } from './FunEmojiLocalizationProvider'; +} from './data/emojis.js'; +import type { LocaleEmojiListType } from '../../types/emoji.js'; +import { useFunEmojiLocalization } from './FunEmojiLocalizationProvider.js'; export type FunEmojiSearchIndexEntry = Readonly<{ key: EmojiParentKey; diff --git a/ts/components/fun/virtual/useFunVirtualGrid.tsx b/ts/components/fun/virtual/useFunVirtualGrid.tsx index b25f96e3e25..92dcc443a63 100644 --- a/ts/components/fun/virtual/useFunVirtualGrid.tsx +++ b/ts/components/fun/virtual/useFunVirtualGrid.tsx @@ -1,16 +1,16 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { Virtualizer } from '@tanstack/react-virtual'; import { useVirtualizer, type Range, type VirtualItem, + type Virtualizer, } from '@tanstack/react-virtual'; import { chunk, groupBy } from 'lodash'; import type { RefObject } from 'react'; import { useCallback, useMemo } from 'react'; -import { strictAssert } from '../../../util/assert'; -import { missingCaseError } from '../../../util/missingCaseError'; +import { strictAssert } from '../../../util/assert.js'; +import { missingCaseError } from '../../../util/missingCaseError.js'; export type SectionKey = `section-${string}`; export type HeaderKey = `header-${string}`; diff --git a/ts/components/installScreen/InstallScreenBackupImportStep.stories.tsx b/ts/components/installScreen/InstallScreenBackupImportStep.stories.tsx index 6ad56dd32cc..cbb5fc8d2c3 100644 --- a/ts/components/installScreen/InstallScreenBackupImportStep.stories.tsx +++ b/ts/components/installScreen/InstallScreenBackupImportStep.stories.tsx @@ -4,14 +4,14 @@ import React, { useState, useCallback, useEffect } from 'react'; import type { Meta, StoryFn } from '@storybook/react'; import { action } from '@storybook/addon-actions'; -import { sleep } from '../../util/sleep'; +import { sleep } from '../../util/sleep.js'; import { InstallScreenBackupStep, InstallScreenBackupError, -} from '../../types/InstallScreen'; -import { DialogType } from '../../types/Dialogs'; -import type { PropsType } from './InstallScreenBackupImportStep'; -import { InstallScreenBackupImportStep } from './InstallScreenBackupImportStep'; +} from '../../types/InstallScreen.js'; +import { DialogType } from '../../types/Dialogs.js'; +import type { PropsType } from './InstallScreenBackupImportStep.js'; +import { InstallScreenBackupImportStep } from './InstallScreenBackupImportStep.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/installScreen/InstallScreenBackupImportStep.tsx b/ts/components/installScreen/InstallScreenBackupImportStep.tsx index d79fd4f4f9b..cd1e3263194 100644 --- a/ts/components/installScreen/InstallScreenBackupImportStep.tsx +++ b/ts/components/installScreen/InstallScreenBackupImportStep.tsx @@ -3,23 +3,23 @@ import React, { useState, useCallback } from 'react'; -import type { LocalizerType } from '../../types/Util'; -import type { UpdatesStateType } from '../../state/ducks/updates'; +import type { LocalizerType } from '../../types/Util.js'; +import type { UpdatesStateType } from '../../state/ducks/updates.js'; import { InstallScreenStep, InstallScreenBackupStep, InstallScreenBackupError, -} from '../../types/InstallScreen'; -import { formatFileSize } from '../../util/formatFileSize'; -import { TitlebarDragArea } from '../TitlebarDragArea'; -import { ProgressBar } from '../ProgressBar'; -import { ConfirmationDialog } from '../ConfirmationDialog'; -import { InstallScreenSignalLogo } from './InstallScreenSignalLogo'; -import { roundFractionForProgressBar } from '../../util/numbers'; -import { missingCaseError } from '../../util/missingCaseError'; -import { SYNCING_MESSAGES_SECURITY_URL } from '../../types/support'; -import { I18n } from '../I18n'; -import { InstallScreenUpdateDialog } from './InstallScreenUpdateDialog'; +} from '../../types/InstallScreen.js'; +import { formatFileSize } from '../../util/formatFileSize.js'; +import { TitlebarDragArea } from '../TitlebarDragArea.js'; +import { ProgressBar } from '../ProgressBar.js'; +import { ConfirmationDialog } from '../ConfirmationDialog.js'; +import { InstallScreenSignalLogo } from './InstallScreenSignalLogo.js'; +import { roundFractionForProgressBar } from '../../util/numbers.js'; +import { missingCaseError } from '../../util/missingCaseError.js'; +import { SYNCING_MESSAGES_SECURITY_URL } from '../../types/support.js'; +import { I18n } from '../I18n.js'; +import { InstallScreenUpdateDialog } from './InstallScreenUpdateDialog.js'; // We can't always use destructuring assignment because of the complexity of this props // type. diff --git a/ts/components/installScreen/InstallScreenErrorStep.stories.tsx b/ts/components/installScreen/InstallScreenErrorStep.stories.tsx index 458b9ba90e1..c11b34318e4 100644 --- a/ts/components/installScreen/InstallScreenErrorStep.stories.tsx +++ b/ts/components/installScreen/InstallScreenErrorStep.stories.tsx @@ -4,9 +4,9 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { InstallScreenError } from '../../types/InstallScreen'; -import type { Props } from './InstallScreenErrorStep'; -import { InstallScreenErrorStep } from './InstallScreenErrorStep'; +import { InstallScreenError } from '../../types/InstallScreen.js'; +import type { Props } from './InstallScreenErrorStep.js'; +import { InstallScreenErrorStep } from './InstallScreenErrorStep.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/installScreen/InstallScreenErrorStep.tsx b/ts/components/installScreen/InstallScreenErrorStep.tsx index b9cc4c2d6df..260cf4f6ee8 100644 --- a/ts/components/installScreen/InstallScreenErrorStep.tsx +++ b/ts/components/installScreen/InstallScreenErrorStep.tsx @@ -3,14 +3,14 @@ import React, { type ReactElement, useCallback } from 'react'; -import type { LocalizerType } from '../../types/Util'; -import { missingCaseError } from '../../util/missingCaseError'; -import { openLinkInWebBrowser } from '../../util/openLinkInWebBrowser'; -import { Button, ButtonVariant } from '../Button'; -import { TitlebarDragArea } from '../TitlebarDragArea'; -import { InstallScreenSignalLogo } from './InstallScreenSignalLogo'; -import { LINK_SIGNAL_DESKTOP } from '../../types/support'; -import { InstallScreenError } from '../../types/InstallScreen'; +import type { LocalizerType } from '../../types/Util.js'; +import { missingCaseError } from '../../util/missingCaseError.js'; +import { openLinkInWebBrowser } from '../../util/openLinkInWebBrowser.js'; +import { Button, ButtonVariant } from '../Button.js'; +import { TitlebarDragArea } from '../TitlebarDragArea.js'; +import { InstallScreenSignalLogo } from './InstallScreenSignalLogo.js'; +import { LINK_SIGNAL_DESKTOP } from '../../types/support.js'; +import { InstallScreenError } from '../../types/InstallScreen.js'; export type Props = Readonly<{ error: InstallScreenError; diff --git a/ts/components/installScreen/InstallScreenLinkInProgress.stories.tsx b/ts/components/installScreen/InstallScreenLinkInProgress.stories.tsx index d7bde45d5b9..dba2bccca33 100644 --- a/ts/components/installScreen/InstallScreenLinkInProgress.stories.tsx +++ b/ts/components/installScreen/InstallScreenLinkInProgress.stories.tsx @@ -3,8 +3,8 @@ import React from 'react'; import type { Meta } from '@storybook/react'; -import type { Props } from './InstallScreenLinkInProgressStep'; -import { InstallScreenLinkInProgressStep } from './InstallScreenLinkInProgressStep'; +import type { Props } from './InstallScreenLinkInProgressStep.js'; +import { InstallScreenLinkInProgressStep } from './InstallScreenLinkInProgressStep.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/installScreen/InstallScreenLinkInProgressStep.tsx b/ts/components/installScreen/InstallScreenLinkInProgressStep.tsx index ebf2c2e3612..7c82c57bd93 100644 --- a/ts/components/installScreen/InstallScreenLinkInProgressStep.tsx +++ b/ts/components/installScreen/InstallScreenLinkInProgressStep.tsx @@ -4,11 +4,11 @@ import type { ReactElement } from 'react'; import React from 'react'; -import type { LocalizerType } from '../../types/Util'; +import type { LocalizerType } from '../../types/Util.js'; -import { Spinner } from '../Spinner'; -import { TitlebarDragArea } from '../TitlebarDragArea'; -import { InstallScreenSignalLogo } from './InstallScreenSignalLogo'; +import { Spinner } from '../Spinner.js'; +import { TitlebarDragArea } from '../TitlebarDragArea.js'; +import { InstallScreenSignalLogo } from './InstallScreenSignalLogo.js'; export type Props = Readonly<{ i18n: LocalizerType }>; diff --git a/ts/components/installScreen/InstallScreenQrCodeNotScannedStep.stories.tsx b/ts/components/installScreen/InstallScreenQrCodeNotScannedStep.stories.tsx index dc53d572bf0..99c963b1433 100644 --- a/ts/components/installScreen/InstallScreenQrCodeNotScannedStep.stories.tsx +++ b/ts/components/installScreen/InstallScreenQrCodeNotScannedStep.stories.tsx @@ -4,12 +4,12 @@ import React, { useEffect, useState } from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta, StoryFn } from '@storybook/react'; -import { DialogType } from '../../types/Dialogs'; -import { InstallScreenQRCodeError } from '../../types/InstallScreen'; -import type { Loadable } from '../../util/loadable'; -import { LoadingState } from '../../util/loadable'; -import type { PropsType } from './InstallScreenQrCodeNotScannedStep'; -import { InstallScreenQrCodeNotScannedStep } from './InstallScreenQrCodeNotScannedStep'; +import { DialogType } from '../../types/Dialogs.js'; +import { InstallScreenQRCodeError } from '../../types/InstallScreen.js'; +import type { Loadable } from '../../util/loadable.js'; +import { LoadingState } from '../../util/loadable.js'; +import type { PropsType } from './InstallScreenQrCodeNotScannedStep.js'; +import { InstallScreenQrCodeNotScannedStep } from './InstallScreenQrCodeNotScannedStep.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/installScreen/InstallScreenQrCodeNotScannedStep.tsx b/ts/components/installScreen/InstallScreenQrCodeNotScannedStep.tsx index ff8b48707e8..a191d72552f 100644 --- a/ts/components/installScreen/InstallScreenQrCodeNotScannedStep.tsx +++ b/ts/components/installScreen/InstallScreenQrCodeNotScannedStep.tsx @@ -6,25 +6,25 @@ import React, { useCallback, useState, useEffect } from 'react'; import classNames from 'classnames'; import { noop } from 'lodash'; -import type { LocalizerType } from '../../types/Util'; +import type { LocalizerType } from '../../types/Util.js'; import { InstallScreenStep, InstallScreenQRCodeError, -} from '../../types/InstallScreen'; -import { missingCaseError } from '../../util/missingCaseError'; -import type { Loadable } from '../../util/loadable'; -import { LoadingState } from '../../util/loadable'; -import { drop } from '../../util/drop'; -import { getEnvironment, Environment } from '../../environment'; +} from '../../types/InstallScreen.js'; +import { missingCaseError } from '../../util/missingCaseError.js'; +import type { Loadable } from '../../util/loadable.js'; +import { LoadingState } from '../../util/loadable.js'; +import { drop } from '../../util/drop.js'; +import { getEnvironment, Environment } from '../../environment.js'; -import { I18n } from '../I18n'; -import { Spinner } from '../Spinner'; -import { BrandedQRCode } from '../BrandedQRCode'; -import { TitlebarDragArea } from '../TitlebarDragArea'; -import { InstallScreenSignalLogo } from './InstallScreenSignalLogo'; -import { InstallScreenUpdateDialog } from './InstallScreenUpdateDialog'; -import { getClassNamesFor } from '../../util/getClassNamesFor'; -import type { UpdatesStateType } from '../../state/ducks/updates'; +import { I18n } from '../I18n.js'; +import { Spinner } from '../Spinner.js'; +import { BrandedQRCode } from '../BrandedQRCode.js'; +import { TitlebarDragArea } from '../TitlebarDragArea.js'; +import { InstallScreenSignalLogo } from './InstallScreenSignalLogo.js'; +import { InstallScreenUpdateDialog } from './InstallScreenUpdateDialog.js'; +import { getClassNamesFor } from '../../util/getClassNamesFor.js'; +import type { UpdatesStateType } from '../../state/ducks/updates.js'; // We can't always use destructuring assignment because of the complexity of this props // type. diff --git a/ts/components/installScreen/InstallScreenUpdateDialog.tsx b/ts/components/installScreen/InstallScreenUpdateDialog.tsx index 12697cabd77..c18546d1ea0 100644 --- a/ts/components/installScreen/InstallScreenUpdateDialog.tsx +++ b/ts/components/installScreen/InstallScreenUpdateDialog.tsx @@ -4,22 +4,22 @@ import React from 'react'; import { noop } from 'lodash'; -import { DialogType } from '../../types/Dialogs'; -import { InstallScreenStep } from '../../types/InstallScreen'; -import type { LocalizerType } from '../../types/Util'; +import { DialogType } from '../../types/Dialogs.js'; +import { InstallScreenStep } from '../../types/InstallScreen.js'; +import type { LocalizerType } from '../../types/Util.js'; import { PRODUCTION_DOWNLOAD_URL, BETA_DOWNLOAD_URL, UNSUPPORTED_OS_URL, -} from '../../types/support'; -import type { UpdatesStateType } from '../../state/ducks/updates'; -import { isBeta } from '../../util/version'; -import { missingCaseError } from '../../util/missingCaseError'; -import { roundFractionForProgressBar } from '../../util/numbers'; -import { ConfirmationDialog } from '../ConfirmationDialog'; -import { Modal } from '../Modal'; -import { I18n } from '../I18n'; -import { formatFileSize } from '../../util/formatFileSize'; +} from '../../types/support.js'; +import type { UpdatesStateType } from '../../state/ducks/updates.js'; +import { isBeta } from '../../util/version.js'; +import { missingCaseError } from '../../util/missingCaseError.js'; +import { roundFractionForProgressBar } from '../../util/numbers.js'; +import { ConfirmationDialog } from '../ConfirmationDialog.js'; +import { Modal } from '../Modal.js'; +import { I18n } from '../I18n.js'; +import { formatFileSize } from '../../util/formatFileSize.js'; export type PropsType = UpdatesStateType & Readonly<{ diff --git a/ts/components/leftPane/LeftPaneArchiveHelper.tsx b/ts/components/leftPane/LeftPaneArchiveHelper.tsx index 32f91458b80..c51940b6773 100644 --- a/ts/components/leftPane/LeftPaneArchiveHelper.tsx +++ b/ts/components/leftPane/LeftPaneArchiveHelper.tsx @@ -5,21 +5,21 @@ import type { ReactChild } from 'react'; import React from 'react'; import { last } from 'lodash'; -import type { ToFindType } from './LeftPaneHelper'; -import { LeftPaneHelper } from './LeftPaneHelper'; -import { getConversationInDirection } from './getConversationInDirection'; -import type { Row } from '../ConversationList'; -import { RowType } from '../ConversationList'; -import type { PropsData as ConversationListItemPropsType } from '../conversationList/ConversationListItem'; -import type { LocalizerType } from '../../types/Util'; +import type { ToFindType } from './LeftPaneHelper.js'; +import { LeftPaneHelper } from './LeftPaneHelper.js'; +import { getConversationInDirection } from './getConversationInDirection.js'; +import type { Row } from '../ConversationList.js'; +import { RowType } from '../ConversationList.js'; +import type { PropsData as ConversationListItemPropsType } from '../conversationList/ConversationListItem.js'; +import type { LocalizerType } from '../../types/Util.js'; import type { ConversationType, ShowConversationType, -} from '../../state/ducks/conversations'; -import { LeftPaneSearchInput } from '../LeftPaneSearchInput'; -import type { LeftPaneSearchPropsType } from './LeftPaneSearchHelper'; -import { LeftPaneSearchHelper } from './LeftPaneSearchHelper'; -import * as KeyboardLayout from '../../services/keyboardLayout'; +} from '../../state/ducks/conversations.js'; +import { LeftPaneSearchInput } from '../LeftPaneSearchInput.js'; +import type { LeftPaneSearchPropsType } from './LeftPaneSearchHelper.js'; +import { LeftPaneSearchHelper } from './LeftPaneSearchHelper.js'; +import * as KeyboardLayout from '../../services/keyboardLayout.js'; type LeftPaneArchiveBasePropsType = { archivedConversations: ReadonlyArray; diff --git a/ts/components/leftPane/LeftPaneChooseGroupMembersHelper.tsx b/ts/components/leftPane/LeftPaneChooseGroupMembersHelper.tsx index 49b576e399e..5661016fece 100644 --- a/ts/components/leftPane/LeftPaneChooseGroupMembersHelper.tsx +++ b/ts/components/leftPane/LeftPaneChooseGroupMembersHelper.tsx @@ -4,27 +4,27 @@ import type { ReactChild, ChangeEvent } from 'react'; import React from 'react'; -import { LeftPaneHelper } from './LeftPaneHelper'; -import type { Row } from '../ConversationList'; -import { RowType } from '../ConversationList'; -import type { ConversationType } from '../../state/ducks/conversations'; -import { ContactCheckboxDisabledReason } from '../conversationList/ContactCheckbox'; -import { ContactPills } from '../ContactPills'; -import { ContactPill } from '../ContactPill'; -import { SearchInput } from '../SearchInput'; +import { LeftPaneHelper } from './LeftPaneHelper.js'; +import type { Row } from '../ConversationList.js'; +import { RowType } from '../ConversationList.js'; +import type { ConversationType } from '../../state/ducks/conversations.js'; +import { ContactCheckboxDisabledReason } from '../conversationList/ContactCheckbox.js'; +import { ContactPills } from '../ContactPills.js'; +import { ContactPill } from '../ContactPill.js'; +import { SearchInput } from '../SearchInput.js'; import { AddGroupMemberErrorDialog, AddGroupMemberErrorDialogMode, -} from '../AddGroupMemberErrorDialog'; -import { Button } from '../Button'; -import type { LocalizerType } from '../../types/Util'; -import type { ParsedE164Type } from '../../util/libphonenumberInstance'; -import { parseAndFormatPhoneNumber } from '../../util/libphonenumberInstance'; -import type { UUIDFetchStateType } from '../../util/uuidFetchState'; +} from '../AddGroupMemberErrorDialog.js'; +import { Button } from '../Button.js'; +import type { LocalizerType } from '../../types/Util.js'; +import type { ParsedE164Type } from '../../util/libphonenumberInstance.js'; +import { parseAndFormatPhoneNumber } from '../../util/libphonenumberInstance.js'; +import type { UUIDFetchStateType } from '../../util/uuidFetchState.js'; import { isFetchingByUsername, isFetchingByE164, -} from '../../util/uuidFetchState'; +} from '../../util/uuidFetchState.js'; export type LeftPaneChooseGroupMembersPropsType = { uuidFetchState: UUIDFetchStateType; diff --git a/ts/components/leftPane/LeftPaneComposeHelper.tsx b/ts/components/leftPane/LeftPaneComposeHelper.tsx index 917eeffee0a..b1797ad7826 100644 --- a/ts/components/leftPane/LeftPaneComposeHelper.tsx +++ b/ts/components/leftPane/LeftPaneComposeHelper.tsx @@ -4,21 +4,21 @@ import type { ReactChild, ChangeEvent } from 'react'; import React from 'react'; -import { LeftPaneHelper } from './LeftPaneHelper'; -import type { Row } from '../ConversationList'; -import { RowType } from '../ConversationList'; -import type { ContactListItemConversationType } from '../conversationList/ContactListItem'; -import { SearchInput } from '../SearchInput'; -import type { LocalizerType } from '../../types/Util'; -import type { ParsedE164Type } from '../../util/libphonenumberInstance'; -import { parseAndFormatPhoneNumber } from '../../util/libphonenumberInstance'; -import type { UUIDFetchStateType } from '../../util/uuidFetchState'; +import { LeftPaneHelper } from './LeftPaneHelper.js'; +import type { Row } from '../ConversationList.js'; +import { RowType } from '../ConversationList.js'; +import type { ContactListItemConversationType } from '../conversationList/ContactListItem.js'; +import { SearchInput } from '../SearchInput.js'; +import type { LocalizerType } from '../../types/Util.js'; +import type { ParsedE164Type } from '../../util/libphonenumberInstance.js'; +import { parseAndFormatPhoneNumber } from '../../util/libphonenumberInstance.js'; +import type { UUIDFetchStateType } from '../../util/uuidFetchState.js'; import { isFetchingByUsername, isFetchingByE164, -} from '../../util/uuidFetchState'; -import type { GroupListItemConversationType } from '../conversationList/GroupListItem'; -import { isProbablyAUsername } from '../../util/Username'; +} from '../../util/uuidFetchState.js'; +import type { GroupListItemConversationType } from '../conversationList/GroupListItem.js'; +import { isProbablyAUsername } from '../../util/Username.js'; export type LeftPaneComposePropsType = { composeContacts: ReadonlyArray; diff --git a/ts/components/leftPane/LeftPaneFindByPhoneNumberHelper.tsx b/ts/components/leftPane/LeftPaneFindByPhoneNumberHelper.tsx index 67d5fe14d98..90de08978da 100644 --- a/ts/components/leftPane/LeftPaneFindByPhoneNumberHelper.tsx +++ b/ts/components/leftPane/LeftPaneFindByPhoneNumberHelper.tsx @@ -4,22 +4,22 @@ import type { ReactChild } from 'react'; import React from 'react'; -import { LeftPaneHelper } from './LeftPaneHelper'; -import type { Row } from '../ConversationList'; -import { RowType } from '../ConversationList'; -import { SearchInput } from '../SearchInput'; -import type { LocalizerType } from '../../types/Util'; -import type { ShowConversationType } from '../../state/ducks/conversations'; -import type { ParsedE164Type } from '../../util/libphonenumberInstance'; -import { parseAndFormatPhoneNumber } from '../../util/libphonenumberInstance'; -import type { UUIDFetchStateType } from '../../util/uuidFetchState'; -import type { CountryDataType } from '../../util/getCountryData'; -import { isFetchingByE164 } from '../../util/uuidFetchState'; -import { drop } from '../../util/drop'; -import type { LookupConversationWithoutServiceIdActionsType } from '../../util/lookupConversationWithoutServiceId'; -import { Spinner } from '../Spinner'; -import { Button } from '../Button'; -import { CountryCodeSelect } from '../CountryCodeSelect'; +import { LeftPaneHelper } from './LeftPaneHelper.js'; +import type { Row } from '../ConversationList.js'; +import { RowType } from '../ConversationList.js'; +import { SearchInput } from '../SearchInput.js'; +import type { LocalizerType } from '../../types/Util.js'; +import type { ShowConversationType } from '../../state/ducks/conversations.js'; +import type { ParsedE164Type } from '../../util/libphonenumberInstance.js'; +import { parseAndFormatPhoneNumber } from '../../util/libphonenumberInstance.js'; +import type { UUIDFetchStateType } from '../../util/uuidFetchState.js'; +import type { CountryDataType } from '../../util/getCountryData.js'; +import { isFetchingByE164 } from '../../util/uuidFetchState.js'; +import { drop } from '../../util/drop.js'; +import type { LookupConversationWithoutServiceIdActionsType } from '../../util/lookupConversationWithoutServiceId.js'; +import { Spinner } from '../Spinner.js'; +import { Button } from '../Button.js'; +import { CountryCodeSelect } from '../CountryCodeSelect.js'; export type LeftPaneFindByPhoneNumberPropsType = { searchTerm: string; diff --git a/ts/components/leftPane/LeftPaneFindByUsernameHelper.tsx b/ts/components/leftPane/LeftPaneFindByUsernameHelper.tsx index b17a9c5a7fb..b4468b1385d 100644 --- a/ts/components/leftPane/LeftPaneFindByUsernameHelper.tsx +++ b/ts/components/leftPane/LeftPaneFindByUsernameHelper.tsx @@ -4,18 +4,18 @@ import type { ReactChild } from 'react'; import React from 'react'; -import { LeftPaneHelper } from './LeftPaneHelper'; -import type { Row } from '../ConversationList'; -import { RowType } from '../ConversationList'; -import { SearchInput } from '../SearchInput'; -import type { LocalizerType } from '../../types/Util'; -import type { ShowConversationType } from '../../state/ducks/conversations'; -import type { UUIDFetchStateType } from '../../util/uuidFetchState'; -import { isFetchingByUsername } from '../../util/uuidFetchState'; -import { drop } from '../../util/drop'; -import type { LookupConversationWithoutServiceIdActionsType } from '../../util/lookupConversationWithoutServiceId'; -import { Spinner } from '../Spinner'; -import { Button } from '../Button'; +import { LeftPaneHelper } from './LeftPaneHelper.js'; +import type { Row } from '../ConversationList.js'; +import { RowType } from '../ConversationList.js'; +import { SearchInput } from '../SearchInput.js'; +import type { LocalizerType } from '../../types/Util.js'; +import type { ShowConversationType } from '../../state/ducks/conversations.js'; +import type { UUIDFetchStateType } from '../../util/uuidFetchState.js'; +import { isFetchingByUsername } from '../../util/uuidFetchState.js'; +import { drop } from '../../util/drop.js'; +import type { LookupConversationWithoutServiceIdActionsType } from '../../util/lookupConversationWithoutServiceId.js'; +import { Spinner } from '../Spinner.js'; +import { Button } from '../Button.js'; export type LeftPaneFindByUsernamePropsType = { searchTerm: string; diff --git a/ts/components/leftPane/LeftPaneHelper.tsx b/ts/components/leftPane/LeftPaneHelper.tsx index 0a4d1c0a146..803660d8df2 100644 --- a/ts/components/leftPane/LeftPaneHelper.tsx +++ b/ts/components/leftPane/LeftPaneHelper.tsx @@ -3,16 +3,16 @@ import type { ChangeEvent, ReactChild } from 'react'; -import type { Row } from '../ConversationList'; -import type { LocalizerType } from '../../types/Util'; +import type { Row } from '../ConversationList.js'; +import type { LocalizerType } from '../../types/Util.js'; import type { DeleteAvatarFromDiskActionType, ReplaceAvatarActionType, SaveAvatarToDiskActionType, -} from '../../types/Avatar'; -import type { DurationInSeconds } from '../../util/durations'; -import type { LookupConversationWithoutServiceIdActionsType } from '../../util/lookupConversationWithoutServiceId'; -import type { ShowConversationType } from '../../state/ducks/conversations'; +} from '../../types/Avatar.js'; +import type { DurationInSeconds } from '../../util/durations/index.js'; +import type { LookupConversationWithoutServiceIdActionsType } from '../../util/lookupConversationWithoutServiceId.js'; +import type { ShowConversationType } from '../../state/ducks/conversations.js'; export enum FindDirection { Up, diff --git a/ts/components/leftPane/LeftPaneInboxHelper.tsx b/ts/components/leftPane/LeftPaneInboxHelper.tsx index 9708d20c4ed..ae17071ebc4 100644 --- a/ts/components/leftPane/LeftPaneInboxHelper.tsx +++ b/ts/components/leftPane/LeftPaneInboxHelper.tsx @@ -5,20 +5,20 @@ import { last } from 'lodash'; import type { ReactChild } from 'react'; import React from 'react'; -import type { ToFindType } from './LeftPaneHelper'; +import type { ToFindType } from './LeftPaneHelper.js'; import type { ConversationType, ShowConversationType, -} from '../../state/ducks/conversations'; -import { LeftPaneHelper } from './LeftPaneHelper'; -import { getConversationInDirection } from './getConversationInDirection'; -import type { Row } from '../ConversationList'; -import { RowType } from '../ConversationList'; -import { NavSidebarEmpty } from '../NavSidebar'; -import type { PropsData as ConversationListItemPropsType } from '../conversationList/ConversationListItem'; -import type { LocalizerType } from '../../types/Util'; -import { handleKeydownForSearch } from './handleKeydownForSearch'; -import { LeftPaneSearchInput } from '../LeftPaneSearchInput'; +} from '../../state/ducks/conversations.js'; +import { LeftPaneHelper } from './LeftPaneHelper.js'; +import { getConversationInDirection } from './getConversationInDirection.js'; +import type { Row } from '../ConversationList.js'; +import { RowType } from '../ConversationList.js'; +import { NavSidebarEmpty } from '../NavSidebar.js'; +import type { PropsData as ConversationListItemPropsType } from '../conversationList/ConversationListItem.js'; +import type { LocalizerType } from '../../types/Util.js'; +import { handleKeydownForSearch } from './handleKeydownForSearch.js'; +import { LeftPaneSearchInput } from '../LeftPaneSearchInput.js'; export type LeftPaneInboxPropsType = { conversations: ReadonlyArray; diff --git a/ts/components/leftPane/LeftPaneSearchHelper.tsx b/ts/components/leftPane/LeftPaneSearchHelper.tsx index 00b209562e8..7c8a9d050a2 100644 --- a/ts/components/leftPane/LeftPaneSearchHelper.tsx +++ b/ts/components/leftPane/LeftPaneSearchHelper.tsx @@ -4,22 +4,22 @@ import type { ReactChild } from 'react'; import React from 'react'; -import type { ToFindType } from './LeftPaneHelper'; -import { LeftPaneHelper } from './LeftPaneHelper'; -import type { LocalizerType } from '../../types/Util'; -import type { Row } from '../ConversationList'; -import { RowType } from '../ConversationList'; -import type { PropsData as ConversationListItemPropsType } from '../conversationList/ConversationListItem'; -import { handleKeydownForSearch } from './handleKeydownForSearch'; +import type { ToFindType } from './LeftPaneHelper.js'; +import { LeftPaneHelper } from './LeftPaneHelper.js'; +import type { LocalizerType } from '../../types/Util.js'; +import type { Row } from '../ConversationList.js'; +import { RowType } from '../ConversationList.js'; +import type { PropsData as ConversationListItemPropsType } from '../conversationList/ConversationListItem.js'; +import { handleKeydownForSearch } from './handleKeydownForSearch.js'; import type { ConversationType, ShowConversationType, -} from '../../state/ducks/conversations'; -import { LeftPaneSearchInput } from '../LeftPaneSearchInput'; +} from '../../state/ducks/conversations.js'; +import { LeftPaneSearchInput } from '../LeftPaneSearchInput.js'; -import { I18n } from '../I18n'; -import { assertDev } from '../../util/assert'; -import { UserText } from '../UserText'; +import { I18n } from '../I18n.js'; +import { assertDev } from '../../util/assert.js'; +import { UserText } from '../UserText.js'; // The "correct" thing to do is to measure the size of the left pane and render enough // search results for the container height. But (1) that's slow (2) the list is diff --git a/ts/components/leftPane/LeftPaneSetGroupMetadataHelper.tsx b/ts/components/leftPane/LeftPaneSetGroupMetadataHelper.tsx index c5f18f889b8..c0437435c72 100644 --- a/ts/components/leftPane/LeftPaneSetGroupMetadataHelper.tsx +++ b/ts/components/leftPane/LeftPaneSetGroupMetadataHelper.tsx @@ -4,27 +4,27 @@ import type { ReactChild } from 'react'; import React from 'react'; -import { LeftPaneHelper } from './LeftPaneHelper'; -import type { Row } from '../ConversationList'; -import { RowType } from '../ConversationList'; -import type { ContactListItemConversationType } from '../conversationList/ContactListItem'; -import { DisappearingTimerSelect } from '../DisappearingTimerSelect'; -import type { LocalizerType } from '../../types/Util'; -import type { DurationInSeconds } from '../../util/durations'; -import { Alert } from '../Alert'; -import { AvatarEditor } from '../AvatarEditor'; -import { AvatarPreview } from '../AvatarPreview'; -import { Spinner } from '../Spinner'; -import { Button } from '../Button'; -import { Modal } from '../Modal'; -import { GroupTitleInput } from '../GroupTitleInput'; +import { LeftPaneHelper } from './LeftPaneHelper.js'; +import type { Row } from '../ConversationList.js'; +import { RowType } from '../ConversationList.js'; +import type { ContactListItemConversationType } from '../conversationList/ContactListItem.js'; +import { DisappearingTimerSelect } from '../DisappearingTimerSelect.js'; +import type { LocalizerType } from '../../types/Util.js'; +import type { DurationInSeconds } from '../../util/durations/index.js'; +import { Alert } from '../Alert.js'; +import { AvatarEditor } from '../AvatarEditor.js'; +import { AvatarPreview } from '../AvatarPreview.js'; +import { Spinner } from '../Spinner.js'; +import { Button } from '../Button.js'; +import { Modal } from '../Modal.js'; +import { GroupTitleInput } from '../GroupTitleInput.js'; import type { AvatarDataType, DeleteAvatarFromDiskActionType, ReplaceAvatarActionType, SaveAvatarToDiskActionType, -} from '../../types/Avatar'; -import { AvatarColors } from '../../types/Colors'; +} from '../../types/Avatar.js'; +import { AvatarColors } from '../../types/Colors.js'; export type LeftPaneSetGroupMetadataPropsType = { groupAvatar: undefined | Uint8Array; diff --git a/ts/components/leftPane/getConversationInDirection.ts b/ts/components/leftPane/getConversationInDirection.ts index 0d6609b1b30..73924762ecf 100644 --- a/ts/components/leftPane/getConversationInDirection.ts +++ b/ts/components/leftPane/getConversationInDirection.ts @@ -3,10 +3,10 @@ import { find as findFirst, findLast, first, last } from 'lodash'; -import type { PropsData as ConversationListItemPropsType } from '../conversationList/ConversationListItem'; -import { isConversationUnread } from '../../util/isConversationUnread'; -import type { ToFindType } from './LeftPaneHelper'; -import { FindDirection } from './LeftPaneHelper'; +import type { PropsData as ConversationListItemPropsType } from '../conversationList/ConversationListItem.js'; +import { isConversationUnread } from '../../util/isConversationUnread.js'; +import type { ToFindType } from './LeftPaneHelper.js'; +import { FindDirection } from './LeftPaneHelper.js'; /** * This will look up or down in an array of conversations for the next one to select. diff --git a/ts/components/leftPane/handleKeydownForSearch.ts b/ts/components/leftPane/handleKeydownForSearch.ts index 20736b8c263..bd84448789e 100644 --- a/ts/components/leftPane/handleKeydownForSearch.ts +++ b/ts/components/leftPane/handleKeydownForSearch.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import * as KeyboardLayout from '../../services/keyboardLayout'; +import * as KeyboardLayout from '../../services/keyboardLayout.js'; export function handleKeydownForSearch( event: Readonly, diff --git a/ts/components/preferences/chatFolders/PreferencesChatFoldersPage.tsx b/ts/components/preferences/chatFolders/PreferencesChatFoldersPage.tsx index 163e6a499bf..a0c4d9fc772 100644 --- a/ts/components/preferences/chatFolders/PreferencesChatFoldersPage.tsx +++ b/ts/components/preferences/chatFolders/PreferencesChatFoldersPage.tsx @@ -3,19 +3,21 @@ import React, { useCallback, useMemo } from 'react'; import type { MutableRefObject } from 'react'; -import type { LocalizerType } from '../../../types/I18N'; -import { PreferencesContent } from '../../Preferences'; -import { SettingsRow } from '../../PreferencesUtil'; -import type { ChatFolderId } from '../../../types/ChatFolder'; +import type { LocalizerType } from '../../../types/I18N.js'; +import { PreferencesContent } from '../../Preferences.js'; +import { SettingsRow } from '../../PreferencesUtil.js'; import { CHAT_FOLDER_PRESETS, matchesChatFolderPreset, - type ChatFolderParams, - type ChatFolderPreset, - type ChatFolder, ChatFolderType, -} from '../../../types/ChatFolder'; -import { Button, ButtonVariant } from '../../Button'; +} from '../../../types/ChatFolder.js'; +import type { + ChatFolderId, + ChatFolderParams, + ChatFolderPreset, + ChatFolder, +} from '../../../types/ChatFolder.js'; +import { Button, ButtonVariant } from '../../Button.js'; // import { showToast } from '../../state/ducks/toast'; export type PreferencesChatFoldersPageProps = Readonly<{ diff --git a/ts/components/preferences/chatFolders/PreferencesEditChatFoldersPage.tsx b/ts/components/preferences/chatFolders/PreferencesEditChatFoldersPage.tsx index 603f70b8276..2226518bf00 100644 --- a/ts/components/preferences/chatFolders/PreferencesEditChatFoldersPage.tsx +++ b/ts/components/preferences/chatFolders/PreferencesEditChatFoldersPage.tsx @@ -2,30 +2,32 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { MutableRefObject } from 'react'; import React, { useCallback, useMemo, useState } from 'react'; -import type { ConversationType } from '../../../state/ducks/conversations'; -import type { PreferredBadgeSelectorType } from '../../../state/selectors/badges'; -import type { LocalizerType } from '../../../types/I18N'; -import type { ThemeType } from '../../../types/Util'; -import { Input } from '../../Input'; -import { Button, ButtonVariant } from '../../Button'; -import { ConfirmationDialog } from '../../ConfirmationDialog'; -import type { ChatFolderSelection } from './PreferencesEditChatFoldersSelectChatsDialog'; -import { PreferencesEditChatFoldersSelectChatsDialog } from './PreferencesEditChatFoldersSelectChatsDialog'; -import { SettingsRow } from '../../PreferencesUtil'; -import { Checkbox } from '../../Checkbox'; -import { Avatar, AvatarSize } from '../../Avatar'; -import { PreferencesContent } from '../../Preferences'; -import type { ChatFolderId } from '../../../types/ChatFolder'; +import type { ConversationType } from '../../../state/ducks/conversations.js'; +import type { PreferredBadgeSelectorType } from '../../../state/selectors/badges.js'; +import type { LocalizerType } from '../../../types/I18N.js'; +import type { ThemeType } from '../../../types/Util.js'; +import { Input } from '../../Input.js'; +import { Button, ButtonVariant } from '../../Button.js'; +import { ConfirmationDialog } from '../../ConfirmationDialog.js'; +import type { ChatFolderSelection } from './PreferencesEditChatFoldersSelectChatsDialog.js'; +import { PreferencesEditChatFoldersSelectChatsDialog } from './PreferencesEditChatFoldersSelectChatsDialog.js'; +import { SettingsRow } from '../../PreferencesUtil.js'; +import { Checkbox } from '../../Checkbox.js'; +import { Avatar, AvatarSize } from '../../Avatar.js'; +import { PreferencesContent } from '../../Preferences.js'; import { CHAT_FOLDER_NAME_MAX_CHAR_LENGTH, ChatFolderParamsSchema, isSameChatFolderParams, validateChatFolderParams, - type ChatFolderParams, -} from '../../../types/ChatFolder'; -import type { GetConversationByIdType } from '../../../state/selectors/conversations'; -import { strictAssert } from '../../../util/assert'; -import { parseStrict } from '../../../util/schemas'; +} from '../../../types/ChatFolder.js'; +import type { + ChatFolderId, + ChatFolderParams, +} from '../../../types/ChatFolder.js'; +import type { GetConversationByIdType } from '../../../state/selectors/conversations.js'; +import { strictAssert } from '../../../util/assert.js'; +import { parseStrict } from '../../../util/schemas.js'; export type PreferencesEditChatFolderPageProps = Readonly<{ i18n: LocalizerType; diff --git a/ts/components/preferences/chatFolders/PreferencesEditChatFoldersSelectChatsDialog.tsx b/ts/components/preferences/chatFolders/PreferencesEditChatFoldersSelectChatsDialog.tsx index 59e69eaf55d..f5f304dce65 100644 --- a/ts/components/preferences/chatFolders/PreferencesEditChatFoldersSelectChatsDialog.tsx +++ b/ts/components/preferences/chatFolders/PreferencesEditChatFoldersSelectChatsDialog.tsx @@ -2,27 +2,27 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { ChangeEvent } from 'react'; import React, { useCallback, useMemo, useState } from 'react'; -import type { ConversationType } from '../../../state/ducks/conversations'; -import type { PreferredBadgeSelectorType } from '../../../state/selectors/badges'; -import type { LocalizerType } from '../../../types/I18N'; -import type { ThemeType } from '../../../types/Util'; -import { filterAndSortConversations } from '../../../util/filterAndSortConversations'; -import { ContactPills } from '../../ContactPills'; -import { ContactPill } from '../../ContactPill'; +import type { ConversationType } from '../../../state/ducks/conversations.js'; +import type { PreferredBadgeSelectorType } from '../../../state/selectors/badges.js'; +import type { LocalizerType } from '../../../types/I18N.js'; +import type { ThemeType } from '../../../types/Util.js'; +import { filterAndSortConversations } from '../../../util/filterAndSortConversations.js'; +import { ContactPills } from '../../ContactPills.js'; +import { ContactPill } from '../../ContactPill.js'; import { asyncShouldNeverBeCalled, shouldNeverBeCalled, -} from '../../../util/shouldNeverBeCalled'; -import { SearchInput } from '../../SearchInput'; -import { Button, ButtonVariant } from '../../Button'; -import { Modal } from '../../Modal'; -import type { Row } from '../../ConversationList'; +} from '../../../util/shouldNeverBeCalled.js'; +import { SearchInput } from '../../SearchInput.js'; +import { Button, ButtonVariant } from '../../Button.js'; +import { Modal } from '../../Modal.js'; +import type { Row } from '../../ConversationList.js'; import { ConversationList, GenericCheckboxRowIcon, RowType, -} from '../../ConversationList'; -import type { GetConversationByIdType } from '../../../state/selectors/conversations'; +} from '../../ConversationList.js'; +import type { GetConversationByIdType } from '../../../state/selectors/conversations.js'; export type ChatFolderSelection = Readonly<{ selectedRecipientIds: ReadonlyArray; diff --git a/ts/components/preferences/donations/DonateInputAmount.tsx b/ts/components/preferences/donations/DonateInputAmount.tsx index fbf61b43fa8..f5443233e7b 100644 --- a/ts/components/preferences/donations/DonateInputAmount.tsx +++ b/ts/components/preferences/donations/DonateInputAmount.tsx @@ -3,12 +3,12 @@ import type { FormEvent } from 'react'; import React, { memo, useCallback, useEffect, useMemo, useRef } from 'react'; import type { Formatter, FormatterToken } from '@signalapp/minimask'; -import { useInputMask } from '../../../hooks/useInputMask'; -import type { CurrencyFormatResult } from '../../../util/currency'; +import { useInputMask } from '../../../hooks/useInputMask.js'; +import type { CurrencyFormatResult } from '../../../util/currency.js'; import { getCurrencyFormat, ZERO_DECIMAL_CURRENCIES, -} from '../../../util/currency'; +} from '../../../util/currency.js'; export type DonateInputAmountProps = Readonly<{ className: string; diff --git a/ts/components/preferences/donations/DonateInputCardCvc.stories.tsx b/ts/components/preferences/donations/DonateInputCardCvc.stories.tsx index 2edad804e69..1a39f093e54 100644 --- a/ts/components/preferences/donations/DonateInputCardCvc.stories.tsx +++ b/ts/components/preferences/donations/DonateInputCardCvc.stories.tsx @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import { action } from '@storybook/addon-actions'; import React, { useState } from 'react'; -import { DonateInputCardCvc } from './DonateInputCardCvc'; -import type { DonateInputCardCvcProps } from './DonateInputCardCvc'; -import type { ComponentMeta } from '../../../storybook/types'; +import { DonateInputCardCvc } from './DonateInputCardCvc.js'; +import type { DonateInputCardCvcProps } from './DonateInputCardCvc.js'; +import type { ComponentMeta } from '../../../storybook/types.js'; export default { component: DonateInputCardCvc, diff --git a/ts/components/preferences/donations/DonateInputCardCvc.tsx b/ts/components/preferences/donations/DonateInputCardCvc.tsx index c6a0d061e85..cbe9b47ec35 100644 --- a/ts/components/preferences/donations/DonateInputCardCvc.tsx +++ b/ts/components/preferences/donations/DonateInputCardCvc.tsx @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { FormEvent, KeyboardEvent } from 'react'; import React, { memo, useCallback, useRef } from 'react'; -import { CC_CVC_FORMATTER, useInputMask } from '../../../hooks/useInputMask'; -import type { LocalizerType } from '../../../types/I18N'; -import { CardCvcError } from '../../../types/DonationsCardForm'; -import { missingCaseError } from '../../../util/missingCaseError'; +import { CC_CVC_FORMATTER, useInputMask } from '../../../hooks/useInputMask.js'; +import type { LocalizerType } from '../../../types/I18N.js'; +import { CardCvcError } from '../../../types/DonationsCardForm.js'; +import { missingCaseError } from '../../../util/missingCaseError.js'; export function getCardCvcErrorMessage( i18n: LocalizerType, diff --git a/ts/components/preferences/donations/DonateInputCardExp.stories.tsx b/ts/components/preferences/donations/DonateInputCardExp.stories.tsx index 464e9994ba4..06d62f3c940 100644 --- a/ts/components/preferences/donations/DonateInputCardExp.stories.tsx +++ b/ts/components/preferences/donations/DonateInputCardExp.stories.tsx @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import { action } from '@storybook/addon-actions'; import React, { useState } from 'react'; -import { DonateInputCardExp } from './DonateInputCardExp'; -import type { DonateInputCardExpProps } from './DonateInputCardExp'; -import type { ComponentMeta } from '../../../storybook/types'; +import { DonateInputCardExp } from './DonateInputCardExp.js'; +import type { DonateInputCardExpProps } from './DonateInputCardExp.js'; +import type { ComponentMeta } from '../../../storybook/types.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/preferences/donations/DonateInputCardExp.tsx b/ts/components/preferences/donations/DonateInputCardExp.tsx index 420de38b4f7..dd5cf4c3d84 100644 --- a/ts/components/preferences/donations/DonateInputCardExp.tsx +++ b/ts/components/preferences/donations/DonateInputCardExp.tsx @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { FormEvent, KeyboardEvent } from 'react'; import React, { memo, useCallback, useRef } from 'react'; -import { CC_EXP_FORMATTER, useInputMask } from '../../../hooks/useInputMask'; -import { CardExpirationError } from '../../../types/DonationsCardForm'; -import { missingCaseError } from '../../../util/missingCaseError'; -import type { LocalizerType } from '../../../types/I18N'; +import { CC_EXP_FORMATTER, useInputMask } from '../../../hooks/useInputMask.js'; +import { CardExpirationError } from '../../../types/DonationsCardForm.js'; +import { missingCaseError } from '../../../util/missingCaseError.js'; +import type { LocalizerType } from '../../../types/I18N.js'; export function getCardExpirationErrorMessage( i18n: LocalizerType, diff --git a/ts/components/preferences/donations/DonateInputCardNumber.stories.tsx b/ts/components/preferences/donations/DonateInputCardNumber.stories.tsx index ff98d485343..9a120dd5527 100644 --- a/ts/components/preferences/donations/DonateInputCardNumber.stories.tsx +++ b/ts/components/preferences/donations/DonateInputCardNumber.stories.tsx @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import { action } from '@storybook/addon-actions'; import React, { useState } from 'react'; -import { DonateInputCardNumber } from './DonateInputCardNumber'; -import type { DonateInputCardNumberProps } from './DonateInputCardNumber'; -import type { ComponentMeta } from '../../../storybook/types'; +import { DonateInputCardNumber } from './DonateInputCardNumber.js'; +import type { DonateInputCardNumberProps } from './DonateInputCardNumber.js'; +import type { ComponentMeta } from '../../../storybook/types.js'; export default { component: DonateInputCardNumber, diff --git a/ts/components/preferences/donations/DonateInputCardNumber.tsx b/ts/components/preferences/donations/DonateInputCardNumber.tsx index 31b61e60759..42450aa03ba 100644 --- a/ts/components/preferences/donations/DonateInputCardNumber.tsx +++ b/ts/components/preferences/donations/DonateInputCardNumber.tsx @@ -2,10 +2,13 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { FormEvent, KeyboardEvent } from 'react'; import React, { memo, useCallback, useRef } from 'react'; -import { CC_NUMBER_FORMATTER, useInputMask } from '../../../hooks/useInputMask'; -import type { LocalizerType } from '../../../types/I18N'; -import { CardNumberError } from '../../../types/DonationsCardForm'; -import { missingCaseError } from '../../../util/missingCaseError'; +import { + CC_NUMBER_FORMATTER, + useInputMask, +} from '../../../hooks/useInputMask.js'; +import type { LocalizerType } from '../../../types/I18N.js'; +import { CardNumberError } from '../../../types/DonationsCardForm.js'; +import { missingCaseError } from '../../../util/missingCaseError.js'; export function getCardNumberErrorMessage( i18n: LocalizerType, diff --git a/ts/components/stickers/StickerButton.stories.tsx b/ts/components/stickers/StickerButton.stories.tsx index dd951075156..f3e1d145a1d 100644 --- a/ts/components/stickers/StickerButton.stories.tsx +++ b/ts/components/stickers/StickerButton.stories.tsx @@ -4,15 +4,15 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './StickerButton'; -import { StickerButton } from './StickerButton'; +import type { Props } from './StickerButton.js'; +import { StickerButton } from './StickerButton.js'; import { createPack, sticker1, sticker2, tallSticker, wideSticker, -} from './mocks'; +} from './mocks.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/stickers/StickerButton.tsx b/ts/components/stickers/StickerButton.tsx index f29bc9ba9a6..d1420f321ef 100644 --- a/ts/components/stickers/StickerButton.tsx +++ b/ts/components/stickers/StickerButton.tsx @@ -7,17 +7,20 @@ import { get, noop } from 'lodash'; import { Manager, Popper, Reference } from 'react-popper'; import { createPortal } from 'react-dom'; -import type { StickerPackType, StickerType } from '../../state/ducks/stickers'; -import type { LocalizerType } from '../../types/Util'; -import type { Theme } from '../../util/theme'; -import { StickerPicker } from './StickerPicker'; -import { countStickers } from './lib'; -import { offsetDistanceModifier } from '../../util/popperUtil'; -import { themeClassName } from '../../util/theme'; -import { handleOutsideClick } from '../../util/handleOutsideClick'; -import * as KeyboardLayout from '../../services/keyboardLayout'; -import { useRefMerger } from '../../hooks/useRefMerger'; -import { UserText } from '../UserText'; +import type { + StickerPackType, + StickerType, +} from '../../state/ducks/stickers.js'; +import type { LocalizerType } from '../../types/Util.js'; +import type { Theme } from '../../util/theme.js'; +import { StickerPicker } from './StickerPicker.js'; +import { countStickers } from './lib.js'; +import { offsetDistanceModifier } from '../../util/popperUtil.js'; +import { themeClassName } from '../../util/theme.js'; +import { handleOutsideClick } from '../../util/handleOutsideClick.js'; +import * as KeyboardLayout from '../../services/keyboardLayout.js'; +import { useRefMerger } from '../../hooks/useRefMerger.js'; +import { UserText } from '../UserText.js'; export type OwnProps = { readonly className?: string; diff --git a/ts/components/stickers/StickerManager.stories.tsx b/ts/components/stickers/StickerManager.stories.tsx index 117c922c5c4..e55ef18ee4d 100644 --- a/ts/components/stickers/StickerManager.stories.tsx +++ b/ts/components/stickers/StickerManager.stories.tsx @@ -4,9 +4,9 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './StickerManager'; -import { StickerManager } from './StickerManager'; -import { createPack, sticker1, sticker2 } from './mocks'; +import type { Props } from './StickerManager.js'; +import { StickerManager } from './StickerManager.js'; +import { createPack, sticker1, sticker2 } from './mocks.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/stickers/StickerManager.tsx b/ts/components/stickers/StickerManager.tsx index ebc1ecc09ed..a787418af90 100644 --- a/ts/components/stickers/StickerManager.tsx +++ b/ts/components/stickers/StickerManager.tsx @@ -2,11 +2,11 @@ // SPDX-License-Identifier: AGPL-3.0-only import * as React from 'react'; -import { StickerManagerPackRow } from './StickerManagerPackRow'; -import { StickerPreviewModal } from './StickerPreviewModal'; -import type { LocalizerType } from '../../types/Util'; -import type { StickerPackType } from '../../state/ducks/stickers'; -import { Tabs } from '../Tabs'; +import { StickerManagerPackRow } from './StickerManagerPackRow.js'; +import { StickerPreviewModal } from './StickerPreviewModal.js'; +import type { LocalizerType } from '../../types/Util.js'; +import type { StickerPackType } from '../../state/ducks/stickers.js'; +import { Tabs } from '../Tabs.js'; export type OwnProps = { readonly blessedPacks: ReadonlyArray; diff --git a/ts/components/stickers/StickerManagerPackRow.tsx b/ts/components/stickers/StickerManagerPackRow.tsx index 585c398b010..6df1340dbb8 100644 --- a/ts/components/stickers/StickerManagerPackRow.tsx +++ b/ts/components/stickers/StickerManagerPackRow.tsx @@ -2,11 +2,11 @@ // SPDX-License-Identifier: AGPL-3.0-only import * as React from 'react'; -import { ConfirmationDialog } from '../ConfirmationDialog'; -import type { LocalizerType } from '../../types/Util'; -import type { StickerPackType } from '../../state/ducks/stickers'; -import { Button, ButtonVariant } from '../Button'; -import { UserText } from '../UserText'; +import { ConfirmationDialog } from '../ConfirmationDialog.js'; +import type { LocalizerType } from '../../types/Util.js'; +import type { StickerPackType } from '../../state/ducks/stickers.js'; +import { Button, ButtonVariant } from '../Button.js'; +import { UserText } from '../UserText.js'; export type OwnProps = { readonly i18n: LocalizerType; diff --git a/ts/components/stickers/StickerPackInstallButton.tsx b/ts/components/stickers/StickerPackInstallButton.tsx index 4c102e58a88..5cc0a4d49e4 100644 --- a/ts/components/stickers/StickerPackInstallButton.tsx +++ b/ts/components/stickers/StickerPackInstallButton.tsx @@ -4,7 +4,7 @@ import type { ButtonHTMLAttributes } from 'react'; import * as React from 'react'; import classNames from 'classnames'; -import type { LocalizerType } from '../../types/Util'; +import type { LocalizerType } from '../../types/Util.js'; export type OwnProps = { readonly installed: boolean; diff --git a/ts/components/stickers/StickerPicker.stories.tsx b/ts/components/stickers/StickerPicker.stories.tsx index fd17c8b2c4e..57863a96c65 100644 --- a/ts/components/stickers/StickerPicker.stories.tsx +++ b/ts/components/stickers/StickerPicker.stories.tsx @@ -4,9 +4,9 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './StickerPicker'; -import { StickerPicker } from './StickerPicker'; -import { abeSticker, createPack, packs, recentStickers } from './mocks'; +import type { Props } from './StickerPicker.js'; +import { StickerPicker } from './StickerPicker.js'; +import { abeSticker, createPack, packs, recentStickers } from './mocks.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/stickers/StickerPicker.tsx b/ts/components/stickers/StickerPicker.tsx index 0e769ae4102..153cde7072b 100644 --- a/ts/components/stickers/StickerPicker.tsx +++ b/ts/components/stickers/StickerPicker.tsx @@ -4,11 +4,14 @@ import classNames from 'classnames'; import * as React from 'react'; import { FocusScope } from 'react-aria'; -import { useRestoreFocus } from '../../hooks/useRestoreFocus'; -import type { StickerPackType, StickerType } from '../../state/ducks/stickers'; -import type { LocalizerType } from '../../types/Util'; -import { getDateTimeFormatter } from '../../util/formatTimestamp'; -import { getAnalogTime } from '../../util/getAnalogTime'; +import { useRestoreFocus } from '../../hooks/useRestoreFocus.js'; +import type { + StickerPackType, + StickerType, +} from '../../state/ducks/stickers.js'; +import type { LocalizerType } from '../../types/Util.js'; +import { getDateTimeFormatter } from '../../util/formatTimestamp.js'; +import { getAnalogTime } from '../../util/getAnalogTime.js'; export type OwnProps = { readonly i18n: LocalizerType; diff --git a/ts/components/stickers/StickerPreviewModal.stories.tsx b/ts/components/stickers/StickerPreviewModal.stories.tsx index 3b650125c10..a13743ca1fd 100644 --- a/ts/components/stickers/StickerPreviewModal.stories.tsx +++ b/ts/components/stickers/StickerPreviewModal.stories.tsx @@ -4,13 +4,13 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './StickerPreviewModal'; -import { StickerPreviewModal } from './StickerPreviewModal'; +import type { Props } from './StickerPreviewModal.js'; +import { StickerPreviewModal } from './StickerPreviewModal.js'; import { landscapeGreenUrl, portraitTealUrl, squareStickerUrl, -} from '../../storybook/Fixtures'; +} from '../../storybook/Fixtures.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/stickers/StickerPreviewModal.tsx b/ts/components/stickers/StickerPreviewModal.tsx index 1cbb453b119..0c328af2576 100644 --- a/ts/components/stickers/StickerPreviewModal.tsx +++ b/ts/components/stickers/StickerPreviewModal.tsx @@ -4,14 +4,14 @@ import * as React from 'react'; import { isNumber, range } from 'lodash'; import classNames from 'classnames'; -import { ConfirmationDialog } from '../ConfirmationDialog'; -import type { LocalizerType } from '../../types/Util'; -import type { StickerPackType } from '../../state/ducks/stickers'; -import { Spinner } from '../Spinner'; -import { useRestoreFocus } from '../../hooks/useRestoreFocus'; -import { Modal } from '../Modal'; -import { Button, ButtonVariant } from '../Button'; -import { UserText } from '../UserText'; +import { ConfirmationDialog } from '../ConfirmationDialog.js'; +import type { LocalizerType } from '../../types/Util.js'; +import type { StickerPackType } from '../../state/ducks/stickers.js'; +import { Spinner } from '../Spinner.js'; +import { useRestoreFocus } from '../../hooks/useRestoreFocus.js'; +import { Modal } from '../Modal.js'; +import { Button, ButtonVariant } from '../Button.js'; +import { UserText } from '../UserText.js'; export type OwnProps = { readonly onClose?: () => unknown; diff --git a/ts/components/stickers/lib.ts b/ts/components/stickers/lib.ts index d16a7080255..734f9fb50bf 100644 --- a/ts/components/stickers/lib.ts +++ b/ts/components/stickers/lib.ts @@ -1,7 +1,7 @@ // Copyright 2019 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { StickerPackType } from '../../state/ducks/stickers'; +import type { StickerPackType } from '../../state/ducks/stickers.js'; // This function exists to force stickers to be counted consistently wherever // they are counted (TypeScript ensures that all data is named and provided) diff --git a/ts/components/stickers/mocks.ts b/ts/components/stickers/mocks.ts index 0aa6a56c693..0a5af585260 100644 --- a/ts/components/stickers/mocks.ts +++ b/ts/components/stickers/mocks.ts @@ -2,7 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import { sample } from 'lodash'; -import type { StickerPackType, StickerType } from '../../state/ducks/stickers'; +import type { + StickerPackType, + StickerType, +} from '../../state/ducks/stickers.js'; export const sticker1: StickerType = { id: 1, diff --git a/ts/context/Bytes.ts b/ts/context/Bytes.ts index 6d3e9ba209f..e2ed724d781 100644 --- a/ts/context/Bytes.ts +++ b/ts/context/Bytes.ts @@ -1,6 +1,9 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only +// This file gets imported into renderer that does not have access to Node.js +// builtins, use an `npm` package. +// eslint-disable-next-line import/enforce-node-protocol-usage import { Buffer } from 'buffer'; export class Bytes { diff --git a/ts/context/Crypto.ts b/ts/context/Crypto.ts index 142dbbb1904..561df42f21d 100644 --- a/ts/context/Crypto.ts +++ b/ts/context/Crypto.ts @@ -1,13 +1,13 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { Buffer } from 'buffer'; -import type { Decipher } from 'crypto'; -import crypto from 'crypto'; +import { Buffer } from 'node:buffer'; +import type { Decipher } from 'node:crypto'; +import crypto from 'node:crypto'; -import { strictAssert } from '../util/assert'; -import type { HashType } from '../types/Crypto'; -import { CipherType } from '../types/Crypto'; +import { strictAssert } from '../util/assert.js'; +import type { HashType } from '../types/Crypto.js'; +import { CipherType } from '../types/Crypto.js'; const AUTH_TAG_SIZE = 16; diff --git a/ts/context/Timers.ts b/ts/context/Timers.ts index dbe265f1f28..6c21a6b0523 100644 --- a/ts/context/Timers.ts +++ b/ts/context/Timers.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { setTimeout, clearTimeout } from 'timers'; +import { setTimeout, clearTimeout } from 'node:timers'; export type Timeout = { id: number; diff --git a/ts/context/activeWindowService.ts b/ts/context/activeWindowService.ts index 0e5dc866733..b145eaa122b 100644 --- a/ts/context/activeWindowService.ts +++ b/ts/context/activeWindowService.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { ipcRenderer } from 'electron'; -import { getActiveWindowService } from '../services/ActiveWindowService'; +import { getActiveWindowService } from '../services/ActiveWindowService.js'; const activeWindowService = getActiveWindowService( window.document, diff --git a/ts/context/config.ts b/ts/context/config.ts index bed045132a7..90aa1eac78b 100644 --- a/ts/context/config.ts +++ b/ts/context/config.ts @@ -3,7 +3,7 @@ import { ipcRenderer } from 'electron'; -import type { RendererConfigType } from '../types/RendererConfig'; +import type { RendererConfigType } from '../types/RendererConfig.js'; const config: RendererConfigType = ipcRenderer.sendSync('get-config'); diff --git a/ts/context/createNativeThemeListener.ts b/ts/context/createNativeThemeListener.ts index f3af4830960..8a0c502d42c 100644 --- a/ts/context/createNativeThemeListener.ts +++ b/ts/context/createNativeThemeListener.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only /* eslint-disable no-restricted-syntax */ -import type { NativeThemeState } from '../types/NativeThemeNotifier.d'; -import { SystemThemeType } from '../types/Util'; +import type { NativeThemeState } from '../types/NativeThemeNotifier.d.ts'; +import { SystemThemeType } from '../types/Util.js'; export type Callback = (change: NativeThemeState) => void; diff --git a/ts/context/environment.ts b/ts/context/environment.ts index b29dd2bfa0f..93e0c87ee55 100644 --- a/ts/context/environment.ts +++ b/ts/context/environment.ts @@ -1,12 +1,12 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { config } from './config'; +import { config } from './config.js'; import { getEnvironment, parseEnvironment, setEnvironment, -} from '../environment'; +} from '../environment.js'; setEnvironment( parseEnvironment(config.environment), diff --git a/ts/context/i18n.ts b/ts/context/i18n.ts index 3cdf5d8610f..b62e33ea7a8 100644 --- a/ts/context/i18n.ts +++ b/ts/context/i18n.ts @@ -1,10 +1,10 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { config } from './config'; -import { localeMessages } from './localeMessages'; -import { setupI18n } from '../util/setupI18n'; -import { strictAssert } from '../util/assert'; +import { config } from './config.js'; +import { localeMessages } from './localeMessages.js'; +import { setupI18n } from '../util/setupI18n.js'; +import { strictAssert } from '../util/assert.js'; const { resolvedTranslationsLocale } = config; strictAssert( diff --git a/ts/context/waitForSettingsChange.ts b/ts/context/waitForSettingsChange.ts index 45c3dd4be7c..2f1429ef157 100644 --- a/ts/context/waitForSettingsChange.ts +++ b/ts/context/waitForSettingsChange.ts @@ -3,7 +3,7 @@ import { ipcRenderer as ipc } from 'electron'; -import { explodePromise } from '../util/explodePromise'; +import { explodePromise } from '../util/explodePromise.js'; let preferencesChangeResolvers = new Array<() => void>(); diff --git a/ts/conversations/isConversationTooBigToRing.ts b/ts/conversations/isConversationTooBigToRing.ts index 9cb9624e1af..af282667367 100644 --- a/ts/conversations/isConversationTooBigToRing.ts +++ b/ts/conversations/isConversationTooBigToRing.ts @@ -1,9 +1,9 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { parseIntWithFallback } from '../util/parseIntWithFallback'; -import { getValue } from '../RemoteConfig'; -import type { ConversationType } from '../state/ducks/conversations'; +import { parseIntWithFallback } from '../util/parseIntWithFallback.js'; +import { getValue } from '../RemoteConfig.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; const getMaxGroupCallRingSize = (): number => parseIntWithFallback(getValue('global.calling.maxGroupCallRingSize'), 16); diff --git a/ts/environment.ts b/ts/environment.ts index ac7216031dd..7b7be182963 100644 --- a/ts/environment.ts +++ b/ts/environment.ts @@ -1,8 +1,8 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { makeEnumParser } from './util/enum'; -import { log } from './logging/log'; +import { makeEnumParser } from './util/enum.js'; +import { log } from './logging/log.js'; // Many places rely on this enum being a string. export enum Environment { diff --git a/ts/groupChange.ts b/ts/groupChange.ts index 4ab25dbdbcd..b57c3362b1b 100644 --- a/ts/groupChange.ts +++ b/ts/groupChange.ts @@ -6,13 +6,17 @@ import type { LocalizerType, ICUStringMessageParamsByKeyType, ICUJSXMessageParamsByKeyType, -} from './types/Util'; -import type { ServiceIdString, AciString, PniString } from './types/ServiceId'; -import { missingCaseError } from './util/missingCaseError'; +} from './types/Util.js'; +import type { + ServiceIdString, + AciString, + PniString, +} from './types/ServiceId.js'; +import { missingCaseError } from './util/missingCaseError.js'; -import type { GroupV2ChangeDetailType, GroupV2ChangeType } from './groups'; -import { SignalService as Proto } from './protobuf'; -import { createLogger } from './logging/log'; +import type { GroupV2ChangeDetailType, GroupV2ChangeType } from './groups.js'; +import { SignalService as Proto } from './protobuf/index.js'; +import { createLogger } from './logging/log.js'; const log = createLogger('groupChange'); diff --git a/ts/groups.ts b/ts/groups.ts index 476d3951fdc..025b8c0567a 100644 --- a/ts/groups.ts +++ b/ts/groups.ts @@ -13,19 +13,19 @@ import { import Long from 'long'; import type { ClientZkGroupCipher } from '@signalapp/libsignal-client/zkgroup'; import { LRUCache } from 'lru-cache'; -import { createLogger } from './logging/log'; +import { createLogger } from './logging/log.js'; import { getCheckedGroupCredentialsForToday, maybeFetchNewCredentials, -} from './services/groupCredentialFetcher'; -import { storageServiceUploadJob } from './services/storage'; -import { DataReader, DataWriter } from './sql/Client'; -import { toWebSafeBase64, fromWebSafeBase64 } from './util/webSafeBase64'; -import { assertDev, strictAssert } from './util/assert'; -import { isMoreRecentThan } from './util/timestamp'; -import { MINUTE, DurationInSeconds, SECOND } from './util/durations'; -import { drop } from './util/drop'; -import { dropNull } from './util/dropNull'; +} from './services/groupCredentialFetcher.js'; +import { storageServiceUploadJob } from './services/storage.js'; +import { DataReader, DataWriter } from './sql/Client.js'; +import { toWebSafeBase64, fromWebSafeBase64 } from './util/webSafeBase64.js'; +import { assertDev, strictAssert } from './util/assert.js'; +import { isMoreRecentThan } from './util/timestamp.js'; +import { MINUTE, DurationInSeconds, SECOND } from './util/durations/index.js'; +import { drop } from './util/drop.js'; +import { dropNull } from './util/dropNull.js'; import type { ConversationAttributesType, GroupV2MemberType, @@ -33,7 +33,7 @@ import type { GroupV2PendingMemberType, GroupV2BannedMemberType, MessageAttributesType, -} from './model-types.d'; +} from './model-types.d.ts'; import { createProfileKeyCredentialPresentation, decodeProfileKeyCredentialPresentation, @@ -52,69 +52,73 @@ import { getClientZkGroupCipher, getClientZkProfileOperations, verifyNotarySignature, -} from './util/zkgroup'; +} from './util/zkgroup.js'; import { computeHash, deriveMasterKeyFromGroupV1, getRandomBytes, -} from './Crypto'; +} from './Crypto.js'; import type { GroupCredentialsType, GroupLogResponseType, -} from './textsecure/WebAPI'; -import { HTTPError } from './textsecure/Errors'; -import type MessageSender from './textsecure/SendMessage'; -import { CURRENT_SCHEMA_VERSION as MAX_MESSAGE_SCHEMA } from './types/Message2'; -import type { ConversationModel } from './models/conversations'; -import { getGroupSizeHardLimit } from './groups/limits'; +} from './textsecure/WebAPI.js'; +import { HTTPError } from './textsecure/Errors.js'; +import type MessageSender from './textsecure/SendMessage.js'; +import { CURRENT_SCHEMA_VERSION as MAX_MESSAGE_SCHEMA } from './types/Message2.js'; +import type { ConversationModel } from './models/conversations.js'; +import { getGroupSizeHardLimit } from './groups/limits.js'; import { isGroupV1 as getIsGroupV1, isGroupV2 as getIsGroupV2, isGroupV2, isMe, -} from './util/whatTypeOfConversation'; -import * as Bytes from './Bytes'; -import type { AvatarDataType } from './types/Avatar'; -import type { ServiceIdString, AciString, PniString } from './types/ServiceId'; +} from './util/whatTypeOfConversation.js'; +import * as Bytes from './Bytes.js'; +import type { AvatarDataType } from './types/Avatar.js'; +import type { + ServiceIdString, + AciString, + PniString, +} from './types/ServiceId.js'; import { ServiceIdKind, isPniString, isServiceIdString, -} from './types/ServiceId'; -import { isAciString } from './util/isAciString'; -import * as Errors from './types/errors'; -import { SignalService as Proto } from './protobuf'; -import { isNotNil } from './util/isNotNil'; -import { isAccessControlEnabled } from './groups/util'; +} from './types/ServiceId.js'; +import { isAciString } from './util/isAciString.js'; +import * as Errors from './types/errors.js'; +import { SignalService as Proto } from './protobuf/index.js'; +import { isNotNil } from './util/isNotNil.js'; +import { isAccessControlEnabled } from './groups/util.js'; import { conversationJobQueue, conversationQueueJobEnum, -} from './jobs/conversationJobQueue'; -import { ReadStatus } from './messages/MessageReadStatus'; -import { SeenStatus } from './MessageSeenStatus'; -import { incrementMessageCounter } from './util/incrementMessageCounter'; -import { sleep } from './util/sleep'; -import { groupInvitesRoute } from './util/signalRoutes'; +} from './jobs/conversationJobQueue.js'; +import { ReadStatus } from './messages/MessageReadStatus.js'; +import { SeenStatus } from './MessageSeenStatus.js'; +import { incrementMessageCounter } from './util/incrementMessageCounter.js'; +import { sleep } from './util/sleep.js'; +import { groupInvitesRoute } from './util/signalRoutes.js'; import { decodeGroupSendEndorsementResponse, validateGroupSendEndorsementsExpiration, -} from './util/groupSendEndorsements'; -import { getProfile } from './util/getProfile'; -import { generateMessageId } from './util/generateMessageId'; -import { postSaveUpdates } from './util/cleanup'; -import { MessageModel } from './models/messages'; -import { areWePending } from './util/groupMembershipUtils'; +} from './util/groupSendEndorsements.js'; +import { getProfile } from './util/getProfile.js'; +import { generateMessageId } from './util/generateMessageId.js'; +import { postSaveUpdates } from './util/cleanup.js'; +import { MessageModel } from './models/messages.js'; +import { areWePending } from './util/groupMembershipUtils.js'; import { isConversationAccepted, isTrustedContact, -} from './util/isConversationAccepted'; +} from './util/isConversationAccepted.js'; const log = createLogger('groups'); type AccessRequiredEnum = Proto.AccessControl.AccessRequired; -export { joinViaLink } from './groups/joinViaLink'; +export { joinViaLink } from './groups/joinViaLink.js'; type GroupV2AccessCreateChangeType = { type: 'create'; diff --git a/ts/groups/joinViaLink.ts b/ts/groups/joinViaLink.ts index 2e52b029626..93684324a65 100644 --- a/ts/groups/joinViaLink.ts +++ b/ts/groups/joinViaLink.ts @@ -3,18 +3,18 @@ import { createRoot, type Root } from 'react-dom/client'; -import type { ConversationAttributesType } from '../model-types.d'; -import type { ConversationModel } from '../models/conversations'; -import type { PreJoinConversationType } from '../state/ducks/conversations'; +import type { ConversationAttributesType } from '../model-types.d.ts'; +import type { ConversationModel } from '../models/conversations.js'; +import type { PreJoinConversationType } from '../state/ducks/conversations.js'; -import { DataWriter } from '../sql/Client'; -import * as Bytes from '../Bytes'; -import * as Errors from '../types/errors'; -import { createLogger } from '../logging/log'; -import { HTTPError } from '../textsecure/Errors'; -import { SignalService as Proto } from '../protobuf'; -import type { ContactAvatarType } from '../types/Avatar'; -import { ToastType } from '../types/Toast'; +import { DataWriter } from '../sql/Client.js'; +import * as Bytes from '../Bytes.js'; +import * as Errors from '../types/errors.js'; +import { createLogger } from '../logging/log.js'; +import { HTTPError } from '../textsecure/Errors.js'; +import { SignalService as Proto } from '../protobuf/index.js'; +import type { ContactAvatarType } from '../types/Avatar.js'; +import { ToastType } from '../types/Toast.js'; import { applyNewAvatar, decryptGroupDescription, @@ -24,17 +24,17 @@ import { idForLogging, LINK_VERSION_ERROR, parseGroupLink, -} from '../groups'; -import { createGroupV2JoinModal } from '../state/roots/createGroupV2JoinModal'; -import { explodePromise } from '../util/explodePromise'; -import { isAccessControlEnabled } from './util'; -import { isGroupV1 } from '../util/whatTypeOfConversation'; -import { longRunningTaskWrapper } from '../util/longRunningTaskWrapper'; -import { sleep } from '../util/sleep'; -import { dropNull } from '../util/dropNull'; -import { getLocalAttachmentUrl } from '../util/getLocalAttachmentUrl'; -import { type Loadable, LoadingState } from '../util/loadable'; -import { missingCaseError } from '../util/missingCaseError'; +} from '../groups.js'; +import { createGroupV2JoinModal } from '../state/roots/createGroupV2JoinModal.js'; +import { explodePromise } from '../util/explodePromise.js'; +import { isAccessControlEnabled } from './util.js'; +import { isGroupV1 } from '../util/whatTypeOfConversation.js'; +import { longRunningTaskWrapper } from '../util/longRunningTaskWrapper.js'; +import { sleep } from '../util/sleep.js'; +import { dropNull } from '../util/dropNull.js'; +import { getLocalAttachmentUrl } from '../util/getLocalAttachmentUrl.js'; +import { type Loadable, LoadingState } from '../util/loadable.js'; +import { missingCaseError } from '../util/missingCaseError.js'; const log = createLogger('joinViaLink'); diff --git a/ts/groups/limits.ts b/ts/groups/limits.ts index 9f85dd607f5..1c0848e3c20 100644 --- a/ts/groups/limits.ts +++ b/ts/groups/limits.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import { isNumber } from 'lodash'; -import { parseIntOrThrow } from '../util/parseIntOrThrow'; -import type { ConfigKeyType } from '../RemoteConfig'; -import { getValue } from '../RemoteConfig'; +import { parseIntOrThrow } from '../util/parseIntOrThrow.js'; +import type { ConfigKeyType } from '../RemoteConfig.js'; +import { getValue } from '../RemoteConfig.js'; function makeGetter(configKey: ConfigKeyType): (fallback?: number) => number { return fallback => { diff --git a/ts/groups/util.ts b/ts/groups/util.ts index 7e830039c3d..58c053f5455 100644 --- a/ts/groups/util.ts +++ b/ts/groups/util.ts @@ -1,7 +1,7 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { SignalService as Proto } from '../protobuf'; +import { SignalService as Proto } from '../protobuf/index.js'; const ACCESS_ENUM = Proto.AccessControl.AccessRequired; diff --git a/ts/hooks/useActivateSpeakerViewOnPresenting.ts b/ts/hooks/useActivateSpeakerViewOnPresenting.ts index 5ba8ffff1cb..fb750499a7b 100644 --- a/ts/hooks/useActivateSpeakerViewOnPresenting.ts +++ b/ts/hooks/useActivateSpeakerViewOnPresenting.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import { useEffect, useMemo } from 'react'; -import type { AciString } from '../types/ServiceId'; -import { usePrevious } from './usePrevious'; +import type { AciString } from '../types/ServiceId.js'; +import { usePrevious } from './usePrevious.js'; type RemoteParticipant = { hasRemoteVideo: boolean; diff --git a/ts/hooks/useAnimated.tsx b/ts/hooks/useAnimated.tsx index ce8dde1a725..69ba0c9a4df 100644 --- a/ts/hooks/useAnimated.tsx +++ b/ts/hooks/useAnimated.tsx @@ -4,7 +4,7 @@ import { useState, useCallback } from 'react'; import type { SpringValues } from '@react-spring/web'; import { useChain, useSpring, useSpringRef } from '@react-spring/web'; -import { useReducedMotion } from './useReducedMotion'; +import { useReducedMotion } from './useReducedMotion.js'; export type ModalConfigType = { opacity: number; diff --git a/ts/hooks/useComputePeaks.ts b/ts/hooks/useComputePeaks.ts index 1c9a295f17f..f8f126e1937 100644 --- a/ts/hooks/useComputePeaks.ts +++ b/ts/hooks/useComputePeaks.ts @@ -3,8 +3,8 @@ import { noop } from 'lodash'; import { useEffect, useState } from 'react'; -import { computePeaks } from '../components/VoiceNotesPlaybackContext'; -import { createLogger } from '../logging/log'; +import { computePeaks } from '../components/VoiceNotesPlaybackContext.js'; +import { createLogger } from '../logging/log.js'; const log = createLogger('useComputePeaks'); diff --git a/ts/hooks/useConfirmDiscard.tsx b/ts/hooks/useConfirmDiscard.tsx index 1dfdc106e37..ac8d8ecc0d0 100644 --- a/ts/hooks/useConfirmDiscard.tsx +++ b/ts/hooks/useConfirmDiscard.tsx @@ -3,15 +3,15 @@ import React, { useEffect, useRef, useState } from 'react'; -import { ConfirmDiscardDialog } from '../components/ConfirmDiscardDialog'; -import { BeforeNavigateResponse } from '../services/BeforeNavigate'; +import { ConfirmDiscardDialog } from '../components/ConfirmDiscardDialog.js'; +import { BeforeNavigateResponse } from '../services/BeforeNavigate.js'; import { explodePromise, type ExplodePromiseResultType, -} from '../util/explodePromise'; +} from '../util/explodePromise.js'; -import type { ConfirmDialogProps } from '../components/ConfirmDiscardDialog'; -import type { LocalizerType } from '../types/Util'; +import type { ConfirmDialogProps } from '../components/ConfirmDiscardDialog.js'; +import type { LocalizerType } from '../types/Util.js'; export function useConfirmDiscard({ i18n, diff --git a/ts/hooks/useInputMask.tsx b/ts/hooks/useInputMask.tsx index 7e99c34594c..d462ca30610 100644 --- a/ts/hooks/useInputMask.tsx +++ b/ts/hooks/useInputMask.tsx @@ -1,16 +1,15 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { FormatterToken } from '@signalapp/minimask'; import { minimask, - type Formatter, createCreditCardExpirationFormatter, } from '@signalapp/minimask'; +import type { FormatterToken, Formatter } from '@signalapp/minimask'; import type { RefObject } from 'react'; import { useEffect } from 'react'; import creditCardType from 'credit-card-type'; -import { strictAssert } from '../util/assert'; +import { strictAssert } from '../util/assert.js'; export function useInputMask( inputRef: RefObject, diff --git a/ts/hooks/useIntersectionObserver.ts b/ts/hooks/useIntersectionObserver.ts index 8904e738476..364c2d05fe1 100644 --- a/ts/hooks/useIntersectionObserver.ts +++ b/ts/hooks/useIntersectionObserver.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { useCallback, useRef, useState } from 'react'; -import { createLogger } from '../logging/log'; +import { createLogger } from '../logging/log.js'; const log = createLogger('useIntersectionObserver'); diff --git a/ts/hooks/useKeyboardShortcuts.tsx b/ts/hooks/useKeyboardShortcuts.tsx index 4978c12e68c..d06edcb3bb9 100644 --- a/ts/hooks/useKeyboardShortcuts.tsx +++ b/ts/hooks/useKeyboardShortcuts.tsx @@ -4,11 +4,11 @@ import { useCallback, useEffect } from 'react'; import { get } from 'lodash'; import { useSelector } from 'react-redux'; -import * as KeyboardLayout from '../services/keyboardLayout'; -import { getHasPanelOpen } from '../state/selectors/conversations'; -import { isInFullScreenCall } from '../state/selectors/calling'; -import { isShowingAnyModal } from '../state/selectors/globalModals'; -import type { ContextMenuTriggerType } from '../components/conversation/MessageContextMenu'; +import * as KeyboardLayout from '../services/keyboardLayout.js'; +import { getHasPanelOpen } from '../state/selectors/conversations.js'; +import { isInFullScreenCall } from '../state/selectors/calling.js'; +import { isShowingAnyModal } from '../state/selectors/globalModals.js'; +import type { ContextMenuTriggerType } from '../components/conversation/MessageContextMenu.js'; type KeyboardShortcutHandlerType = (ev: KeyboardEvent) => boolean; diff --git a/ts/hooks/useMinimalConversation.ts b/ts/hooks/useMinimalConversation.ts index e907f787658..89adc3ac48e 100644 --- a/ts/hooks/useMinimalConversation.ts +++ b/ts/hooks/useMinimalConversation.ts @@ -1,7 +1,7 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import { useMemo } from 'react'; -import type { ConversationType } from '../state/ducks/conversations'; +import type { ConversationType } from '../state/ducks/conversations.js'; type Primitive = undefined | null | boolean | number | bigint | string; type PrimitiveObject = Record; diff --git a/ts/hooks/useNowThatUpdatesEveryMinute.ts b/ts/hooks/useNowThatUpdatesEveryMinute.ts index f2c3f4b1960..8fcbd2b88e2 100644 --- a/ts/hooks/useNowThatUpdatesEveryMinute.ts +++ b/ts/hooks/useNowThatUpdatesEveryMinute.ts @@ -1,14 +1,13 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { EventEmitter } from 'events'; import { useEffect, useState } from 'react'; -import { MINUTE } from '../util/durations'; +import { MINUTE } from '../util/durations/index.js'; -const ev = new EventEmitter(); -ev.setMaxListeners(Infinity); -setInterval(() => ev.emit('tick'), MINUTE); +const listeners = new Set<() => void>(); + +let timer: ReturnType | undefined; export function useNowThatUpdatesEveryMinute(): number { const [now, setNow] = useState(Date.now()); @@ -17,10 +16,21 @@ export function useNowThatUpdatesEveryMinute(): number { const updateNow = () => setNow(Date.now()); updateNow(); - ev.on('tick', updateNow); + if (listeners.size === 0 && timer == null) { + timer = setInterval(() => { + for (const fn of listeners) { + fn(); + } + }, MINUTE); + } + listeners.add(updateNow); return () => { - ev.off('tick', updateNow); + listeners.delete(updateNow); + if (listeners.size === 0 && timer != null) { + clearInterval(timer); + timer = undefined; + } }; }, []); diff --git a/ts/hooks/useProxySelector.ts b/ts/hooks/useProxySelector.ts index 5359070e458..f0960def1a4 100644 --- a/ts/hooks/useProxySelector.ts +++ b/ts/hooks/useProxySelector.ts @@ -5,7 +5,7 @@ import { useCallback, useMemo } from 'react'; import { useSelector } from 'react-redux'; import { memoize } from '@indutny/sneequals'; -import type { StateType } from '../state/reducer'; +import type { StateType } from '../state/reducer.js'; export function useProxySelector, Result>( selector: (state: StateType, ...params: Params) => Result, diff --git a/ts/hooks/useRefMerger.ts b/ts/hooks/useRefMerger.ts index 3b559fb53f2..3da301fbb11 100644 --- a/ts/hooks/useRefMerger.ts +++ b/ts/hooks/useRefMerger.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { useMemo } from 'react'; -import { createRefMerger } from '../util/refMerger'; +import { createRefMerger } from '../util/refMerger.js'; export const useRefMerger = (): ReturnType => useMemo(createRefMerger, []); diff --git a/ts/hooks/useRetryStorySend.tsx b/ts/hooks/useRetryStorySend.tsx index b92342eaffe..a5d3949e29e 100644 --- a/ts/hooks/useRetryStorySend.tsx +++ b/ts/hooks/useRetryStorySend.tsx @@ -3,10 +3,10 @@ import React, { useState, useEffect } from 'react'; -import type { LocalizerType } from '../types/Util'; -import { Alert } from '../components/Alert'; -import { ResolvedSendStatus } from '../types/Stories'; -import { usePrevious } from './usePrevious'; +import type { LocalizerType } from '../types/Util.js'; +import { Alert } from '../components/Alert.js'; +import { ResolvedSendStatus } from '../types/Stories.js'; +import { usePrevious } from './usePrevious.js'; export function useRetryStorySend( i18n: LocalizerType, diff --git a/ts/hooks/useScrollLock.tsx b/ts/hooks/useScrollLock.tsx index 8ce71e70c76..09e41b47b1a 100644 --- a/ts/hooks/useScrollLock.tsx +++ b/ts/hooks/useScrollLock.tsx @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { useContext, createContext, useEffect, useRef } from 'react'; -import { createLogger } from '../logging/log'; +import { createLogger } from '../logging/log.js'; const log = createLogger('useScrollLock'); diff --git a/ts/hooks/useSizeObserver.tsx b/ts/hooks/useSizeObserver.tsx index 68dd92dbf1e..8aff5105db7 100644 --- a/ts/hooks/useSizeObserver.tsx +++ b/ts/hooks/useSizeObserver.tsx @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { RefObject } from 'react'; import { useCallback, useEffect, useRef, useState } from 'react'; -import { strictAssert } from '../util/assert'; +import { strictAssert } from '../util/assert.js'; export type Size = Readonly<{ width: number; diff --git a/ts/hooks/useTabs.tsx b/ts/hooks/useTabs.tsx index d36b2fa558f..ae9d57928d8 100644 --- a/ts/hooks/useTabs.tsx +++ b/ts/hooks/useTabs.tsx @@ -4,8 +4,8 @@ import type { KeyboardEvent } from 'react'; import React, { useState } from 'react'; import classNames from 'classnames'; -import { assertDev } from '../util/assert'; -import { getClassNamesFor } from '../util/getClassNamesFor'; +import { assertDev } from '../util/assert.js'; +import { getClassNamesFor } from '../util/getClassNamesFor.js'; type Tab = { id: string; diff --git a/ts/hooks/useTheme.ts b/ts/hooks/useTheme.ts index a9d9c052b09..f1b1708f972 100644 --- a/ts/hooks/useTheme.ts +++ b/ts/hooks/useTheme.ts @@ -3,7 +3,7 @@ import { useState, useEffect } from 'react'; -import { ThemeType } from '../types/Util'; +import { ThemeType } from '../types/Util.js'; // Note that this hook is used in non-main windows (e.g. "About" and // "Debug Log" windows), and thus can't access redux state. diff --git a/ts/indexeddb.ts b/ts/indexeddb.ts index dc80d448410..767096227ef 100644 --- a/ts/indexeddb.ts +++ b/ts/indexeddb.ts @@ -1,7 +1,7 @@ // Copyright 2018 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from './logging/log'; +import { createLogger } from './logging/log.js'; const log = createLogger('indexeddb'); diff --git a/ts/jobs/AttachmentBackupManager.ts b/ts/jobs/AttachmentBackupManager.ts index 4dab2e50d26..ad982d86ec5 100644 --- a/ts/jobs/AttachmentBackupManager.ts +++ b/ts/jobs/AttachmentBackupManager.ts @@ -5,64 +5,67 @@ import { existsSync } from 'node:fs'; import { PassThrough } from 'node:stream'; -import * as durations from '../util/durations'; -import { createLogger } from '../logging/log'; -import { DataWriter } from '../sql/Client'; +import * as durations from '../util/durations/index.js'; +import { createLogger } from '../logging/log.js'; +import { DataWriter } from '../sql/Client.js'; -import * as Errors from '../types/errors'; -import { redactGenericText } from '../util/privacy'; +import * as Errors from '../types/errors.js'; +import { redactGenericText } from '../util/privacy.js'; import { JobManager, type JobManagerParamsType, type JobManagerJobResultType, -} from './JobManager'; -import { strictAssert } from '../util/assert'; -import { type BackupsService, backupsService } from '../services/backups'; +} from './JobManager.js'; +import { strictAssert } from '../util/assert.js'; +import { + type BackupsService, + backupsService, +} from '../services/backups/index.js'; import { type EncryptedAttachmentV2, getAttachmentCiphertextLength, getAesCbcCiphertextLength, decryptAttachmentV2ToSink, -} from '../AttachmentCrypto'; +} from '../AttachmentCrypto.js'; import { getBackupMediaRootKey, deriveBackupMediaKeyMaterial, deriveBackupThumbnailTransitKeyMaterial, -} from '../services/backups/crypto'; +} from '../services/backups/crypto.js'; import { type AttachmentBackupJobType, type CoreAttachmentBackupJobType, type StandardAttachmentBackupJobType, type ThumbnailAttachmentBackupJobType, -} from '../types/AttachmentBackup'; -import { isInCall as isInCallSelector } from '../state/selectors/calling'; -import { encryptAndUploadAttachment } from '../util/uploadAttachment'; +} from '../types/AttachmentBackup.js'; +import { isInCall as isInCallSelector } from '../state/selectors/calling.js'; +import { encryptAndUploadAttachment } from '../util/uploadAttachment.js'; import { getMediaIdFromMediaName, getMediaNameForAttachmentThumbnail, -} from '../services/backups/util/mediaId'; -import { fromBase64, toBase64 } from '../Bytes'; -import type { WebAPIType } from '../textsecure/WebAPI'; +} from '../services/backups/util/mediaId.js'; +import { fromBase64, toBase64 } from '../Bytes.js'; +import type { WebAPIType } from '../textsecure/WebAPI.js'; import { type AttachmentType, canAttachmentHaveThumbnail, mightStillBeOnTransitTier, -} from '../types/Attachment'; +} from '../types/Attachment.js'; import { type CreatedThumbnailType, makeImageThumbnailForBackup, makeVideoScreenshot, -} from '../types/VisualAttachment'; -import { missingCaseError } from '../util/missingCaseError'; +} from '../types/VisualAttachment.js'; +import { missingCaseError } from '../util/missingCaseError.js'; import { isImageTypeSupported, isVideoTypeSupported, -} from '../util/GoogleChrome'; -import { getLocalAttachmentUrl } from '../util/getLocalAttachmentUrl'; -import { findRetryAfterTimeFromError } from './helpers/findRetryAfterTimeFromError'; -import { BackupCredentialType } from '../types/backups'; -import { supportsIncrementalMac } from '../types/MIME'; -import type { MIMEType } from '../types/MIME'; +} from '../util/GoogleChrome.js'; +import { getLocalAttachmentUrl } from '../util/getLocalAttachmentUrl.js'; +import { findRetryAfterTimeFromError } from './helpers/findRetryAfterTimeFromError.js'; +import { BackupCredentialType } from '../types/backups.js'; +import { supportsIncrementalMac } from '../types/MIME.js'; +import type { MIMEType } from '../types/MIME.js'; const log = createLogger('AttachmentBackupManager'); diff --git a/ts/jobs/AttachmentDownloadManager.ts b/ts/jobs/AttachmentDownloadManager.ts index 6cae5ffab34..57bca7981ad 100644 --- a/ts/jobs/AttachmentDownloadManager.ts +++ b/ts/jobs/AttachmentDownloadManager.ts @@ -3,24 +3,24 @@ import { noop, omit, throttle } from 'lodash'; import { statfs } from 'node:fs/promises'; -import * as durations from '../util/durations'; -import { createLogger } from '../logging/log'; -import type { AttachmentBackfillResponseSyncEvent } from '../textsecure/messageReceiverEvents'; +import * as durations from '../util/durations/index.js'; +import { createLogger } from '../logging/log.js'; +import type { AttachmentBackfillResponseSyncEvent } from '../textsecure/messageReceiverEvents.js'; import { type AttachmentDownloadJobTypeType, type AttachmentDownloadJobType, type CoreAttachmentDownloadJobType, AttachmentDownloadUrgency, coreAttachmentDownloadJobSchema, -} from '../types/AttachmentDownload'; +} from '../types/AttachmentDownload.js'; import { downloadAttachment as downloadAttachmentUtil, isIncrementalMacVerificationError, -} from '../util/downloadAttachment'; -import { DataReader, DataWriter } from '../sql/Client'; -import { getValue } from '../RemoteConfig'; +} from '../util/downloadAttachment.js'; +import { DataReader, DataWriter } from '../sql/Client.js'; +import { getValue } from '../RemoteConfig.js'; -import { isInCall as isInCallSelector } from '../state/selectors/calling'; +import { isInCall as isInCallSelector } from '../state/selectors/calling.js'; import { AttachmentSizeError, type AttachmentType, @@ -31,46 +31,46 @@ import { shouldAttachmentEndUpInRemoteBackup, getUndownloadedAttachmentSignature, isIncremental, -} from '../types/Attachment'; -import { type ReadonlyMessageAttributesType } from '../model-types.d'; -import { getMessageById } from '../messages/getMessageById'; +} from '../types/Attachment.js'; +import type { ReadonlyMessageAttributesType } from '../model-types.d.ts'; +import { getMessageById } from '../messages/getMessageById.js'; import { KIBIBYTE, getMaximumIncomingAttachmentSizeInKb, getMaximumIncomingTextAttachmentSizeInKb, -} from '../types/AttachmentSize'; -import { addAttachmentToMessage } from '../messageModifiers/AttachmentDownloads'; -import * as Errors from '../types/errors'; -import { redactGenericText } from '../util/privacy'; +} from '../types/AttachmentSize.js'; +import { addAttachmentToMessage } from '../messageModifiers/AttachmentDownloads.js'; +import * as Errors from '../types/errors.js'; +import { redactGenericText } from '../util/privacy.js'; import { JobManager, type JobManagerParamsType, type JobManagerJobResultType, type JobManagerJobType, -} from './JobManager'; -import { IMAGE_WEBP } from '../types/MIME'; -import { AttachmentDownloadSource } from '../sql/Interface'; -import { drop } from '../util/drop'; +} from './JobManager.js'; +import { IMAGE_WEBP } from '../types/MIME.js'; +import { AttachmentDownloadSource } from '../sql/Interface.js'; +import { drop } from '../util/drop.js'; import { getAttachmentCiphertextLength, type ReencryptedAttachmentV2, -} from '../AttachmentCrypto'; -import { safeParsePartial } from '../util/schemas'; -import { deleteDownloadsJobQueue } from './deleteDownloadsJobQueue'; -import { createBatcher } from '../util/batcher'; -import { showDownloadFailedToast } from '../util/showDownloadFailedToast'; -import { markAttachmentAsPermanentlyErrored } from '../util/attachments/markAttachmentAsPermanentlyErrored'; +} from '../AttachmentCrypto.js'; +import { safeParsePartial } from '../util/schemas.js'; +import { deleteDownloadsJobQueue } from './deleteDownloadsJobQueue.js'; +import { createBatcher } from '../util/batcher.js'; +import { showDownloadFailedToast } from '../util/showDownloadFailedToast.js'; +import { markAttachmentAsPermanentlyErrored } from '../util/attachments/markAttachmentAsPermanentlyErrored.js'; import { AttachmentBackfill, isPermanentlyUndownloadable, isPermanentlyUndownloadableWithoutBackfill, -} from './helpers/attachmentBackfill'; -import { formatCountForLogging } from '../logging/formatCountForLogging'; -import { strictAssert } from '../util/assert'; -import { updateBackupMediaDownloadProgress } from '../util/updateBackupMediaDownloadProgress'; -import { HTTPError } from '../textsecure/Errors'; -import { isOlderThan } from '../util/timestamp'; -import { getMessageQueueTime as doGetMessageQueueTime } from '../util/getMessageQueueTime'; +} from './helpers/attachmentBackfill.js'; +import { formatCountForLogging } from '../logging/formatCountForLogging.js'; +import { strictAssert } from '../util/assert.js'; +import { updateBackupMediaDownloadProgress } from '../util/updateBackupMediaDownloadProgress.js'; +import { HTTPError } from '../textsecure/Errors.js'; +import { isOlderThan } from '../util/timestamp.js'; +import { getMessageQueueTime as doGetMessageQueueTime } from '../util/getMessageQueueTime.js'; const log = createLogger('AttachmentDownloadManager'); diff --git a/ts/jobs/AttachmentLocalBackupManager.ts b/ts/jobs/AttachmentLocalBackupManager.ts index ecaa826506e..25326cb3ae5 100644 --- a/ts/jobs/AttachmentLocalBackupManager.ts +++ b/ts/jobs/AttachmentLocalBackupManager.ts @@ -4,31 +4,34 @@ import { existsSync } from 'node:fs'; import { PassThrough } from 'node:stream'; -import { constants as FS_CONSTANTS, copyFile, mkdir } from 'fs/promises'; +import { constants as FS_CONSTANTS, copyFile, mkdir } from 'node:fs/promises'; -import * as durations from '../util/durations'; -import { createLogger } from '../logging/log'; +import * as durations from '../util/durations/index.js'; +import { createLogger } from '../logging/log.js'; -import * as Errors from '../types/errors'; -import { redactGenericText } from '../util/privacy'; +import * as Errors from '../types/errors.js'; +import { redactGenericText } from '../util/privacy.js'; import { JobManager, type JobManagerParamsType, type JobManagerJobResultType, -} from './JobManager'; -import { type BackupsService, backupsService } from '../services/backups'; -import { decryptAttachmentV2ToSink } from '../AttachmentCrypto'; +} from './JobManager.js'; +import { + type BackupsService, + backupsService, +} from '../services/backups/index.js'; +import { decryptAttachmentV2ToSink } from '../AttachmentCrypto.js'; import { type AttachmentLocalBackupJobType, type CoreAttachmentLocalBackupJobType, -} from '../types/AttachmentBackup'; -import { isInCall as isInCallSelector } from '../state/selectors/calling'; -import { encryptAndUploadAttachment } from '../util/uploadAttachment'; -import type { WebAPIType } from '../textsecure/WebAPI'; +} from '../types/AttachmentBackup.js'; +import { isInCall as isInCallSelector } from '../state/selectors/calling.js'; +import { encryptAndUploadAttachment } from '../util/uploadAttachment.js'; +import type { WebAPIType } from '../textsecure/WebAPI.js'; import { getLocalBackupDirectoryForMediaName, getLocalBackupPathForMediaName, -} from '../services/backups/util/localBackup'; +} from '../services/backups/util/localBackup.js'; const log = createLogger('AttachmentLocalBackupManager'); diff --git a/ts/jobs/CallLinkFinalizeDeleteManager.ts b/ts/jobs/CallLinkFinalizeDeleteManager.ts index 25adfd7b3eb..4796057578a 100644 --- a/ts/jobs/CallLinkFinalizeDeleteManager.ts +++ b/ts/jobs/CallLinkFinalizeDeleteManager.ts @@ -1,14 +1,14 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import * as durations from '../util/durations'; -import { createLogger } from '../logging/log'; -import { DataReader, DataWriter } from '../sql/Client'; +import * as durations from '../util/durations/index.js'; +import { createLogger } from '../logging/log.js'; +import { DataReader, DataWriter } from '../sql/Client.js'; import { JobManager, type JobManagerParamsType, type JobManagerJobResultType, type JobManagerJobType, -} from './JobManager'; +} from './JobManager.js'; const log = createLogger('CallLinkFinalizeDeleteManager'); diff --git a/ts/jobs/Job.ts b/ts/jobs/Job.ts index 90a63a53071..7af94f88ee5 100644 --- a/ts/jobs/Job.ts +++ b/ts/jobs/Job.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ParsedJob } from './types'; +import type { ParsedJob } from './types.js'; /** * A single job instance. Shouldn't be instantiated directly, except by `JobQueue`. diff --git a/ts/jobs/JobError.ts b/ts/jobs/JobError.ts index 948bf273090..24082744f51 100644 --- a/ts/jobs/JobError.ts +++ b/ts/jobs/JobError.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { reallyJsonStringify } from '../util/reallyJsonStringify'; +import { reallyJsonStringify } from '../util/reallyJsonStringify.js'; /** * An error that wraps job errors. diff --git a/ts/jobs/JobLogger.ts b/ts/jobs/JobLogger.ts index 87a71d58beb..18d5d313541 100644 --- a/ts/jobs/JobLogger.ts +++ b/ts/jobs/JobLogger.ts @@ -1,8 +1,8 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { LoggerType } from '../types/Logging'; -import type { ParsedJob } from './types'; +import type { LoggerType } from '../types/Logging.js'; +import type { ParsedJob } from './types.js'; export class JobLogger implements LoggerType { #id: string; diff --git a/ts/jobs/JobManager.ts b/ts/jobs/JobManager.ts index 01bc7b64fc5..211f66f78e0 100644 --- a/ts/jobs/JobManager.ts +++ b/ts/jobs/JobManager.ts @@ -1,21 +1,21 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import * as z from 'zod'; -import { MINUTE, SECOND } from '../util/durations'; +import { MINUTE, SECOND } from '../util/durations/index.js'; import { explodePromise, type ExplodePromiseResultType, -} from '../util/explodePromise'; -import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary'; -import { drop } from '../util/drop'; -import { createLogger } from '../logging/log'; -import { missingCaseError } from '../util/missingCaseError'; +} from '../util/explodePromise.js'; +import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary.js'; +import { drop } from '../util/drop.js'; +import { createLogger } from '../logging/log.js'; +import { missingCaseError } from '../util/missingCaseError.js'; import { type ExponentialBackoffOptionsType, exponentialBackoffSleepTime, -} from '../util/exponentialBackoff'; -import * as Errors from '../types/errors'; -import { sleep } from '../util/sleep'; +} from '../util/exponentialBackoff.js'; +import * as Errors from '../types/errors.js'; +import { sleep } from '../util/sleep.js'; const log = createLogger('JobManager'); diff --git a/ts/jobs/JobQueue.ts b/ts/jobs/JobQueue.ts index 824dbae4cae..2154a381053 100644 --- a/ts/jobs/JobQueue.ts +++ b/ts/jobs/JobQueue.ts @@ -5,17 +5,17 @@ import PQueue from 'p-queue'; import { v7 as uuid } from 'uuid'; import { noop } from 'lodash'; -import { Job } from './Job'; -import { JobError } from './JobError'; -import type { ParsedJob, StoredJob, JobQueueStore } from './types'; -import { assertDev } from '../util/assert'; -import { createLogger } from '../logging/log'; -import { JobLogger } from './JobLogger'; -import * as Errors from '../types/errors'; -import type { LoggerType } from '../types/Logging'; -import { drop } from '../util/drop'; -import { sleep } from '../util/sleep'; -import { SECOND } from '../util/durations'; +import { Job } from './Job.js'; +import { JobError } from './JobError.js'; +import type { ParsedJob, StoredJob, JobQueueStore } from './types.js'; +import { assertDev } from '../util/assert.js'; +import { createLogger } from '../logging/log.js'; +import { JobLogger } from './JobLogger.js'; +import * as Errors from '../types/errors.js'; +import type { LoggerType } from '../types/Logging.js'; +import { drop } from '../util/drop.js'; +import { sleep } from '../util/sleep.js'; +import { SECOND } from '../util/durations/index.js'; const log = createLogger('JobQueue'); diff --git a/ts/jobs/JobQueueDatabaseStore.ts b/ts/jobs/JobQueueDatabaseStore.ts index 6a3b91b4fd0..fbec4f77645 100644 --- a/ts/jobs/JobQueueDatabaseStore.ts +++ b/ts/jobs/JobQueueDatabaseStore.ts @@ -2,12 +2,12 @@ // SPDX-License-Identifier: AGPL-3.0-only import { noop } from 'lodash'; -import { AsyncQueue } from '../util/AsyncQueue'; -import { concat, wrapPromise } from '../util/asyncIterables'; -import type { JobQueueStore, StoredJob } from './types'; -import { formatJobForInsert } from './formatJobForInsert'; -import { DataReader, DataWriter } from '../sql/Client'; -import { createLogger } from '../logging/log'; +import { AsyncQueue } from '../util/AsyncQueue.js'; +import { concat, wrapPromise } from '../util/asyncIterables.js'; +import type { JobQueueStore, StoredJob } from './types.js'; +import { formatJobForInsert } from './formatJobForInsert.js'; +import { DataReader, DataWriter } from '../sql/Client.js'; +import { createLogger } from '../logging/log.js'; const log = createLogger('JobQueueDatabaseStore'); diff --git a/ts/jobs/callLinkRefreshJobQueue.ts b/ts/jobs/callLinkRefreshJobQueue.ts index 78ba2a3f509..9a1e92e6bb9 100644 --- a/ts/jobs/callLinkRefreshJobQueue.ts +++ b/ts/jobs/callLinkRefreshJobQueue.ts @@ -4,23 +4,23 @@ import * as z from 'zod'; import PQueue from 'p-queue'; import { CallLinkRootKey, CallLinkEpoch } from '@signalapp/ringrtc'; -import { createLogger } from '../logging/log'; -import type { LoggerType } from '../types/Logging'; -import { exponentialBackoffMaxAttempts } from '../util/exponentialBackoff'; -import type { ParsedJob, StoredJob } from './types'; -import type { JOB_STATUS } from './JobQueue'; -import { JobQueue } from './JobQueue'; -import { jobQueueDatabaseStore } from './JobQueueDatabaseStore'; -import { DAY, SECOND } from '../util/durations'; -import { commonShouldJobContinue } from './helpers/commonShouldJobContinue'; -import { DataReader, DataWriter } from '../sql/Client'; -import type { CallLinkType, PendingCallLinkType } from '../types/CallLink'; -import { calling } from '../services/calling'; -import { sleeper } from '../util/sleeper'; -import { parseUnknown } from '../util/schemas'; -import { getRoomIdFromRootKey } from '../util/callLinksRingrtc'; -import { toCallHistoryFromUnusedCallLink } from '../util/callLinks'; -import type { StorageServiceFieldsType } from '../sql/Interface'; +import { createLogger } from '../logging/log.js'; +import type { LoggerType } from '../types/Logging.js'; +import { exponentialBackoffMaxAttempts } from '../util/exponentialBackoff.js'; +import type { ParsedJob, StoredJob } from './types.js'; +import type { JOB_STATUS } from './JobQueue.js'; +import { JobQueue } from './JobQueue.js'; +import { jobQueueDatabaseStore } from './JobQueueDatabaseStore.js'; +import { DAY, SECOND } from '../util/durations/index.js'; +import { commonShouldJobContinue } from './helpers/commonShouldJobContinue.js'; +import { DataReader, DataWriter } from '../sql/Client.js'; +import type { CallLinkType, PendingCallLinkType } from '../types/CallLink.js'; +import { calling } from '../services/calling.js'; +import { sleeper } from '../util/sleeper.js'; +import { parseUnknown } from '../util/schemas.js'; +import { getRoomIdFromRootKey } from '../util/callLinksRingrtc.js'; +import { toCallHistoryFromUnusedCallLink } from '../util/callLinks.js'; +import type { StorageServiceFieldsType } from '../sql/Interface.js'; const globalLogger = createLogger('callLinkRefreshJobQueue'); diff --git a/ts/jobs/conversationJobQueue.ts b/ts/jobs/conversationJobQueue.ts index 6a5f8e48259..152b19e0790 100644 --- a/ts/jobs/conversationJobQueue.ts +++ b/ts/jobs/conversationJobQueue.ts @@ -3,54 +3,54 @@ import { z } from 'zod'; import type PQueue from 'p-queue'; -import { createLogger } from '../logging/log'; +import { createLogger } from '../logging/log.js'; -import * as durations from '../util/durations'; -import { exponentialBackoffMaxAttempts } from '../util/exponentialBackoff'; -import { InMemoryQueues } from './helpers/InMemoryQueues'; -import { jobQueueDatabaseStore } from './JobQueueDatabaseStore'; -import { JOB_STATUS, JobQueue } from './JobQueue'; +import * as durations from '../util/durations/index.js'; +import { exponentialBackoffMaxAttempts } from '../util/exponentialBackoff.js'; +import { InMemoryQueues } from './helpers/InMemoryQueues.js'; +import { jobQueueDatabaseStore } from './JobQueueDatabaseStore.js'; +import { JOB_STATUS, JobQueue } from './JobQueue.js'; -import { sendNormalMessage } from './helpers/sendNormalMessage'; -import { sendCallingMessage } from './helpers/sendCallingMessage'; -import { sendDirectExpirationTimerUpdate } from './helpers/sendDirectExpirationTimerUpdate'; -import { sendGroupCallUpdate } from './helpers/sendGroupCallUpdate'; -import { sendGroupUpdate } from './helpers/sendGroupUpdate'; -import { sendDeleteForEveryone } from './helpers/sendDeleteForEveryone'; -import { sendDeleteStoryForEveryone } from './helpers/sendDeleteStoryForEveryone'; -import { sendProfileKey } from './helpers/sendProfileKey'; -import { sendReaction } from './helpers/sendReaction'; -import { sendStory } from './helpers/sendStory'; -import { sendReceipts } from './helpers/sendReceipts'; +import { sendNormalMessage } from './helpers/sendNormalMessage.js'; +import { sendCallingMessage } from './helpers/sendCallingMessage.js'; +import { sendDirectExpirationTimerUpdate } from './helpers/sendDirectExpirationTimerUpdate.js'; +import { sendGroupCallUpdate } from './helpers/sendGroupCallUpdate.js'; +import { sendGroupUpdate } from './helpers/sendGroupUpdate.js'; +import { sendDeleteForEveryone } from './helpers/sendDeleteForEveryone.js'; +import { sendDeleteStoryForEveryone } from './helpers/sendDeleteStoryForEveryone.js'; +import { sendProfileKey } from './helpers/sendProfileKey.js'; +import { sendReaction } from './helpers/sendReaction.js'; +import { sendStory } from './helpers/sendStory.js'; +import { sendReceipts } from './helpers/sendReceipts.js'; -import type { LoggerType } from '../types/Logging'; -import { ConversationVerificationState } from '../state/ducks/conversationsEnums'; -import { MINUTE } from '../util/durations'; +import type { LoggerType } from '../types/Logging.js'; +import { ConversationVerificationState } from '../state/ducks/conversationsEnums.js'; +import { MINUTE } from '../util/durations/index.js'; import { OutgoingIdentityKeyError, SendMessageChallengeError, SendMessageProtoError, -} from '../textsecure/Errors'; -import { strictAssert } from '../util/assert'; -import { missingCaseError } from '../util/missingCaseError'; -import { explodePromise } from '../util/explodePromise'; -import type { Job } from './Job'; -import type { ParsedJob, StoredJob } from './types'; -import type SendMessage from '../textsecure/SendMessage'; -import type { ServiceIdString } from '../types/ServiceId'; -import { commonShouldJobContinue } from './helpers/commonShouldJobContinue'; -import { sleeper } from '../util/sleeper'; -import { receiptSchema, ReceiptType } from '../types/Receipt'; -import { serviceIdSchema, aciSchema } from '../types/ServiceId'; -import { sendResendRequest } from './helpers/sendResendRequest'; -import { sendNullMessage } from './helpers/sendNullMessage'; -import { sendSenderKeyDistribution } from './helpers/sendSenderKeyDistribution'; -import { sendSavedProto } from './helpers/sendSavedProto'; -import { drop } from '../util/drop'; -import { isInPast } from '../util/timestamp'; -import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary'; -import { FIBONACCI } from '../util/BackOff'; -import { parseUnknown } from '../util/schemas'; +} from '../textsecure/Errors.js'; +import { strictAssert } from '../util/assert.js'; +import { missingCaseError } from '../util/missingCaseError.js'; +import { explodePromise } from '../util/explodePromise.js'; +import type { Job } from './Job.js'; +import type { ParsedJob, StoredJob } from './types.js'; +import type SendMessage from '../textsecure/SendMessage.js'; +import type { ServiceIdString } from '../types/ServiceId.js'; +import { commonShouldJobContinue } from './helpers/commonShouldJobContinue.js'; +import { sleeper } from '../util/sleeper.js'; +import { receiptSchema, ReceiptType } from '../types/Receipt.js'; +import { serviceIdSchema, aciSchema } from '../types/ServiceId.js'; +import { sendResendRequest } from './helpers/sendResendRequest.js'; +import { sendNullMessage } from './helpers/sendNullMessage.js'; +import { sendSenderKeyDistribution } from './helpers/sendSenderKeyDistribution.js'; +import { sendSavedProto } from './helpers/sendSavedProto.js'; +import { drop } from '../util/drop.js'; +import { isInPast } from '../util/timestamp.js'; +import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary.js'; +import { FIBONACCI } from '../util/BackOff.js'; +import { parseUnknown } from '../util/schemas.js'; const globalLogger = createLogger('conversationJobQueue'); diff --git a/ts/jobs/deleteDownloadsJobQueue.ts b/ts/jobs/deleteDownloadsJobQueue.ts index e76fe0be86e..8da0cdc8bc2 100644 --- a/ts/jobs/deleteDownloadsJobQueue.ts +++ b/ts/jobs/deleteDownloadsJobQueue.ts @@ -4,16 +4,16 @@ import { z } from 'zod'; import { omit } from 'lodash'; -import { JobQueue } from './JobQueue'; -import { jobQueueDatabaseStore } from './JobQueueDatabaseStore'; -import { parseUnknown } from '../util/schemas'; -import { DataReader } from '../sql/Client'; +import { JobQueue } from './JobQueue.js'; +import { jobQueueDatabaseStore } from './JobQueueDatabaseStore.js'; +import { parseUnknown } from '../util/schemas.js'; +import { DataReader } from '../sql/Client.js'; -import type { JOB_STATUS } from './JobQueue'; -import type { LoggerType } from '../types/Logging'; -import { commonShouldJobContinue } from './helpers/commonShouldJobContinue'; -import { DAY } from '../util/durations'; -import { exponentialBackoffMaxAttempts } from '../util/exponentialBackoff'; +import type { JOB_STATUS } from './JobQueue.js'; +import type { LoggerType } from '../types/Logging.js'; +import { commonShouldJobContinue } from './helpers/commonShouldJobContinue.js'; +import { DAY } from '../util/durations/index.js'; +import { exponentialBackoffMaxAttempts } from '../util/exponentialBackoff.js'; const deleteDownloadsJobDataSchema = z.object({ digest: z.string().optional(), diff --git a/ts/jobs/formatJobForInsert.ts b/ts/jobs/formatJobForInsert.ts index bd20dbd6344..801402de8e1 100644 --- a/ts/jobs/formatJobForInsert.ts +++ b/ts/jobs/formatJobForInsert.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ParsedJob, StoredJob } from './types'; +import type { ParsedJob, StoredJob } from './types.js'; /** * Format a job to be inserted into the database. diff --git a/ts/jobs/groupAvatarJobQueue.ts b/ts/jobs/groupAvatarJobQueue.ts index 8c08710f79f..ae39c4f0909 100644 --- a/ts/jobs/groupAvatarJobQueue.ts +++ b/ts/jobs/groupAvatarJobQueue.ts @@ -2,15 +2,15 @@ // SPDX-License-Identifier: AGPL-3.0-only import * as z from 'zod'; -import type { LoggerType } from '../types/Logging'; -import { applyNewAvatar } from '../groups'; -import { isGroupV2 } from '../util/whatTypeOfConversation'; -import { DataWriter } from '../sql/Client'; +import type { LoggerType } from '../types/Logging.js'; +import { applyNewAvatar } from '../groups.js'; +import { isGroupV2 } from '../util/whatTypeOfConversation.js'; +import { DataWriter } from '../sql/Client.js'; -import type { JOB_STATUS } from './JobQueue'; -import { JobQueue } from './JobQueue'; -import { jobQueueDatabaseStore } from './JobQueueDatabaseStore'; -import { parseUnknown } from '../util/schemas'; +import type { JOB_STATUS } from './JobQueue.js'; +import { JobQueue } from './JobQueue.js'; +import { jobQueueDatabaseStore } from './JobQueueDatabaseStore.js'; +import { parseUnknown } from '../util/schemas.js'; const groupAvatarJobDataSchema = z.object({ conversationId: z.string(), diff --git a/ts/jobs/helpers/addReportSpamJob.ts b/ts/jobs/helpers/addReportSpamJob.ts index 782a8045d9c..511b04917c3 100644 --- a/ts/jobs/helpers/addReportSpamJob.ts +++ b/ts/jobs/helpers/addReportSpamJob.ts @@ -1,12 +1,12 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { assertDev } from '../../util/assert'; -import { isDirectConversation } from '../../util/whatTypeOfConversation'; -import { createLogger } from '../../logging/log'; -import { isAciString } from '../../util/isAciString'; -import type { reportSpamJobQueue } from '../reportSpamJobQueue'; -import type { ConversationType } from '../../state/ducks/conversations'; +import { assertDev } from '../../util/assert.js'; +import { isDirectConversation } from '../../util/whatTypeOfConversation.js'; +import { createLogger } from '../../logging/log.js'; +import { isAciString } from '../../util/isAciString.js'; +import type { reportSpamJobQueue } from '../reportSpamJobQueue.js'; +import type { ConversationType } from '../../state/ducks/conversations.js'; const log = createLogger('addReportSpamJob'); diff --git a/ts/jobs/helpers/areAllErrorsUnregistered.ts b/ts/jobs/helpers/areAllErrorsUnregistered.ts index 1dc3fce8ec2..9e42915e9e1 100644 --- a/ts/jobs/helpers/areAllErrorsUnregistered.ts +++ b/ts/jobs/helpers/areAllErrorsUnregistered.ts @@ -1,12 +1,12 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationAttributesType } from '../../model-types.d'; +import type { ConversationAttributesType } from '../../model-types.d.ts'; import { SendMessageProtoError, UnregisteredUserError, -} from '../../textsecure/Errors'; -import { isGroup } from '../../util/whatTypeOfConversation'; +} from '../../textsecure/Errors.js'; +import { isGroup } from '../../util/whatTypeOfConversation.js'; export function areAllErrorsUnregistered( conversation: ConversationAttributesType, diff --git a/ts/jobs/helpers/attachmentBackfill.ts b/ts/jobs/helpers/attachmentBackfill.ts index 1e93783312a..f656984adb2 100644 --- a/ts/jobs/helpers/attachmentBackfill.ts +++ b/ts/jobs/helpers/attachmentBackfill.ts @@ -1,49 +1,49 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AttachmentBackfillResponseSyncEvent } from '../../textsecure/messageReceiverEvents'; -import MessageSender from '../../textsecure/SendMessage'; -import { createLogger } from '../../logging/log'; -import type { ReadonlyMessageAttributesType } from '../../model-types.d'; +import type { AttachmentBackfillResponseSyncEvent } from '../../textsecure/messageReceiverEvents.js'; +import MessageSender from '../../textsecure/SendMessage.js'; +import { createLogger } from '../../logging/log.js'; +import type { ReadonlyMessageAttributesType } from '../../model-types.d.ts'; import { type AttachmentType, isDownloading, isDownloaded, isDownloadable, getUndownloadedAttachmentSignature, -} from '../../types/Attachment'; +} from '../../types/Attachment.js'; import { type AttachmentDownloadJobTypeType, AttachmentDownloadUrgency, -} from '../../types/AttachmentDownload'; -import { AttachmentDownloadSource } from '../../sql/Interface'; -import { APPLICATION_OCTET_STREAM } from '../../types/MIME'; +} from '../../types/AttachmentDownload.js'; +import { AttachmentDownloadSource } from '../../sql/Interface.js'; +import { APPLICATION_OCTET_STREAM } from '../../types/MIME.js'; import { getConversationIdentifier, getAddressableMessage, getConversationFromTarget, getMessageQueryFromTarget, findMatchingMessage, -} from '../../util/syncIdentifiers'; -import { strictAssert } from '../../util/assert'; -import { drop } from '../../util/drop'; -import { missingCaseError } from '../../util/missingCaseError'; -import { isStagingServer } from '../../util/isStagingServer'; +} from '../../util/syncIdentifiers.js'; +import { strictAssert } from '../../util/assert.js'; +import { drop } from '../../util/drop.js'; +import { missingCaseError } from '../../util/missingCaseError.js'; +import { isStagingServer } from '../../util/isStagingServer.js'; import { ensureBodyAttachmentsAreSeparated, queueAttachmentDownloads, -} from '../../util/queueAttachmentDownloads'; -import { SECOND } from '../../util/durations'; -import { showDownloadFailedToast } from '../../util/showDownloadFailedToast'; -import { markAttachmentAsPermanentlyErrored } from '../../util/attachments/markAttachmentAsPermanentlyErrored'; -import { singleProtoJobQueue } from '../singleProtoJobQueue'; -import { MessageModel } from '../../models/messages'; -import { getMessageById } from '../../messages/getMessageById'; -import { addAttachmentToMessage } from '../../messageModifiers/AttachmentDownloads'; -import { SignalService as Proto } from '../../protobuf'; -import * as RemoteConfig from '../../RemoteConfig'; -import { isTestOrMockEnvironment } from '../../environment'; -import { BackfillFailureKind } from '../../components/BackfillFailureModal'; +} from '../../util/queueAttachmentDownloads.js'; +import { SECOND } from '../../util/durations/index.js'; +import { showDownloadFailedToast } from '../../util/showDownloadFailedToast.js'; +import { markAttachmentAsPermanentlyErrored } from '../../util/attachments/markAttachmentAsPermanentlyErrored.js'; +import { singleProtoJobQueue } from '../singleProtoJobQueue.js'; +import { MessageModel } from '../../models/messages.js'; +import { getMessageById } from '../../messages/getMessageById.js'; +import { addAttachmentToMessage } from '../../messageModifiers/AttachmentDownloads.js'; +import { SignalService as Proto } from '../../protobuf/index.js'; +import * as RemoteConfig from '../../RemoteConfig.js'; +import { isTestOrMockEnvironment } from '../../environment.js'; +import { BackfillFailureKind } from '../../components/BackfillFailureModal.js'; const log = createLogger('attachmentBackfill'); diff --git a/ts/jobs/helpers/commonShouldJobContinue.ts b/ts/jobs/helpers/commonShouldJobContinue.ts index 5552d0c0d6a..17dec11e15a 100644 --- a/ts/jobs/helpers/commonShouldJobContinue.ts +++ b/ts/jobs/helpers/commonShouldJobContinue.ts @@ -1,11 +1,11 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { LoggerType } from '../../types/Logging'; -import { waitForOnline } from '../../util/waitForOnline'; -import { exponentialBackoffSleepTime } from '../../util/exponentialBackoff'; -import { isDone as isDeviceLinked } from '../../util/registration'; -import { sleeper } from '../../util/sleeper'; +import type { LoggerType } from '../../types/Logging.js'; +import { waitForOnline } from '../../util/waitForOnline.js'; +import { exponentialBackoffSleepTime } from '../../util/exponentialBackoff.js'; +import { isDone as isDeviceLinked } from '../../util/registration.js'; +import { sleeper } from '../../util/sleeper.js'; export async function commonShouldJobContinue({ attempt, diff --git a/ts/jobs/helpers/findRetryAfterTimeFromError.ts b/ts/jobs/helpers/findRetryAfterTimeFromError.ts index 6f82666ac8b..650f24acec1 100644 --- a/ts/jobs/helpers/findRetryAfterTimeFromError.ts +++ b/ts/jobs/helpers/findRetryAfterTimeFromError.ts @@ -1,9 +1,9 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { isRecord } from '../../util/isRecord'; -import { HTTPError } from '../../textsecure/Errors'; -import { parseRetryAfterWithDefault } from '../../util/parseRetryAfter'; +import { isRecord } from '../../util/isRecord.js'; +import { HTTPError } from '../../textsecure/Errors.js'; +import { parseRetryAfterWithDefault } from '../../util/parseRetryAfter.js'; export function findRetryAfterTimeFromError( err: unknown, diff --git a/ts/jobs/helpers/getHttpErrorCode.ts b/ts/jobs/helpers/getHttpErrorCode.ts index 7c55d7f4da3..a75484e819e 100644 --- a/ts/jobs/helpers/getHttpErrorCode.ts +++ b/ts/jobs/helpers/getHttpErrorCode.ts @@ -1,8 +1,8 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { isRecord } from '../../util/isRecord'; -import { parseIntWithFallback } from '../../util/parseIntWithFallback'; +import { isRecord } from '../../util/isRecord.js'; +import { parseIntWithFallback } from '../../util/parseIntWithFallback.js'; /** * Looks for an HTTP code. First tries the top level error, then looks at its `httpError` diff --git a/ts/jobs/helpers/getUntrustedConversationServiceIds.ts b/ts/jobs/helpers/getUntrustedConversationServiceIds.ts index 44b4827ac60..47d75322cfd 100644 --- a/ts/jobs/helpers/getUntrustedConversationServiceIds.ts +++ b/ts/jobs/helpers/getUntrustedConversationServiceIds.ts @@ -1,9 +1,9 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { isNotNil } from '../../util/isNotNil'; -import { createLogger } from '../../logging/log'; -import type { ServiceIdString } from '../../types/ServiceId'; +import { isNotNil } from '../../util/isNotNil.js'; +import { createLogger } from '../../logging/log.js'; +import type { ServiceIdString } from '../../types/ServiceId.js'; const log = createLogger('getUntrustedConversationServiceIds'); diff --git a/ts/jobs/helpers/getValidRecipients.ts b/ts/jobs/helpers/getValidRecipients.ts index 2e2a9054b83..7cbb78ca5d0 100644 --- a/ts/jobs/helpers/getValidRecipients.ts +++ b/ts/jobs/helpers/getValidRecipients.ts @@ -1,10 +1,10 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { isNotNil } from '../../util/isNotNil'; +import { isNotNil } from '../../util/isNotNil.js'; -import type { LoggerType } from '../../types/Logging'; -import type { ServiceIdString } from '../../types/ServiceId'; +import type { LoggerType } from '../../types/Logging.js'; +import type { ServiceIdString } from '../../types/ServiceId.js'; export function getValidRecipients( recipients: Array, diff --git a/ts/jobs/helpers/handleCommonJobRequestError.ts b/ts/jobs/helpers/handleCommonJobRequestError.ts index 8a09aa370aa..3fd1fedc176 100644 --- a/ts/jobs/helpers/handleCommonJobRequestError.ts +++ b/ts/jobs/helpers/handleCommonJobRequestError.ts @@ -1,9 +1,9 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { LoggerType } from '../../types/Logging'; -import { sleepForRateLimitRetryAfterTime } from './sleepForRateLimitRetryAfterTime'; -import { getHttpErrorCode } from './getHttpErrorCode'; +import type { LoggerType } from '../../types/Logging.js'; +import { sleepForRateLimitRetryAfterTime } from './sleepForRateLimitRetryAfterTime.js'; +import { getHttpErrorCode } from './getHttpErrorCode.js'; export async function handleCommonJobRequestError({ err, diff --git a/ts/jobs/helpers/handleMultipleSendErrors.ts b/ts/jobs/helpers/handleMultipleSendErrors.ts index 01bd090982f..be25263393c 100644 --- a/ts/jobs/helpers/handleMultipleSendErrors.ts +++ b/ts/jobs/helpers/handleMultipleSendErrors.ts @@ -1,13 +1,13 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { LoggerType } from '../../types/Logging'; -import * as Errors from '../../types/errors'; -import { sleepForRateLimitRetryAfterTime } from './sleepForRateLimitRetryAfterTime'; -import { getHttpErrorCode } from './getHttpErrorCode'; -import { strictAssert } from '../../util/assert'; -import { findRetryAfterTimeFromError } from './findRetryAfterTimeFromError'; -import { SendMessageProtoError } from '../../textsecure/Errors'; +import type { LoggerType } from '../../types/Logging.js'; +import * as Errors from '../../types/errors.js'; +import { sleepForRateLimitRetryAfterTime } from './sleepForRateLimitRetryAfterTime.js'; +import { getHttpErrorCode } from './getHttpErrorCode.js'; +import { strictAssert } from '../../util/assert.js'; +import { findRetryAfterTimeFromError } from './findRetryAfterTimeFromError.js'; +import { SendMessageProtoError } from '../../textsecure/Errors.js'; export function maybeExpandErrors(error: unknown): ReadonlyArray { if (error instanceof SendMessageProtoError) { diff --git a/ts/jobs/helpers/sendCallingMessage.ts b/ts/jobs/helpers/sendCallingMessage.ts index 321aa12add6..5d1d412c5c5 100644 --- a/ts/jobs/helpers/sendCallingMessage.ts +++ b/ts/jobs/helpers/sendCallingMessage.ts @@ -3,32 +3,32 @@ import { ContentHint } from '@signalapp/libsignal-client'; -import { handleMessageSend } from '../../util/handleMessageSend'; -import { getSendOptions } from '../../util/getSendOptions'; +import { handleMessageSend } from '../../util/handleMessageSend.js'; +import { getSendOptions } from '../../util/getSendOptions.js'; import { isDirectConversation, isGroup, -} from '../../util/whatTypeOfConversation'; -import { SignalService as Proto } from '../../protobuf'; +} from '../../util/whatTypeOfConversation.js'; +import { SignalService as Proto } from '../../protobuf/index.js'; import { handleMultipleSendErrors, maybeExpandErrors, -} from './handleMultipleSendErrors'; +} from './handleMultipleSendErrors.js'; -import type { ConversationModel } from '../../models/conversations'; +import type { ConversationModel } from '../../models/conversations.js'; import type { ConversationQueueJobBundle, CallingMessageJobData, -} from '../conversationJobQueue'; -import { isConversationUnregistered } from '../../util/isConversationUnregistered'; +} from '../conversationJobQueue.js'; +import { isConversationUnregistered } from '../../util/isConversationUnregistered.js'; import { OutgoingIdentityKeyError, UnregisteredUserError, -} from '../../textsecure/Errors'; -import { getUntrustedConversationServiceIds } from './getUntrustedConversationServiceIds'; -import { sendContentMessageToGroup } from '../../util/sendToGroup'; -import * as Bytes from '../../Bytes'; -import { getValidRecipients } from './getValidRecipients'; +} from '../../textsecure/Errors.js'; +import { getUntrustedConversationServiceIds } from './getUntrustedConversationServiceIds.js'; +import { sendContentMessageToGroup } from '../../util/sendToGroup.js'; +import * as Bytes from '../../Bytes.js'; +import { getValidRecipients } from './getValidRecipients.js'; export async function sendCallingMessage( conversation: ConversationModel, diff --git a/ts/jobs/helpers/sendDeleteForEveryone.ts b/ts/jobs/helpers/sendDeleteForEveryone.ts index 6545cb36478..47bf56cd959 100644 --- a/ts/jobs/helpers/sendDeleteForEveryone.ts +++ b/ts/jobs/helpers/sendDeleteForEveryone.ts @@ -4,40 +4,40 @@ import { ContentHint } from '@signalapp/libsignal-client'; import { isNumber } from 'lodash'; -import * as Errors from '../../types/errors'; -import { getSendOptions } from '../../util/getSendOptions'; +import * as Errors from '../../types/errors.js'; +import { getSendOptions } from '../../util/getSendOptions.js'; import { isDirectConversation, isGroupV2, isMe, -} from '../../util/whatTypeOfConversation'; -import { SignalService as Proto } from '../../protobuf'; +} from '../../util/whatTypeOfConversation.js'; +import { SignalService as Proto } from '../../protobuf/index.js'; import { handleMultipleSendErrors, maybeExpandErrors, -} from './handleMultipleSendErrors'; -import { ourProfileKeyService } from '../../services/ourProfileKey'; -import { wrapWithSyncMessageSend } from '../../util/wrapWithSyncMessageSend'; +} from './handleMultipleSendErrors.js'; +import { ourProfileKeyService } from '../../services/ourProfileKey.js'; +import { wrapWithSyncMessageSend } from '../../util/wrapWithSyncMessageSend.js'; -import type { ConversationModel } from '../../models/conversations'; +import type { ConversationModel } from '../../models/conversations.js'; import type { ConversationQueueJobBundle, DeleteForEveryoneJobData, -} from '../conversationJobQueue'; -import { getUntrustedConversationServiceIds } from './getUntrustedConversationServiceIds'; -import { handleMessageSend } from '../../util/handleMessageSend'; -import { isConversationAccepted } from '../../util/isConversationAccepted'; -import { isConversationUnregistered } from '../../util/isConversationUnregistered'; -import { getMessageById } from '../../messages/getMessageById'; -import { isNotNil } from '../../util/isNotNil'; -import type { CallbackResultType } from '../../textsecure/Types.d'; -import type { MessageModel } from '../../models/messages'; -import { SendMessageProtoError } from '../../textsecure/Errors'; -import { strictAssert } from '../../util/assert'; -import type { LoggerType } from '../../types/Logging'; -import type { ServiceIdString } from '../../types/ServiceId'; -import { isStory } from '../../messages/helpers'; -import { sendToGroup } from '../../util/sendToGroup'; +} from '../conversationJobQueue.js'; +import { getUntrustedConversationServiceIds } from './getUntrustedConversationServiceIds.js'; +import { handleMessageSend } from '../../util/handleMessageSend.js'; +import { isConversationAccepted } from '../../util/isConversationAccepted.js'; +import { isConversationUnregistered } from '../../util/isConversationUnregistered.js'; +import { getMessageById } from '../../messages/getMessageById.js'; +import { isNotNil } from '../../util/isNotNil.js'; +import type { CallbackResultType } from '../../textsecure/Types.d.ts'; +import type { MessageModel } from '../../models/messages.js'; +import { SendMessageProtoError } from '../../textsecure/Errors.js'; +import { strictAssert } from '../../util/assert.js'; +import type { LoggerType } from '../../types/Logging.js'; +import type { ServiceIdString } from '../../types/ServiceId.js'; +import { isStory } from '../../messages/helpers.js'; +import { sendToGroup } from '../../util/sendToGroup.js'; export async function sendDeleteForEveryone( conversation: ConversationModel, diff --git a/ts/jobs/helpers/sendDeleteStoryForEveryone.ts b/ts/jobs/helpers/sendDeleteStoryForEveryone.ts index 2f6a2b4fc59..8f3e4740ad4 100644 --- a/ts/jobs/helpers/sendDeleteStoryForEveryone.ts +++ b/ts/jobs/helpers/sendDeleteStoryForEveryone.ts @@ -3,32 +3,35 @@ import { ContentHint } from '@signalapp/libsignal-client'; -import * as Errors from '../../types/errors'; -import { getSendOptions } from '../../util/getSendOptions'; -import { isDirectConversation, isMe } from '../../util/whatTypeOfConversation'; +import * as Errors from '../../types/errors.js'; +import { getSendOptions } from '../../util/getSendOptions.js'; +import { + isDirectConversation, + isMe, +} from '../../util/whatTypeOfConversation.js'; import { handleMultipleSendErrors, maybeExpandErrors, -} from './handleMultipleSendErrors'; -import { ourProfileKeyService } from '../../services/ourProfileKey'; +} from './handleMultipleSendErrors.js'; +import { ourProfileKeyService } from '../../services/ourProfileKey.js'; -import type { ConversationModel } from '../../models/conversations'; +import type { ConversationModel } from '../../models/conversations.js'; import type { ConversationQueueJobBundle, DeleteStoryForEveryoneJobData, -} from '../conversationJobQueue'; -import { getUntrustedConversationServiceIds } from './getUntrustedConversationServiceIds'; -import { handleMessageSend } from '../../util/handleMessageSend'; -import { isConversationAccepted } from '../../util/isConversationAccepted'; -import { isConversationUnregistered } from '../../util/isConversationUnregistered'; -import { getMessageById } from '../../messages/getMessageById'; -import { isNotNil } from '../../util/isNotNil'; -import type { CallbackResultType } from '../../textsecure/Types.d'; -import type { MessageModel } from '../../models/messages'; -import { SendMessageProtoError } from '../../textsecure/Errors'; -import { strictAssert } from '../../util/assert'; -import type { LoggerType } from '../../types/Logging'; -import { isStory } from '../../messages/helpers'; +} from '../conversationJobQueue.js'; +import { getUntrustedConversationServiceIds } from './getUntrustedConversationServiceIds.js'; +import { handleMessageSend } from '../../util/handleMessageSend.js'; +import { isConversationAccepted } from '../../util/isConversationAccepted.js'; +import { isConversationUnregistered } from '../../util/isConversationUnregistered.js'; +import { getMessageById } from '../../messages/getMessageById.js'; +import { isNotNil } from '../../util/isNotNil.js'; +import type { CallbackResultType } from '../../textsecure/Types.d.ts'; +import type { MessageModel } from '../../models/messages.js'; +import { SendMessageProtoError } from '../../textsecure/Errors.js'; +import { strictAssert } from '../../util/assert.js'; +import type { LoggerType } from '../../types/Logging.js'; +import { isStory } from '../../messages/helpers.js'; export async function sendDeleteStoryForEveryone( ourConversation: ConversationModel, diff --git a/ts/jobs/helpers/sendDirectExpirationTimerUpdate.ts b/ts/jobs/helpers/sendDirectExpirationTimerUpdate.ts index 3cb558294ee..09a73986a91 100644 --- a/ts/jobs/helpers/sendDirectExpirationTimerUpdate.ts +++ b/ts/jobs/helpers/sendDirectExpirationTimerUpdate.ts @@ -3,25 +3,28 @@ import { ContentHint } from '@signalapp/libsignal-client'; -import { getSendOptions } from '../../util/getSendOptions'; -import { isDirectConversation, isMe } from '../../util/whatTypeOfConversation'; -import { SignalService as Proto } from '../../protobuf'; +import { getSendOptions } from '../../util/getSendOptions.js'; +import { + isDirectConversation, + isMe, +} from '../../util/whatTypeOfConversation.js'; +import { SignalService as Proto } from '../../protobuf/index.js'; import { handleMultipleSendErrors, maybeExpandErrors, -} from './handleMultipleSendErrors'; -import { wrapWithSyncMessageSend } from '../../util/wrapWithSyncMessageSend'; -import { ourProfileKeyService } from '../../services/ourProfileKey'; +} from './handleMultipleSendErrors.js'; +import { wrapWithSyncMessageSend } from '../../util/wrapWithSyncMessageSend.js'; +import { ourProfileKeyService } from '../../services/ourProfileKey.js'; -import type { ConversationModel } from '../../models/conversations'; +import type { ConversationModel } from '../../models/conversations.js'; import type { ExpirationTimerUpdateJobData, ConversationQueueJobBundle, -} from '../conversationJobQueue'; -import { handleMessageSend } from '../../util/handleMessageSend'; -import { isConversationAccepted } from '../../util/isConversationAccepted'; -import { isConversationUnregistered } from '../../util/isConversationUnregistered'; -import { DurationInSeconds } from '../../util/durations'; +} from '../conversationJobQueue.js'; +import { handleMessageSend } from '../../util/handleMessageSend.js'; +import { isConversationAccepted } from '../../util/isConversationAccepted.js'; +import { isConversationUnregistered } from '../../util/isConversationUnregistered.js'; +import { DurationInSeconds } from '../../util/durations/index.js'; export async function sendDirectExpirationTimerUpdate( conversation: ConversationModel, diff --git a/ts/jobs/helpers/sendGroupCallUpdate.ts b/ts/jobs/helpers/sendGroupCallUpdate.ts index 06be00be494..a530054d4ac 100644 --- a/ts/jobs/helpers/sendGroupCallUpdate.ts +++ b/ts/jobs/helpers/sendGroupCallUpdate.ts @@ -3,22 +3,22 @@ import { ContentHint } from '@signalapp/libsignal-client'; -import { getSendOptions } from '../../util/getSendOptions'; -import { isGroup } from '../../util/whatTypeOfConversation'; +import { getSendOptions } from '../../util/getSendOptions.js'; +import { isGroup } from '../../util/whatTypeOfConversation.js'; import { handleMultipleSendErrors, maybeExpandErrors, -} from './handleMultipleSendErrors'; +} from './handleMultipleSendErrors.js'; -import type { ConversationModel } from '../../models/conversations'; +import type { ConversationModel } from '../../models/conversations.js'; import type { ConversationQueueJobBundle, GroupCallUpdateJobData, -} from '../conversationJobQueue'; -import { getUntrustedConversationServiceIds } from './getUntrustedConversationServiceIds'; -import { sendToGroup } from '../../util/sendToGroup'; -import { wrapWithSyncMessageSend } from '../../util/wrapWithSyncMessageSend'; -import { getValidRecipients } from './getValidRecipients'; +} from '../conversationJobQueue.js'; +import { getUntrustedConversationServiceIds } from './getUntrustedConversationServiceIds.js'; +import { sendToGroup } from '../../util/sendToGroup.js'; +import { wrapWithSyncMessageSend } from '../../util/wrapWithSyncMessageSend.js'; +import { getValidRecipients } from './getValidRecipients.js'; export async function sendGroupCallUpdate( conversation: ConversationModel, diff --git a/ts/jobs/helpers/sendGroupUpdate.ts b/ts/jobs/helpers/sendGroupUpdate.ts index ae1c37133b0..8f87d01df71 100644 --- a/ts/jobs/helpers/sendGroupUpdate.ts +++ b/ts/jobs/helpers/sendGroupUpdate.ts @@ -3,26 +3,26 @@ import { ContentHint } from '@signalapp/libsignal-client'; -import { getSendOptionsForRecipients } from '../../util/getSendOptions'; -import { isGroupV2 } from '../../util/whatTypeOfConversation'; +import { getSendOptionsForRecipients } from '../../util/getSendOptions.js'; +import { isGroupV2 } from '../../util/whatTypeOfConversation.js'; import { handleMultipleSendErrors, maybeExpandErrors, -} from './handleMultipleSendErrors'; -import { wrapWithSyncMessageSend } from '../../util/wrapWithSyncMessageSend'; -import * as Bytes from '../../Bytes'; -import { strictAssert } from '../../util/assert'; -import { ourProfileKeyService } from '../../services/ourProfileKey'; +} from './handleMultipleSendErrors.js'; +import { wrapWithSyncMessageSend } from '../../util/wrapWithSyncMessageSend.js'; +import * as Bytes from '../../Bytes.js'; +import { strictAssert } from '../../util/assert.js'; +import { ourProfileKeyService } from '../../services/ourProfileKey.js'; -import type { ConversationModel } from '../../models/conversations'; -import type { GroupV2InfoType } from '../../textsecure/SendMessage'; +import type { ConversationModel } from '../../models/conversations.js'; +import type { GroupV2InfoType } from '../../textsecure/SendMessage.js'; import type { GroupUpdateJobData, ConversationQueueJobBundle, -} from '../conversationJobQueue'; -import { getUntrustedConversationServiceIds } from './getUntrustedConversationServiceIds'; -import { sendToGroup } from '../../util/sendToGroup'; -import { getValidRecipients } from './getValidRecipients'; +} from '../conversationJobQueue.js'; +import { getUntrustedConversationServiceIds } from './getUntrustedConversationServiceIds.js'; +import { sendToGroup } from '../../util/sendToGroup.js'; +import { getValidRecipients } from './getValidRecipients.js'; // Note: because we don't have a recipient map, if some sends fail, we will resend this // message to folks that got it on the first go-round. This is okay, because receivers diff --git a/ts/jobs/helpers/sendNormalMessage.ts b/ts/jobs/helpers/sendNormalMessage.ts index 6cdfe56af49..ccf636319cb 100644 --- a/ts/jobs/helpers/sendNormalMessage.ts +++ b/ts/jobs/helpers/sendNormalMessage.ts @@ -5,67 +5,67 @@ import { isNumber } from 'lodash'; import PQueue from 'p-queue'; import { ContentHint } from '@signalapp/libsignal-client'; -import * as Errors from '../../types/errors'; -import { strictAssert } from '../../util/assert'; -import type { MessageModel } from '../../models/messages'; -import { getMessageById } from '../../messages/getMessageById'; -import type { ConversationModel } from '../../models/conversations'; -import { isGroup, isGroupV2, isMe } from '../../util/whatTypeOfConversation'; -import { getSendOptions } from '../../util/getSendOptions'; -import { handleMessageSend } from '../../util/handleMessageSend'; -import { findAndFormatContact } from '../../util/findAndFormatContact'; -import { uploadAttachment } from '../../util/uploadAttachment'; -import type { CallbackResultType } from '../../textsecure/Types.d'; -import { isSent } from '../../messages/MessageSendState'; -import { isOutgoing, canReact } from '../../state/selectors/message'; +import * as Errors from '../../types/errors.js'; +import { strictAssert } from '../../util/assert.js'; +import type { MessageModel } from '../../models/messages.js'; +import { getMessageById } from '../../messages/getMessageById.js'; +import type { ConversationModel } from '../../models/conversations.js'; +import { isGroup, isGroupV2, isMe } from '../../util/whatTypeOfConversation.js'; +import { getSendOptions } from '../../util/getSendOptions.js'; +import { handleMessageSend } from '../../util/handleMessageSend.js'; +import { findAndFormatContact } from '../../util/findAndFormatContact.js'; +import { uploadAttachment } from '../../util/uploadAttachment.js'; +import type { CallbackResultType } from '../../textsecure/Types.d.ts'; +import { isSent } from '../../messages/MessageSendState.js'; +import { isOutgoing, canReact } from '../../state/selectors/message.js'; import type { ReactionType, OutgoingQuoteType, OutgoingQuoteAttachmentType, OutgoingLinkPreviewType, OutgoingStickerType, -} from '../../textsecure/SendMessage'; +} from '../../textsecure/SendMessage.js'; import type { AttachmentType, UploadedAttachmentType, -} from '../../types/Attachment'; -import { copyCdnFields } from '../../util/attachments'; -import type { RawBodyRange } from '../../types/BodyRange'; -import type { EmbeddedContactWithUploadedAvatar } from '../../types/EmbeddedContact'; -import type { StoryContextType } from '../../types/Util'; -import type { LoggerType } from '../../types/Logging'; +} from '../../types/Attachment.js'; +import { copyCdnFields } from '../../util/attachments.js'; +import type { RawBodyRange } from '../../types/BodyRange.js'; +import type { EmbeddedContactWithUploadedAvatar } from '../../types/EmbeddedContact.js'; +import type { StoryContextType } from '../../types/Util.js'; +import type { LoggerType } from '../../types/Logging.js'; import type { ConversationQueueJobBundle, NormalMessageSendJobData, -} from '../conversationJobQueue'; -import type { QuotedMessageType } from '../../model-types.d'; +} from '../conversationJobQueue.js'; +import type { QuotedMessageType } from '../../model-types.d.ts'; -import { handleMultipleSendErrors } from './handleMultipleSendErrors'; -import { ourProfileKeyService } from '../../services/ourProfileKey'; -import { isConversationUnregistered } from '../../util/isConversationUnregistered'; -import { isConversationAccepted } from '../../util/isConversationAccepted'; -import { sendToGroup } from '../../util/sendToGroup'; -import type { DurationInSeconds } from '../../util/durations'; -import type { ServiceIdString } from '../../types/ServiceId'; -import { normalizeAci } from '../../util/normalizeAci'; +import { handleMultipleSendErrors } from './handleMultipleSendErrors.js'; +import { ourProfileKeyService } from '../../services/ourProfileKey.js'; +import { isConversationUnregistered } from '../../util/isConversationUnregistered.js'; +import { isConversationAccepted } from '../../util/isConversationAccepted.js'; +import { sendToGroup } from '../../util/sendToGroup.js'; +import type { DurationInSeconds } from '../../util/durations/index.js'; +import type { ServiceIdString } from '../../types/ServiceId.js'; +import { normalizeAci } from '../../util/normalizeAci.js'; import { getPropForTimestamp, getTargetOfThisEditTimestamp, getChangesForPropAtTimestamp, -} from '../../util/editHelpers'; -import { getMessageSentTimestamp } from '../../util/getMessageSentTimestamp'; -import { isSignalConversation } from '../../util/isSignalConversation'; +} from '../../util/editHelpers.js'; +import { getMessageSentTimestamp } from '../../util/getMessageSentTimestamp.js'; +import { isSignalConversation } from '../../util/isSignalConversation.js'; import { isBodyTooLong, MAX_BODY_ATTACHMENT_BYTE_LENGTH, trimBody, -} from '../../util/longAttachment'; +} from '../../util/longAttachment.js'; import { markFailed, saveErrorsOnMessage, -} from '../../test-node/util/messageFailures'; -import { getMessageIdForLogging } from '../../util/idForLogging'; -import { send, sendSyncMessageOnly } from '../../messages/send'; +} from '../../test-node/util/messageFailures.js'; +import { getMessageIdForLogging } from '../../util/idForLogging.js'; +import { send, sendSyncMessageOnly } from '../../messages/send.js'; const MAX_CONCURRENT_ATTACHMENT_UPLOADS = 5; diff --git a/ts/jobs/helpers/sendNullMessage.ts b/ts/jobs/helpers/sendNullMessage.ts index c10cf79f520..86f9eb749ee 100644 --- a/ts/jobs/helpers/sendNullMessage.ts +++ b/ts/jobs/helpers/sendNullMessage.ts @@ -3,27 +3,27 @@ import { ContentHint } from '@signalapp/libsignal-client'; -import { handleMessageSend } from '../../util/handleMessageSend'; -import { getSendOptions } from '../../util/getSendOptions'; -import { isDirectConversation } from '../../util/whatTypeOfConversation'; +import { handleMessageSend } from '../../util/handleMessageSend.js'; +import { getSendOptions } from '../../util/getSendOptions.js'; +import { isDirectConversation } from '../../util/whatTypeOfConversation.js'; import { handleMultipleSendErrors, maybeExpandErrors, -} from './handleMultipleSendErrors'; +} from './handleMultipleSendErrors.js'; -import type { ConversationModel } from '../../models/conversations'; +import type { ConversationModel } from '../../models/conversations.js'; import type { ConversationQueueJobBundle, NullMessageJobData, -} from '../conversationJobQueue'; -import type { SessionResetsType } from '../../textsecure/Types.d'; -import { isConversationUnregistered } from '../../util/isConversationUnregistered'; +} from '../conversationJobQueue.js'; +import type { SessionResetsType } from '../../textsecure/Types.d.ts'; +import { isConversationUnregistered } from '../../util/isConversationUnregistered.js'; import { OutgoingIdentityKeyError, UnregisteredUserError, -} from '../../textsecure/Errors'; -import MessageSender from '../../textsecure/SendMessage'; -import { sendToGroup } from '../../util/sendToGroup'; +} from '../../textsecure/Errors.js'; +import MessageSender from '../../textsecure/SendMessage.js'; +import { sendToGroup } from '../../util/sendToGroup.js'; async function clearResetsTracking(idForTracking: string | undefined) { if (!idForTracking) { diff --git a/ts/jobs/helpers/sendProfileKey.ts b/ts/jobs/helpers/sendProfileKey.ts index a4dbba82404..33e8aaf5dc5 100644 --- a/ts/jobs/helpers/sendProfileKey.ts +++ b/ts/jobs/helpers/sendProfileKey.ts @@ -4,36 +4,36 @@ import { isNumber } from 'lodash'; import { ContentHint } from '@signalapp/libsignal-client'; -import { handleMessageSend } from '../../util/handleMessageSend'; -import { getSendOptions } from '../../util/getSendOptions'; +import { handleMessageSend } from '../../util/handleMessageSend.js'; +import { getSendOptions } from '../../util/getSendOptions.js'; import { isDirectConversation, isGroup, isGroupV2, -} from '../../util/whatTypeOfConversation'; -import { SignalService as Proto } from '../../protobuf'; +} from '../../util/whatTypeOfConversation.js'; +import { SignalService as Proto } from '../../protobuf/index.js'; import { handleMultipleSendErrors, maybeExpandErrors, -} from './handleMultipleSendErrors'; -import { ourProfileKeyService } from '../../services/ourProfileKey'; +} from './handleMultipleSendErrors.js'; +import { ourProfileKeyService } from '../../services/ourProfileKey.js'; -import type { ConversationModel } from '../../models/conversations'; +import type { ConversationModel } from '../../models/conversations.js'; import type { ConversationQueueJobBundle, ProfileKeyJobData, -} from '../conversationJobQueue'; -import type { CallbackResultType } from '../../textsecure/Types.d'; -import { isConversationUnregistered } from '../../util/isConversationUnregistered'; -import type { ConversationAttributesType } from '../../model-types.d'; +} from '../conversationJobQueue.js'; +import type { CallbackResultType } from '../../textsecure/Types.d.ts'; +import { isConversationUnregistered } from '../../util/isConversationUnregistered.js'; +import type { ConversationAttributesType } from '../../model-types.d.ts'; import { OutgoingIdentityKeyError, SendMessageChallengeError, SendMessageProtoError, UnregisteredUserError, -} from '../../textsecure/Errors'; -import { shouldSendToConversation } from './shouldSendToConversation'; -import { sendToGroup } from '../../util/sendToGroup'; +} from '../../textsecure/Errors.js'; +import { shouldSendToConversation } from './shouldSendToConversation.js'; +import { sendToGroup } from '../../util/sendToGroup.js'; export function canAllErrorsBeIgnored( conversation: ConversationAttributesType, diff --git a/ts/jobs/helpers/sendReaction.ts b/ts/jobs/helpers/sendReaction.ts index 2d0f915d01b..d398b0730ab 100644 --- a/ts/jobs/helpers/sendReaction.ts +++ b/ts/jobs/helpers/sendReaction.ts @@ -4,44 +4,44 @@ import { isNumber } from 'lodash'; import { ContentHint } from '@signalapp/libsignal-client'; -import * as Errors from '../../types/errors'; -import { strictAssert } from '../../util/assert'; -import { repeat, zipObject } from '../../util/iterables'; -import type { CallbackResultType } from '../../textsecure/Types.d'; -import { MessageModel } from '../../models/messages'; -import type { MessageReactionType } from '../../model-types.d'; -import type { ConversationModel } from '../../models/conversations'; +import * as Errors from '../../types/errors.js'; +import { strictAssert } from '../../util/assert.js'; +import { repeat, zipObject } from '../../util/iterables.js'; +import type { CallbackResultType } from '../../textsecure/Types.d.ts'; +import { MessageModel } from '../../models/messages.js'; +import type { MessageReactionType } from '../../model-types.d.ts'; +import type { ConversationModel } from '../../models/conversations.js'; -import * as reactionUtil from '../../reactions/util'; -import { isSent, SendStatus } from '../../messages/MessageSendState'; -import { getMessageById } from '../../messages/getMessageById'; -import { isIncoming } from '../../messages/helpers'; +import * as reactionUtil from '../../reactions/util.js'; +import { isSent, SendStatus } from '../../messages/MessageSendState.js'; +import { getMessageById } from '../../messages/getMessageById.js'; +import { isIncoming } from '../../messages/helpers.js'; import { isMe, isDirectConversation, isGroupV2, -} from '../../util/whatTypeOfConversation'; -import { getSendOptions } from '../../util/getSendOptions'; -import { handleMessageSend } from '../../util/handleMessageSend'; -import { ourProfileKeyService } from '../../services/ourProfileKey'; -import { canReact, isStory } from '../../state/selectors/message'; -import { findAndFormatContact } from '../../util/findAndFormatContact'; -import type { AciString, ServiceIdString } from '../../types/ServiceId'; -import { isAciString } from '../../util/isAciString'; -import { handleMultipleSendErrors } from './handleMultipleSendErrors'; -import { incrementMessageCounter } from '../../util/incrementMessageCounter'; -import { generateMessageId } from '../../util/generateMessageId'; +} from '../../util/whatTypeOfConversation.js'; +import { getSendOptions } from '../../util/getSendOptions.js'; +import { handleMessageSend } from '../../util/handleMessageSend.js'; +import { ourProfileKeyService } from '../../services/ourProfileKey.js'; +import { canReact, isStory } from '../../state/selectors/message.js'; +import { findAndFormatContact } from '../../util/findAndFormatContact.js'; +import type { AciString, ServiceIdString } from '../../types/ServiceId.js'; +import { isAciString } from '../../util/isAciString.js'; +import { handleMultipleSendErrors } from './handleMultipleSendErrors.js'; +import { incrementMessageCounter } from '../../util/incrementMessageCounter.js'; +import { generateMessageId } from '../../util/generateMessageId.js'; import type { ConversationQueueJobBundle, ReactionJobData, -} from '../conversationJobQueue'; -import { isConversationAccepted } from '../../util/isConversationAccepted'; -import { isConversationUnregistered } from '../../util/isConversationUnregistered'; -import type { LoggerType } from '../../types/Logging'; -import { sendToGroup } from '../../util/sendToGroup'; -import { hydrateStoryContext } from '../../util/hydrateStoryContext'; -import { send, sendSyncMessageOnly } from '../../messages/send'; +} from '../conversationJobQueue.js'; +import { isConversationAccepted } from '../../util/isConversationAccepted.js'; +import { isConversationUnregistered } from '../../util/isConversationUnregistered.js'; +import type { LoggerType } from '../../types/Logging.js'; +import { sendToGroup } from '../../util/sendToGroup.js'; +import { hydrateStoryContext } from '../../util/hydrateStoryContext.js'; +import { send, sendSyncMessageOnly } from '../../messages/send.js'; export async function sendReaction( conversation: ConversationModel, diff --git a/ts/jobs/helpers/sendReceipts.ts b/ts/jobs/helpers/sendReceipts.ts index 8a7bcb669f5..4ed10e79625 100644 --- a/ts/jobs/helpers/sendReceipts.ts +++ b/ts/jobs/helpers/sendReceipts.ts @@ -1,13 +1,13 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationModel } from '../../models/conversations'; -import { sendReceipts as sendReceiptsTask } from '../../util/sendReceipts'; +import type { ConversationModel } from '../../models/conversations.js'; +import { sendReceipts as sendReceiptsTask } from '../../util/sendReceipts.js'; import type { ConversationQueueJobBundle, ReceiptsJobData, -} from '../conversationJobQueue'; -import { shouldSendToConversation } from './shouldSendToConversation'; +} from '../conversationJobQueue.js'; +import { shouldSendToConversation } from './shouldSendToConversation.js'; export async function sendReceipts( conversation: ConversationModel, diff --git a/ts/jobs/helpers/sendResendRequest.ts b/ts/jobs/helpers/sendResendRequest.ts index 99990b5334f..1889d440c93 100644 --- a/ts/jobs/helpers/sendResendRequest.ts +++ b/ts/jobs/helpers/sendResendRequest.ts @@ -3,30 +3,30 @@ import { ContentHint, PlaintextContent } from '@signalapp/libsignal-client'; -import { handleMessageSend } from '../../util/handleMessageSend'; -import { getSendOptions } from '../../util/getSendOptions'; -import { isDirectConversation } from '../../util/whatTypeOfConversation'; +import { handleMessageSend } from '../../util/handleMessageSend.js'; +import { getSendOptions } from '../../util/getSendOptions.js'; +import { isDirectConversation } from '../../util/whatTypeOfConversation.js'; import { handleMultipleSendErrors, maybeExpandErrors, -} from './handleMultipleSendErrors'; +} from './handleMultipleSendErrors.js'; -import type { ConversationModel } from '../../models/conversations'; +import type { ConversationModel } from '../../models/conversations.js'; import type { ConversationQueueJobBundle, ResendRequestJobData, -} from '../conversationJobQueue'; -import { isConversationUnregistered } from '../../util/isConversationUnregistered'; +} from '../conversationJobQueue.js'; +import { isConversationUnregistered } from '../../util/isConversationUnregistered.js'; import { OutgoingIdentityKeyError, UnregisteredUserError, -} from '../../textsecure/Errors'; -import { drop } from '../../util/drop'; -import { strictAssert } from '../../util/assert'; -import type { DecryptionErrorEventData } from '../../textsecure/messageReceiverEvents'; -import type { LoggerType } from '../../types/Logging'; -import { startAutomaticSessionReset } from '../../util/handleRetry'; -import * as Bytes from '../../Bytes'; +} from '../../textsecure/Errors.js'; +import { drop } from '../../util/drop.js'; +import { strictAssert } from '../../util/assert.js'; +import type { DecryptionErrorEventData } from '../../textsecure/messageReceiverEvents.js'; +import type { LoggerType } from '../../types/Logging.js'; +import { startAutomaticSessionReset } from '../../util/handleRetry.js'; +import * as Bytes from '../../Bytes.js'; function failoverToLocalReset( logger: LoggerType, diff --git a/ts/jobs/helpers/sendSavedProto.ts b/ts/jobs/helpers/sendSavedProto.ts index c7e01699f2a..924682df575 100644 --- a/ts/jobs/helpers/sendSavedProto.ts +++ b/ts/jobs/helpers/sendSavedProto.ts @@ -1,26 +1,26 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { handleMessageSend } from '../../util/handleMessageSend'; -import { getSendOptions } from '../../util/getSendOptions'; -import { isDirectConversation } from '../../util/whatTypeOfConversation'; -import { SignalService as Proto } from '../../protobuf'; +import { handleMessageSend } from '../../util/handleMessageSend.js'; +import { getSendOptions } from '../../util/getSendOptions.js'; +import { isDirectConversation } from '../../util/whatTypeOfConversation.js'; +import { SignalService as Proto } from '../../protobuf/index.js'; import { handleMultipleSendErrors, maybeExpandErrors, -} from './handleMultipleSendErrors'; +} from './handleMultipleSendErrors.js'; -import type { ConversationModel } from '../../models/conversations'; +import type { ConversationModel } from '../../models/conversations.js'; import type { ConversationQueueJobBundle, SavedProtoJobData, -} from '../conversationJobQueue'; -import { isConversationUnregistered } from '../../util/isConversationUnregistered'; +} from '../conversationJobQueue.js'; +import { isConversationUnregistered } from '../../util/isConversationUnregistered.js'; import { OutgoingIdentityKeyError, UnregisteredUserError, -} from '../../textsecure/Errors'; -import * as Bytes from '../../Bytes'; +} from '../../textsecure/Errors.js'; +import * as Bytes from '../../Bytes.js'; export async function sendSavedProto( conversation: ConversationModel, diff --git a/ts/jobs/helpers/sendSenderKeyDistribution.ts b/ts/jobs/helpers/sendSenderKeyDistribution.ts index 577b4336124..c83dc2e13ca 100644 --- a/ts/jobs/helpers/sendSenderKeyDistribution.ts +++ b/ts/jobs/helpers/sendSenderKeyDistribution.ts @@ -1,26 +1,26 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { handleMessageSend } from '../../util/handleMessageSend'; -import { getSendOptions } from '../../util/getSendOptions'; -import { isDirectConversation } from '../../util/whatTypeOfConversation'; +import { handleMessageSend } from '../../util/handleMessageSend.js'; +import { getSendOptions } from '../../util/getSendOptions.js'; +import { isDirectConversation } from '../../util/whatTypeOfConversation.js'; import { handleMultipleSendErrors, maybeExpandErrors, -} from './handleMultipleSendErrors'; +} from './handleMultipleSendErrors.js'; -import type { ConversationModel } from '../../models/conversations'; +import type { ConversationModel } from '../../models/conversations.js'; import type { ConversationQueueJobBundle, SenderKeyDistributionJobData, -} from '../conversationJobQueue'; -import { isConversationUnregistered } from '../../util/isConversationUnregistered'; +} from '../conversationJobQueue.js'; +import { isConversationUnregistered } from '../../util/isConversationUnregistered.js'; import { NoSenderKeyError, OutgoingIdentityKeyError, UnregisteredUserError, -} from '../../textsecure/Errors'; -import { shouldSendToConversation } from './shouldSendToConversation'; +} from '../../textsecure/Errors.js'; +import { shouldSendToConversation } from './shouldSendToConversation.js'; // Note: in regular scenarios, sender keys are sent as part of a group send. This job type // is only used in decryption error recovery scenarios. diff --git a/ts/jobs/helpers/sendStory.ts b/ts/jobs/helpers/sendStory.ts index f26b77fe73a..f14c5c099eb 100644 --- a/ts/jobs/helpers/sendStory.ts +++ b/ts/jobs/helpers/sendStory.ts @@ -4,49 +4,49 @@ import { isEqual } from 'lodash'; import { ContentHint } from '@signalapp/libsignal-client'; -import type { UploadedAttachmentType } from '../../types/Attachment'; -import type { ConversationModel } from '../../models/conversations'; +import type { UploadedAttachmentType } from '../../types/Attachment.js'; +import type { ConversationModel } from '../../models/conversations.js'; import type { ConversationQueueJobBundle, StoryJobData, -} from '../conversationJobQueue'; -import type { LoggerType } from '../../types/Logging'; -import type { MessageModel } from '../../models/messages'; +} from '../conversationJobQueue.js'; +import type { LoggerType } from '../../types/Logging.js'; +import type { MessageModel } from '../../models/messages.js'; import type { SendState, SendStateByConversationId, -} from '../../messages/MessageSendState'; +} from '../../messages/MessageSendState.js'; import { isSent, SendActionType, sendStateReducer, -} from '../../messages/MessageSendState'; -import type { ServiceIdString } from '../../types/ServiceId'; -import type { StoryDistributionIdString } from '../../types/StoryDistributionId'; -import * as Errors from '../../types/errors'; -import type { StoryMessageRecipientsType } from '../../types/Stories'; -import { DataReader } from '../../sql/Client'; -import { SignalService as Proto } from '../../protobuf'; -import { getMessagesById } from '../../messages/getMessagesById'; +} from '../../messages/MessageSendState.js'; +import type { ServiceIdString } from '../../types/ServiceId.js'; +import type { StoryDistributionIdString } from '../../types/StoryDistributionId.js'; +import * as Errors from '../../types/errors.js'; +import type { StoryMessageRecipientsType } from '../../types/Stories.js'; +import { DataReader } from '../../sql/Client.js'; +import { SignalService as Proto } from '../../protobuf/index.js'; +import { getMessagesById } from '../../messages/getMessagesById.js'; import { getSendOptions, getSendOptionsForRecipients, -} from '../../util/getSendOptions'; -import { handleMessageSend } from '../../util/handleMessageSend'; -import { handleMultipleSendErrors } from './handleMultipleSendErrors'; -import { isGroupV2, isMe } from '../../util/whatTypeOfConversation'; -import { ourProfileKeyService } from '../../services/ourProfileKey'; -import { sendContentMessageToGroup } from '../../util/sendToGroup'; -import { distributionListToSendTarget } from '../../util/distributionListToSendTarget'; -import { uploadAttachment } from '../../util/uploadAttachment'; -import { SendMessageChallengeError } from '../../textsecure/Errors'; -import type { OutgoingTextAttachmentType } from '../../textsecure/SendMessage'; +} from '../../util/getSendOptions.js'; +import { handleMessageSend } from '../../util/handleMessageSend.js'; +import { handleMultipleSendErrors } from './handleMultipleSendErrors.js'; +import { isGroupV2, isMe } from '../../util/whatTypeOfConversation.js'; +import { ourProfileKeyService } from '../../services/ourProfileKey.js'; +import { sendContentMessageToGroup } from '../../util/sendToGroup.js'; +import { distributionListToSendTarget } from '../../util/distributionListToSendTarget.js'; +import { uploadAttachment } from '../../util/uploadAttachment.js'; +import { SendMessageChallengeError } from '../../textsecure/Errors.js'; +import type { OutgoingTextAttachmentType } from '../../textsecure/SendMessage.js'; import { markFailed, notifyStorySendFailed, saveErrorsOnMessage, -} from '../../test-node/util/messageFailures'; -import { send } from '../../messages/send'; +} from '../../test-node/util/messageFailures.js'; +import { send } from '../../messages/send.js'; export async function sendStory( conversation: ConversationModel, diff --git a/ts/jobs/helpers/shouldSendToConversation.ts b/ts/jobs/helpers/shouldSendToConversation.ts index 8d78a2e84ae..899f454e8ed 100644 --- a/ts/jobs/helpers/shouldSendToConversation.ts +++ b/ts/jobs/helpers/shouldSendToConversation.ts @@ -1,12 +1,12 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationModel } from '../../models/conversations'; -import type { LoggerType } from '../../types/Logging'; -import { getRecipients } from '../../util/getRecipients'; -import { isConversationAccepted } from '../../util/isConversationAccepted'; -import { isSignalConversation } from '../../util/isSignalConversation'; -import { getUntrustedConversationServiceIds } from './getUntrustedConversationServiceIds'; +import type { ConversationModel } from '../../models/conversations.js'; +import type { LoggerType } from '../../types/Logging.js'; +import { getRecipients } from '../../util/getRecipients.js'; +import { isConversationAccepted } from '../../util/isConversationAccepted.js'; +import { isSignalConversation } from '../../util/isSignalConversation.js'; +import { getUntrustedConversationServiceIds } from './getUntrustedConversationServiceIds.js'; export function shouldSendToConversation( conversation: ConversationModel, diff --git a/ts/jobs/helpers/sleepForRateLimitRetryAfterTime.ts b/ts/jobs/helpers/sleepForRateLimitRetryAfterTime.ts index c868b53db66..a55e27ac8b8 100644 --- a/ts/jobs/helpers/sleepForRateLimitRetryAfterTime.ts +++ b/ts/jobs/helpers/sleepForRateLimitRetryAfterTime.ts @@ -1,9 +1,9 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { LoggerType } from '../../types/Logging'; -import { sleeper } from '../../util/sleeper'; -import { findRetryAfterTimeFromError } from './findRetryAfterTimeFromError'; +import type { LoggerType } from '../../types/Logging.js'; +import { sleeper } from '../../util/sleeper.js'; +import { findRetryAfterTimeFromError } from './findRetryAfterTimeFromError.js'; export async function sleepForRateLimitRetryAfterTime({ err, diff --git a/ts/jobs/helpers/syncHelpers.ts b/ts/jobs/helpers/syncHelpers.ts index d2ad61ec713..a57d4b7e5a1 100644 --- a/ts/jobs/helpers/syncHelpers.ts +++ b/ts/jobs/helpers/syncHelpers.ts @@ -2,20 +2,20 @@ // SPDX-License-Identifier: AGPL-3.0-only import { chunk } from 'lodash'; -import type { LoggerType } from '../../types/Logging'; -import type { AciString } from '../../types/ServiceId'; -import { normalizeAci } from '../../util/normalizeAci'; -import { getSendOptions } from '../../util/getSendOptions'; -import type { SendTypesType } from '../../util/handleMessageSend'; -import { handleMessageSend } from '../../util/handleMessageSend'; -import { isNotNil } from '../../util/isNotNil'; -import { strictAssert } from '../../util/assert'; -import { isRecord } from '../../util/isRecord'; +import type { LoggerType } from '../../types/Logging.js'; +import type { AciString } from '../../types/ServiceId.js'; +import { normalizeAci } from '../../util/normalizeAci.js'; +import { getSendOptions } from '../../util/getSendOptions.js'; +import type { SendTypesType } from '../../util/handleMessageSend.js'; +import { handleMessageSend } from '../../util/handleMessageSend.js'; +import { isNotNil } from '../../util/isNotNil.js'; +import { strictAssert } from '../../util/assert.js'; +import { isRecord } from '../../util/isRecord.js'; -import { commonShouldJobContinue } from './commonShouldJobContinue'; -import { handleCommonJobRequestError } from './handleCommonJobRequestError'; -import { missingCaseError } from '../../util/missingCaseError'; -import type SendMessage from '../../textsecure/SendMessage'; +import { commonShouldJobContinue } from './commonShouldJobContinue.js'; +import { handleCommonJobRequestError } from './handleCommonJobRequestError.js'; +import { missingCaseError } from '../../util/missingCaseError.js'; +import type SendMessage from '../../textsecure/SendMessage.js'; const CHUNK_SIZE = 100; diff --git a/ts/jobs/initializeAllJobQueues.ts b/ts/jobs/initializeAllJobQueues.ts index 1d170d045da..03da108fae5 100644 --- a/ts/jobs/initializeAllJobQueues.ts +++ b/ts/jobs/initializeAllJobQueues.ts @@ -1,20 +1,20 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { WebAPIType } from '../textsecure/WebAPI'; -import { drop } from '../util/drop'; -import { CallLinkFinalizeDeleteManager } from './CallLinkFinalizeDeleteManager'; -import { chatFolderCleanupService } from '../services/expiring/chatFolderCleanupService'; -import { callLinkRefreshJobQueue } from './callLinkRefreshJobQueue'; -import { conversationJobQueue } from './conversationJobQueue'; -import { deleteDownloadsJobQueue } from './deleteDownloadsJobQueue'; -import { groupAvatarJobQueue } from './groupAvatarJobQueue'; -import { readSyncJobQueue } from './readSyncJobQueue'; -import { removeStorageKeyJobQueue } from './removeStorageKeyJobQueue'; -import { reportSpamJobQueue } from './reportSpamJobQueue'; -import { singleProtoJobQueue } from './singleProtoJobQueue'; -import { viewOnceOpenJobQueue } from './viewOnceOpenJobQueue'; -import { viewSyncJobQueue } from './viewSyncJobQueue'; +import type { WebAPIType } from '../textsecure/WebAPI.js'; +import { drop } from '../util/drop.js'; +import { CallLinkFinalizeDeleteManager } from './CallLinkFinalizeDeleteManager.js'; +import { chatFolderCleanupService } from '../services/expiring/chatFolderCleanupService.js'; +import { callLinkRefreshJobQueue } from './callLinkRefreshJobQueue.js'; +import { conversationJobQueue } from './conversationJobQueue.js'; +import { deleteDownloadsJobQueue } from './deleteDownloadsJobQueue.js'; +import { groupAvatarJobQueue } from './groupAvatarJobQueue.js'; +import { readSyncJobQueue } from './readSyncJobQueue.js'; +import { removeStorageKeyJobQueue } from './removeStorageKeyJobQueue.js'; +import { reportSpamJobQueue } from './reportSpamJobQueue.js'; +import { singleProtoJobQueue } from './singleProtoJobQueue.js'; +import { viewOnceOpenJobQueue } from './viewOnceOpenJobQueue.js'; +import { viewSyncJobQueue } from './viewSyncJobQueue.js'; /** * Start all of the job queues. Should be called when the database is ready. diff --git a/ts/jobs/readSyncJobQueue.ts b/ts/jobs/readSyncJobQueue.ts index ef6f3470361..b8c3d6e42ce 100644 --- a/ts/jobs/readSyncJobQueue.ts +++ b/ts/jobs/readSyncJobQueue.ts @@ -1,21 +1,21 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import * as durations from '../util/durations'; -import type { LoggerType } from '../types/Logging'; -import { exponentialBackoffMaxAttempts } from '../util/exponentialBackoff'; -import type { SyncType } from './helpers/syncHelpers'; +import * as durations from '../util/durations/index.js'; +import type { LoggerType } from '../types/Logging.js'; +import { exponentialBackoffMaxAttempts } from '../util/exponentialBackoff.js'; +import type { SyncType } from './helpers/syncHelpers.js'; import { SyncTypeList, parseRawSyncDataArray, runSyncJob, -} from './helpers/syncHelpers'; -import { strictAssert } from '../util/assert'; -import { isRecord } from '../util/isRecord'; +} from './helpers/syncHelpers.js'; +import { strictAssert } from '../util/assert.js'; +import { isRecord } from '../util/isRecord.js'; -import type { JOB_STATUS } from './JobQueue'; -import { JobQueue } from './JobQueue'; -import { jobQueueDatabaseStore } from './JobQueueDatabaseStore'; +import type { JOB_STATUS } from './JobQueue.js'; +import { JobQueue } from './JobQueue.js'; +import { jobQueueDatabaseStore } from './JobQueueDatabaseStore.js'; const MAX_RETRY_TIME = durations.DAY; diff --git a/ts/jobs/removeStorageKeyJobQueue.ts b/ts/jobs/removeStorageKeyJobQueue.ts index 574c782d71e..9e37235a8d2 100644 --- a/ts/jobs/removeStorageKeyJobQueue.ts +++ b/ts/jobs/removeStorageKeyJobQueue.ts @@ -3,11 +3,11 @@ import { z } from 'zod'; -import type { JOB_STATUS } from './JobQueue'; -import { JobQueue } from './JobQueue'; +import type { JOB_STATUS } from './JobQueue.js'; +import { JobQueue } from './JobQueue.js'; -import { jobQueueDatabaseStore } from './JobQueueDatabaseStore'; -import { parseUnknown } from '../util/schemas'; +import { jobQueueDatabaseStore } from './JobQueueDatabaseStore.js'; +import { parseUnknown } from '../util/schemas.js'; const removeStorageKeyJobDataSchema = z.object({ key: z.enum([ diff --git a/ts/jobs/reportSpamJobQueue.ts b/ts/jobs/reportSpamJobQueue.ts index 897bf4e3ccf..914ebebb016 100644 --- a/ts/jobs/reportSpamJobQueue.ts +++ b/ts/jobs/reportSpamJobQueue.ts @@ -2,22 +2,22 @@ // SPDX-License-Identifier: AGPL-3.0-only import * as z from 'zod'; -import * as durations from '../util/durations'; -import { strictAssert } from '../util/assert'; -import { waitForOnline } from '../util/waitForOnline'; -import { isDone as isDeviceLinked } from '../util/registration'; -import type { LoggerType } from '../types/Logging'; -import { aciSchema } from '../types/ServiceId'; -import { map } from '../util/iterables'; +import * as durations from '../util/durations/index.js'; +import { strictAssert } from '../util/assert.js'; +import { waitForOnline } from '../util/waitForOnline.js'; +import { isDone as isDeviceLinked } from '../util/registration.js'; +import type { LoggerType } from '../types/Logging.js'; +import { aciSchema } from '../types/ServiceId.js'; +import { map } from '../util/iterables.js'; -import type { JOB_STATUS } from './JobQueue'; -import { JobQueue } from './JobQueue'; -import { jobQueueDatabaseStore } from './JobQueueDatabaseStore'; -import { parseIntWithFallback } from '../util/parseIntWithFallback'; -import type { WebAPIType } from '../textsecure/WebAPI'; -import { HTTPError } from '../textsecure/Errors'; -import { sleeper } from '../util/sleeper'; -import { parseUnknown } from '../util/schemas'; +import type { JOB_STATUS } from './JobQueue.js'; +import { JobQueue } from './JobQueue.js'; +import { jobQueueDatabaseStore } from './JobQueueDatabaseStore.js'; +import { parseIntWithFallback } from '../util/parseIntWithFallback.js'; +import type { WebAPIType } from '../textsecure/WebAPI.js'; +import { HTTPError } from '../textsecure/Errors.js'; +import { sleeper } from '../util/sleeper.js'; +import { parseUnknown } from '../util/schemas.js'; const RETRY_WAIT_TIME = durations.MINUTE; const RETRYABLE_4XX_FAILURE_STATUSES = new Set([ diff --git a/ts/jobs/singleProtoJobQueue.ts b/ts/jobs/singleProtoJobQueue.ts index 74ad5e91706..7ab4a18e405 100644 --- a/ts/jobs/singleProtoJobQueue.ts +++ b/ts/jobs/singleProtoJobQueue.ts @@ -4,27 +4,27 @@ import PQueue from 'p-queue'; import { isBoolean } from 'lodash'; -import * as Bytes from '../Bytes'; -import type { LoggerType } from '../types/Logging'; -import { exponentialBackoffMaxAttempts } from '../util/exponentialBackoff'; -import type { ParsedJob } from './types'; -import type { JOB_STATUS } from './JobQueue'; -import { JobQueue } from './JobQueue'; -import { jobQueueDatabaseStore } from './JobQueueDatabaseStore'; -import { DAY } from '../util/durations'; -import { commonShouldJobContinue } from './helpers/commonShouldJobContinue'; -import { SignalService as Proto } from '../protobuf'; -import { handleMessageSend } from '../util/handleMessageSend'; -import { getSendOptions } from '../util/getSendOptions'; -import type { SingleProtoJobData } from '../textsecure/SendMessage'; -import { singleProtoJobDataSchema } from '../textsecure/SendMessage'; +import * as Bytes from '../Bytes.js'; +import type { LoggerType } from '../types/Logging.js'; +import { exponentialBackoffMaxAttempts } from '../util/exponentialBackoff.js'; +import type { ParsedJob } from './types.js'; +import type { JOB_STATUS } from './JobQueue.js'; +import { JobQueue } from './JobQueue.js'; +import { jobQueueDatabaseStore } from './JobQueueDatabaseStore.js'; +import { DAY } from '../util/durations/index.js'; +import { commonShouldJobContinue } from './helpers/commonShouldJobContinue.js'; +import { SignalService as Proto } from '../protobuf/index.js'; +import { handleMessageSend } from '../util/handleMessageSend.js'; +import { getSendOptions } from '../util/getSendOptions.js'; +import type { SingleProtoJobData } from '../textsecure/SendMessage.js'; +import { singleProtoJobDataSchema } from '../textsecure/SendMessage.js'; import { handleMultipleSendErrors, maybeExpandErrors, -} from './helpers/handleMultipleSendErrors'; -import { isConversationUnregistered } from '../util/isConversationUnregistered'; -import { isConversationAccepted } from '../util/isConversationAccepted'; -import { parseUnknown } from '../util/schemas'; +} from './helpers/handleMultipleSendErrors.js'; +import { isConversationUnregistered } from '../util/isConversationUnregistered.js'; +import { isConversationAccepted } from '../util/isConversationAccepted.js'; +import { parseUnknown } from '../util/schemas.js'; const MAX_RETRY_TIME = DAY; const MAX_PARALLEL_JOBS = 5; diff --git a/ts/jobs/viewOnceOpenJobQueue.ts b/ts/jobs/viewOnceOpenJobQueue.ts index 7eb1653accd..4d66259609c 100644 --- a/ts/jobs/viewOnceOpenJobQueue.ts +++ b/ts/jobs/viewOnceOpenJobQueue.ts @@ -1,21 +1,21 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import * as durations from '../util/durations'; -import type { LoggerType } from '../types/Logging'; -import { exponentialBackoffMaxAttempts } from '../util/exponentialBackoff'; -import type { SyncType } from './helpers/syncHelpers'; +import * as durations from '../util/durations/index.js'; +import type { LoggerType } from '../types/Logging.js'; +import { exponentialBackoffMaxAttempts } from '../util/exponentialBackoff.js'; +import type { SyncType } from './helpers/syncHelpers.js'; import { SyncTypeList, parseRawSyncDataArray, runSyncJob, -} from './helpers/syncHelpers'; -import { strictAssert } from '../util/assert'; -import { isRecord } from '../util/isRecord'; +} from './helpers/syncHelpers.js'; +import { strictAssert } from '../util/assert.js'; +import { isRecord } from '../util/isRecord.js'; -import type { JOB_STATUS } from './JobQueue'; -import { JobQueue } from './JobQueue'; -import { jobQueueDatabaseStore } from './JobQueueDatabaseStore'; +import type { JOB_STATUS } from './JobQueue.js'; +import { JobQueue } from './JobQueue.js'; +import { jobQueueDatabaseStore } from './JobQueueDatabaseStore.js'; const MAX_RETRY_TIME = durations.DAY; diff --git a/ts/jobs/viewSyncJobQueue.ts b/ts/jobs/viewSyncJobQueue.ts index 840607d5f8d..5ed11109b97 100644 --- a/ts/jobs/viewSyncJobQueue.ts +++ b/ts/jobs/viewSyncJobQueue.ts @@ -1,21 +1,21 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import * as durations from '../util/durations'; -import type { LoggerType } from '../types/Logging'; -import { exponentialBackoffMaxAttempts } from '../util/exponentialBackoff'; -import type { SyncType } from './helpers/syncHelpers'; +import * as durations from '../util/durations/index.js'; +import type { LoggerType } from '../types/Logging.js'; +import { exponentialBackoffMaxAttempts } from '../util/exponentialBackoff.js'; +import type { SyncType } from './helpers/syncHelpers.js'; import { SyncTypeList, parseRawSyncDataArray, runSyncJob, -} from './helpers/syncHelpers'; -import { strictAssert } from '../util/assert'; -import { isRecord } from '../util/isRecord'; +} from './helpers/syncHelpers.js'; +import { strictAssert } from '../util/assert.js'; +import { isRecord } from '../util/isRecord.js'; -import type { JOB_STATUS } from './JobQueue'; -import { JobQueue } from './JobQueue'; -import { jobQueueDatabaseStore } from './JobQueueDatabaseStore'; +import type { JOB_STATUS } from './JobQueue.js'; +import { JobQueue } from './JobQueue.js'; +import { jobQueueDatabaseStore } from './JobQueueDatabaseStore.js'; const MAX_RETRY_TIME = durations.DAY; diff --git a/ts/linkPreviews/linkPreviewFetch.ts b/ts/linkPreviews/linkPreviewFetch.ts index 2a740e8ac4b..fcd1304c820 100644 --- a/ts/linkPreviews/linkPreviewFetch.ts +++ b/ts/linkPreviews/linkPreviewFetch.ts @@ -4,7 +4,7 @@ import type { RequestInit, Response } from 'node-fetch'; import { blobToArrayBuffer } from 'blob-util'; -import type { MIMEType } from '../types/MIME'; +import type { MIMEType } from '../types/MIME.js'; import { IMAGE_GIF, IMAGE_ICO, @@ -12,10 +12,10 @@ import { IMAGE_PNG, IMAGE_WEBP, stringToMIMEType, -} from '../types/MIME'; -import type { LoggerType } from '../types/Logging'; -import { scaleImageToLevel } from '../util/scaleImageToLevel'; -import { createLogger } from '../logging/log'; +} from '../types/MIME.js'; +import type { LoggerType } from '../types/Logging.js'; +import { scaleImageToLevel } from '../util/scaleImageToLevel.js'; +import { createLogger } from '../logging/log.js'; const log = createLogger('linkPreviewFetch'); diff --git a/ts/linkPreviews/shouldUseFullSizeLinkPreviewImage.ts b/ts/linkPreviews/shouldUseFullSizeLinkPreviewImage.ts index 6328caae75a..85de97635c4 100644 --- a/ts/linkPreviews/shouldUseFullSizeLinkPreviewImage.ts +++ b/ts/linkPreviews/shouldUseFullSizeLinkPreviewImage.ts @@ -1,8 +1,8 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { LinkPreviewType } from '../types/message/LinkPreviews'; -import { isImageAttachment } from '../types/Attachment'; +import type { LinkPreviewType } from '../types/message/LinkPreviews.js'; +import { isImageAttachment } from '../types/Attachment.js'; const MINIMUM_FULL_SIZE_DIMENSION = 200; diff --git a/ts/logging/debuglogs.ts b/ts/logging/debuglogs.ts index b588ffcaef4..c591197264d 100644 --- a/ts/logging/debuglogs.ts +++ b/ts/logging/debuglogs.ts @@ -2,17 +2,17 @@ // SPDX-License-Identifier: AGPL-3.0-only import { memoize, sortBy } from 'lodash'; -import { reallyJsonStringify } from '../util/reallyJsonStringify'; -import type { FetchLogIpcData, LogEntryType } from './shared'; +import { reallyJsonStringify } from '../util/reallyJsonStringify.js'; +import type { FetchLogIpcData, LogEntryType } from './shared.js'; import { LogLevel, getLogLevelString, isFetchLogIpcData, isLogEntry, levelMaxLength, -} from './shared'; -import { redactAll } from '../util/privacy'; -import { getEnvironment } from '../environment'; +} from './shared.js'; +import { redactAll } from '../util/privacy.js'; +import { getEnvironment } from '../environment.js'; // The mechanics of preparing a log for publish diff --git a/ts/logging/log.ts b/ts/logging/log.ts index fa390c55d78..a55712e5dbe 100644 --- a/ts/logging/log.ts +++ b/ts/logging/log.ts @@ -4,10 +4,10 @@ import pino from 'pino'; import { LRUCache } from 'lru-cache'; -import type { LoggerType } from '../types/Logging'; -import { Environment, getEnvironment } from '../environment'; -import { reallyJsonStringify } from '../util/reallyJsonStringify'; -import { getLogLevelString, type LogLevel } from './shared'; +import type { LoggerType } from '../types/Logging.js'; +import { Environment, getEnvironment } from '../environment.js'; +import { reallyJsonStringify } from '../util/reallyJsonStringify.js'; +import { getLogLevelString, type LogLevel } from './shared.js'; // This file is imported by some components so we can't import `ts/util/privacy` let redactAll = (value: string) => value; diff --git a/ts/logging/main_process_logging.ts b/ts/logging/main_process_logging.ts index b2f1e27f089..8d2d61ce212 100644 --- a/ts/logging/main_process_logging.ts +++ b/ts/logging/main_process_logging.ts @@ -18,19 +18,19 @@ import { writeFileSync, } from 'node:fs'; import { rm } from 'node:fs/promises'; -import { join } from 'path'; +import { join } from 'node:path'; import { read as readLastLines } from 'read-last-lines'; import split2 from 'split2'; -import type { LoggerType } from '../types/Logging'; -import * as Errors from '../types/errors'; -import { createRotatingPinoDest } from '../util/rotatingPinoDest'; -import { redactAll } from '../util/privacy'; +import type { LoggerType } from '../types/Logging.js'; +import * as Errors from '../types/errors.js'; +import { createRotatingPinoDest } from '../util/rotatingPinoDest.js'; +import { redactAll } from '../util/privacy.js'; -import { setPinoDestination, log } from './log'; +import { setPinoDestination, log } from './log.js'; -import type { FetchLogIpcData, LogEntryType } from './shared'; -import { LogLevel, isLogEntry } from './shared'; +import type { FetchLogIpcData, LogEntryType } from './shared.js'; +import { LogLevel, isLogEntry } from './shared.js'; const MAX_LOG_LINES = 10_000_000; diff --git a/ts/logging/set_up_renderer_logging.ts b/ts/logging/set_up_renderer_logging.ts index 26bf59769aa..69cf5b030d2 100644 --- a/ts/logging/set_up_renderer_logging.ts +++ b/ts/logging/set_up_renderer_logging.ts @@ -4,17 +4,17 @@ /* eslint-env node */ import { ipcRenderer as ipc } from 'electron'; -import * as path from 'path'; +import * as path from 'node:path'; import { initLogger, LogLevel as SignalClientLogLevel, } from '@signalapp/libsignal-client'; -import { setPinoDestination, log } from './log'; -import * as Errors from '../types/errors'; -import { createRotatingPinoDest } from '../util/rotatingPinoDest'; -import { redactAll } from '../util/privacy'; +import { setPinoDestination, log } from './log.js'; +import * as Errors from '../types/errors.js'; +import { createRotatingPinoDest } from '../util/rotatingPinoDest.js'; +import { redactAll } from '../util/privacy.js'; let isInitialized = false; let shouldRestart = false; diff --git a/ts/logging/shared.ts b/ts/logging/shared.ts index 07fb8227cc5..31dc3b74e72 100644 --- a/ts/logging/shared.ts +++ b/ts/logging/shared.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import pino from 'pino'; -import { isRecord } from '../util/isRecord'; -import { missingCaseError } from '../util/missingCaseError'; -import { LogLevel } from '../types/Logging'; +import { isRecord } from '../util/isRecord.js'; +import { missingCaseError } from '../util/missingCaseError.js'; +import { LogLevel } from '../types/Logging.js'; export { LogLevel }; diff --git a/ts/logging/uploadDebugLog.ts b/ts/logging/uploadDebugLog.ts index 650ec7003e1..2b193b41e7b 100644 --- a/ts/logging/uploadDebugLog.ts +++ b/ts/logging/uploadDebugLog.ts @@ -5,13 +5,13 @@ import type { Response } from 'got'; import { z } from 'zod'; import FormData from 'form-data'; import got from 'got'; -import { gzip } from 'zlib'; +import { gzip } from 'node:zlib'; import pify from 'pify'; -import { getUserAgent } from '../util/getUserAgent'; -import { maybeParseUrl } from '../util/url'; -import * as durations from '../util/durations'; -import type { LoggerType } from '../types/Logging'; -import { parseUnknown } from '../util/schemas'; +import { getUserAgent } from '../util/getUserAgent.js'; +import { maybeParseUrl } from '../util/url.js'; +import * as durations from '../util/durations/index.js'; +import type { LoggerType } from '../types/Logging.js'; +import { parseUnknown } from '../util/schemas.js'; const BASE_URL = 'https://debuglogs.org'; diff --git a/ts/main/NativeThemeNotifier.ts b/ts/main/NativeThemeNotifier.ts index 139646eba32..e488f4c1dc1 100644 --- a/ts/main/NativeThemeNotifier.ts +++ b/ts/main/NativeThemeNotifier.ts @@ -4,7 +4,7 @@ import type { BrowserWindow } from 'electron'; import { ipcMain as ipc, nativeTheme } from 'electron'; -import type { NativeThemeState } from '../types/NativeThemeNotifier.d'; +import type { NativeThemeState } from '../types/NativeThemeNotifier.d.ts'; function getState(): NativeThemeState { return { diff --git a/ts/main/challengeMain.ts b/ts/main/challengeMain.ts index 2619af23d0e..93a9fc7b328 100644 --- a/ts/main/challengeMain.ts +++ b/ts/main/challengeMain.ts @@ -4,8 +4,12 @@ import type { IpcMainEvent } from 'electron'; import { ipcMain as ipc } from 'electron'; -import { createLogger } from '../logging/log'; -import type { IPCRequest, IPCResponse, ChallengeResponse } from '../challenge'; +import { createLogger } from '../logging/log.js'; +import type { + IPCRequest, + IPCResponse, + ChallengeResponse, +} from '../challenge.js'; const log = createLogger('challengeMain'); diff --git a/ts/main/settingsChannel.ts b/ts/main/settingsChannel.ts index ee3203af099..249c9fe8d08 100644 --- a/ts/main/settingsChannel.ts +++ b/ts/main/settingsChannel.ts @@ -3,15 +3,15 @@ import type { BrowserWindow } from 'electron'; import { ipcMain as ipc, session } from 'electron'; -import { EventEmitter } from 'events'; +import { EventEmitter } from 'node:events'; -import { createLogger } from '../logging/log'; -import { userConfig } from '../../app/user_config'; -import { ephemeralConfig } from '../../app/ephemeral_config'; -import { installPermissionsHandler } from '../../app/permissions'; -import { strictAssert } from '../util/assert'; +import { createLogger } from '../logging/log.js'; +import { userConfig } from '../../app/user_config.js'; +import { ephemeralConfig } from '../../app/ephemeral_config.js'; +import { installPermissionsHandler } from '../../app/permissions.js'; +import { strictAssert } from '../util/assert.js'; -import type { EphemeralSettings } from '../util/preload'; +import type { EphemeralSettings } from '../util/preload.js'; const log = createLogger('settingsChannel'); diff --git a/ts/mediaEditor/MediaEditorFabricAnalogTimeSticker.ts b/ts/mediaEditor/MediaEditorFabricAnalogTimeSticker.ts index 30ae2f2472f..0f4653c45d5 100644 --- a/ts/mediaEditor/MediaEditorFabricAnalogTimeSticker.ts +++ b/ts/mediaEditor/MediaEditorFabricAnalogTimeSticker.ts @@ -3,10 +3,10 @@ import { get } from 'lodash'; import { fabric } from 'fabric'; -import { customFabricObjectControls } from './util/customFabricObjectControls'; -import { getAnalogTime } from '../util/getAnalogTime'; -import { strictAssert } from '../util/assert'; -import { moreStyles } from './util/moreStyles'; +import { customFabricObjectControls } from './util/customFabricObjectControls.js'; +import { getAnalogTime } from '../util/getAnalogTime.js'; +import { strictAssert } from '../util/assert.js'; +import { moreStyles } from './util/moreStyles.js'; export enum AnalogClockStickerStyle { Arabic = 'Arabic', diff --git a/ts/mediaEditor/MediaEditorFabricCropRect.ts b/ts/mediaEditor/MediaEditorFabricCropRect.ts index 6e282bd608f..8f89748ae25 100644 --- a/ts/mediaEditor/MediaEditorFabricCropRect.ts +++ b/ts/mediaEditor/MediaEditorFabricCropRect.ts @@ -3,7 +3,7 @@ import { fabric } from 'fabric'; import { clamp } from 'lodash'; -import { strictAssert } from '../util/assert'; +import { strictAssert } from '../util/assert.js'; export class MediaEditorFabricCropRect extends fabric.Rect { static PADDING = 4; diff --git a/ts/mediaEditor/MediaEditorFabricDigitalTimeSticker.ts b/ts/mediaEditor/MediaEditorFabricDigitalTimeSticker.ts index 0ac3d2358ec..d2c68bbdd42 100644 --- a/ts/mediaEditor/MediaEditorFabricDigitalTimeSticker.ts +++ b/ts/mediaEditor/MediaEditorFabricDigitalTimeSticker.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import { fabric } from 'fabric'; -import { customFabricObjectControls } from './util/customFabricObjectControls'; -import { moreStyles } from './util/moreStyles'; -import { getDateTimeFormatter } from '../util/formatTimestamp'; +import { customFabricObjectControls } from './util/customFabricObjectControls.js'; +import { moreStyles } from './util/moreStyles.js'; +import { getDateTimeFormatter } from '../util/formatTimestamp.js'; export enum DigitalClockStickerStyle { White = 'White', diff --git a/ts/mediaEditor/MediaEditorFabricIText.ts b/ts/mediaEditor/MediaEditorFabricIText.ts index 32a92704c81..eb3e04d1a03 100644 --- a/ts/mediaEditor/MediaEditorFabricIText.ts +++ b/ts/mediaEditor/MediaEditorFabricIText.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { fabric } from 'fabric'; -import { customFabricObjectControls } from './util/customFabricObjectControls'; +import { customFabricObjectControls } from './util/customFabricObjectControls.js'; export class MediaEditorFabricIText extends fabric.IText { constructor(text: string, options: fabric.ITextOptions) { diff --git a/ts/mediaEditor/MediaEditorFabricPencilBrush.ts b/ts/mediaEditor/MediaEditorFabricPencilBrush.ts index 7caa5f7ed9b..d68d88dd138 100644 --- a/ts/mediaEditor/MediaEditorFabricPencilBrush.ts +++ b/ts/mediaEditor/MediaEditorFabricPencilBrush.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { fabric } from 'fabric'; -import { MediaEditorFabricPath } from './MediaEditorFabricPath'; +import { MediaEditorFabricPath } from './MediaEditorFabricPath.js'; export class MediaEditorFabricPencilBrush extends fabric.PencilBrush { public strokeMiterLimit: undefined | number; diff --git a/ts/mediaEditor/MediaEditorFabricSticker.ts b/ts/mediaEditor/MediaEditorFabricSticker.ts index 0f89e7b9dbb..d7db7b5e9bd 100644 --- a/ts/mediaEditor/MediaEditorFabricSticker.ts +++ b/ts/mediaEditor/MediaEditorFabricSticker.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import { fabric } from 'fabric'; -import { loadImage } from '../util/loadImage'; -import { customFabricObjectControls } from './util/customFabricObjectControls'; +import { loadImage } from '../util/loadImage.js'; +import { customFabricObjectControls } from './util/customFabricObjectControls.js'; export class MediaEditorFabricSticker extends fabric.Image { constructor( diff --git a/ts/mediaEditor/useFabricHistory.ts b/ts/mediaEditor/useFabricHistory.ts index 700d95e9bdc..2f539040eba 100644 --- a/ts/mediaEditor/useFabricHistory.ts +++ b/ts/mediaEditor/useFabricHistory.ts @@ -4,16 +4,16 @@ import { useCallback, useEffect, useState } from 'react'; import { fabric } from 'fabric'; -import { createLogger } from '../logging/log'; +import { createLogger } from '../logging/log.js'; -import type { ImageStateType } from './ImageStateType'; -import { MediaEditorFabricAnalogTimeSticker } from './MediaEditorFabricAnalogTimeSticker'; -import { MediaEditorFabricDigitalTimeSticker } from './MediaEditorFabricDigitalTimeSticker'; -import { MediaEditorFabricIText } from './MediaEditorFabricIText'; -import { MediaEditorFabricPath } from './MediaEditorFabricPath'; -import { MediaEditorFabricSticker } from './MediaEditorFabricSticker'; -import { fabricEffectListener } from './fabricEffectListener'; -import { strictAssert } from '../util/assert'; +import type { ImageStateType } from './ImageStateType.js'; +import { MediaEditorFabricAnalogTimeSticker } from './MediaEditorFabricAnalogTimeSticker.js'; +import { MediaEditorFabricDigitalTimeSticker } from './MediaEditorFabricDigitalTimeSticker.js'; +import { MediaEditorFabricIText } from './MediaEditorFabricIText.js'; +import { MediaEditorFabricPath } from './MediaEditorFabricPath.js'; +import { MediaEditorFabricSticker } from './MediaEditorFabricSticker.js'; +import { fabricEffectListener } from './fabricEffectListener.js'; +import { strictAssert } from '../util/assert.js'; const log = createLogger('useFabricHistory'); diff --git a/ts/mediaEditor/util/color.ts b/ts/mediaEditor/util/color.ts index f0264914b24..fbfaac6e33b 100644 --- a/ts/mediaEditor/util/color.ts +++ b/ts/mediaEditor/util/color.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { hslToRGB } from '../../util/hslToRGB'; +import { hslToRGB } from '../../util/hslToRGB.js'; function getRatio(min: number, max: number, value: number) { return (value - min) / (max - min); diff --git a/ts/mediaEditor/util/getTextStyleAttributes.ts b/ts/mediaEditor/util/getTextStyleAttributes.ts index b24a4e2f138..2a0cb839949 100644 --- a/ts/mediaEditor/util/getTextStyleAttributes.ts +++ b/ts/mediaEditor/util/getTextStyleAttributes.ts @@ -1,10 +1,10 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../../logging/log'; -import { getHSL } from './color'; -import { missingCaseError } from '../../util/missingCaseError'; -import { toLogFormat } from '../../types/errors'; +import { createLogger } from '../../logging/log.js'; +import { getHSL } from './color.js'; +import { missingCaseError } from '../../util/missingCaseError.js'; +import { toLogFormat } from '../../types/errors.js'; const log = createLogger('getTextStyleAttributes'); diff --git a/ts/messageModifiers/AttachmentDownloads.ts b/ts/messageModifiers/AttachmentDownloads.ts index 3531f50b37b..b33a9fc0454 100644 --- a/ts/messageModifiers/AttachmentDownloads.ts +++ b/ts/messageModifiers/AttachmentDownloads.ts @@ -1,17 +1,17 @@ // Copyright 2019 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import { omit } from 'lodash'; -import { createLogger } from '../logging/log'; -import * as Bytes from '../Bytes'; -import type { AttachmentDownloadJobTypeType } from '../types/AttachmentDownload'; +import { createLogger } from '../logging/log.js'; +import * as Bytes from '../Bytes.js'; +import type { AttachmentDownloadJobTypeType } from '../types/AttachmentDownload.js'; -import type { AttachmentType } from '../types/Attachment'; +import type { AttachmentType } from '../types/Attachment.js'; import { doAttachmentsOnSameMessageMatch, isDownloaded, -} from '../types/Attachment'; -import { getMessageById } from '../messages/getMessageById'; -import { trimMessageWhitespace } from '../types/BodyRange'; +} from '../types/Attachment.js'; +import { getMessageById } from '../messages/getMessageById.js'; +import { trimMessageWhitespace } from '../types/BodyRange.js'; const log = createLogger('AttachmentDownloads'); diff --git a/ts/messageModifiers/Deletes.ts b/ts/messageModifiers/Deletes.ts index 5edad7c15d6..867fd283489 100644 --- a/ts/messageModifiers/Deletes.ts +++ b/ts/messageModifiers/Deletes.ts @@ -1,15 +1,15 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { MessageAttributesType } from '../model-types.d'; -import { getAuthorId } from '../messages/helpers'; -import { DataReader } from '../sql/Client'; -import { createLogger } from '../logging/log'; -import * as Errors from '../types/errors'; -import { deleteForEveryone } from '../util/deleteForEveryone'; -import { drop } from '../util/drop'; -import { getMessageSentTimestampSet } from '../util/getMessageSentTimestampSet'; -import { MessageModel } from '../models/messages'; +import type { MessageAttributesType } from '../model-types.d.ts'; +import { getAuthorId } from '../messages/helpers.js'; +import { DataReader } from '../sql/Client.js'; +import { createLogger } from '../logging/log.js'; +import * as Errors from '../types/errors.js'; +import { deleteForEveryone } from '../util/deleteForEveryone.js'; +import { drop } from '../util/drop.js'; +import { getMessageSentTimestampSet } from '../util/getMessageSentTimestampSet.js'; +import { MessageModel } from '../models/messages.js'; const log = createLogger('Deletes'); diff --git a/ts/messageModifiers/DeletesForMe.ts b/ts/messageModifiers/DeletesForMe.ts index 3e0d9a388ef..27b772bc522 100644 --- a/ts/messageModifiers/DeletesForMe.ts +++ b/ts/messageModifiers/DeletesForMe.ts @@ -1,26 +1,26 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log'; -import * as Errors from '../types/errors'; -import { drop } from '../util/drop'; -import { getMessageSentTimestampSet } from '../util/getMessageSentTimestampSet'; +import { createLogger } from '../logging/log.js'; +import * as Errors from '../types/errors.js'; +import { drop } from '../util/drop.js'; +import { getMessageSentTimestampSet } from '../util/getMessageSentTimestampSet.js'; -import type { MessageAttributesType } from '../model-types'; +import type { MessageAttributesType } from '../model-types.js'; import type { ConversationIdentifier, AddressableMessage, -} from '../textsecure/messageReceiverEvents'; +} from '../textsecure/messageReceiverEvents.js'; import { deleteAttachmentFromMessage, deleteMessage, -} from '../util/deleteForMe'; +} from '../util/deleteForMe.js'; import { doesMessageMatch, getConversationFromTarget, getMessageQueryFromTarget, -} from '../util/syncIdentifiers'; -import { DataWriter } from '../sql/Client'; +} from '../util/syncIdentifiers.js'; +import { DataWriter } from '../sql/Client.js'; const log = createLogger('DeletesForMe'); diff --git a/ts/messageModifiers/Edits.ts b/ts/messageModifiers/Edits.ts index afdea844bf1..7e3262ae697 100644 --- a/ts/messageModifiers/Edits.ts +++ b/ts/messageModifiers/Edits.ts @@ -1,19 +1,19 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { MessageAttributesType } from '../model-types.d'; -import * as Errors from '../types/errors'; -import { createLogger } from '../logging/log'; -import { DataReader } from '../sql/Client'; -import { drop } from '../util/drop'; -import { getAuthorId } from '../messages/helpers'; -import { handleEditMessage } from '../util/handleEditMessage'; -import { getMessageSentTimestamp } from '../util/getMessageSentTimestamp'; +import type { MessageAttributesType } from '../model-types.d.ts'; +import * as Errors from '../types/errors.js'; +import { createLogger } from '../logging/log.js'; +import { DataReader } from '../sql/Client.js'; +import { drop } from '../util/drop.js'; +import { getAuthorId } from '../messages/helpers.js'; +import { handleEditMessage } from '../util/handleEditMessage.js'; +import { getMessageSentTimestamp } from '../util/getMessageSentTimestamp.js'; import { isAttachmentDownloadQueueEmpty, registerQueueEmptyCallback, -} from '../util/attachmentDownloadQueue'; -import { MessageModel } from '../models/messages'; +} from '../util/attachmentDownloadQueue.js'; +import { MessageModel } from '../models/messages.js'; const log = createLogger('Edits'); diff --git a/ts/messageModifiers/MessageReceipts.ts b/ts/messageModifiers/MessageReceipts.ts index faeee892b60..1f598d022a1 100644 --- a/ts/messageModifiers/MessageReceipts.ts +++ b/ts/messageModifiers/MessageReceipts.ts @@ -7,34 +7,34 @@ import { groupBy } from 'lodash'; import type { MessageAttributesType, ReadonlyMessageAttributesType, -} from '../model-types.d'; -import type { SendStateByConversationId } from '../messages/MessageSendState'; -import { isOutgoing, isStory } from '../state/selectors/message'; -import { getOwn } from '../util/getOwn'; -import { missingCaseError } from '../util/missingCaseError'; -import { createWaitBatcher } from '../util/waitBatcher'; -import { isServiceIdString } from '../types/ServiceId'; +} from '../model-types.d.ts'; +import type { SendStateByConversationId } from '../messages/MessageSendState.js'; +import { isOutgoing, isStory } from '../state/selectors/message.js'; +import { getOwn } from '../util/getOwn.js'; +import { missingCaseError } from '../util/missingCaseError.js'; +import { createWaitBatcher } from '../util/waitBatcher.js'; +import { isServiceIdString } from '../types/ServiceId.js'; import { SendActionType, SendStatus, UNDELIVERED_SEND_STATUSES, sendStateReducer, -} from '../messages/MessageSendState'; -import { DataReader, DataWriter } from '../sql/Client'; -import type { DeleteSentProtoRecipientOptionsType } from '../sql/Interface'; -import { createLogger } from '../logging/log'; -import { getSourceServiceId } from '../messages/helpers'; -import { getMessageSentTimestamp } from '../util/getMessageSentTimestamp'; -import { getMessageIdForLogging } from '../util/idForLogging'; -import { getPropForTimestamp } from '../util/editHelpers'; +} from '../messages/MessageSendState.js'; +import { DataReader, DataWriter } from '../sql/Client.js'; +import type { DeleteSentProtoRecipientOptionsType } from '../sql/Interface.js'; +import { createLogger } from '../logging/log.js'; +import { getSourceServiceId } from '../messages/helpers.js'; +import { getMessageSentTimestamp } from '../util/getMessageSentTimestamp.js'; +import { getMessageIdForLogging } from '../util/idForLogging.js'; +import { getPropForTimestamp } from '../util/editHelpers.js'; import { DELETE_SENT_PROTO_BATCHER_WAIT_MS, RECEIPT_BATCHER_WAIT_MS, -} from '../types/Receipt'; -import { drop } from '../util/drop'; -import { getMessageById } from '../messages/getMessageById'; -import { MessageModel } from '../models/messages'; -import { areStoryViewReceiptsEnabled } from '../types/Stories'; +} from '../types/Receipt.js'; +import { drop } from '../util/drop.js'; +import { getMessageById } from '../messages/getMessageById.js'; +import { MessageModel } from '../models/messages.js'; +import { areStoryViewReceiptsEnabled } from '../types/Stories.js'; const log = createLogger('MessageReceipts'); diff --git a/ts/messageModifiers/MessageRequests.ts b/ts/messageModifiers/MessageRequests.ts index b392e688509..97ff4323387 100644 --- a/ts/messageModifiers/MessageRequests.ts +++ b/ts/messageModifiers/MessageRequests.ts @@ -1,13 +1,13 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AciString } from '../types/ServiceId'; -import type { ConversationModel } from '../models/conversations'; -import * as Errors from '../types/errors'; -import { createLogger } from '../logging/log'; -import { drop } from '../util/drop'; -import { getConversationIdForLogging } from '../util/idForLogging'; -import type { MessageRequestResponseSource } from '../types/MessageRequestResponseEvent'; +import type { AciString } from '../types/ServiceId.js'; +import type { ConversationModel } from '../models/conversations.js'; +import * as Errors from '../types/errors.js'; +import { createLogger } from '../logging/log.js'; +import { drop } from '../util/drop.js'; +import { getConversationIdForLogging } from '../util/idForLogging.js'; +import type { MessageRequestResponseSource } from '../types/MessageRequestResponseEvent.js'; const log = createLogger('MessageRequests'); diff --git a/ts/messageModifiers/Reactions.ts b/ts/messageModifiers/Reactions.ts index 249525bfa1f..98b7a31e1d2 100644 --- a/ts/messageModifiers/Reactions.ts +++ b/ts/messageModifiers/Reactions.ts @@ -3,48 +3,48 @@ import { maxBy } from 'lodash'; -import type { AciString } from '../types/ServiceId'; +import type { AciString } from '../types/ServiceId.js'; import type { MessageAttributesType, MessageReactionType, ReadonlyMessageAttributesType, -} from '../model-types.d'; -import { MessageModel } from '../models/messages'; -import { ReactionSource } from '../reactions/ReactionSource'; -import { DataReader, DataWriter } from '../sql/Client'; -import * as Errors from '../types/errors'; -import { createLogger } from '../logging/log'; +} from '../model-types.d.ts'; +import { MessageModel } from '../models/messages.js'; +import { ReactionSource } from '../reactions/ReactionSource.js'; +import { DataReader, DataWriter } from '../sql/Client.js'; +import * as Errors from '../types/errors.js'; +import { createLogger } from '../logging/log.js'; import { getAuthor, isIncoming, isIncomingStory, isOutgoing, isOutgoingStory, -} from '../messages/helpers'; -import { getMessageSentTimestampSet } from '../util/getMessageSentTimestampSet'; -import { isDirectConversation, isMe } from '../util/whatTypeOfConversation'; +} from '../messages/helpers.js'; +import { getMessageSentTimestampSet } from '../util/getMessageSentTimestampSet.js'; +import { isDirectConversation, isMe } from '../util/whatTypeOfConversation.js'; import { getMessagePropStatus, hasErrors, isStory, -} from '../state/selectors/message'; -import { getPropForTimestamp } from '../util/editHelpers'; -import { isSent } from '../messages/MessageSendState'; -import { strictAssert } from '../util/assert'; -import { repeat, zipObject } from '../util/iterables'; -import { getMessageIdForLogging } from '../util/idForLogging'; -import { hydrateStoryContext } from '../util/hydrateStoryContext'; -import { drop } from '../util/drop'; -import * as reactionUtil from '../reactions/util'; -import { isNewReactionReplacingPrevious } from '../reactions/util'; -import { notificationService } from '../services/notifications'; -import { ReactionReadStatus } from '../types/Reactions'; -import type { ConversationQueueJobData } from '../jobs/conversationJobQueue'; +} from '../state/selectors/message.js'; +import { getPropForTimestamp } from '../util/editHelpers.js'; +import { isSent } from '../messages/MessageSendState.js'; +import { strictAssert } from '../util/assert.js'; +import { repeat, zipObject } from '../util/iterables.js'; +import { getMessageIdForLogging } from '../util/idForLogging.js'; +import { hydrateStoryContext } from '../util/hydrateStoryContext.js'; +import { drop } from '../util/drop.js'; +import * as reactionUtil from '../reactions/util.js'; +import { isNewReactionReplacingPrevious } from '../reactions/util.js'; +import { notificationService } from '../services/notifications.js'; +import { ReactionReadStatus } from '../types/Reactions.js'; +import type { ConversationQueueJobData } from '../jobs/conversationJobQueue.js'; import { conversationJobQueue, conversationQueueJobEnum, -} from '../jobs/conversationJobQueue'; -import { maybeNotify } from '../messages/maybeNotify'; +} from '../jobs/conversationJobQueue.js'; +import { maybeNotify } from '../messages/maybeNotify.js'; const log = createLogger('Reactions'); diff --git a/ts/messageModifiers/ReadSyncs.ts b/ts/messageModifiers/ReadSyncs.ts index 6043864c629..c26387dbe51 100644 --- a/ts/messageModifiers/ReadSyncs.ts +++ b/ts/messageModifiers/ReadSyncs.ts @@ -3,22 +3,22 @@ import { z } from 'zod'; -import type { ReadonlyMessageAttributesType } from '../model-types.d'; -import * as Errors from '../types/errors'; -import { createLogger } from '../logging/log'; -import { StartupQueue } from '../util/StartupQueue'; -import { drop } from '../util/drop'; -import { getMessageIdForLogging } from '../util/idForLogging'; -import { getMessageSentTimestamp } from '../util/getMessageSentTimestamp'; -import { isIncoming } from '../state/selectors/message'; -import { isMessageUnread } from '../util/isMessageUnread'; -import { notificationService } from '../services/notifications'; -import { queueUpdateMessage } from '../util/messageBatcher'; -import { strictAssert } from '../util/assert'; -import { isAciString } from '../util/isAciString'; -import { DataReader, DataWriter } from '../sql/Client'; -import { markRead } from '../services/MessageUpdater'; -import { MessageModel } from '../models/messages'; +import type { ReadonlyMessageAttributesType } from '../model-types.d.ts'; +import * as Errors from '../types/errors.js'; +import { createLogger } from '../logging/log.js'; +import { StartupQueue } from '../util/StartupQueue.js'; +import { drop } from '../util/drop.js'; +import { getMessageIdForLogging } from '../util/idForLogging.js'; +import { getMessageSentTimestamp } from '../util/getMessageSentTimestamp.js'; +import { isIncoming } from '../state/selectors/message.js'; +import { isMessageUnread } from '../util/isMessageUnread.js'; +import { notificationService } from '../services/notifications.js'; +import { queueUpdateMessage } from '../util/messageBatcher.js'; +import { strictAssert } from '../util/assert.js'; +import { isAciString } from '../util/isAciString.js'; +import { DataReader, DataWriter } from '../sql/Client.js'; +import { markRead } from '../services/MessageUpdater.js'; +import { MessageModel } from '../models/messages.js'; const log = createLogger('ReadSyncs'); diff --git a/ts/messageModifiers/ViewOnceOpenSyncs.ts b/ts/messageModifiers/ViewOnceOpenSyncs.ts index 07dbed93f97..1b2f1465421 100644 --- a/ts/messageModifiers/ViewOnceOpenSyncs.ts +++ b/ts/messageModifiers/ViewOnceOpenSyncs.ts @@ -1,14 +1,14 @@ // Copyright 2019 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AciString } from '../types/ServiceId'; -import type { ReadonlyMessageAttributesType } from '../model-types.d'; -import { DataReader } from '../sql/Client'; -import * as Errors from '../types/errors'; -import { createLogger } from '../logging/log'; -import { getMessageIdForLogging } from '../util/idForLogging'; -import { markViewOnceMessageViewed } from '../services/MessageUpdater'; -import { MessageModel } from '../models/messages'; +import type { AciString } from '../types/ServiceId.js'; +import type { ReadonlyMessageAttributesType } from '../model-types.d.ts'; +import { DataReader } from '../sql/Client.js'; +import * as Errors from '../types/errors.js'; +import { createLogger } from '../logging/log.js'; +import { getMessageIdForLogging } from '../util/idForLogging.js'; +import { markViewOnceMessageViewed } from '../services/MessageUpdater.js'; +import { MessageModel } from '../models/messages.js'; const log = createLogger('ViewOnceOpenSyncs'); diff --git a/ts/messageModifiers/ViewSyncs.ts b/ts/messageModifiers/ViewSyncs.ts index fc3c6f2534c..6e1e640f539 100644 --- a/ts/messageModifiers/ViewSyncs.ts +++ b/ts/messageModifiers/ViewSyncs.ts @@ -3,21 +3,21 @@ import { z } from 'zod'; -import type { ReadonlyMessageAttributesType } from '../model-types.d'; -import * as Errors from '../types/errors'; -import { createLogger } from '../logging/log'; -import { GiftBadgeStates } from '../components/conversation/Message'; -import { ReadStatus } from '../messages/MessageReadStatus'; -import { getMessageIdForLogging } from '../util/idForLogging'; -import { getMessageSentTimestamp } from '../util/getMessageSentTimestamp'; -import { isIncoming } from '../state/selectors/message'; -import { markViewed } from '../services/MessageUpdater'; -import { notificationService } from '../services/notifications'; -import { queueUpdateMessage } from '../util/messageBatcher'; -import { isAciString } from '../util/isAciString'; -import { DataReader, DataWriter } from '../sql/Client'; -import { MessageModel } from '../models/messages'; -import { drop } from '../util/drop'; +import type { ReadonlyMessageAttributesType } from '../model-types.d.ts'; +import * as Errors from '../types/errors.js'; +import { createLogger } from '../logging/log.js'; +import { GiftBadgeStates } from '../components/conversation/Message.js'; +import { ReadStatus } from '../messages/MessageReadStatus.js'; +import { getMessageIdForLogging } from '../util/idForLogging.js'; +import { getMessageSentTimestamp } from '../util/getMessageSentTimestamp.js'; +import { isIncoming } from '../state/selectors/message.js'; +import { markViewed } from '../services/MessageUpdater.js'; +import { notificationService } from '../services/notifications.js'; +import { queueUpdateMessage } from '../util/messageBatcher.js'; +import { isAciString } from '../util/isAciString.js'; +import { DataReader, DataWriter } from '../sql/Client.js'; +import { MessageModel } from '../models/messages.js'; +import { drop } from '../util/drop.js'; const log = createLogger('ViewSyncs'); diff --git a/ts/messages/MessageSendState.ts b/ts/messages/MessageSendState.ts index af6722f6ad4..d5c8c80ca8a 100644 --- a/ts/messages/MessageSendState.ts +++ b/ts/messages/MessageSendState.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import memoizee from 'memoizee'; -import { makeEnumParser } from '../util/enum'; +import { makeEnumParser } from '../util/enum.js'; /** * `SendStatus` represents the send status of a message to a single recipient. For diff --git a/ts/messages/copyQuote.ts b/ts/messages/copyQuote.ts index 27f4bb94d80..d7e9a8306a7 100644 --- a/ts/messages/copyQuote.ts +++ b/ts/messages/copyQuote.ts @@ -3,18 +3,18 @@ import { omit } from 'lodash'; -import { createLogger } from '../logging/log'; -import type { QuotedMessageType } from '../model-types'; -import { SignalService } from '../protobuf'; -import { isGiftBadge, isTapToView } from '../state/selectors/message'; -import type { ProcessedQuote } from '../textsecure/Types'; -import { IMAGE_JPEG } from '../types/MIME'; -import { strictAssert } from '../util/assert'; -import { getQuoteBodyText } from '../util/getQuoteBodyText'; -import { isQuoteAMatch, messageHasPaymentEvent } from './helpers'; -import * as Errors from '../types/errors'; -import type { MessageModel } from '../models/messages'; -import { isDownloadable } from '../types/Attachment'; +import { createLogger } from '../logging/log.js'; +import type { QuotedMessageType } from '../model-types.js'; +import { SignalService } from '../protobuf/index.js'; +import { isGiftBadge, isTapToView } from '../state/selectors/message.js'; +import type { ProcessedQuote } from '../textsecure/Types.js'; +import { IMAGE_JPEG } from '../types/MIME.js'; +import { strictAssert } from '../util/assert.js'; +import { getQuoteBodyText } from '../util/getQuoteBodyText.js'; +import { isQuoteAMatch, messageHasPaymentEvent } from './helpers.js'; +import * as Errors from '../types/errors.js'; +import type { MessageModel } from '../models/messages.js'; +import { isDownloadable } from '../types/Attachment.js'; const log = createLogger('copyQuote'); diff --git a/ts/messages/getMessageById.ts b/ts/messages/getMessageById.ts index c4a423f4813..1d9cb60988e 100644 --- a/ts/messages/getMessageById.ts +++ b/ts/messages/getMessageById.ts @@ -1,11 +1,11 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log'; -import * as Errors from '../types/errors'; -import { DataReader } from '../sql/Client'; -import { MessageModel } from '../models/messages'; -import type { MessageAttributesType } from '../model-types.d'; +import { createLogger } from '../logging/log.js'; +import * as Errors from '../types/errors.js'; +import { DataReader } from '../sql/Client.js'; +import { MessageModel } from '../models/messages.js'; +import type { MessageAttributesType } from '../model-types.d.ts'; const log = createLogger('getMessageById'); diff --git a/ts/messages/getMessagesById.ts b/ts/messages/getMessagesById.ts index 34f1fc4bcd7..381b5e89b4d 100644 --- a/ts/messages/getMessagesById.ts +++ b/ts/messages/getMessagesById.ts @@ -1,11 +1,11 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log'; -import { DataReader } from '../sql/Client'; -import { MessageModel } from '../models/messages'; -import type { MessageAttributesType } from '../model-types.d'; -import * as Errors from '../types/errors'; +import { createLogger } from '../logging/log.js'; +import { DataReader } from '../sql/Client.js'; +import { MessageModel } from '../models/messages.js'; +import type { MessageAttributesType } from '../model-types.d.ts'; +import * as Errors from '../types/errors.js'; const log = createLogger('getMessagesById'); diff --git a/ts/messages/handleDataMessage.ts b/ts/messages/handleDataMessage.ts index 2e14124c4d6..1648af076ba 100644 --- a/ts/messages/handleDataMessage.ts +++ b/ts/messages/handleDataMessage.ts @@ -3,28 +3,28 @@ import { isNumber } from 'lodash'; -import { createLogger } from '../logging/log'; -import * as Errors from '../types/errors'; -import * as LinkPreview from '../types/LinkPreview'; +import { createLogger } from '../logging/log.js'; +import * as Errors from '../types/errors.js'; +import * as LinkPreview from '../types/LinkPreview.js'; -import { getAuthor, isStory, messageHasPaymentEvent } from './helpers'; -import { getMessageIdForLogging } from '../util/idForLogging'; -import { getSenderIdentifier } from '../util/getSenderIdentifier'; -import { isNormalNumber } from '../util/isNormalNumber'; -import { getOwn } from '../util/getOwn'; +import { getAuthor, isStory, messageHasPaymentEvent } from './helpers.js'; +import { getMessageIdForLogging } from '../util/idForLogging.js'; +import { getSenderIdentifier } from '../util/getSenderIdentifier.js'; +import { isNormalNumber } from '../util/isNormalNumber.js'; +import { getOwn } from '../util/getOwn.js'; import { SendActionType, sendStateReducer, SendStatus, -} from './MessageSendState'; -import { DataReader, DataWriter } from '../sql/Client'; -import { eraseMessageContents } from '../util/cleanup'; +} from './MessageSendState.js'; +import { DataReader, DataWriter } from '../sql/Client.js'; +import { eraseMessageContents } from '../util/cleanup.js'; import { isDirectConversation, isGroup, isGroupV1, -} from '../util/whatTypeOfConversation'; -import { generateMessageId } from '../util/generateMessageId'; +} from '../util/whatTypeOfConversation.js'; +import { generateMessageId } from '../util/generateMessageId.js'; import { hasErrors, isEndSession, @@ -32,39 +32,39 @@ import { isGroupUpdate, isTapToView, isUnsupportedMessage, -} from '../state/selectors/message'; -import { drop } from '../util/drop'; -import { strictAssert } from '../util/assert'; -import { isAciString } from '../util/isAciString'; -import { copyFromQuotedMessage } from './copyQuote'; -import { findStoryMessages } from '../util/findStoryMessage'; -import { getRoomIdFromCallLink } from '../util/callLinksRingrtc'; -import { isNotNil } from '../util/isNotNil'; -import { normalizeServiceId } from '../types/ServiceId'; -import { BodyRange, trimMessageWhitespace } from '../types/BodyRange'; -import { hydrateStoryContext } from '../util/hydrateStoryContext'; -import { isMessageEmpty } from '../util/isMessageEmpty'; -import { isValidTapToView } from '../util/isValidTapToView'; -import { getNotificationTextForMessage } from '../util/getNotificationTextForMessage'; -import { getMessageAuthorText } from '../util/getMessageAuthorText'; -import { GiftBadgeStates } from '../components/conversation/Message'; -import { parseBoostBadgeListFromServer } from '../badges/parseBadgesFromServer'; -import { SignalService as Proto } from '../protobuf'; +} from '../state/selectors/message.js'; +import { drop } from '../util/drop.js'; +import { strictAssert } from '../util/assert.js'; +import { isAciString } from '../util/isAciString.js'; +import { copyFromQuotedMessage } from './copyQuote.js'; +import { findStoryMessages } from '../util/findStoryMessage.js'; +import { getRoomIdFromCallLink } from '../util/callLinksRingrtc.js'; +import { isNotNil } from '../util/isNotNil.js'; +import { normalizeServiceId } from '../types/ServiceId.js'; +import { BodyRange, trimMessageWhitespace } from '../types/BodyRange.js'; +import { hydrateStoryContext } from '../util/hydrateStoryContext.js'; +import { isMessageEmpty } from '../util/isMessageEmpty.js'; +import { isValidTapToView } from '../util/isValidTapToView.js'; +import { getNotificationTextForMessage } from '../util/getNotificationTextForMessage.js'; +import { getMessageAuthorText } from '../util/getMessageAuthorText.js'; +import { GiftBadgeStates } from '../components/conversation/Message.js'; +import { parseBoostBadgeListFromServer } from '../badges/parseBadgesFromServer.js'; +import { SignalService as Proto } from '../protobuf/index.js'; import { modifyTargetMessage, ModifyTargetMessageResult, -} from '../util/modifyTargetMessage'; -import { saveAndNotify } from './saveAndNotify'; -import { MessageModel } from '../models/messages'; +} from '../util/modifyTargetMessage.js'; +import { saveAndNotify } from './saveAndNotify.js'; +import { MessageModel } from '../models/messages.js'; -import type { SentEventData } from '../textsecure/messageReceiverEvents'; +import type { SentEventData } from '../textsecure/messageReceiverEvents.js'; import type { ProcessedDataMessage, ProcessedUnidentifiedDeliveryStatus, -} from '../textsecure/Types'; -import type { ServiceIdString } from '../types/ServiceId'; -import type { LinkPreviewType } from '../types/message/LinkPreviews'; -import { getCachedSubscriptionConfiguration } from '../util/subscriptionConfiguration'; +} from '../textsecure/Types.js'; +import type { ServiceIdString } from '../types/ServiceId.js'; +import type { LinkPreviewType } from '../types/message/LinkPreviews.js'; +import { getCachedSubscriptionConfiguration } from '../util/subscriptionConfiguration.js'; const log = createLogger('handleDataMessage'); diff --git a/ts/messages/helpers.ts b/ts/messages/helpers.ts index 9099f8bd87c..03941cc6267 100644 --- a/ts/messages/helpers.ts +++ b/ts/messages/helpers.ts @@ -3,20 +3,20 @@ import type { ReadonlyDeep } from 'type-fest'; -import { createLogger } from '../logging/log'; -import type { ConversationModel } from '../models/conversations'; +import { createLogger } from '../logging/log.js'; +import type { ConversationModel } from '../models/conversations.js'; import type { CustomError, ReadonlyMessageAttributesType, QuotedAttachmentType, QuotedMessageType, -} from '../model-types.d'; -import type { AciString, ServiceIdString } from '../types/ServiceId'; -import { PaymentEventKind } from '../types/Payment'; -import type { AnyPaymentEvent } from '../types/Payment'; -import type { LocalizerType } from '../types/Util'; -import { missingCaseError } from '../util/missingCaseError'; -import { isDownloaded } from '../types/Attachment'; +} from '../model-types.d.ts'; +import type { AciString, ServiceIdString } from '../types/ServiceId.js'; +import { PaymentEventKind } from '../types/Payment.js'; +import type { AnyPaymentEvent } from '../types/Payment.js'; +import type { LocalizerType } from '../types/Util.js'; +import { missingCaseError } from '../util/missingCaseError.js'; +import { isDownloaded } from '../types/Attachment.js'; const log = createLogger('helpers'); diff --git a/ts/messages/maybeNotify.ts b/ts/messages/maybeNotify.ts index 64d55e2b8e4..e0c5cad3de6 100644 --- a/ts/messages/maybeNotify.ts +++ b/ts/messages/maybeNotify.ts @@ -1,25 +1,25 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log'; +import { createLogger } from '../logging/log.js'; -import { getAuthor, isIncoming, isOutgoing } from './helpers'; +import { getAuthor, isIncoming, isOutgoing } from './helpers.js'; -import type { ConversationModel } from '../models/conversations'; -import { getActiveProfile } from '../state/selectors/notificationProfiles'; -import { shouldNotify as shouldNotifyDuringNotificationProfile } from '../types/NotificationProfile'; -import { isMessageUnread } from '../util/isMessageUnread'; -import { isDirectConversation } from '../util/whatTypeOfConversation'; -import { hasExpiration } from '../types/Message2'; +import type { ConversationModel } from '../models/conversations.js'; +import { getActiveProfile } from '../state/selectors/notificationProfiles.js'; +import { shouldNotify as shouldNotifyDuringNotificationProfile } from '../types/NotificationProfile.js'; +import { isMessageUnread } from '../util/isMessageUnread.js'; +import { isDirectConversation } from '../util/whatTypeOfConversation.js'; +import { hasExpiration } from '../types/Message2.js'; import { notificationService, NotificationType, -} from '../services/notifications'; -import { getNotificationTextForMessage } from '../util/getNotificationTextForMessage'; -import type { MessageAttributesType } from '../model-types'; -import type { ReactionAttributesType } from '../messageModifiers/Reactions'; -import { shouldStoryReplyNotifyUser } from '../util/shouldStoryReplyNotifyUser'; -import { ReactionSource } from '../reactions/ReactionSource'; +} from '../services/notifications.js'; +import { getNotificationTextForMessage } from '../util/getNotificationTextForMessage.js'; +import type { MessageAttributesType } from '../model-types.js'; +import type { ReactionAttributesType } from '../messageModifiers/Reactions.js'; +import { shouldStoryReplyNotifyUser } from '../util/shouldStoryReplyNotifyUser.js'; +import { ReactionSource } from '../reactions/ReactionSource.js'; const log = createLogger('maybeNotify'); diff --git a/ts/messages/migrateLegacyReadStatus.ts b/ts/messages/migrateLegacyReadStatus.ts index b09e6fd0f99..2ed488a7987 100644 --- a/ts/messages/migrateLegacyReadStatus.ts +++ b/ts/messages/migrateLegacyReadStatus.ts @@ -1,8 +1,8 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { MessageAttributesType } from '../model-types.d'; -import { ReadStatus } from './MessageReadStatus'; +import type { MessageAttributesType } from '../model-types.d.ts'; +import { ReadStatus } from './MessageReadStatus.js'; export function migrateLegacyReadStatus( message: Readonly> diff --git a/ts/messages/migrateLegacySendAttributes.ts b/ts/messages/migrateLegacySendAttributes.ts index 343e8f5c05f..20c7653fd70 100644 --- a/ts/messages/migrateLegacySendAttributes.ts +++ b/ts/messages/migrateLegacySendAttributes.ts @@ -2,16 +2,19 @@ // SPDX-License-Identifier: AGPL-3.0-only import { get, isEmpty } from 'lodash'; -import { getOwn } from '../util/getOwn'; -import { map, concat, repeat, zipObject } from '../util/iterables'; -import { isOutgoing } from '../state/selectors/message'; -import type { MessageAttributesType } from '../model-types.d'; -import type { SendState, SendStateByConversationId } from './MessageSendState'; +import { getOwn } from '../util/getOwn.js'; +import { map, concat, repeat, zipObject } from '../util/iterables.js'; +import { isOutgoing } from '../state/selectors/message.js'; +import type { MessageAttributesType } from '../model-types.d.ts'; +import type { + SendState, + SendStateByConversationId, +} from './MessageSendState.js'; import { SendActionType, sendStateReducer, SendStatus, -} from './MessageSendState'; +} from './MessageSendState.js'; type LegacyCustomError = Error & { identifier?: string; diff --git a/ts/messages/migrateMessageData.ts b/ts/messages/migrateMessageData.ts index 97a711a6073..b213a3246c3 100644 --- a/ts/messages/migrateMessageData.ts +++ b/ts/messages/migrateMessageData.ts @@ -5,15 +5,15 @@ import { isFunction, isNumber } from 'lodash'; import pMap from 'p-map'; import PQueue from 'p-queue'; -import { CURRENT_SCHEMA_VERSION } from '../types/Message2'; -import { isNotNil } from '../util/isNotNil'; -import { MINUTE } from '../util/durations'; -import type { MessageAttributesType } from '../model-types.d'; -import type { AciString } from '../types/ServiceId'; -import * as Errors from '../types/errors'; -import { DataReader, DataWriter } from '../sql/Client'; -import { postSaveUpdates } from '../util/cleanup'; -import { createLogger } from '../logging/log'; +import { CURRENT_SCHEMA_VERSION } from '../types/Message2.js'; +import { isNotNil } from '../util/isNotNil.js'; +import { MINUTE } from '../util/durations/index.js'; +import type { MessageAttributesType } from '../model-types.d.ts'; +import type { AciString } from '../types/ServiceId.js'; +import * as Errors from '../types/errors.js'; +import { DataReader, DataWriter } from '../sql/Client.js'; +import { postSaveUpdates } from '../util/cleanup.js'; +import { createLogger } from '../logging/log.js'; const log = createLogger('migrateMessageData'); diff --git a/ts/messages/saveAndNotify.ts b/ts/messages/saveAndNotify.ts index cecee2576f2..23ae012218e 100644 --- a/ts/messages/saveAndNotify.ts +++ b/ts/messages/saveAndNotify.ts @@ -1,22 +1,22 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log'; +import { createLogger } from '../logging/log.js'; -import { explodePromise } from '../util/explodePromise'; +import { explodePromise } from '../util/explodePromise.js'; -import { saveNewMessageBatcher } from '../util/messageBatcher'; -import { handleAttachmentDownloadsForNewMessage } from '../util/queueAttachmentDownloads'; +import { saveNewMessageBatcher } from '../util/messageBatcher.js'; +import { handleAttachmentDownloadsForNewMessage } from '../util/queueAttachmentDownloads.js'; import { modifyTargetMessage, ModifyTargetMessageResult, -} from '../util/modifyTargetMessage'; -import { isStory } from './helpers'; -import { drop } from '../util/drop'; +} from '../util/modifyTargetMessage.js'; +import { isStory } from './helpers.js'; +import { drop } from '../util/drop.js'; -import type { ConversationModel } from '../models/conversations'; -import type { MessageModel } from '../models/messages'; -import { maybeNotify } from './maybeNotify'; +import type { ConversationModel } from '../models/conversations.js'; +import type { MessageModel } from '../models/messages.js'; +import { maybeNotify } from './maybeNotify.js'; const log = createLogger('saveAndNotify'); diff --git a/ts/messages/send.ts b/ts/messages/send.ts index a923de6f6b7..a3cf79eb282 100644 --- a/ts/messages/send.ts +++ b/ts/messages/send.ts @@ -3,31 +3,35 @@ import { noop, union } from 'lodash'; -import { filter, map } from '../util/iterables'; -import { isNotNil } from '../util/isNotNil'; -import { SendMessageProtoError } from '../textsecure/Errors'; -import { getOwn } from '../util/getOwn'; -import { isGroup } from '../util/whatTypeOfConversation'; -import { handleMessageSend } from '../util/handleMessageSend'; -import { getSendOptions } from '../util/getSendOptions'; -import { createLogger } from '../logging/log'; +import { filter, map } from '../util/iterables.js'; +import { isNotNil } from '../util/isNotNil.js'; +import { SendMessageProtoError } from '../textsecure/Errors.js'; +import { getOwn } from '../util/getOwn.js'; +import { isGroup } from '../util/whatTypeOfConversation.js'; +import { handleMessageSend } from '../util/handleMessageSend.js'; +import { getSendOptions } from '../util/getSendOptions.js'; +import { createLogger } from '../logging/log.js'; import { getPropForTimestamp, getChangesForPropAtTimestamp, -} from '../util/editHelpers'; -import { getMessageSentTimestamp } from '../util/getMessageSentTimestamp'; +} from '../util/editHelpers.js'; +import { getMessageSentTimestamp } from '../util/getMessageSentTimestamp.js'; import { notifyStorySendFailed, saveErrorsOnMessage, -} from '../test-node/util/messageFailures'; -import { isCustomError } from './helpers'; -import { SendActionType, isSent, sendStateReducer } from './MessageSendState'; +} from '../test-node/util/messageFailures.js'; +import { isCustomError } from './helpers.js'; +import { + SendActionType, + isSent, + sendStateReducer, +} from './MessageSendState.js'; -import type { CustomError, MessageAttributesType } from '../model-types.d'; -import type { CallbackResultType } from '../textsecure/Types.d'; -import type { MessageModel } from '../models/messages'; -import type { ServiceIdString } from '../types/ServiceId'; -import type { SendStateByConversationId } from './MessageSendState'; +import type { CustomError, MessageAttributesType } from '../model-types.d.ts'; +import type { CallbackResultType } from '../textsecure/Types.d.ts'; +import type { MessageModel } from '../models/messages.js'; +import type { ServiceIdString } from '../types/ServiceId.js'; +import type { SendStateByConversationId } from './MessageSendState.js'; const log = createLogger('send'); diff --git a/ts/model-types.d.ts b/ts/model-types.d.ts index 9adac64d9bc..d0334e52154 100644 --- a/ts/model-types.d.ts +++ b/ts/model-types.d.ts @@ -3,36 +3,43 @@ import type { ReadonlyDeep } from 'type-fest'; -import type { GroupV2ChangeType } from './groups'; -import type { DraftBodyRanges, RawBodyRange } from './types/BodyRange'; -import type { CustomColorType, ConversationColorType } from './types/Colors'; -import type { SendMessageChallengeData } from './textsecure/Errors'; -import type { ProfileNameChangeType } from './util/getStringForProfileChange'; -import type { CapabilitiesType } from './textsecure/WebAPI'; -import type { ReadStatus } from './messages/MessageReadStatus'; -import type { SendStateByConversationId } from './messages/MessageSendState'; -import type { GroupNameCollisionsWithIdsByTitle } from './util/groupMemberNameCollisions'; +import type { GroupV2ChangeType } from './groups.js'; +import type { DraftBodyRanges, RawBodyRange } from './types/BodyRange.js'; +import type { CustomColorType, ConversationColorType } from './types/Colors.js'; +import type { SendMessageChallengeData } from './textsecure/Errors.js'; +import type { ProfileNameChangeType } from './util/getStringForProfileChange.js'; +import type { CapabilitiesType } from './textsecure/WebAPI.js'; +import type { ReadStatus } from './messages/MessageReadStatus.js'; +import type { SendStateByConversationId } from './messages/MessageSendState.js'; +import type { GroupNameCollisionsWithIdsByTitle } from './util/groupMemberNameCollisions.js'; -import type { AttachmentDraftType, AttachmentType } from './types/Attachment'; -import type { EmbeddedContactType } from './types/EmbeddedContact'; -import { SignalService as Proto } from './protobuf'; -import type { AvatarDataType, ContactAvatarType } from './types/Avatar'; -import type { AciString, PniString, ServiceIdString } from './types/ServiceId'; -import type { StoryDistributionIdString } from './types/StoryDistributionId'; -import type { SeenStatus } from './MessageSeenStatus'; -import type { GiftBadgeStates } from './components/conversation/Message'; -import type { LinkPreviewType } from './types/message/LinkPreviews'; +import type { + AttachmentDraftType, + AttachmentType, +} from './types/Attachment.js'; +import type { EmbeddedContactType } from './types/EmbeddedContact.js'; +import { SignalService as Proto } from './protobuf/index.js'; +import type { AvatarDataType, ContactAvatarType } from './types/Avatar.js'; +import type { + AciString, + PniString, + ServiceIdString, +} from './types/ServiceId.js'; +import type { StoryDistributionIdString } from './types/StoryDistributionId.js'; +import type { SeenStatus } from './MessageSeenStatus.js'; +import type { GiftBadgeStates } from './components/conversation/Message.js'; +import type { LinkPreviewType } from './types/message/LinkPreviews.js'; -import type { StickerType } from './types/Stickers'; -import type { StorySendMode } from './types/Stories'; -import type { MIMEType } from './types/MIME'; -import type { DurationInSeconds } from './util/durations'; -import type { AnyPaymentEvent } from './types/Payment'; +import type { StickerType } from './types/Stickers.js'; +import type { StorySendMode } from './types/Stories.js'; +import type { MIMEType } from './types/MIME.js'; +import type { DurationInSeconds } from './util/durations/index.js'; +import type { AnyPaymentEvent } from './types/Payment.js'; import AccessRequiredEnum = Proto.AccessControl.AccessRequired; import MemberRoleEnum = Proto.Member.Role; -import type { MessageRequestResponseEvent } from './types/MessageRequestResponseEvent'; -import type { QuotedMessageForComposerType } from './state/ducks/composer'; +import type { MessageRequestResponseEvent } from './types/MessageRequestResponseEvent.js'; +import type { QuotedMessageForComposerType } from './state/ducks/composer.js'; export type LastMessageStatus = | 'paused' diff --git a/ts/models/conversations.ts b/ts/models/conversations.ts index 5964370686b..9eed5aec3b0 100644 --- a/ts/models/conversations.ts +++ b/ts/models/conversations.ts @@ -14,87 +14,94 @@ import type { MessageAttributesType, QuotedMessageType, SenderKeyInfoType, -} from '../model-types.d'; -import { DataReader, DataWriter } from '../sql/Client'; -import { getConversation } from '../util/getConversation'; -import { drop } from '../util/drop'; -import { isShallowEqual } from '../util/isShallowEqual'; -import { getInitials } from '../util/getInitials'; -import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary'; -import { getMessageSentTimestamp } from '../util/getMessageSentTimestamp'; -import { getNotificationTextForMessage } from '../util/getNotificationTextForMessage'; -import { getNotificationDataForMessage } from '../util/getNotificationDataForMessage'; -import type { ProfileNameChangeType } from '../util/getStringForProfileChange'; -import type { AttachmentType, ThumbnailType } from '../types/Attachment'; -import { toDayMillis } from '../util/timestamp'; -import { areWeAdmin } from '../util/areWeAdmin'; -import { isBlocked } from '../util/isBlocked'; -import { getAboutText } from '../util/getAboutText'; +} from '../model-types.d.ts'; +import { DataReader, DataWriter } from '../sql/Client.js'; +import { getConversation } from '../util/getConversation.js'; +import { drop } from '../util/drop.js'; +import { isShallowEqual } from '../util/isShallowEqual.js'; +import { getInitials } from '../util/getInitials.js'; +import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary.js'; +import { getMessageSentTimestamp } from '../util/getMessageSentTimestamp.js'; +import { getNotificationTextForMessage } from '../util/getNotificationTextForMessage.js'; +import { getNotificationDataForMessage } from '../util/getNotificationDataForMessage.js'; +import type { ProfileNameChangeType } from '../util/getStringForProfileChange.js'; +import type { AttachmentType, ThumbnailType } from '../types/Attachment.js'; +import { toDayMillis } from '../util/timestamp.js'; +import { areWeAdmin } from '../util/areWeAdmin.js'; +import { isBlocked } from '../util/isBlocked.js'; +import { getAboutText } from '../util/getAboutText.js'; import { getAvatar, getRawAvatarPath, getLocalAvatarUrl, -} from '../util/avatarUtils'; -import { getDraftPreview } from '../util/getDraftPreview'; -import { hasDraft } from '../util/hasDraft'; -import { hydrateStoryContext } from '../util/hydrateStoryContext'; -import * as Conversation from '../types/Conversation'; -import type { StickerType, StickerWithHydratedData } from '../types/Stickers'; -import * as Stickers from '../types/Stickers'; -import { StorySendMode } from '../types/Stories'; -import type { EmbeddedContactWithHydratedAvatar } from '../types/EmbeddedContact'; -import type { GroupV2InfoType } from '../textsecure/SendMessage'; -import createTaskWithTimeout from '../textsecure/TaskWithTimeout'; -import MessageSender from '../textsecure/SendMessage'; +} from '../util/avatarUtils.js'; +import { getDraftPreview } from '../util/getDraftPreview.js'; +import { hasDraft } from '../util/hasDraft.js'; +import { hydrateStoryContext } from '../util/hydrateStoryContext.js'; +import * as Conversation from '../types/Conversation.js'; +import type { + StickerType, + StickerWithHydratedData, +} from '../types/Stickers.js'; +import * as Stickers from '../types/Stickers.js'; +import { StorySendMode } from '../types/Stories.js'; +import type { EmbeddedContactWithHydratedAvatar } from '../types/EmbeddedContact.js'; +import type { GroupV2InfoType } from '../textsecure/SendMessage.js'; +import createTaskWithTimeout from '../textsecure/TaskWithTimeout.js'; +import MessageSender from '../textsecure/SendMessage.js'; import type { CallbackResultType, PniSignatureMessageType, -} from '../textsecure/Types.d'; +} from '../textsecure/Types.d.ts'; import type { ConversationType, DraftPreviewType, -} from '../state/ducks/conversations'; +} from '../state/ducks/conversations.js'; import type { AvatarColorType, ConversationColorType, CustomColorType, -} from '../types/Colors'; -import { strictAssert } from '../util/assert'; -import { isConversationMuted } from '../util/isConversationMuted'; -import { isConversationSMSOnly } from '../util/isConversationSMSOnly'; +} from '../types/Colors.js'; +import { strictAssert } from '../util/assert.js'; +import { isConversationMuted } from '../util/isConversationMuted.js'; +import { isConversationSMSOnly } from '../util/isConversationSMSOnly.js'; import { isConversationEverUnregistered, isConversationUnregistered, isConversationUnregisteredAndStale, -} from '../util/isConversationUnregistered'; -import { sniffImageMimeType } from '../util/sniffImageMimeType'; -import { isValidE164 } from '../util/isValidE164'; -import type { MIMEType } from '../types/MIME'; -import { IMAGE_JPEG, IMAGE_WEBP } from '../types/MIME'; -import type { AciString, PniString, ServiceIdString } from '../types/ServiceId'; +} from '../util/isConversationUnregistered.js'; +import { sniffImageMimeType } from '../util/sniffImageMimeType.js'; +import { isValidE164 } from '../util/isValidE164.js'; +import type { MIMEType } from '../types/MIME.js'; +import { IMAGE_JPEG, IMAGE_WEBP } from '../types/MIME.js'; +import type { + AciString, + PniString, + ServiceIdString, +} from '../types/ServiceId.js'; import { ServiceIdKind, normalizeServiceId, normalizePni, -} from '../types/ServiceId'; -import { isAciString } from '../util/isAciString'; +} from '../types/ServiceId.js'; +import { isAciString } from '../util/isAciString.js'; import { constantTimeEqual, decryptProfile, decryptProfileName, deriveAccessKey, hashProfileKey, -} from '../Crypto'; -import { decryptAttachmentV2 } from '../AttachmentCrypto'; -import * as Bytes from '../Bytes'; -import type { DraftBodyRanges } from '../types/BodyRange'; -import { migrateColor } from '../util/migrateColor'; -import { isNotNil } from '../util/isNotNil'; -import { shouldSaveNotificationAvatarToDisk } from '../services/notifications'; -import { storageServiceUploadJob } from '../services/storage'; -import { getSendOptions } from '../util/getSendOptions'; -import type { IsConversationAcceptedOptionsType } from '../util/isConversationAccepted'; -import { isConversationAccepted } from '../util/isConversationAccepted'; +} from '../Crypto.js'; +import { decryptAttachmentV2 } from '../AttachmentCrypto.js'; +import * as Bytes from '../Bytes.js'; +import type { DraftBodyRanges } from '../types/BodyRange.js'; +import { migrateColor } from '../util/migrateColor.js'; +import { isNotNil } from '../util/isNotNil.js'; +import { shouldSaveNotificationAvatarToDisk } from '../services/notifications.js'; +import { storageServiceUploadJob } from '../services/storage.js'; +import { getSendOptions } from '../util/getSendOptions.js'; +import type { IsConversationAcceptedOptionsType } from '../util/isConversationAccepted.js'; +import { isConversationAccepted } from '../util/isConversationAccepted.js'; import { getNumber, getProfileName, @@ -103,97 +110,100 @@ import { hasNumberTitle, hasUsernameTitle, canHaveUsername, -} from '../util/getTitle'; -import { markConversationRead } from '../util/markConversationRead'; -import { handleMessageSend } from '../util/handleMessageSend'; -import { getConversationMembers } from '../util/getConversationMembers'; -import { updateConversationsWithUuidLookup } from '../updateConversationsWithUuidLookup'; -import { ReadStatus } from '../messages/MessageReadStatus'; -import { SendStatus } from '../messages/MessageSendState'; +} from '../util/getTitle.js'; +import { markConversationRead } from '../util/markConversationRead.js'; +import { handleMessageSend } from '../util/handleMessageSend.js'; +import { getConversationMembers } from '../util/getConversationMembers.js'; +import { updateConversationsWithUuidLookup } from '../updateConversationsWithUuidLookup.js'; +import { ReadStatus } from '../messages/MessageReadStatus.js'; +import { SendStatus } from '../messages/MessageSendState.js'; import type { LinkPreviewType, LinkPreviewWithHydratedData, -} from '../types/message/LinkPreviews'; -import { MINUTE, SECOND, DurationInSeconds } from '../util/durations'; -import { concat, filter, map, repeat, zipObject } from '../util/iterables'; -import * as universalExpireTimer from '../util/universalExpireTimer'; -import type { GroupNameCollisionsWithIdsByTitle } from '../util/groupMemberNameCollisions'; +} from '../types/message/LinkPreviews.js'; +import { MINUTE, SECOND, DurationInSeconds } from '../util/durations/index.js'; +import { concat, filter, map, repeat, zipObject } from '../util/iterables.js'; +import * as universalExpireTimer from '../util/universalExpireTimer.js'; +import type { GroupNameCollisionsWithIdsByTitle } from '../util/groupMemberNameCollisions.js'; import { isDirectConversation, isGroup, isGroupV1, isGroupV2, isMe, -} from '../util/whatTypeOfConversation'; -import { SignalService as Proto } from '../protobuf'; +} from '../util/whatTypeOfConversation.js'; +import { SignalService as Proto } from '../protobuf/index.js'; import { getMessagePropStatus, hasErrors, isIncoming, isStory, -} from '../state/selectors/message'; -import { getPreloadedConversationId } from '../state/selectors/conversations'; +} from '../state/selectors/message.js'; +import { getPreloadedConversationId } from '../state/selectors/conversations.js'; import { conversationJobQueue, conversationQueueJobEnum, -} from '../jobs/conversationJobQueue'; -import { getProfile } from '../util/getProfile'; -import { SEALED_SENDER } from '../types/SealedSender'; -import { createIdenticon } from '../util/createIdenticon'; -import { createLogger } from '../logging/log'; -import * as Errors from '../types/errors'; -import { isMessageUnread } from '../util/isMessageUnread'; -import type { SenderKeyTargetType } from '../util/sendToGroup'; -import { resetSenderKey, sendContentMessageToGroup } from '../util/sendToGroup'; -import { singleProtoJobQueue } from '../jobs/singleProtoJobQueue'; -import { TimelineMessageLoadingState } from '../util/timelineUtil'; -import { SeenStatus } from '../MessageSeenStatus'; -import { getConversationIdForLogging } from '../util/idForLogging'; -import { getSendTarget } from '../util/getSendTarget'; -import { getRecipients } from '../util/getRecipients'; -import { validateConversation } from '../util/validateConversation'; -import { isSignalConversation } from '../util/isSignalConversation'; -import { removePendingMember } from '../util/removePendingMember'; +} from '../jobs/conversationJobQueue.js'; +import { getProfile } from '../util/getProfile.js'; +import { SEALED_SENDER } from '../types/SealedSender.js'; +import { createIdenticon } from '../util/createIdenticon.js'; +import { createLogger } from '../logging/log.js'; +import * as Errors from '../types/errors.js'; +import { isMessageUnread } from '../util/isMessageUnread.js'; +import type { SenderKeyTargetType } from '../util/sendToGroup.js'; +import { + resetSenderKey, + sendContentMessageToGroup, +} from '../util/sendToGroup.js'; +import { singleProtoJobQueue } from '../jobs/singleProtoJobQueue.js'; +import { TimelineMessageLoadingState } from '../util/timelineUtil.js'; +import { SeenStatus } from '../MessageSeenStatus.js'; +import { getConversationIdForLogging } from '../util/idForLogging.js'; +import { getSendTarget } from '../util/getSendTarget.js'; +import { getRecipients } from '../util/getRecipients.js'; +import { validateConversation } from '../util/validateConversation.js'; +import { isSignalConversation } from '../util/isSignalConversation.js'; +import { removePendingMember } from '../util/removePendingMember.js'; import { isMember, isMemberAwaitingApproval, isMemberBanned, isMemberPending, isMemberRequestingToJoin, -} from '../util/groupMembershipUtils'; -import { imageToBlurHash } from '../util/imageToBlurHash'; -import { ReceiptType } from '../types/Receipt'; -import { getQuoteAttachment } from '../util/makeQuote'; -import { deriveProfileKeyVersion } from '../util/zkgroup'; -import { incrementMessageCounter } from '../util/incrementMessageCounter'; -import { generateMessageId } from '../util/generateMessageId'; -import { getMessageAuthorText } from '../util/getMessageAuthorText'; -import { downscaleOutgoingAttachment } from '../util/attachments'; +} from '../util/groupMembershipUtils.js'; +import { imageToBlurHash } from '../util/imageToBlurHash.js'; +import { ReceiptType } from '../types/Receipt.js'; +import { getQuoteAttachment } from '../util/makeQuote.js'; +import { deriveProfileKeyVersion } from '../util/zkgroup.js'; +import { incrementMessageCounter } from '../util/incrementMessageCounter.js'; +import { generateMessageId } from '../util/generateMessageId.js'; +import { getMessageAuthorText } from '../util/getMessageAuthorText.js'; +import { downscaleOutgoingAttachment } from '../util/attachments.js'; import { MessageRequestResponseSource, type MessageRequestResponseInfo, MessageRequestResponseEvent, -} from '../types/MessageRequestResponseEvent'; -import type { AddressableMessage } from '../textsecure/messageReceiverEvents'; +} from '../types/MessageRequestResponseEvent.js'; +import type { AddressableMessage } from '../textsecure/messageReceiverEvents.js'; import { getConversationIdentifier, getAddressableMessage, -} from '../util/syncIdentifiers'; -import { explodePromise } from '../util/explodePromise'; -import { getCallHistorySelector } from '../state/selectors/callHistory'; -import { migrateLegacyReadStatus } from '../messages/migrateLegacyReadStatus'; -import { migrateLegacySendAttributes } from '../messages/migrateLegacySendAttributes'; -import { getIsInitialContactSync } from '../services/contactSync'; -import { queueAttachmentDownloadsAndMaybeSaveMessage } from '../util/queueAttachmentDownloads'; -import { cleanupMessages } from '../util/cleanup'; -import { MessageModel } from './messages'; -import { applyNewAvatar } from '../groups'; -import { safeSetTimeout } from '../util/timeout'; -import { getTypingIndicatorSetting } from '../types/Util'; -import { INITIAL_EXPIRE_TIMER_VERSION } from '../util/expirationTimer'; -import { maybeNotify } from '../messages/maybeNotify'; -import { missingCaseError } from '../util/missingCaseError'; -import * as Message from '../types/Message2'; +} from '../util/syncIdentifiers.js'; +import { explodePromise } from '../util/explodePromise.js'; +import { getCallHistorySelector } from '../state/selectors/callHistory.js'; +import { migrateLegacyReadStatus } from '../messages/migrateLegacyReadStatus.js'; +import { migrateLegacySendAttributes } from '../messages/migrateLegacySendAttributes.js'; +import { getIsInitialContactSync } from '../services/contactSync.js'; +import { queueAttachmentDownloadsAndMaybeSaveMessage } from '../util/queueAttachmentDownloads.js'; +import { cleanupMessages } from '../util/cleanup.js'; +import { MessageModel } from './messages.js'; +import { applyNewAvatar } from '../groups.js'; +import { safeSetTimeout } from '../util/timeout.js'; +import { getTypingIndicatorSetting } from '../types/Util.js'; +import { INITIAL_EXPIRE_TIMER_VERSION } from '../util/expirationTimer.js'; +import { maybeNotify } from '../messages/maybeNotify.js'; +import { missingCaseError } from '../util/missingCaseError.js'; +import * as Message from '../types/Message2.js'; const log = createLogger('conversations'); diff --git a/ts/models/messages.ts b/ts/models/messages.ts index 3701f3bc06b..361afe07f08 100644 --- a/ts/models/messages.ts +++ b/ts/models/messages.ts @@ -1,9 +1,9 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { MessageAttributesType } from '../model-types.d'; -import type { CallbackResultType } from '../textsecure/Types.d'; -import { createLogger } from '../logging/log'; +import type { MessageAttributesType } from '../model-types.d.ts'; +import type { CallbackResultType } from '../textsecure/Types.d.ts'; +import { createLogger } from '../logging/log.js'; const log = createLogger('messages'); diff --git a/ts/protobuf/index.ts b/ts/protobuf/index.ts index 9e319adca1c..6c99dbc25be 100644 --- a/ts/protobuf/index.ts +++ b/ts/protobuf/index.ts @@ -1,13 +1,13 @@ // Copyright 2018 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import './wrap'; +import './wrap.js'; import { signal as Signal, signalbackups as Backups, signalservice as SignalService, migrations as Migrations, -} from './compiled'; +} from './compiled.js'; export { Backups, SignalService, Signal, Migrations }; diff --git a/ts/quill/auto-substitute-ascii-emojis/index.tsx b/ts/quill/auto-substitute-ascii-emojis/index.tsx index 59b4b12e266..784c478de21 100644 --- a/ts/quill/auto-substitute-ascii-emojis/index.tsx +++ b/ts/quill/auto-substitute-ascii-emojis/index.tsx @@ -5,13 +5,13 @@ import { Delta } from '@signalapp/quill-cjs'; import Emitter from '@signalapp/quill-cjs/core/emitter'; import type Quill from '@signalapp/quill-cjs'; -import { createLogger } from '../../logging/log'; -import type { EmojiData } from '../../components/emoji/lib'; +import { createLogger } from '../../logging/log.js'; +import type { EmojiData } from '../../components/emoji/lib.js'; import { convertShortName, convertShortNameToData, -} from '../../components/emoji/lib'; -import { EmojiSkinTone } from '../../components/fun/data/emojis'; +} from '../../components/emoji/lib.js'; +import { EmojiSkinTone } from '../../components/fun/data/emojis.js'; const log = createLogger('index'); diff --git a/ts/quill/emoji/blot.tsx b/ts/quill/emoji/blot.tsx index 698ab94f870..aa6b02cfd8c 100644 --- a/ts/quill/emoji/blot.tsx +++ b/ts/quill/emoji/blot.tsx @@ -2,16 +2,16 @@ // SPDX-License-Identifier: AGPL-3.0-only import EmbedBlot from '@signalapp/quill-cjs/blots/embed'; -import { strictAssert } from '../../util/assert'; +import { strictAssert } from '../../util/assert.js'; import { getEmojiVariantByKey, getEmojiVariantKeyByValue, isEmojiVariantValue, -} from '../../components/fun/data/emojis'; +} from '../../components/fun/data/emojis.js'; import { createStaticEmojiBlot, FUN_STATIC_EMOJI_CLASS, -} from '../../components/fun/FunEmoji'; +} from '../../components/fun/FunEmoji.js'; // the DOM structure of this EmojiBlot should match the other emoji implementations: // ts/components/fun/FunEmoji.tsx diff --git a/ts/quill/emoji/completion.tsx b/ts/quill/emoji/completion.tsx index 5137e5146d2..b5d22f1f654 100644 --- a/ts/quill/emoji/completion.tsx +++ b/ts/quill/emoji/completion.tsx @@ -10,23 +10,23 @@ import { Popper } from 'react-popper'; import classNames from 'classnames'; import { createPortal } from 'react-dom'; import type { VirtualElement } from '@popperjs/core'; -import { convertShortName } from '../../components/emoji/lib'; -import type { EmojiPickDataType } from '../../components/emoji/EmojiPicker'; -import { getBlotTextPartitions, matchBlotTextPartitions } from '../util'; -import { handleOutsideClick } from '../../util/handleOutsideClick'; -import { createLogger } from '../../logging/log'; -import { FunStaticEmoji } from '../../components/fun/FunEmoji'; +import { convertShortName } from '../../components/emoji/lib.js'; +import type { EmojiPickDataType } from '../../components/emoji/EmojiPicker.js'; +import { getBlotTextPartitions, matchBlotTextPartitions } from '../util.js'; +import { handleOutsideClick } from '../../util/handleOutsideClick.js'; +import { createLogger } from '../../logging/log.js'; +import { FunStaticEmoji } from '../../components/fun/FunEmoji.js'; import { EmojiSkinTone, getEmojiParentByKey, getEmojiVariantByParentKeyAndSkinTone, normalizeShortNameCompletionDisplay, -} from '../../components/fun/data/emojis'; +} from '../../components/fun/data/emojis.js'; import type { FunEmojiSearchResult, FunEmojiSearch, -} from '../../components/fun/useFunEmojiSearch'; -import { type FunEmojiLocalizer } from '../../components/fun/useFunEmojiLocalizer'; +} from '../../components/fun/useFunEmojiSearch.js'; +import { type FunEmojiLocalizer } from '../../components/fun/useFunEmojiLocalizer.js'; const log = createLogger('completion'); diff --git a/ts/quill/emoji/index.tsx b/ts/quill/emoji/index.tsx index 6876a0b61d9..a2b117f2050 100644 --- a/ts/quill/emoji/index.tsx +++ b/ts/quill/emoji/index.tsx @@ -1,5 +1,5 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -export { EmojiBlot } from './blot'; -export { EmojiCompletion } from './completion'; +export { EmojiBlot } from './blot.js'; +export { EmojiCompletion } from './completion.js'; diff --git a/ts/quill/emoji/matchers.ts b/ts/quill/emoji/matchers.ts index e2316b413b2..b3342775000 100644 --- a/ts/quill/emoji/matchers.ts +++ b/ts/quill/emoji/matchers.ts @@ -3,12 +3,12 @@ import { Delta } from '@signalapp/quill-cjs'; -import { insertEmojiOps } from '../util'; -import type { Matcher } from '../util'; +import { insertEmojiOps } from '../util.js'; +import type { Matcher } from '../util.js'; import { FUN_INLINE_EMOJI_CLASS, FUN_STATIC_EMOJI_CLASS, -} from '../../components/fun/FunEmoji'; +} from '../../components/fun/FunEmoji.js'; export const matchEmojiImage: Matcher = ( node, diff --git a/ts/quill/formatting/matchers.ts b/ts/quill/formatting/matchers.ts index 09f1c6b8ae9..d0e50feda37 100644 --- a/ts/quill/formatting/matchers.ts +++ b/ts/quill/formatting/matchers.ts @@ -4,8 +4,8 @@ import { Delta } from '@signalapp/quill-cjs'; import type { AttributeMap } from '@signalapp/quill-cjs'; -import { QuillFormattingStyle } from './menu'; -import type { Matcher } from '../util'; +import { QuillFormattingStyle } from './menu.js'; +import type { Matcher } from '../util.js'; function applyStyleToOps( delta: Delta, diff --git a/ts/quill/formatting/menu.tsx b/ts/quill/formatting/menu.tsx index 3c928432bda..da44300e75e 100644 --- a/ts/quill/formatting/menu.tsx +++ b/ts/quill/formatting/menu.tsx @@ -12,10 +12,10 @@ import type { Op } from '@signalapp/quill-cjs'; import type { Context as KeyboardContext } from '@signalapp/quill-cjs/modules/keyboard'; import type { VirtualElement } from '@popperjs/core'; -import { createLogger } from '../../logging/log'; -import * as Errors from '../../types/errors'; -import type { LocalizerType } from '../../types/Util'; -import { handleOutsideClick } from '../../util/handleOutsideClick'; +import { createLogger } from '../../logging/log.js'; +import * as Errors from '../../types/errors.js'; +import type { LocalizerType } from '../../types/Util.js'; +import { handleOutsideClick } from '../../util/handleOutsideClick.js'; const log = createLogger('menu'); diff --git a/ts/quill/memberRepository.ts b/ts/quill/memberRepository.ts index eebd137afd2..095ea1b3214 100644 --- a/ts/quill/memberRepository.ts +++ b/ts/quill/memberRepository.ts @@ -4,12 +4,12 @@ import Fuse from 'fuse.js'; import { get } from 'lodash'; -import type { ConversationType } from '../state/ducks/conversations'; -import type { AciString } from '../types/ServiceId'; -import { isAciString } from '../util/isAciString'; -import { filter, map } from '../util/iterables'; -import { removeDiacritics } from '../util/removeDiacritics'; -import { isNotNil } from '../util/isNotNil'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import type { AciString } from '../types/ServiceId.js'; +import { isAciString } from '../util/isAciString.js'; +import { filter, map } from '../util/iterables.js'; +import { removeDiacritics } from '../util/removeDiacritics.js'; +import { isNotNil } from '../util/isNotNil.js'; export type MemberType = Omit & Readonly<{ diff --git a/ts/quill/mentions/blot.tsx b/ts/quill/mentions/blot.tsx index b41253ec65d..342fe461faf 100644 --- a/ts/quill/mentions/blot.tsx +++ b/ts/quill/mentions/blot.tsx @@ -5,11 +5,11 @@ import React, { StrictMode } from 'react'; import EmbedBlot from '@signalapp/quill-cjs/blots/embed'; import { createRoot } from 'react-dom/client'; -import { Emojify } from '../../components/conversation/Emojify'; -import { normalizeAci } from '../../util/normalizeAci'; -import type { MentionBlotValue } from '../util'; -import { FunEmojiLocalizationProvider } from '../../components/fun/FunEmojiLocalizationProvider'; -import { AxoProvider } from '../../axo/AxoProvider'; +import { Emojify } from '../../components/conversation/Emojify.js'; +import { normalizeAci } from '../../util/normalizeAci.js'; +import type { MentionBlotValue } from '../util.js'; +import { FunEmojiLocalizationProvider } from '../../components/fun/FunEmojiLocalizationProvider.js'; +import { AxoProvider } from '../../axo/AxoProvider.js'; export class MentionBlot extends EmbedBlot { static override blotName = 'mention'; diff --git a/ts/quill/mentions/completion.tsx b/ts/quill/mentions/completion.tsx index fd5ec1fcf01..2493c4534b4 100644 --- a/ts/quill/mentions/completion.tsx +++ b/ts/quill/mentions/completion.tsx @@ -11,15 +11,15 @@ import { Popper } from 'react-popper'; import classNames from 'classnames'; import { createPortal } from 'react-dom'; -import { Avatar, AvatarSize } from '../../components/Avatar'; -import type { LocalizerType, ThemeType } from '../../types/Util'; -import type { MemberType, MemberRepository } from '../memberRepository'; -import type { PreferredBadgeSelectorType } from '../../state/selectors/badges'; -import { matchBlotTextPartitions } from '../util'; -import type { MentionBlotValue } from '../util'; -import { handleOutsideClick } from '../../util/handleOutsideClick'; -import { sameWidthModifier } from '../../util/popperUtil'; -import { UserText } from '../../components/UserText'; +import { Avatar, AvatarSize } from '../../components/Avatar.js'; +import type { LocalizerType, ThemeType } from '../../types/Util.js'; +import type { MemberType, MemberRepository } from '../memberRepository.js'; +import type { PreferredBadgeSelectorType } from '../../state/selectors/badges.js'; +import { matchBlotTextPartitions } from '../util.js'; +import type { MentionBlotValue } from '../util.js'; +import { handleOutsideClick } from '../../util/handleOutsideClick.js'; +import { sameWidthModifier } from '../../util/popperUtil.js'; +import { UserText } from '../../components/UserText.js'; export type MentionCompletionOptions = { getPreferredBadge: PreferredBadgeSelectorType; diff --git a/ts/quill/mentions/matchers.ts b/ts/quill/mentions/matchers.ts index 02f630fe93e..64fddeb9f96 100644 --- a/ts/quill/mentions/matchers.ts +++ b/ts/quill/mentions/matchers.ts @@ -4,10 +4,10 @@ import { Delta } from '@signalapp/quill-cjs'; import type { RefObject } from 'react'; -import { assertDev } from '../../util/assert'; -import { isAciString } from '../../util/isAciString'; -import type { MemberRepository } from '../memberRepository'; -import type { Matcher } from '../util'; +import { assertDev } from '../../util/assert.js'; +import { isAciString } from '../../util/isAciString.js'; +import type { MemberRepository } from '../memberRepository.js'; +import type { Matcher } from '../util.js'; export const matchMention: ( memberRepositoryRef: RefObject diff --git a/ts/quill/signal-clipboard/index.ts b/ts/quill/signal-clipboard/index.ts index 8ced059863c..df959f0adc9 100644 --- a/ts/quill/signal-clipboard/index.ts +++ b/ts/quill/signal-clipboard/index.ts @@ -5,9 +5,9 @@ import type Quill from '@signalapp/quill-cjs'; import { Delta } from '@signalapp/quill-cjs'; import { deleteRange } from '@signalapp/quill-cjs/modules/keyboard'; -import { FormattingMenu, QuillFormattingStyle } from '../formatting/menu'; -import { insertEmojiOps } from '../util'; -import { createEventHandler } from './util'; +import { FormattingMenu, QuillFormattingStyle } from '../formatting/menu.js'; +import { insertEmojiOps } from '../util.js'; +import { createEventHandler } from './util.js'; type ClipboardOptions = Readonly<{ isDisabled: boolean; diff --git a/ts/quill/signal-clipboard/util.ts b/ts/quill/signal-clipboard/util.ts index 9d85ae8f9fd..096a28c5e13 100644 --- a/ts/quill/signal-clipboard/util.ts +++ b/ts/quill/signal-clipboard/util.ts @@ -4,7 +4,7 @@ import { FUN_INLINE_EMOJI_CLASS, FUN_STATIC_EMOJI_CLASS, -} from '../../components/fun/FunEmoji'; +} from '../../components/fun/FunEmoji.js'; const QUILL_EMBED_GUARD = '\uFEFF'; diff --git a/ts/quill/util.ts b/ts/quill/util.ts index 7f956e9de61..f1013bab054 100644 --- a/ts/quill/util.ts +++ b/ts/quill/util.ts @@ -9,14 +9,14 @@ import type { DisplayNode, DraftBodyRange, DraftBodyRanges, -} from '../types/BodyRange'; -import { BodyRange } from '../types/BodyRange'; -import type { MentionBlot } from './mentions/blot'; -import type { EmojiBlot } from './emoji/blot'; -import { isNewlineOnlyOp, QuillFormattingStyle } from './formatting/menu'; -import { isNotNil } from '../util/isNotNil'; -import type { AciString } from '../types/ServiceId'; -import { emojiToData } from '../components/emoji/lib'; +} from '../types/BodyRange.js'; +import { BodyRange } from '../types/BodyRange.js'; +import type { MentionBlot } from './mentions/blot.js'; +import type { EmojiBlot } from './emoji/blot.js'; +import { isNewlineOnlyOp, QuillFormattingStyle } from './formatting/menu.js'; +import { isNotNil } from '../util/isNotNil.js'; +import type { AciString } from '../types/ServiceId.js'; +import { emojiToData } from '../components/emoji/lib.js'; export type Matcher = ( node: HTMLElement, diff --git a/ts/reactions/enqueueReactionForSend.ts b/ts/reactions/enqueueReactionForSend.ts index cc7f42382f5..8a410beeedc 100644 --- a/ts/reactions/enqueueReactionForSend.ts +++ b/ts/reactions/enqueueReactionForSend.ts @@ -4,25 +4,25 @@ import noop from 'lodash/noop'; import { v7 as generateUuid } from 'uuid'; -import { DataWriter } from '../sql/Client'; -import { MessageModel } from '../models/messages'; +import { DataWriter } from '../sql/Client.js'; +import { MessageModel } from '../models/messages.js'; import { handleReaction, type ReactionAttributesType, -} from '../messageModifiers/Reactions'; -import { ReactionSource } from './ReactionSource'; -import { getMessageById } from '../messages/getMessageById'; -import { getSourceServiceId, isStory } from '../messages/helpers'; -import { strictAssert } from '../util/assert'; -import { isDirectConversation } from '../util/whatTypeOfConversation'; -import { incrementMessageCounter } from '../util/incrementMessageCounter'; -import { generateMessageId } from '../util/generateMessageId'; -import { repeat, zipObject } from '../util/iterables'; -import { getMessageSentTimestamp } from '../util/getMessageSentTimestamp'; -import { isAciString } from '../util/isAciString'; -import { SendStatus } from '../messages/MessageSendState'; -import { createLogger } from '../logging/log'; -import { getMessageIdForLogging } from '../util/idForLogging'; +} from '../messageModifiers/Reactions.js'; +import { ReactionSource } from './ReactionSource.js'; +import { getMessageById } from '../messages/getMessageById.js'; +import { getSourceServiceId, isStory } from '../messages/helpers.js'; +import { strictAssert } from '../util/assert.js'; +import { isDirectConversation } from '../util/whatTypeOfConversation.js'; +import { incrementMessageCounter } from '../util/incrementMessageCounter.js'; +import { generateMessageId } from '../util/generateMessageId.js'; +import { repeat, zipObject } from '../util/iterables.js'; +import { getMessageSentTimestamp } from '../util/getMessageSentTimestamp.js'; +import { isAciString } from '../util/isAciString.js'; +import { SendStatus } from '../messages/MessageSendState.js'; +import { createLogger } from '../logging/log.js'; +import { getMessageIdForLogging } from '../util/idForLogging.js'; const log = createLogger('enqueueReactionForSend'); diff --git a/ts/reactions/isValidReactionEmoji.ts b/ts/reactions/isValidReactionEmoji.ts index b1ef0d1c11b..e26795e965b 100644 --- a/ts/reactions/isValidReactionEmoji.ts +++ b/ts/reactions/isValidReactionEmoji.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import emojiRegex from 'emoji-regex'; -import { getGraphemes } from '../util/grapheme'; -import { take, size } from '../util/iterables'; +import { getGraphemes } from '../util/grapheme.js'; +import { take, size } from '../util/iterables.js'; export function isValidReactionEmoji(value: unknown): value is string { if (typeof value !== 'string') { diff --git a/ts/reactions/preferredReactionEmoji.ts b/ts/reactions/preferredReactionEmoji.ts index 23afdcadbce..822d480ebe6 100644 --- a/ts/reactions/preferredReactionEmoji.ts +++ b/ts/reactions/preferredReactionEmoji.ts @@ -2,11 +2,11 @@ // SPDX-License-Identifier: AGPL-3.0-only import { times } from 'lodash'; -import { createLogger } from '../logging/log'; -import { DEFAULT_PREFERRED_REACTION_EMOJI_SHORT_NAMES } from './constants'; -import { convertShortName } from '../components/emoji/lib'; -import { isValidReactionEmoji } from './isValidReactionEmoji'; -import type { EmojiSkinTone } from '../components/fun/data/emojis'; +import { createLogger } from '../logging/log.js'; +import { DEFAULT_PREFERRED_REACTION_EMOJI_SHORT_NAMES } from './constants.js'; +import { convertShortName } from '../components/emoji/lib.js'; +import { isValidReactionEmoji } from './isValidReactionEmoji.js'; +import type { EmojiSkinTone } from '../components/fun/data/emojis.js'; const log = createLogger('preferredReactionEmoji'); diff --git a/ts/reactions/util.ts b/ts/reactions/util.ts index cabb80dcd09..fdb11667ea3 100644 --- a/ts/reactions/util.ts +++ b/ts/reactions/util.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import { findLastIndex, has, identity, omit, negate } from 'lodash'; -import type { MessageReactionType } from '../model-types.d'; -import { areObjectEntriesEqual } from '../util/areObjectEntriesEqual'; +import type { MessageReactionType } from '../model-types.d.ts'; +import { areObjectEntriesEqual } from '../util/areObjectEntriesEqual.js'; const isReactionEqual = ( a: undefined | Readonly, diff --git a/ts/routineProfileRefresh.ts b/ts/routineProfileRefresh.ts index 9943c1d4c96..611ca2ed734 100644 --- a/ts/routineProfileRefresh.ts +++ b/ts/routineProfileRefresh.ts @@ -4,18 +4,18 @@ import { isNil, sortBy } from 'lodash'; import PQueue from 'p-queue'; -import { createLogger } from './logging/log'; -import { assertDev } from './util/assert'; -import { sleep } from './util/sleep'; -import { isNormalNumber } from './util/isNormalNumber'; -import { take } from './util/iterables'; -import type { ConversationModel } from './models/conversations'; -import type { StorageInterface } from './types/Storage.d'; -import * as Errors from './types/errors'; -import { getProfile } from './util/getProfile'; -import { drop } from './util/drop'; -import { MINUTE, HOUR, DAY, WEEK } from './util/durations'; -import { isDirectConversation } from './util/whatTypeOfConversation'; +import { createLogger } from './logging/log.js'; +import { assertDev } from './util/assert.js'; +import { sleep } from './util/sleep.js'; +import { isNormalNumber } from './util/isNormalNumber.js'; +import { take } from './util/iterables.js'; +import type { ConversationModel } from './models/conversations.js'; +import type { StorageInterface } from './types/Storage.d.ts'; +import * as Errors from './types/errors.js'; +import { getProfile } from './util/getProfile.js'; +import { drop } from './util/drop.js'; +import { MINUTE, HOUR, DAY, WEEK } from './util/durations/index.js'; +import { isDirectConversation } from './util/whatTypeOfConversation.js'; const log = createLogger('routineProfileRefresh'); diff --git a/ts/scripts/after-all-artifact-build.ts b/ts/scripts/after-all-artifact-build.ts index f7b45bc1f4d..7eb0894e765 100644 --- a/ts/scripts/after-all-artifact-build.ts +++ b/ts/scripts/after-all-artifact-build.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { BuildResult } from 'electron-builder'; -import { afterAllArtifactBuild as notarizeUniversalDMG } from './notarize-universal-dmg'; +import { afterAllArtifactBuild as notarizeUniversalDMG } from './notarize-universal-dmg.js'; export async function afterAllArtifactBuild( result: BuildResult diff --git a/ts/scripts/after-pack.ts b/ts/scripts/after-pack.ts index 66befe48085..a574806b639 100644 --- a/ts/scripts/after-pack.ts +++ b/ts/scripts/after-pack.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { AfterPackContext } from 'electron-builder'; -import { afterPack as fuseElectron } from './fuse-electron'; -import { afterPack as copyPacks } from './copy-language-packs'; -import { afterPack as pruneMacOSRelease } from './prune-macos-release'; +import { afterPack as fuseElectron } from './fuse-electron.js'; +import { afterPack as copyPacks } from './copy-language-packs.js'; +import { afterPack as pruneMacOSRelease } from './prune-macos-release.js'; export async function afterPack(context: AfterPackContext): Promise { await pruneMacOSRelease(context); diff --git a/ts/scripts/after-sign.ts b/ts/scripts/after-sign.ts index a80d5dd31f2..d9fba7950e9 100644 --- a/ts/scripts/after-sign.ts +++ b/ts/scripts/after-sign.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { AfterPackContext } from 'electron-builder'; -import { afterSign as notarize } from './notarize'; +import { afterSign as notarize } from './notarize.js'; // NOTE: It is AfterPackContext here even though it is afterSign. // See: https://www.electron.build/configuration/configuration.html#aftersign diff --git a/ts/scripts/artifact-build-completed.ts b/ts/scripts/artifact-build-completed.ts index 635896e7bf1..2d92f382f82 100644 --- a/ts/scripts/artifact-build-completed.ts +++ b/ts/scripts/artifact-build-completed.ts @@ -1,12 +1,12 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { tmpdir } from 'os'; -import { mkdtemp, rm, rename, stat } from 'fs/promises'; -import { createReadStream } from 'fs'; -import { pipeline } from 'stream/promises'; -import { createHash } from 'crypto'; -import path from 'path'; +import { tmpdir } from 'node:os'; +import { mkdtemp, rm, rename, stat } from 'node:fs/promises'; +import { createReadStream } from 'node:fs'; +import { pipeline } from 'node:stream/promises'; +import { createHash } from 'node:crypto'; +import path from 'node:path'; import type { ArtifactCreated } from 'electron-builder'; export async function artifactBuildCompleted({ diff --git a/ts/scripts/build-localized-display-names.ts b/ts/scripts/build-localized-display-names.ts index d7fc6948cdd..cb84c36e669 100644 --- a/ts/scripts/build-localized-display-names.ts +++ b/ts/scripts/build-localized-display-names.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import { parse } from 'csv-parse'; -import fs from 'fs/promises'; +import fs from 'node:fs/promises'; import { z } from 'zod'; -import { _getAvailableLocales } from '../../app/locale'; -import { parseUnknown } from '../util/schemas'; +import { _getAvailableLocales } from '../../app/locale.js'; +import { parseUnknown } from '../util/schemas.js'; const type = process.argv[2]; if (type !== 'countries' && type !== 'locales') { diff --git a/ts/scripts/check-upgradeable-deps.ts b/ts/scripts/check-upgradeable-deps.ts index 96c215a1f71..758e720e852 100644 --- a/ts/scripts/check-upgradeable-deps.ts +++ b/ts/scripts/check-upgradeable-deps.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only /* eslint-disable no-await-in-loop */ -import { join } from 'path'; -import { readFile } from 'fs/promises'; +import { join } from 'node:path'; +import { readFile } from 'node:fs/promises'; import chalk from 'chalk'; import semver from 'semver'; import got from 'got'; diff --git a/ts/scripts/compile-stories-icu-lookup.ts b/ts/scripts/compile-stories-icu-lookup.ts index 268e7925c46..3b87aff1cd8 100644 --- a/ts/scripts/compile-stories-icu-lookup.ts +++ b/ts/scripts/compile-stories-icu-lookup.ts @@ -5,7 +5,7 @@ import { readFile, writeFile, readdir, readlink } from 'node:fs/promises'; import { join, basename } from 'node:path'; import pMap from 'p-map'; -import { drop } from '../util/drop'; +import { drop } from '../util/drop.js'; async function main(): Promise { const source = process.argv[2]; diff --git a/ts/scripts/copy-language-packs.ts b/ts/scripts/copy-language-packs.ts index 18b5fdede1d..b87111f5933 100644 --- a/ts/scripts/copy-language-packs.ts +++ b/ts/scripts/copy-language-packs.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import fse from 'fs-extra'; -import path from 'path'; +import path from 'node:path'; import type { AfterPackContext } from 'electron-builder'; export async function afterPack({ diff --git a/ts/scripts/copy.ts b/ts/scripts/copy.ts index 56311bbf4a6..ca0944b1019 100644 --- a/ts/scripts/copy.ts +++ b/ts/scripts/copy.ts @@ -1,8 +1,8 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { join } from 'path'; -import { copyFileSync } from 'fs'; +import { join } from 'node:path'; +import { copyFileSync } from 'node:fs'; const BASE_BOWER = join(__dirname, '../../components'); diff --git a/ts/scripts/fuse-electron.ts b/ts/scripts/fuse-electron.ts index 9a72791e593..7b910801b4f 100644 --- a/ts/scripts/fuse-electron.ts +++ b/ts/scripts/fuse-electron.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import path from 'path'; +import path from 'node:path'; import { flipFuses, FuseVersion, FuseV1Options } from '@electron/fuses'; import type { AfterPackContext } from 'electron-builder'; diff --git a/ts/scripts/gen-locales-config.ts b/ts/scripts/gen-locales-config.ts index 9b16b08ee88..35b326c13cd 100644 --- a/ts/scripts/gen-locales-config.ts +++ b/ts/scripts/gen-locales-config.ts @@ -1,8 +1,8 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import fs from 'fs/promises'; -import path from 'path'; +import fs from 'node:fs/promises'; +import path from 'node:path'; import fastGlob from 'fast-glob'; import * as LocaleMatcher from '@formatjs/intl-localematcher'; diff --git a/ts/scripts/gen-nsis-script.ts b/ts/scripts/gen-nsis-script.ts index 53d525b2848..bcec5facf90 100644 --- a/ts/scripts/gen-nsis-script.ts +++ b/ts/scripts/gen-nsis-script.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import { createIntl } from '@formatjs/intl'; -import path from 'path'; -import fs from 'fs'; +import path from 'node:path'; +import fs from 'node:fs'; // Note: if this warning appears and build fails: // @@ -11,7 +11,7 @@ import fs from 'fs'; // // Make sure to sync up the values in `util/nsis` with upstream // `app-builder-lib`. -import { REQUIRED_LANGUAGES, LCID } from '../util/nsis'; +import { REQUIRED_LANGUAGES, LCID } from '../util/nsis.js'; const STRING_VARS = new Map([ [ diff --git a/ts/scripts/generate-compact-locales.ts b/ts/scripts/generate-compact-locales.ts index 7187d287acc..472577996cb 100644 --- a/ts/scripts/generate-compact-locales.ts +++ b/ts/scripts/generate-compact-locales.ts @@ -4,7 +4,7 @@ import { readdir, mkdir, readFile, writeFile } from 'node:fs/promises'; import { join, dirname } from 'node:path'; import pMap from 'p-map'; -import { isLocaleMessageType } from '../util/setupI18nMain'; +import { isLocaleMessageType } from '../util/setupI18nMain.js'; async function compact({ sourceDir, diff --git a/ts/scripts/generate-dns-fallback.ts b/ts/scripts/generate-dns-fallback.ts index 90e7736b9a7..55f82033c2c 100644 --- a/ts/scripts/generate-dns-fallback.ts +++ b/ts/scripts/generate-dns-fallback.ts @@ -1,12 +1,12 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { resolve4 as resolve4Cb, resolve6 as resolve6Cb } from 'dns'; -import { writeFile } from 'fs/promises'; -import { join } from 'path'; -import { promisify } from 'util'; +import { resolve4 as resolve4Cb, resolve6 as resolve6Cb } from 'node:dns'; +import { writeFile } from 'node:fs/promises'; +import { join } from 'node:path'; +import { promisify } from 'node:util'; -import { isNotNil } from '../util/isNotNil'; +import { isNotNil } from '../util/isNotNil.js'; const resolve4 = promisify(resolve4Cb); const resolve6 = promisify(resolve6Cb); diff --git a/ts/scripts/generate-fixtures.ts b/ts/scripts/generate-fixtures.ts index 4939610a4a6..c06780649ae 100644 --- a/ts/scripts/generate-fixtures.ts +++ b/ts/scripts/generate-fixtures.ts @@ -1,10 +1,10 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import fs from 'fs/promises'; -import path from 'path'; -import crypto from 'crypto'; -import { execFileSync } from 'child_process'; +import fs from 'node:fs/promises'; +import path from 'node:path'; +import crypto from 'node:crypto'; +import { execFileSync } from 'node:child_process'; const FIXTURES = path.join(__dirname, '..', '..', 'fixtures'); const SIZE = 256 * 1024; diff --git a/ts/scripts/generate-icu-types.ts b/ts/scripts/generate-icu-types.ts index 60dcc0b61d2..085b39defc9 100644 --- a/ts/scripts/generate-icu-types.ts +++ b/ts/scripts/generate-icu-types.ts @@ -1,18 +1,18 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import fs from 'fs/promises'; -import { createHash } from 'crypto'; -import path from 'path'; +import fs from 'node:fs/promises'; +import { createHash } from 'node:crypto'; +import path from 'node:path'; import ts from 'typescript'; import prettier from 'prettier'; -import { getICUMessageParams } from '../util/getICUMessageParams'; -import type { ICUMessageParamType } from '../util/getICUMessageParams'; -import { missingCaseError } from '../util/missingCaseError'; +import { getICUMessageParams } from '../util/getICUMessageParams.js'; +import type { ICUMessageParamType } from '../util/getICUMessageParams.js'; +import { missingCaseError } from '../util/missingCaseError.js'; import globalMessages from '../../_locales/en/messages.json'; -import { DELETED_REGEXP } from './constants'; +import { DELETED_REGEXP } from './constants.js'; function translateParamType( param: ICUMessageParamType, diff --git a/ts/scripts/generate-preload-cache.ts b/ts/scripts/generate-preload-cache.ts index f3c8fede731..bef851578c4 100644 --- a/ts/scripts/generate-preload-cache.ts +++ b/ts/scripts/generate-preload-cache.ts @@ -8,8 +8,8 @@ import { mkdir, mkdtemp, rm, rename } from 'node:fs/promises'; import pTimeout from 'p-timeout'; import ELECTRON_BIN from 'electron'; -import { MINUTE } from '../util/durations'; -import { explodePromise } from '../util/explodePromise'; +import { MINUTE } from '../util/durations/index.js'; +import { explodePromise } from '../util/explodePromise.js'; const ROOT_DIR = join(__dirname, '..', '..'); diff --git a/ts/scripts/generate-tray-icons.ts b/ts/scripts/generate-tray-icons.ts index 3408bca5427..16b27dce07d 100644 --- a/ts/scripts/generate-tray-icons.ts +++ b/ts/scripts/generate-tray-icons.ts @@ -4,7 +4,7 @@ import { createCanvas, GlobalFonts, loadImage } from '@napi-rs/canvas'; import { join } from 'node:path'; import { mkdir, rm, writeFile } from 'node:fs/promises'; -import { strictAssert } from '../util/assert'; +import { strictAssert } from '../util/assert.js'; const cwd = __dirname; const fontsDir = join(cwd, '..', '..', 'fonts'); diff --git a/ts/scripts/get-emoji-locales.ts b/ts/scripts/get-emoji-locales.ts index 993042c37e4..e8029306610 100644 --- a/ts/scripts/get-emoji-locales.ts +++ b/ts/scripts/get-emoji-locales.ts @@ -7,9 +7,9 @@ import { join } from 'node:path'; import z from 'zod'; import prettier from 'prettier'; -import type { OptionalResourceType } from '../types/OptionalResource'; -import { OptionalResourcesDictSchema } from '../types/OptionalResource'; -import { parseUnknown } from '../util/schemas'; +import type { OptionalResourceType } from '../types/OptionalResource.js'; +import { OptionalResourcesDictSchema } from '../types/OptionalResource.js'; +import { parseUnknown } from '../util/schemas.js'; const MANIFEST_URL = 'https://updates.signal.org/dynamic/android/emoji/search/manifest.json'; diff --git a/ts/scripts/get-expire-time.ts b/ts/scripts/get-expire-time.ts index 4d33e266f2f..4d38ce4cfc2 100644 --- a/ts/scripts/get-expire-time.ts +++ b/ts/scripts/get-expire-time.ts @@ -1,13 +1,13 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { join } from 'path'; -import { execSync } from 'child_process'; -import { writeFileSync } from 'fs'; +import { join } from 'node:path'; +import { execSync } from 'node:child_process'; +import { writeFileSync } from 'node:fs'; -import { DAY } from '../util/durations'; +import { DAY } from '../util/durations/index.js'; import { version } from '../../package.json'; -import { isNotUpdatable } from '../util/version'; +import { isNotUpdatable } from '../util/version.js'; const unixTimestamp = parseInt( process.env.SOURCE_DATE_EPOCH || diff --git a/ts/scripts/get-jumbomoji.ts b/ts/scripts/get-jumbomoji.ts index aef02473a0b..c03811e7dea 100644 --- a/ts/scripts/get-jumbomoji.ts +++ b/ts/scripts/get-jumbomoji.ts @@ -7,9 +7,9 @@ import { join } from 'node:path'; import z from 'zod'; import prettier from 'prettier'; -import type { OptionalResourceType } from '../types/OptionalResource'; -import { OptionalResourcesDictSchema } from '../types/OptionalResource'; -import { parseUnknown } from '../util/schemas'; +import type { OptionalResourceType } from '../types/OptionalResource.js'; +import { OptionalResourcesDictSchema } from '../types/OptionalResource.js'; +import { parseUnknown } from '../util/schemas.js'; const VERSION = 10; diff --git a/ts/scripts/get-strings.ts b/ts/scripts/get-strings.ts index 756aaef9c00..7ed43208074 100644 --- a/ts/scripts/get-strings.ts +++ b/ts/scripts/get-strings.ts @@ -8,7 +8,7 @@ import prettier from 'prettier'; import pMap from 'p-map'; import z from 'zod'; -import { authenticate, API_BASE, PROJECT_ID } from '../util/smartling'; +import { authenticate, API_BASE, PROJECT_ID } from '../util/smartling.js'; const { SMARTLING_USER, SMARTLING_SECRET } = process.env; diff --git a/ts/scripts/mark-unused-strings-deleted.ts b/ts/scripts/mark-unused-strings-deleted.ts index 3085a8da9ba..827c606749a 100644 --- a/ts/scripts/mark-unused-strings-deleted.ts +++ b/ts/scripts/mark-unused-strings-deleted.ts @@ -3,7 +3,7 @@ import { spawnSync } from 'node:child_process'; import path from 'node:path'; import { readFileSync, writeFileSync } from 'node:fs'; -import { DELETED_REGEXP } from './constants'; +import { DELETED_REGEXP } from './constants.js'; const rootDir = path.resolve(__dirname, '..', '..'); const messagesPath = path.join(rootDir, '_locales/en/messages.json'); diff --git a/ts/scripts/notarize.ts b/ts/scripts/notarize.ts index 5e65eef9d25..15745a4c923 100644 --- a/ts/scripts/notarize.ts +++ b/ts/scripts/notarize.ts @@ -1,7 +1,7 @@ // Copyright 2019 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import path from 'path'; +import path from 'node:path'; import type { AfterPackContext } from 'electron-builder'; import { notarize } from '@electron/notarize'; diff --git a/ts/scripts/prune-macos-release.ts b/ts/scripts/prune-macos-release.ts index 3bc390be428..478ceb9210d 100644 --- a/ts/scripts/prune-macos-release.ts +++ b/ts/scripts/prune-macos-release.ts @@ -3,7 +3,7 @@ import type { AfterPackContext } from 'electron-builder'; import fs, { readdir, rm } from 'node:fs/promises'; -import path from 'path'; +import path from 'node:path'; async function safeReaddir(dir: string): Promise | null> { try { diff --git a/ts/scripts/push-strings.ts b/ts/scripts/push-strings.ts index 88099a8ffba..73fab704481 100644 --- a/ts/scripts/push-strings.ts +++ b/ts/scripts/push-strings.ts @@ -4,7 +4,7 @@ import { randomBytes } from 'node:crypto'; import { readFile } from 'node:fs/promises'; -import { API_BASE, PROJECT_ID, authenticate } from '../util/smartling'; +import { API_BASE, PROJECT_ID, authenticate } from '../util/smartling.js'; const { SMARTLING_USER, SMARTLING_SECRET } = process.env; diff --git a/ts/scripts/remove-strings.ts b/ts/scripts/remove-strings.ts index 213a2155cd1..3a7f0f4862c 100644 --- a/ts/scripts/remove-strings.ts +++ b/ts/scripts/remove-strings.ts @@ -3,13 +3,13 @@ import chalk from 'chalk'; import execa from 'execa'; -import fs from 'fs/promises'; +import fs from 'node:fs/promises'; import pLimit from 'p-limit'; -import path from 'path'; +import path from 'node:path'; -import { MONTH } from '../util/durations'; -import { isOlderThan } from '../util/timestamp'; -import { DELETED_REGEXP } from './constants'; +import { MONTH } from '../util/durations/index.js'; +import { isOlderThan } from '../util/timestamp.js'; +import { DELETED_REGEXP } from './constants.js'; const ROOT_DIR = path.join(__dirname, '..', '..'); const MESSAGES_FILE = path.join(ROOT_DIR, '_locales', 'en', 'messages.json'); diff --git a/ts/scripts/sign-macos.ts b/ts/scripts/sign-macos.ts index 7e3a2c98815..0256897ca92 100644 --- a/ts/scripts/sign-macos.ts +++ b/ts/scripts/sign-macos.ts @@ -1,7 +1,7 @@ // Copyright 2019 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { execSync } from 'child_process'; +import { execSync } from 'node:child_process'; import { realpath } from 'fs-extra'; diff --git a/ts/scripts/sign-windows.ts b/ts/scripts/sign-windows.ts index 0d1cef95698..96b304defb6 100644 --- a/ts/scripts/sign-windows.ts +++ b/ts/scripts/sign-windows.ts @@ -1,7 +1,7 @@ // Copyright 2019 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { execSync } from 'child_process'; +import { execSync } from 'node:child_process'; import { realpath } from 'fs-extra'; diff --git a/ts/scripts/symbolicate-crash-report.ts b/ts/scripts/symbolicate-crash-report.ts index 1aa91258f11..ae00052f428 100644 --- a/ts/scripts/symbolicate-crash-report.ts +++ b/ts/scripts/symbolicate-crash-report.ts @@ -1,11 +1,11 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { tmpdir } from 'os'; -import { readFile, writeFile, mkdtemp } from 'fs/promises'; -import { gunzip as gunzipCb } from 'zlib'; -import { join, basename } from 'path'; -import { promisify } from 'util'; +import { tmpdir } from 'node:os'; +import { readFile, writeFile, mkdtemp } from 'node:fs/promises'; +import { gunzip as gunzipCb } from 'node:zlib'; +import { join, basename } from 'node:path'; +import { promisify } from 'node:util'; import { symbolicate } from '@electron/symbolicate-mac'; import pMap from 'p-map'; diff --git a/ts/scripts/test-electron.ts b/ts/scripts/test-electron.ts index 70d1d9957f9..cd3ed8d24e6 100644 --- a/ts/scripts/test-electron.ts +++ b/ts/scripts/test-electron.ts @@ -11,10 +11,10 @@ import z from 'zod'; import split2 from 'split2'; import logSymbols from 'log-symbols'; -import { explodePromise } from '../util/explodePromise'; -import { missingCaseError } from '../util/missingCaseError'; -import { SECOND } from '../util/durations'; -import { parseUnknown } from '../util/schemas'; +import { explodePromise } from '../util/explodePromise.js'; +import { missingCaseError } from '../util/missingCaseError.js'; +import { SECOND } from '../util/durations/index.js'; +import { parseUnknown } from '../util/schemas.js'; const ROOT_DIR = join(__dirname, '..', '..'); diff --git a/ts/scripts/test-release.ts b/ts/scripts/test-release.ts index fbfc2ecdb0b..552c338d324 100644 --- a/ts/scripts/test-release.ts +++ b/ts/scripts/test-release.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import asar from '@electron/asar'; -import assert from 'assert'; -import { join } from 'path'; +import assert from 'node:assert'; +import { join } from 'node:path'; import { _electron as electron } from 'playwright'; import packageJson from '../../package.json'; diff --git a/ts/scripts/update-gha.ts b/ts/scripts/update-gha.ts index e4e7c39acd5..65594229f1f 100644 --- a/ts/scripts/update-gha.ts +++ b/ts/scripts/update-gha.ts @@ -6,8 +6,8 @@ import { readFile, readdir, writeFile } from 'node:fs/promises'; import z from 'zod'; import semver from 'semver'; -import { drop } from '../util/drop'; -import { strictAssert } from '../util/assert'; +import { drop } from '../util/drop.js'; +import { strictAssert } from '../util/assert.js'; const { GITHUB_TOKEN } = process.env; diff --git a/ts/services/ActiveWindowService.ts b/ts/services/ActiveWindowService.ts index 0b9872e8dd1..a1c06ddeff6 100644 --- a/ts/services/ActiveWindowService.ts +++ b/ts/services/ActiveWindowService.ts @@ -1,7 +1,7 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { throttle } from '../util/throttle'; +import { throttle } from '../util/throttle.js'; // Idle timer - you're active for ACTIVE_TIMEOUT after one of these events const ACTIVE_TIMEOUT = 15 * 1000; diff --git a/ts/services/BeforeNavigate.ts b/ts/services/BeforeNavigate.ts index 0e75184993e..cca680a7e04 100644 --- a/ts/services/BeforeNavigate.ts +++ b/ts/services/BeforeNavigate.ts @@ -1,12 +1,12 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log'; +import { createLogger } from '../logging/log.js'; -import { SECOND } from '../util/durations'; -import { sleep } from '../util/sleep'; +import { SECOND } from '../util/durations/index.js'; +import { sleep } from '../util/sleep.js'; -import type { Location } from '../types/Nav'; +import type { Location } from '../types/Nav.js'; const log = createLogger('BeforeNavigate'); diff --git a/ts/services/LinkPreview.ts b/ts/services/LinkPreview.ts index 851cda28deb..ff8826de590 100644 --- a/ts/services/LinkPreview.ts +++ b/ts/services/LinkPreview.ts @@ -4,36 +4,36 @@ import { debounce, omit } from 'lodash'; import { CallLinkRootKey, CallLinkEpoch } from '@signalapp/ringrtc'; -import type { LinkPreviewWithHydratedData } from '../types/message/LinkPreviews'; +import type { LinkPreviewWithHydratedData } from '../types/message/LinkPreviews.js'; import type { LinkPreviewImage, LinkPreviewResult, LinkPreviewSourceType, MaybeGrabLinkPreviewOptionsType, AddLinkPreviewOptionsType, -} from '../types/LinkPreview'; -import type { LinkPreviewImage as LinkPreviewFetchImage } from '../linkPreviews/linkPreviewFetch'; -import * as Errors from '../types/errors'; -import type { StickerPackType as StickerPackDBType } from '../sql/Interface'; -import type { MIMEType } from '../types/MIME'; -import * as Bytes from '../Bytes'; -import { sha256 } from '../Crypto'; -import * as LinkPreview from '../types/LinkPreview'; -import * as Stickers from '../types/Stickers'; -import * as VisualAttachment from '../types/VisualAttachment'; -import { createLogger } from '../logging/log'; -import { IMAGE_JPEG, IMAGE_WEBP, stringToMIMEType } from '../types/MIME'; -import { SECOND } from '../util/durations'; -import { autoScale } from '../util/handleImageAttachment'; -import { dropNull } from '../util/dropNull'; -import { fileToBytes } from '../util/fileToBytes'; -import { imageToBlurHash } from '../util/imageToBlurHash'; -import { maybeParseUrl } from '../util/url'; -import { sniffImageMimeType } from '../util/sniffImageMimeType'; -import { drop } from '../util/drop'; -import { calling } from './calling'; -import { getKeyAndEpochFromCallLink } from '../util/callLinks'; -import { getRoomIdFromCallLink } from '../util/callLinksRingrtc'; +} from '../types/LinkPreview.js'; +import type { LinkPreviewImage as LinkPreviewFetchImage } from '../linkPreviews/linkPreviewFetch.js'; +import * as Errors from '../types/errors.js'; +import type { StickerPackType as StickerPackDBType } from '../sql/Interface.js'; +import type { MIMEType } from '../types/MIME.js'; +import * as Bytes from '../Bytes.js'; +import { sha256 } from '../Crypto.js'; +import * as LinkPreview from '../types/LinkPreview.js'; +import * as Stickers from '../types/Stickers.js'; +import * as VisualAttachment from '../types/VisualAttachment.js'; +import { createLogger } from '../logging/log.js'; +import { IMAGE_JPEG, IMAGE_WEBP, stringToMIMEType } from '../types/MIME.js'; +import { SECOND } from '../util/durations/index.js'; +import { autoScale } from '../util/handleImageAttachment.js'; +import { dropNull } from '../util/dropNull.js'; +import { fileToBytes } from '../util/fileToBytes.js'; +import { imageToBlurHash } from '../util/imageToBlurHash.js'; +import { maybeParseUrl } from '../util/url.js'; +import { sniffImageMimeType } from '../util/sniffImageMimeType.js'; +import { drop } from '../util/drop.js'; +import { calling } from './calling.js'; +import { getKeyAndEpochFromCallLink } from '../util/callLinks.js'; +import { getRoomIdFromCallLink } from '../util/callLinksRingrtc.js'; const log = createLogger('LinkPreview'); diff --git a/ts/services/MessageCache.ts b/ts/services/MessageCache.ts index e24b9030641..dd914af857f 100644 --- a/ts/services/MessageCache.ts +++ b/ts/services/MessageCache.ts @@ -4,19 +4,19 @@ import { throttle } from 'lodash'; import { LRUCache } from 'lru-cache'; -import { createLogger } from '../logging/log'; -import { MessageModel } from '../models/messages'; -import { DataReader, DataWriter } from '../sql/Client'; -import { getMessageConversation } from '../util/getMessageConversation'; -import { getSenderIdentifier } from '../util/getSenderIdentifier'; -import { isNotNil } from '../util/isNotNil'; -import { isStory } from '../messages/helpers'; -import { getStoryDataFromMessageAttributes } from './storyLoader'; -import { postSaveUpdates } from '../util/cleanup'; +import { createLogger } from '../logging/log.js'; +import { MessageModel } from '../models/messages.js'; +import { DataReader, DataWriter } from '../sql/Client.js'; +import { getMessageConversation } from '../util/getMessageConversation.js'; +import { getSenderIdentifier } from '../util/getSenderIdentifier.js'; +import { isNotNil } from '../util/isNotNil.js'; +import { isStory } from '../messages/helpers.js'; +import { getStoryDataFromMessageAttributes } from './storyLoader.js'; +import { postSaveUpdates } from '../util/cleanup.js'; -import type { MessageAttributesType } from '../model-types.d'; -import type { SendStateByConversationId } from '../messages/MessageSendState'; -import type { StoredJob } from '../jobs/types'; +import type { MessageAttributesType } from '../model-types.d.ts'; +import type { SendStateByConversationId } from '../messages/MessageSendState.js'; +import type { StoredJob } from '../jobs/types.js'; const log = createLogger('MessageCache'); diff --git a/ts/services/MessageUpdater.ts b/ts/services/MessageUpdater.ts index faaee9b5059..b46e2b48c60 100644 --- a/ts/services/MessageUpdater.ts +++ b/ts/services/MessageUpdater.ts @@ -1,21 +1,21 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { MessageAttributesType } from '../model-types.d'; -import type { MessageModel } from '../models/messages'; -import { ReadStatus, maxReadStatus } from '../messages/MessageReadStatus'; -import { notificationService } from './notifications'; -import { SeenStatus } from '../MessageSeenStatus'; -import { queueUpdateMessage } from '../util/messageBatcher'; -import * as Errors from '../types/errors'; -import { createLogger } from '../logging/log'; -import { isValidTapToView } from '../util/isValidTapToView'; -import { getMessageIdForLogging } from '../util/idForLogging'; -import { eraseMessageContents } from '../util/cleanup'; -import { getSource, getSourceServiceId } from '../messages/helpers'; -import { isAciString } from '../util/isAciString'; -import { viewOnceOpenJobQueue } from '../jobs/viewOnceOpenJobQueue'; -import { drop } from '../util/drop'; +import type { MessageAttributesType } from '../model-types.d.ts'; +import type { MessageModel } from '../models/messages.js'; +import { ReadStatus, maxReadStatus } from '../messages/MessageReadStatus.js'; +import { notificationService } from './notifications.js'; +import { SeenStatus } from '../MessageSeenStatus.js'; +import { queueUpdateMessage } from '../util/messageBatcher.js'; +import * as Errors from '../types/errors.js'; +import { createLogger } from '../logging/log.js'; +import { isValidTapToView } from '../util/isValidTapToView.js'; +import { getMessageIdForLogging } from '../util/idForLogging.js'; +import { eraseMessageContents } from '../util/cleanup.js'; +import { getSource, getSourceServiceId } from '../messages/helpers.js'; +import { isAciString } from '../util/isAciString.js'; +import { viewOnceOpenJobQueue } from '../jobs/viewOnceOpenJobQueue.js'; +import { drop } from '../util/drop.js'; const log = createLogger('MessageUpdater'); diff --git a/ts/services/ZoomFactorService.ts b/ts/services/ZoomFactorService.ts index c1698ca18e3..0da760057f4 100644 --- a/ts/services/ZoomFactorService.ts +++ b/ts/services/ZoomFactorService.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { BrowserWindow } from 'electron'; import { ipcMain } from 'electron'; -import EventEmitter from 'events'; +import EventEmitter from 'node:events'; -import { createLogger } from '../logging/log'; +import { createLogger } from '../logging/log.js'; const log = createLogger('ZoomFactorService'); diff --git a/ts/services/addGlobalKeyboardShortcuts.ts b/ts/services/addGlobalKeyboardShortcuts.ts index 1bf9759be7e..ac9c4c5363f 100644 --- a/ts/services/addGlobalKeyboardShortcuts.ts +++ b/ts/services/addGlobalKeyboardShortcuts.ts @@ -1,15 +1,15 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import * as KeyboardLayout from './keyboardLayout'; -import { createLogger } from '../logging/log'; -import { PanelType } from '../types/Panels'; -import { clearConversationDraftAttachments } from '../util/clearConversationDraftAttachments'; -import { drop } from '../util/drop'; -import { matchOrQueryFocusable } from '../util/focusableSelectors'; -import { getQuotedMessageSelector } from '../state/selectors/composer'; -import { removeLinkPreview } from './LinkPreview'; -import { ForwardMessagesModalType } from '../components/ForwardMessagesModal'; +import * as KeyboardLayout from './keyboardLayout.js'; +import { createLogger } from '../logging/log.js'; +import { PanelType } from '../types/Panels.js'; +import { clearConversationDraftAttachments } from '../util/clearConversationDraftAttachments.js'; +import { drop } from '../util/drop.js'; +import { matchOrQueryFocusable } from '../util/focusableSelectors.js'; +import { getQuotedMessageSelector } from '../state/selectors/composer.js'; +import { removeLinkPreview } from './LinkPreview.js'; +import { ForwardMessagesModalType } from '../components/ForwardMessagesModal.js'; const log = createLogger('addGlobalKeyboardShortcuts'); diff --git a/ts/services/allLoaders.ts b/ts/services/allLoaders.ts index e2171005378..89752e6a780 100644 --- a/ts/services/allLoaders.ts +++ b/ts/services/allLoaders.ts @@ -2,39 +2,45 @@ // SPDX-License-Identifier: AGPL-3.0-only // loader services -import { getBadgesForRedux, loadBadges } from './badgeLoader'; +import { getBadgesForRedux, loadBadges } from './badgeLoader.js'; import { getCallsHistoryForRedux, getCallsHistoryUnreadCountForRedux, loadCallHistory, -} from './callHistoryLoader'; -import { getCallLinksForRedux, loadCallLinks } from './callLinksLoader'; +} from './callHistoryLoader.js'; +import { getCallLinksForRedux, loadCallLinks } from './callLinksLoader.js'; import { getDistributionListsForRedux, loadDistributionLists, -} from './distributionListLoader'; -import { getDonationsForRedux, loadDonationReceipts } from './donationsLoader'; -import { getStoriesForRedux, loadStories } from './storyLoader'; -import { getUserDataForRedux, loadUserData } from './userLoader'; +} from './distributionListLoader.js'; +import { + getDonationsForRedux, + loadDonationReceipts, +} from './donationsLoader.js'; +import { getStoriesForRedux, loadStories } from './storyLoader.js'; +import { getUserDataForRedux, loadUserData } from './userLoader.js'; import { loadCachedProfiles as loadNotificationProfiles, getCachedProfiles as getNotificationProfiles, -} from './notificationProfilesService'; +} from './notificationProfilesService.js'; // old-style loaders import { getEmojiReducerState, loadRecentEmojis, -} from '../util/loadRecentEmojis'; +} from '../util/loadRecentEmojis.js'; import { load as loadStickers, getInitialState as getStickersReduxState, -} from '../types/Stickers'; +} from '../types/Stickers.js'; -import { type ReduxInitData } from '../state/initializeRedux'; -import { reinitializeRedux } from '../state/reinitializeRedux'; -import { getGifsStateForRedux, loadGifsState } from './gifsLoader'; -import { getChatFoldersForRedux, loadChatFolders } from './chatFoldersLoader'; +import { type ReduxInitData } from '../state/initializeRedux.js'; +import { reinitializeRedux } from '../state/reinitializeRedux.js'; +import { getGifsStateForRedux, loadGifsState } from './gifsLoader.js'; +import { + getChatFoldersForRedux, + loadChatFolders, +} from './chatFoldersLoader.js'; export async function loadAll(): Promise { await Promise.all([ diff --git a/ts/services/areWeASubscriber.ts b/ts/services/areWeASubscriber.ts index bf17d57f42a..79b966aae46 100644 --- a/ts/services/areWeASubscriber.ts +++ b/ts/services/areWeASubscriber.ts @@ -1,10 +1,10 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { StorageInterface } from '../types/Storage.d'; -import type { WebAPIType } from '../textsecure/WebAPI'; -import { LatestQueue } from '../util/LatestQueue'; -import { waitForOnline } from '../util/waitForOnline'; +import type { StorageInterface } from '../types/Storage.d.ts'; +import type { WebAPIType } from '../textsecure/WebAPI.js'; +import { LatestQueue } from '../util/LatestQueue.js'; +import { waitForOnline } from '../util/waitForOnline.js'; // This is only exported for testing. export class AreWeASubscriberService { diff --git a/ts/services/audioRecorder.ts b/ts/services/audioRecorder.ts index 76cacc52201..d70c43bb96f 100644 --- a/ts/services/audioRecorder.ts +++ b/ts/services/audioRecorder.ts @@ -1,10 +1,10 @@ // Copyright 2016 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log'; -import * as Errors from '../types/errors'; -import { requestMicrophonePermissions } from '../util/requestMicrophonePermissions'; -import { WebAudioRecorder } from '../WebAudioRecorder'; +import { createLogger } from '../logging/log.js'; +import * as Errors from '../types/errors.js'; +import { requestMicrophonePermissions } from '../util/requestMicrophonePermissions.js'; +import { WebAudioRecorder } from '../WebAudioRecorder.js'; const log = createLogger('audioRecorder'); diff --git a/ts/services/backups/api.ts b/ts/services/backups/api.ts index 06268e0ee74..de12b429e9b 100644 --- a/ts/services/backups/api.ts +++ b/ts/services/backups/api.ts @@ -3,7 +3,7 @@ import { type Readable } from 'node:stream'; -import { strictAssert } from '../../util/assert'; +import { strictAssert } from '../../util/assert.js'; import type { WebAPIType, AttachmentUploadFormResponseType, @@ -13,17 +13,17 @@ import type { BackupListMediaResponseType, TransferArchiveType, SubscriptionResponseType, -} from '../../textsecure/WebAPI'; -import type { BackupCredentials } from './credentials'; +} from '../../textsecure/WebAPI.js'; +import type { BackupCredentials } from './credentials.js'; import { BackupCredentialType, type BackupsSubscriptionType, type SubscriptionCostType, -} from '../../types/backups'; -import { uploadFile } from '../../util/uploadAttachment'; -import { HTTPError } from '../../textsecure/Errors'; -import { createLogger } from '../../logging/log'; -import { toLogFormat } from '../../types/errors'; +} from '../../types/backups.js'; +import { uploadFile } from '../../util/uploadAttachment.js'; +import { HTTPError } from '../../textsecure/Errors.js'; +import { createLogger } from '../../logging/log.js'; +import { toLogFormat } from '../../types/errors.js'; const log = createLogger('api'); diff --git a/ts/services/backups/constants.ts b/ts/services/backups/constants.ts index f5ba4ce8c34..83270b19f69 100644 --- a/ts/services/backups/constants.ts +++ b/ts/services/backups/constants.ts @@ -1,8 +1,8 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { Backups } from '../../protobuf'; -import type { ConversationColorType } from '../../types/Colors'; +import { Backups } from '../../protobuf/index.js'; +import type { ConversationColorType } from '../../types/Colors.js'; export const BACKUP_VERSION = 1; diff --git a/ts/services/backups/credentials.ts b/ts/services/backups/credentials.ts index 71304af2b24..2fc52bef7b5 100644 --- a/ts/services/backups/credentials.ts +++ b/ts/services/backups/credentials.ts @@ -12,38 +12,43 @@ import { import { type BackupKey } from '@signalapp/libsignal-client/dist/AccountKeys'; import { throttle } from 'lodash/fp'; -import * as Bytes from '../../Bytes'; -import { createLogger } from '../../logging/log'; -import { strictAssert } from '../../util/assert'; -import { drop } from '../../util/drop'; -import { isMoreRecentThan, toDayMillis } from '../../util/timestamp'; -import { DAY, DurationInSeconds, HOUR, MINUTE } from '../../util/durations'; -import { BackOff, FIBONACCI_TIMEOUTS } from '../../util/BackOff'; -import { missingCaseError } from '../../util/missingCaseError'; +import * as Bytes from '../../Bytes.js'; +import { createLogger } from '../../logging/log.js'; +import { strictAssert } from '../../util/assert.js'; +import { drop } from '../../util/drop.js'; +import { isMoreRecentThan, toDayMillis } from '../../util/timestamp.js'; +import { + DAY, + DurationInSeconds, + HOUR, + MINUTE, +} from '../../util/durations/index.js'; +import { BackOff, FIBONACCI_TIMEOUTS } from '../../util/BackOff.js'; +import { missingCaseError } from '../../util/missingCaseError.js'; import { type BackupCdnReadCredentialType, type BackupCredentialWrapperType, type BackupPresentationHeadersType, type BackupSignedPresentationType, BackupCredentialType, -} from '../../types/backups'; -import { toLogFormat } from '../../types/errors'; -import { HTTPError } from '../../textsecure/Errors'; +} from '../../types/backups.js'; +import { toLogFormat } from '../../types/errors.js'; +import { HTTPError } from '../../textsecure/Errors.js'; import type { GetBackupCredentialsResponseType, GetBackupCDNCredentialsResponseType, -} from '../../textsecure/WebAPI'; +} from '../../textsecure/WebAPI.js'; import { getBackupKey, getBackupMediaRootKey, getBackupSignatureKey, getBackupMediaSignatureKey, -} from './crypto'; -import { isTestOrMockEnvironment } from '../../environment'; +} from './crypto.js'; +import { isTestOrMockEnvironment } from '../../environment.js'; import { areRemoteBackupsTurnedOn, canAttemptRemoteBackupDownload, -} from '../../util/isBackupEnabled'; +} from '../../util/isBackupEnabled.js'; const log = createLogger('Backup.Credentials'); diff --git a/ts/services/backups/crypto.ts b/ts/services/backups/crypto.ts index b0b79698c3c..b05af4a8474 100644 --- a/ts/services/backups/crypto.ts +++ b/ts/services/backups/crypto.ts @@ -9,9 +9,9 @@ import { } from '@signalapp/libsignal-client/dist/AccountKeys'; import { MessageBackupKey } from '@signalapp/libsignal-client/dist/MessageBackup'; -import { strictAssert } from '../../util/assert'; -import type { AciString } from '../../types/ServiceId'; -import { toAciObject } from '../../util/ServiceId'; +import { strictAssert } from '../../util/assert.js'; +import type { AciString } from '../../types/ServiceId.js'; +import { toAciObject } from '../../util/ServiceId.js'; const getMemoizedBackupKey = memoizee((accountEntropyPool: string) => { return AccountEntropyPool.deriveBackupKey(accountEntropyPool); diff --git a/ts/services/backups/errors.ts b/ts/services/backups/errors.ts index efcde06d92a..38cac2566a4 100644 --- a/ts/services/backups/errors.ts +++ b/ts/services/backups/errors.ts @@ -4,7 +4,7 @@ import type Long from 'long'; -import { InstallScreenBackupError } from '../../types/InstallScreen'; +import { InstallScreenBackupError } from '../../types/InstallScreen.js'; export class BackupInstallerError extends Error { constructor( diff --git a/ts/services/backups/export.ts b/ts/services/backups/export.ts index 367bd13876a..9be374afce6 100644 --- a/ts/services/backups/export.ts +++ b/ts/services/backups/export.ts @@ -4,66 +4,71 @@ import Long from 'long'; import { Aci, Pni, ServiceId } from '@signalapp/libsignal-client'; import type { BackupLevel } from '@signalapp/libsignal-client/zkgroup'; -import { dirname } from 'path'; +import { dirname } from 'node:path'; import pMap from 'p-map'; import pTimeout from 'p-timeout'; -import { Readable } from 'stream'; +import { Readable } from 'node:stream'; import { isNumber } from 'lodash'; import { CallLinkRootKey } from '@signalapp/ringrtc'; -import { Backups, SignalService } from '../../protobuf'; +import { Backups, SignalService } from '../../protobuf/index.js'; import { DataReader, DataWriter, pauseWriteAccess, resumeWriteAccess, -} from '../../sql/Client'; +} from '../../sql/Client.js'; import type { PageMessagesCursorType, IdentityKeyType, -} from '../../sql/Interface'; -import { createLogger } from '../../logging/log'; -import { GiftBadgeStates } from '../../components/conversation/Message'; -import { type CustomColorType } from '../../types/Colors'; -import { StorySendMode, MY_STORY_ID } from '../../types/Stories'; -import { getStickerPacksForBackup } from '../../types/Stickers'; +} from '../../sql/Interface.js'; +import { createLogger } from '../../logging/log.js'; +import { GiftBadgeStates } from '../../components/conversation/Message.js'; +import { type CustomColorType } from '../../types/Colors.js'; +import { StorySendMode, MY_STORY_ID } from '../../types/Stories.js'; +import { getStickerPacksForBackup } from '../../types/Stickers.js'; import { isPniString, isServiceIdString, type AciString, type ServiceIdString, -} from '../../types/ServiceId'; -import type { RawBodyRange } from '../../types/BodyRange'; -import { PaymentEventKind } from '../../types/Payment'; -import { MessageRequestResponseEvent } from '../../types/MessageRequestResponseEvent'; +} from '../../types/ServiceId.js'; +import type { RawBodyRange } from '../../types/BodyRange.js'; +import { PaymentEventKind } from '../../types/Payment.js'; +import { MessageRequestResponseEvent } from '../../types/MessageRequestResponseEvent.js'; import type { ConversationAttributesType, MessageAttributesType, QuotedAttachmentType, -} from '../../model-types.d'; -import { drop } from '../../util/drop'; -import { isNotNil } from '../../util/isNotNil'; -import { explodePromise } from '../../util/explodePromise'; +} from '../../model-types.d.ts'; +import { drop } from '../../util/drop.js'; +import { isNotNil } from '../../util/isNotNil.js'; +import { explodePromise } from '../../util/explodePromise.js'; import { isDirectConversation, isGroup, isGroupV1, isGroupV2, isMe, -} from '../../util/whatTypeOfConversation'; -import { uuidToBytes } from '../../util/uuidToBytes'; -import { strictAssert } from '../../util/assert'; -import { getSafeLongFromTimestamp } from '../../util/timestampLongUtils'; -import { DAY, MINUTE, SECOND, DurationInSeconds } from '../../util/durations'; +} from '../../util/whatTypeOfConversation.js'; +import { uuidToBytes } from '../../util/uuidToBytes.js'; +import { strictAssert } from '../../util/assert.js'; +import { getSafeLongFromTimestamp } from '../../util/timestampLongUtils.js'; +import { + DAY, + MINUTE, + SECOND, + DurationInSeconds, +} from '../../util/durations/index.js'; import { PhoneNumberDiscoverability, parsePhoneNumberDiscoverability, -} from '../../util/phoneNumberDiscoverability'; +} from '../../util/phoneNumberDiscoverability.js'; import { PhoneNumberSharingMode, parsePhoneNumberSharingMode, -} from '../../util/phoneNumberSharingMode'; -import { missingCaseError } from '../../util/missingCaseError'; +} from '../../util/phoneNumberSharingMode.js'; +import { missingCaseError } from '../../util/missingCaseError.js'; import { isCallHistory, isChatSessionRefreshed, @@ -88,20 +93,20 @@ import { isJoinedSignalNotification, isTitleTransitionNotification, isMessageRequestResponse, -} from '../../state/selectors/message'; -import * as Bytes from '../../Bytes'; -import { canBeSynced as canPreferredReactionEmojiBeSynced } from '../../reactions/preferredReactionEmoji'; -import { SendStatus } from '../../messages/MessageSendState'; -import { BACKUP_VERSION } from './constants'; +} from '../../state/selectors/message.js'; +import * as Bytes from '../../Bytes.js'; +import { canBeSynced as canPreferredReactionEmojiBeSynced } from '../../reactions/preferredReactionEmoji.js'; +import { SendStatus } from '../../messages/MessageSendState.js'; +import { BACKUP_VERSION } from './constants.js'; import { getMessageIdForLogging, getConversationIdForLogging, -} from '../../util/idForLogging'; -import { makeLookup } from '../../util/makeLookup'; +} from '../../util/idForLogging.js'; +import { makeLookup } from '../../util/makeLookup.js'; import type { CallHistoryDetails, CallStatus, -} from '../../types/CallDisposition'; +} from '../../types/CallDisposition.js'; import { CallMode, CallDirection, @@ -109,59 +114,59 @@ import { DirectCallStatus, GroupCallStatus, AdhocCallStatus, -} from '../../types/CallDisposition'; -import { isAciString } from '../../util/isAciString'; -import { hslToRGBInt } from '../../util/hslToRGB'; -import type { AboutMe, LocalChatStyle } from './types'; -import { BackupType } from './types'; -import { messageHasPaymentEvent } from '../../messages/helpers'; +} from '../../types/CallDisposition.js'; +import { isAciString } from '../../util/isAciString.js'; +import { hslToRGBInt } from '../../util/hslToRGB.js'; +import type { AboutMe, LocalChatStyle } from './types.js'; +import { BackupType } from './types.js'; +import { messageHasPaymentEvent } from '../../messages/helpers.js'; import { numberToAddressType, numberToPhoneType, -} from '../../types/EmbeddedContact'; -import { toLogFormat } from '../../types/errors'; +} from '../../types/EmbeddedContact.js'; +import { toLogFormat } from '../../types/errors.js'; import { type AttachmentType, isGIF, isDownloaded, hasRequiredInformationForBackup, -} from '../../types/Attachment'; -import { getFilePointerForAttachment } from './util/filePointers'; -import { getBackupMediaRootKey } from './crypto'; +} from '../../types/Attachment.js'; +import { getFilePointerForAttachment } from './util/filePointers.js'; +import { getBackupMediaRootKey } from './crypto.js'; import type { CoreAttachmentBackupJobType, PartialAttachmentLocalBackupJobType, -} from '../../types/AttachmentBackup'; -import { AttachmentBackupManager } from '../../jobs/AttachmentBackupManager'; -import { AttachmentLocalBackupManager } from '../../jobs/AttachmentLocalBackupManager'; -import { getBackupCdnInfo, getMediaNameForAttachment } from './util/mediaId'; -import { calculateExpirationTimestamp } from '../../util/expirationTimer'; -import { ReadStatus } from '../../messages/MessageReadStatus'; -import { CallLinkRestrictions } from '../../types/CallLink'; +} from '../../types/AttachmentBackup.js'; +import { AttachmentBackupManager } from '../../jobs/AttachmentBackupManager.js'; +import { AttachmentLocalBackupManager } from '../../jobs/AttachmentLocalBackupManager.js'; +import { getBackupCdnInfo, getMediaNameForAttachment } from './util/mediaId.js'; +import { calculateExpirationTimestamp } from '../../util/expirationTimer.js'; +import { ReadStatus } from '../../messages/MessageReadStatus.js'; +import { CallLinkRestrictions } from '../../types/CallLink.js'; import { isCallHistoryForUnusedCallLink, toAdminKeyBytes, -} from '../../util/callLinks'; +} from '../../util/callLinks.js'; import { getRoomIdFromRootKey, toEpochBytes, -} from '../../util/callLinksRingrtc'; -import { SeenStatus } from '../../MessageSeenStatus'; -import { migrateAllMessages } from '../../messages/migrateMessageData'; -import { isBodyTooLong, trimBody } from '../../util/longAttachment'; -import { generateBackupsSubscriberData } from '../../util/backupSubscriptionData'; +} from '../../util/callLinksRingrtc.js'; +import { SeenStatus } from '../../MessageSeenStatus.js'; +import { migrateAllMessages } from '../../messages/migrateMessageData.js'; +import { isBodyTooLong, trimBody } from '../../util/longAttachment.js'; +import { generateBackupsSubscriberData } from '../../util/backupSubscriptionData.js'; import { getEnvironment, isTestEnvironment, isTestOrMockEnvironment, -} from '../../environment'; -import { calculateLightness } from '../../util/getHSL'; -import { isSignalServiceId } from '../../util/isSignalConversation'; -import { isValidE164 } from '../../util/isValidE164'; -import { toDayOfWeekArray } from '../../types/NotificationProfile'; -import { getLinkPreviewSetting } from '../../types/LinkPreview'; -import { getTypingIndicatorSetting } from '../../types/Util'; -import { KIBIBYTE } from '../../types/AttachmentSize'; +} from '../../environment.js'; +import { calculateLightness } from '../../util/getHSL.js'; +import { isSignalServiceId } from '../../util/isSignalConversation.js'; +import { isValidE164 } from '../../util/isValidE164.js'; +import { toDayOfWeekArray } from '../../types/NotificationProfile.js'; +import { getLinkPreviewSetting } from '../../types/LinkPreview.js'; +import { getTypingIndicatorSetting } from '../../types/Util.js'; +import { KIBIBYTE } from '../../types/AttachmentSize.js'; const log = createLogger('export'); diff --git a/ts/services/backups/import.ts b/ts/services/backups/import.ts index b9cb0eaa619..194dcf0adfc 100644 --- a/ts/services/backups/import.ts +++ b/ts/services/backups/import.ts @@ -8,49 +8,49 @@ import { } from '@signalapp/libsignal-client/zkgroup'; import { v7 as generateUuid } from 'uuid'; import pMap from 'p-map'; -import { Writable } from 'stream'; +import { Writable } from 'node:stream'; import { isNumber } from 'lodash'; import { CallLinkRootKey } from '@signalapp/ringrtc'; import type Long from 'long'; -import { Backups, SignalService } from '../../protobuf'; -import { DataReader, DataWriter } from '../../sql/Client'; +import { Backups, SignalService } from '../../protobuf/index.js'; +import { DataReader, DataWriter } from '../../sql/Client.js'; import { AttachmentDownloadSource, type StoryDistributionWithMembersType, type IdentityKeyType, -} from '../../sql/Interface'; -import { createLogger } from '../../logging/log'; -import { GiftBadgeStates } from '../../components/conversation/Message'; -import { StorySendMode, MY_STORY_ID } from '../../types/Stories'; -import type { AciString, ServiceIdString } from '../../types/ServiceId'; -import * as LinkPreview from '../../types/LinkPreview'; +} from '../../sql/Interface.js'; +import { createLogger } from '../../logging/log.js'; +import { GiftBadgeStates } from '../../components/conversation/Message.js'; +import { StorySendMode, MY_STORY_ID } from '../../types/Stories.js'; +import type { AciString, ServiceIdString } from '../../types/ServiceId.js'; +import * as LinkPreview from '../../types/LinkPreview.js'; import { fromAciObject, fromPniObject, fromServiceIdObject, -} from '../../types/ServiceId'; -import { isStoryDistributionId } from '../../types/StoryDistributionId'; -import * as Errors from '../../types/errors'; -import { PaymentEventKind } from '../../types/Payment'; -import { MessageRequestResponseEvent } from '../../types/MessageRequestResponseEvent'; +} from '../../types/ServiceId.js'; +import { isStoryDistributionId } from '../../types/StoryDistributionId.js'; +import * as Errors from '../../types/errors.js'; +import { PaymentEventKind } from '../../types/Payment.js'; +import { MessageRequestResponseEvent } from '../../types/MessageRequestResponseEvent.js'; import { ContactFormType, AddressType as ContactAddressType, -} from '../../types/EmbeddedContact'; +} from '../../types/EmbeddedContact.js'; import { STICKERPACK_ID_BYTE_LEN, STICKERPACK_KEY_BYTE_LEN, createPacksFromBackup, type StickerPackPointerType, -} from '../../types/Stickers'; +} from '../../types/Stickers.js'; import type { ConversationColorType, CustomColorsItemType, CustomColorType, CustomColorDataType, -} from '../../types/Colors'; -import { SEALED_SENDER } from '../../types/SealedSender'; +} from '../../types/Colors.js'; +import { SEALED_SENDER } from '../../types/SealedSender.js'; import type { ConversationAttributesType, CustomError, @@ -58,53 +58,59 @@ import type { MessageReactionType, EditHistoryType, QuotedMessageType, -} from '../../model-types.d'; -import { assertDev, strictAssert } from '../../util/assert'; +} from '../../model-types.d.ts'; +import { assertDev, strictAssert } from '../../util/assert.js'; import { getCheckedTimestampFromLong, getCheckedTimestampOrUndefinedFromLong, getTimestampOrUndefinedFromLong, -} from '../../util/timestampLongUtils'; -import { MAX_SAFE_DATE } from '../../util/timestamp'; -import { DurationInSeconds, SECOND } from '../../util/durations'; -import { calculateExpirationTimestamp } from '../../util/expirationTimer'; -import { dropNull } from '../../util/dropNull'; +} from '../../util/timestampLongUtils.js'; +import { MAX_SAFE_DATE } from '../../util/timestamp.js'; +import { DurationInSeconds, SECOND } from '../../util/durations/index.js'; +import { calculateExpirationTimestamp } from '../../util/expirationTimer.js'; +import { dropNull } from '../../util/dropNull.js'; import { deriveGroupID, deriveGroupSecretParams, deriveGroupPublicParams, -} from '../../util/zkgroup'; -import { incrementMessageCounter } from '../../util/incrementMessageCounter'; -import { generateMessageId } from '../../util/generateMessageId'; -import { isAciString } from '../../util/isAciString'; -import { PhoneNumberDiscoverability } from '../../util/phoneNumberDiscoverability'; -import { PhoneNumberSharingMode } from '../../util/phoneNumberSharingMode'; -import { bytesToUuid } from '../../util/uuidToBytes'; -import { missingCaseError } from '../../util/missingCaseError'; -import { ReadStatus } from '../../messages/MessageReadStatus'; -import { SendStatus } from '../../messages/MessageSendState'; -import type { SendStateByConversationId } from '../../messages/MessageSendState'; -import { SeenStatus } from '../../MessageSeenStatus'; -import { constantTimeEqual, deriveAccessKey } from '../../Crypto'; -import * as Bytes from '../../Bytes'; -import { BACKUP_VERSION, WALLPAPER_TO_BUBBLE_COLOR } from './constants'; -import { UnsupportedBackupVersion } from './errors'; -import type { AboutMe, LocalChatStyle } from './types'; -import { BackupType } from './types'; -import { getBackupMediaRootKey } from './crypto'; -import type { GroupV2ChangeDetailType } from '../../groups'; -import { queueAttachmentDownloads } from '../../util/queueAttachmentDownloads'; -import { isNotNil } from '../../util/isNotNil'; -import { isGroup } from '../../util/whatTypeOfConversation'; -import { rgbIntToHSL } from '../../util/rgbToHSL'; +} from '../../util/zkgroup.js'; +import { incrementMessageCounter } from '../../util/incrementMessageCounter.js'; +import { generateMessageId } from '../../util/generateMessageId.js'; +import { isAciString } from '../../util/isAciString.js'; +import { PhoneNumberDiscoverability } from '../../util/phoneNumberDiscoverability.js'; +import { PhoneNumberSharingMode } from '../../util/phoneNumberSharingMode.js'; +import { bytesToUuid } from '../../util/uuidToBytes.js'; +import { missingCaseError } from '../../util/missingCaseError.js'; +import { ReadStatus } from '../../messages/MessageReadStatus.js'; +import { SendStatus } from '../../messages/MessageSendState.js'; +import type { SendStateByConversationId } from '../../messages/MessageSendState.js'; +import { SeenStatus } from '../../MessageSeenStatus.js'; +import { constantTimeEqual, deriveAccessKey } from '../../Crypto.js'; +import * as Bytes from '../../Bytes.js'; +import { BACKUP_VERSION, WALLPAPER_TO_BUBBLE_COLOR } from './constants.js'; +import { UnsupportedBackupVersion } from './errors.js'; +import type { AboutMe, LocalChatStyle } from './types.js'; +import { BackupType } from './types.js'; +import { getBackupMediaRootKey } from './crypto.js'; +import type { GroupV2ChangeDetailType } from '../../groups.js'; +import { queueAttachmentDownloads } from '../../util/queueAttachmentDownloads.js'; +import { isNotNil } from '../../util/isNotNil.js'; +import { isGroup } from '../../util/whatTypeOfConversation.js'; +import { rgbIntToHSL } from '../../util/rgbToHSL.js'; import { convertBackupMessageAttachmentToAttachment, convertFilePointerToAttachment, -} from './util/filePointers'; -import { filterAndClean, trimMessageWhitespace } from '../../types/BodyRange'; -import { APPLICATION_OCTET_STREAM, stringToMIMEType } from '../../types/MIME'; -import { groupAvatarJobQueue } from '../../jobs/groupAvatarJobQueue'; -import { AttachmentDownloadManager } from '../../jobs/AttachmentDownloadManager'; +} from './util/filePointers.js'; +import { + filterAndClean, + trimMessageWhitespace, +} from '../../types/BodyRange.js'; +import { + APPLICATION_OCTET_STREAM, + stringToMIMEType, +} from '../../types/MIME.js'; +import { groupAvatarJobQueue } from '../../jobs/groupAvatarJobQueue.js'; +import { AttachmentDownloadManager } from '../../jobs/AttachmentDownloadManager.js'; import { AdhocCallStatus, CallDirection, @@ -112,44 +118,44 @@ import { CallType, DirectCallStatus, GroupCallStatus, -} from '../../types/CallDisposition'; -import type { CallHistoryDetails } from '../../types/CallDisposition'; -import { CallLinkRestrictions, isCallLinkAdmin } from '../../types/CallLink'; -import type { CallLinkType } from '../../types/CallLink'; -import type { RawBodyRange } from '../../types/BodyRange'; +} from '../../types/CallDisposition.js'; +import type { CallHistoryDetails } from '../../types/CallDisposition.js'; +import { CallLinkRestrictions, isCallLinkAdmin } from '../../types/CallLink.js'; +import type { CallLinkType } from '../../types/CallLink.js'; +import type { RawBodyRange } from '../../types/BodyRange.js'; import { fromAdminKeyBytes, toCallHistoryFromUnusedCallLink, -} from '../../util/callLinks'; +} from '../../util/callLinks.js'; import { getRoomIdFromRootKey, fromEpochBytes, -} from '../../util/callLinksRingrtc'; -import { loadAllAndReinitializeRedux } from '../allLoaders'; +} from '../../util/callLinksRingrtc.js'; +import { loadAllAndReinitializeRedux } from '../allLoaders.js'; import { startBackupMediaDownload, resetBackupMediaDownloadStats, -} from '../../util/backupMediaDownload'; +} from '../../util/backupMediaDownload.js'; import { getEnvironment, isTestEnvironment, isTestOrMockEnvironment, -} from '../../environment'; -import { hasAttachmentDownloads } from '../../util/hasAttachmentDownloads'; -import { isAdhoc, isNightly } from '../../util/version'; -import { ToastType } from '../../types/Toast'; -import { isConversationAccepted } from '../../util/isConversationAccepted'; -import { saveBackupsSubscriberData } from '../../util/backupSubscriptionData'; -import { postSaveUpdates } from '../../util/cleanup'; -import type { LinkPreviewType } from '../../types/message/LinkPreviews'; -import { MessageModel } from '../../models/messages'; +} from '../../environment.js'; +import { hasAttachmentDownloads } from '../../util/hasAttachmentDownloads.js'; +import { isAdhoc, isNightly } from '../../util/version.js'; +import { ToastType } from '../../types/Toast.js'; +import { isConversationAccepted } from '../../util/isConversationAccepted.js'; +import { saveBackupsSubscriberData } from '../../util/backupSubscriptionData.js'; +import { postSaveUpdates } from '../../util/cleanup.js'; +import type { LinkPreviewType } from '../../types/message/LinkPreviews.js'; +import { MessageModel } from '../../models/messages.js'; import { DEFAULT_PROFILE_COLOR, fromDayOfWeekArray, type NotificationProfileType, -} from '../../types/NotificationProfile'; -import { normalizeNotificationProfileId } from '../../types/NotificationProfile-node'; -import { updateBackupMediaDownloadProgress } from '../../util/updateBackupMediaDownloadProgress'; +} from '../../types/NotificationProfile.js'; +import { normalizeNotificationProfileId } from '../../types/NotificationProfile-node.js'; +import { updateBackupMediaDownloadProgress } from '../../util/updateBackupMediaDownloadProgress.js'; const log = createLogger('import'); diff --git a/ts/services/backups/index.ts b/ts/services/backups/index.ts index d7606f4525b..71858ccd7ce 100644 --- a/ts/services/backups/index.ts +++ b/ts/services/backups/index.ts @@ -1,90 +1,90 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { pipeline } from 'stream/promises'; -import { PassThrough } from 'stream'; -import type { Readable, Writable } from 'stream'; -import { createReadStream, createWriteStream } from 'fs'; -import { mkdir, stat, unlink } from 'fs/promises'; +import { pipeline } from 'node:stream/promises'; +import { PassThrough } from 'node:stream'; +import type { Readable, Writable } from 'node:stream'; +import { createReadStream, createWriteStream } from 'node:fs'; +import { mkdir, stat, unlink } from 'node:fs/promises'; import { ensureFile } from 'fs-extra'; -import { join } from 'path'; -import { createGzip, createGunzip } from 'zlib'; -import { createCipheriv, createHmac, randomBytes } from 'crypto'; +import { join } from 'node:path'; +import { createGzip, createGunzip } from 'node:zlib'; +import { createCipheriv, createHmac, randomBytes } from 'node:crypto'; import { isEqual, noop } from 'lodash'; import { BackupLevel } from '@signalapp/libsignal-client/zkgroup'; import { BackupKey } from '@signalapp/libsignal-client/dist/AccountKeys'; import { throttle } from 'lodash/fp'; import { ipcRenderer } from 'electron'; -import { DataReader, DataWriter } from '../../sql/Client'; -import { createLogger } from '../../logging/log'; -import * as Bytes from '../../Bytes'; -import { strictAssert } from '../../util/assert'; -import { drop } from '../../util/drop'; -import { DelimitedStream } from '../../util/DelimitedStream'; -import { appendPaddingStream } from '../../util/logPadding'; -import { prependStream } from '../../util/prependStream'; -import { appendMacStream } from '../../util/appendMacStream'; -import { getMacAndUpdateHmac } from '../../util/getMacAndUpdateHmac'; -import { missingCaseError } from '../../util/missingCaseError'; -import { DAY, HOUR, SECOND } from '../../util/durations'; -import type { ExplodePromiseResultType } from '../../util/explodePromise'; -import { explodePromise } from '../../util/explodePromise'; -import type { RetryBackupImportValue } from '../../state/ducks/installer'; -import { CipherType, HashType } from '../../types/Crypto'; +import { DataReader, DataWriter } from '../../sql/Client.js'; +import { createLogger } from '../../logging/log.js'; +import * as Bytes from '../../Bytes.js'; +import { strictAssert } from '../../util/assert.js'; +import { drop } from '../../util/drop.js'; +import { DelimitedStream } from '../../util/DelimitedStream.js'; +import { appendPaddingStream } from '../../util/logPadding.js'; +import { prependStream } from '../../util/prependStream.js'; +import { appendMacStream } from '../../util/appendMacStream.js'; +import { getMacAndUpdateHmac } from '../../util/getMacAndUpdateHmac.js'; +import { missingCaseError } from '../../util/missingCaseError.js'; +import { DAY, HOUR, SECOND } from '../../util/durations/index.js'; +import type { ExplodePromiseResultType } from '../../util/explodePromise.js'; +import { explodePromise } from '../../util/explodePromise.js'; +import type { RetryBackupImportValue } from '../../state/ducks/installer.js'; +import { CipherType, HashType } from '../../types/Crypto.js'; import { InstallScreenBackupStep, InstallScreenBackupError, -} from '../../types/InstallScreen'; -import * as Errors from '../../types/errors'; +} from '../../types/InstallScreen.js'; +import * as Errors from '../../types/errors.js'; import { BackupCredentialType, type BackupsSubscriptionType, type BackupStatusType, -} from '../../types/backups'; -import { HTTPError } from '../../textsecure/Errors'; -import { constantTimeEqual } from '../../Crypto'; -import { measureSize } from '../../AttachmentCrypto'; -import { isTestOrMockEnvironment } from '../../environment'; -import { runStorageServiceSyncJob } from '../storage'; -import { BackupExportStream, type StatsType } from './export'; -import { BackupImportStream } from './import'; +} from '../../types/backups.js'; +import { HTTPError } from '../../textsecure/Errors.js'; +import { constantTimeEqual } from '../../Crypto.js'; +import { measureSize } from '../../AttachmentCrypto.js'; +import { isTestOrMockEnvironment } from '../../environment.js'; +import { runStorageServiceSyncJob } from '../storage.js'; +import { BackupExportStream, type StatsType } from './export.js'; +import { BackupImportStream } from './import.js'; import { getBackupId, getKeyMaterial, getLocalBackupMetadataKey, -} from './crypto'; -import { BackupCredentials } from './credentials'; -import { BackupAPI } from './api'; +} from './crypto.js'; +import { BackupCredentials } from './credentials.js'; +import { BackupAPI } from './api.js'; import { validateBackup, validateBackupStream, ValidationType, -} from './validator'; -import { BackupType } from './types'; +} from './validator.js'; +import { BackupType } from './types.js'; import { BackupInstallerError, BackupDownloadFailedError, BackupImportCanceledError, BackupProcessingError, RelinkRequestedError, -} from './errors'; -import { FileStream } from './util/FileStream'; -import { ToastType } from '../../types/Toast'; -import { isAdhoc, isNightly } from '../../util/version'; -import { getMessageQueueTime } from '../../util/getMessageQueueTime'; -import { isLocalBackupsEnabled } from '../../util/isLocalBackupsEnabled'; -import type { ValidateLocalBackupStructureResultType } from './util/localBackup'; +} from './errors.js'; +import { FileStream } from './util/FileStream.js'; +import { ToastType } from '../../types/Toast.js'; +import { isAdhoc, isNightly } from '../../util/version.js'; +import { getMessageQueueTime } from '../../util/getMessageQueueTime.js'; +import { isLocalBackupsEnabled } from '../../util/isLocalBackupsEnabled.js'; +import type { ValidateLocalBackupStructureResultType } from './util/localBackup.js'; import { writeLocalBackupMetadata, verifyLocalBackupMetadata, writeLocalBackupFilesList, readLocalBackupFilesList, validateLocalBackupStructure, -} from './util/localBackup'; -import { AttachmentLocalBackupManager } from '../../jobs/AttachmentLocalBackupManager'; -import { decipherWithAesKey } from '../../util/decipherWithAesKey'; -import { areRemoteBackupsTurnedOn } from '../../util/isBackupEnabled'; +} from './util/localBackup.js'; +import { AttachmentLocalBackupManager } from '../../jobs/AttachmentLocalBackupManager.js'; +import { decipherWithAesKey } from '../../util/decipherWithAesKey.js'; +import { areRemoteBackupsTurnedOn } from '../../util/isBackupEnabled.js'; const log = createLogger('backupsService'); diff --git a/ts/services/backups/types.ts b/ts/services/backups/types.ts index 1ee76c3f98c..9930b5ed1bd 100644 --- a/ts/services/backups/types.ts +++ b/ts/services/backups/types.ts @@ -1,8 +1,8 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AciString, PniString } from '../../types/ServiceId'; -import type { ConversationColorType } from '../../types/Colors'; +import type { AciString, PniString } from '../../types/ServiceId.js'; +import type { ConversationColorType } from '../../types/Colors.js'; // Duplicated here to allow loading it in a non-node environment export enum BackupLevel { diff --git a/ts/services/backups/util/filePointers.ts b/ts/services/backups/util/filePointers.ts index 0768a359ca7..bc9e232ce9b 100644 --- a/ts/services/backups/util/filePointers.ts +++ b/ts/services/backups/util/filePointers.ts @@ -6,39 +6,39 @@ import { BackupLevel } from '@signalapp/libsignal-client/zkgroup'; import { APPLICATION_OCTET_STREAM, stringToMIMEType, -} from '../../../types/MIME'; -import { createLogger } from '../../../logging/log'; +} from '../../../types/MIME.js'; +import { createLogger } from '../../../logging/log.js'; import { type AttachmentType, hasRequiredInformationForBackup, hasRequiredInformationToDownloadFromTransitTier, -} from '../../../types/Attachment'; -import { Backups, SignalService } from '../../../protobuf'; -import * as Bytes from '../../../Bytes'; +} from '../../../types/Attachment.js'; +import { Backups, SignalService } from '../../../protobuf/index.js'; +import * as Bytes from '../../../Bytes.js'; import { getSafeLongFromTimestamp, getTimestampFromLong, -} from '../../../util/timestampLongUtils'; -import { strictAssert } from '../../../util/assert'; +} from '../../../util/timestampLongUtils.js'; +import { strictAssert } from '../../../util/assert.js'; import type { CoreAttachmentBackupJobType, PartialAttachmentLocalBackupJobType, -} from '../../../types/AttachmentBackup'; +} from '../../../types/AttachmentBackup.js'; import { type GetBackupCdnInfoType, getMediaIdFromMediaName, getMediaName, -} from './mediaId'; -import { missingCaseError } from '../../../util/missingCaseError'; -import { bytesToUuid } from '../../../util/uuidToBytes'; -import { createName } from '../../../util/attachmentPath'; -import { generateAttachmentKeys } from '../../../AttachmentCrypto'; -import { getAttachmentLocalBackupPathFromSnapshotDir } from './localBackup'; +} from './mediaId.js'; +import { missingCaseError } from '../../../util/missingCaseError.js'; +import { bytesToUuid } from '../../../util/uuidToBytes.js'; +import { createName } from '../../../util/attachmentPath.js'; +import { generateAttachmentKeys } from '../../../AttachmentCrypto.js'; +import { getAttachmentLocalBackupPathFromSnapshotDir } from './localBackup.js'; import { isValidAttachmentKey, isValidPlaintextHash, -} from '../../../types/Crypto'; -import { isTestOrMockEnvironment } from '../../../environment'; +} from '../../../types/Crypto.js'; +import { isTestOrMockEnvironment } from '../../../environment.js'; const log = createLogger('filePointers'); diff --git a/ts/services/backups/util/localBackup.ts b/ts/services/backups/util/localBackup.ts index 0fce4b20856..1b6952831f7 100644 --- a/ts/services/backups/util/localBackup.ts +++ b/ts/services/backups/util/localBackup.ts @@ -1,25 +1,25 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { randomBytes } from 'crypto'; -import { dirname, join } from 'path'; -import { readFile, stat, writeFile } from 'fs/promises'; -import { createReadStream, createWriteStream } from 'fs'; -import { Transform } from 'stream'; -import { pipeline } from 'stream/promises'; -import { createLogger } from '../../../logging/log'; -import * as Bytes from '../../../Bytes'; -import * as Errors from '../../../types/errors'; -import { Signal } from '../../../protobuf'; -import protobuf from '../../../protobuf/wrap'; -import { strictAssert } from '../../../util/assert'; -import { decryptAesCtr, encryptAesCtr } from '../../../Crypto'; -import type { LocalBackupMetadataVerificationType } from '../../../types/backups'; +import { randomBytes } from 'node:crypto'; +import { dirname, join } from 'node:path'; +import { readFile, stat, writeFile } from 'node:fs/promises'; +import { createReadStream, createWriteStream } from 'node:fs'; +import { Transform } from 'node:stream'; +import { pipeline } from 'node:stream/promises'; +import { createLogger } from '../../../logging/log.js'; +import * as Bytes from '../../../Bytes.js'; +import * as Errors from '../../../types/errors.js'; +import { Signal } from '../../../protobuf/index.js'; +import protobuf from '../../../protobuf/wrap.js'; +import { strictAssert } from '../../../util/assert.js'; +import { decryptAesCtr, encryptAesCtr } from '../../../Crypto.js'; +import type { LocalBackupMetadataVerificationType } from '../../../types/backups.js'; import { LOCAL_BACKUP_VERSION, LOCAL_BACKUP_BACKUP_ID_IV_LENGTH, -} from '../constants'; -import { explodePromise } from '../../../util/explodePromise'; +} from '../constants.js'; +import { explodePromise } from '../../../util/explodePromise.js'; const log = createLogger('localBackup'); diff --git a/ts/services/backups/util/mediaId.ts b/ts/services/backups/util/mediaId.ts index 08033130bbe..b977c37b0bd 100644 --- a/ts/services/backups/util/mediaId.ts +++ b/ts/services/backups/util/mediaId.ts @@ -1,10 +1,10 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { DataReader } from '../../../sql/Client'; -import * as Bytes from '../../../Bytes'; -import { getBackupMediaRootKey } from '../crypto'; -import { type BackupableAttachmentType } from '../../../types/Attachment'; +import { DataReader } from '../../../sql/Client.js'; +import * as Bytes from '../../../Bytes.js'; +import { getBackupMediaRootKey } from '../crypto.js'; +import { type BackupableAttachmentType } from '../../../types/Attachment.js'; export function getMediaIdFromMediaName(mediaName: string): { string: string; diff --git a/ts/services/backups/validator.ts b/ts/services/backups/validator.ts index 92d01be4ab6..e3b09b7eaf8 100644 --- a/ts/services/backups/validator.ts +++ b/ts/services/backups/validator.ts @@ -7,9 +7,9 @@ import * as libsignal from '@signalapp/libsignal-client/dist/MessageBackup'; import type { InputStream } from '@signalapp/libsignal-client/dist/io'; import { Reader } from 'protobufjs'; -import { strictAssert } from '../../util/assert'; -import { toAciObject } from '../../util/ServiceId'; -import { missingCaseError } from '../../util/missingCaseError'; +import { strictAssert } from '../../util/assert.js'; +import { toAciObject } from '../../util/ServiceId.js'; +import { missingCaseError } from '../../util/missingCaseError.js'; export enum ValidationType { Export = 'Export', diff --git a/ts/services/badgeLoader.ts b/ts/services/badgeLoader.ts index 52ff218c117..c9c6eeb023c 100644 --- a/ts/services/badgeLoader.ts +++ b/ts/services/badgeLoader.ts @@ -1,12 +1,12 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { DataReader } from '../sql/Client'; -import { strictAssert } from '../util/assert'; -import { makeLookup } from '../util/makeLookup'; +import { DataReader } from '../sql/Client.js'; +import { strictAssert } from '../util/assert.js'; +import { makeLookup } from '../util/makeLookup.js'; -import type { BadgeType } from '../badges/types'; -import type { BadgesStateType } from '../state/ducks/badges'; +import type { BadgeType } from '../badges/types.js'; +import type { BadgesStateType } from '../state/ducks/badges.js'; let badges: Array | undefined; diff --git a/ts/services/buildExpiration.ts b/ts/services/buildExpiration.ts index e003b62b097..5a4a632e57b 100644 --- a/ts/services/buildExpiration.ts +++ b/ts/services/buildExpiration.ts @@ -6,9 +6,9 @@ import EventEmitter from 'node:events'; import { hasBuildExpired, getBuildExpirationTimestamp, -} from '../util/buildExpiration'; -import { LongTimeout } from '../util/timeout'; -import { createLogger } from '../logging/log'; +} from '../util/buildExpiration.js'; +import { LongTimeout } from '../util/timeout.js'; +import { createLogger } from '../logging/log.js'; const log = createLogger('buildExpiration'); diff --git a/ts/services/callHistoryLoader.ts b/ts/services/callHistoryLoader.ts index 39859167f75..69ebd36de2a 100644 --- a/ts/services/callHistoryLoader.ts +++ b/ts/services/callHistoryLoader.ts @@ -1,9 +1,9 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { DataReader, DataWriter } from '../sql/Client'; -import type { CallHistoryDetails } from '../types/CallDisposition'; -import { strictAssert } from '../util/assert'; +import { DataReader, DataWriter } from '../sql/Client.js'; +import type { CallHistoryDetails } from '../types/CallDisposition.js'; +import { strictAssert } from '../util/assert.js'; let callsHistoryData: ReadonlyArray; let callsHistoryUnreadCount: number; diff --git a/ts/services/callLinksLoader.ts b/ts/services/callLinksLoader.ts index 34268a54e13..eaec1b4329e 100644 --- a/ts/services/callLinksLoader.ts +++ b/ts/services/callLinksLoader.ts @@ -1,9 +1,9 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { DataReader } from '../sql/Client'; -import type { CallLinkType } from '../types/CallLink'; -import { strictAssert } from '../util/assert'; +import { DataReader } from '../sql/Client.js'; +import type { CallLinkType } from '../types/CallLink.js'; +import { strictAssert } from '../util/assert.js'; let callLinksData: ReadonlyArray; diff --git a/ts/services/calling.ts b/ts/services/calling.ts index adcf11e904e..3e5582c813e 100644 --- a/ts/services/calling.ts +++ b/ts/services/calling.ts @@ -50,16 +50,19 @@ import { ServerPublicParams, } from '@signalapp/libsignal-client/zkgroup'; import { Aci } from '@signalapp/libsignal-client'; -import { CanvasVideoRenderer, GumVideoCapturer } from '../calling/VideoSupport'; -import type { GumVideoCaptureOptions } from '../calling/VideoSupport'; +import { + CanvasVideoRenderer, + GumVideoCapturer, +} from '../calling/VideoSupport.js'; +import type { GumVideoCaptureOptions } from '../calling/VideoSupport.js'; import type { ActionsType as CallingReduxActionsType, GroupCallParticipantInfoType, GroupCallPeekInfoType, -} from '../state/ducks/calling'; -import type { ConversationType } from '../state/ducks/conversations'; -import { getConversationCallMode } from '../state/ducks/conversations'; -import { isMe } from '../util/whatTypeOfConversation'; +} from '../state/ducks/calling.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import { getConversationCallMode } from '../state/ducks/conversations.js'; +import { isMe } from '../util/whatTypeOfConversation.js'; import type { AvailableIODevicesType, CallEndedReason, @@ -67,34 +70,34 @@ import type { IceServerCacheType, MediaDeviceSettings, PresentedSource, -} from '../types/Calling'; +} from '../types/Calling.js'; import { GroupCallConnectionState, GroupCallJoinState, ScreenShareStatus, -} from '../types/Calling'; -import { CallMode, LocalCallEvent } from '../types/CallDisposition'; +} from '../types/Calling.js'; +import { CallMode, LocalCallEvent } from '../types/CallDisposition.js'; import { findBestMatchingAudioDeviceIndex, findBestMatchingCameraId, -} from '../calling/findBestMatchingDevice'; -import { normalizeAci } from '../util/normalizeAci'; -import { isAciString } from '../util/isAciString'; -import * as Errors from '../types/errors'; -import type { ConversationModel } from '../models/conversations'; -import * as Bytes from '../Bytes'; -import { uuidToBytes, bytesToUuid } from '../util/uuidToBytes'; -import { drop } from '../util/drop'; -import { dropNull } from '../util/dropNull'; -import { getOwn } from '../util/getOwn'; -import * as durations from '../util/durations'; -import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary'; -import { fetchMembershipProof, getMembershipList } from '../groups'; -import type { ProcessedEnvelope } from '../textsecure/Types.d'; -import type { GetIceServersResultType } from '../textsecure/WebAPI'; -import { missingCaseError } from '../util/missingCaseError'; -import { normalizeGroupCallTimestamp } from '../util/ringrtc/normalizeGroupCallTimestamp'; -import { requestCameraPermissions } from '../util/callingPermissions'; +} from '../calling/findBestMatchingDevice.js'; +import { normalizeAci } from '../util/normalizeAci.js'; +import { isAciString } from '../util/isAciString.js'; +import * as Errors from '../types/errors.js'; +import type { ConversationModel } from '../models/conversations.js'; +import * as Bytes from '../Bytes.js'; +import { uuidToBytes, bytesToUuid } from '../util/uuidToBytes.js'; +import { drop } from '../util/drop.js'; +import { dropNull } from '../util/dropNull.js'; +import { getOwn } from '../util/getOwn.js'; +import * as durations from '../util/durations/index.js'; +import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary.js'; +import { fetchMembershipProof, getMembershipList } from '../groups.js'; +import type { ProcessedEnvelope } from '../textsecure/Types.d.ts'; +import type { GetIceServersResultType } from '../textsecure/WebAPI.js'; +import { missingCaseError } from '../util/missingCaseError.js'; +import { normalizeGroupCallTimestamp } from '../util/ringrtc/normalizeGroupCallTimestamp.js'; +import { requestCameraPermissions } from '../util/callingPermissions.js'; import { AUDIO_LEVEL_INTERVAL_MS, REQUESTED_VIDEO_WIDTH, @@ -105,20 +108,20 @@ import { REQUESTED_SCREEN_SHARE_WIDTH, REQUESTED_SCREEN_SHARE_HEIGHT, REQUESTED_SCREEN_SHARE_FRAMERATE, -} from '../calling/constants'; -import { callingMessageToProto } from '../util/callingMessageToProto'; -import { requestMicrophonePermissions } from '../util/requestMicrophonePermissions'; -import { SignalService as Proto } from '../protobuf'; -import { DataReader, DataWriter } from '../sql/Client'; +} from '../calling/constants.js'; +import { callingMessageToProto } from '../util/callingMessageToProto.js'; +import { requestMicrophonePermissions } from '../util/requestMicrophonePermissions.js'; +import { SignalService as Proto } from '../protobuf/index.js'; +import { DataReader, DataWriter } from '../sql/Client.js'; import { notificationService, NotificationSetting, FALLBACK_NOTIFICATION_TITLE, NotificationType, shouldSaveNotificationAvatarToDisk, -} from './notifications'; -import { createLogger } from '../logging/log'; -import { assertDev, strictAssert } from '../util/assert'; +} from './notifications.js'; +import { createLogger } from '../logging/log.js'; +import { assertDev, strictAssert } from '../util/assert.js'; import { formatLocalDeviceState, formatPeekInfo, @@ -138,30 +141,30 @@ import { updateAdhocCallHistory, getCallIdFromEra, getCallDetailsForAdhocCall, -} from '../util/callDisposition'; -import { isNormalNumber } from '../util/isNormalNumber'; -import type { AciString, ServiceIdString } from '../types/ServiceId'; -import { isServiceIdString, isPniString } from '../types/ServiceId'; -import { isSignalConnection } from '../util/getSignalConnections'; -import { toAdminKeyBytes } from '../util/callLinks'; +} from '../util/callDisposition.js'; +import { isNormalNumber } from '../util/isNormalNumber.js'; +import type { AciString, ServiceIdString } from '../types/ServiceId.js'; +import { isServiceIdString, isPniString } from '../types/ServiceId.js'; +import { isSignalConnection } from '../util/getSignalConnections.js'; +import { toAdminKeyBytes } from '../util/callLinks.js'; import { getCallLinkAuthCredentialPresentation, getRoomIdFromRootKey, callLinkRestrictionsToRingRTC, callLinkStateFromRingRTC, -} from '../util/callLinksRingrtc'; +} from '../util/callLinksRingrtc.js'; import { conversationJobQueue, conversationQueueJobEnum, -} from '../jobs/conversationJobQueue'; -import type { CallLinkType, CallLinkStateType } from '../types/CallLink'; -import { CallLinkRestrictions } from '../types/CallLink'; -import { getConversationIdForLogging } from '../util/idForLogging'; -import { sendCallLinkUpdateSync } from '../util/sendCallLinkUpdateSync'; -import { createIdenticon } from '../util/createIdenticon'; -import { getColorForCallLink } from '../util/getColorForCallLink'; -import OS from '../util/os/osMain'; -import { sleep } from '../util/sleep'; +} from '../jobs/conversationJobQueue.js'; +import type { CallLinkType, CallLinkStateType } from '../types/CallLink.js'; +import { CallLinkRestrictions } from '../types/CallLink.js'; +import { getConversationIdForLogging } from '../util/idForLogging.js'; +import { sendCallLinkUpdateSync } from '../util/sendCallLinkUpdateSync.js'; +import { createIdenticon } from '../util/createIdenticon.js'; +import { getColorForCallLink } from '../util/getColorForCallLink.js'; +import OS from '../util/os/osMain.js'; +import { sleep } from '../util/sleep.js'; const log = createLogger('calling'); const ringrtcLog = createLogger('@signalapp/ringrtc'); diff --git a/ts/services/chatFoldersLoader.ts b/ts/services/chatFoldersLoader.ts index 766077bbbcb..79fc7ef5bd1 100644 --- a/ts/services/chatFoldersLoader.ts +++ b/ts/services/chatFoldersLoader.ts @@ -1,9 +1,9 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { DataReader } from '../sql/Client'; -import type { ChatFolder } from '../types/ChatFolder'; -import { strictAssert } from '../util/assert'; +import { DataReader } from '../sql/Client.js'; +import type { ChatFolder } from '../types/ChatFolder.js'; +import { strictAssert } from '../util/assert.js'; let chatFolders: ReadonlyArray; diff --git a/ts/services/contactSync.ts b/ts/services/contactSync.ts index 30c94ef6d62..02cbbfc77e9 100644 --- a/ts/services/contactSync.ts +++ b/ts/services/contactSync.ts @@ -4,28 +4,28 @@ import PQueue from 'p-queue'; import { noop } from 'lodash'; -import { DataWriter } from '../sql/Client'; -import type { ContactSyncEvent } from '../textsecure/messageReceiverEvents'; +import { DataWriter } from '../sql/Client.js'; +import type { ContactSyncEvent } from '../textsecure/messageReceiverEvents.js'; import { parseContactsV2, type ContactDetailsWithAvatar, -} from '../textsecure/ContactsParser'; -import * as Conversation from '../types/Conversation'; -import * as Errors from '../types/errors'; -import type { ValidateConversationType } from '../model-types.d'; -import type { ConversationModel } from '../models/conversations'; -import { validateConversation } from '../util/validateConversation'; -import { isDirectConversation, isMe } from '../util/whatTypeOfConversation'; -import { createLogger } from '../logging/log'; -import { dropNull } from '../util/dropNull'; -import type { ProcessedAttachment } from '../textsecure/Types'; -import { downloadAttachment } from '../textsecure/downloadAttachment'; -import { strictAssert } from '../util/assert'; -import type { ReencryptedAttachmentV2 } from '../AttachmentCrypto'; -import { SECOND } from '../util/durations'; -import { AttachmentVariant } from '../types/Attachment'; -import { MediaTier } from '../types/AttachmentDownload'; -import { waitForOnline } from '../util/waitForOnline'; +} from '../textsecure/ContactsParser.js'; +import * as Conversation from '../types/Conversation.js'; +import * as Errors from '../types/errors.js'; +import type { ValidateConversationType } from '../model-types.d.ts'; +import type { ConversationModel } from '../models/conversations.js'; +import { validateConversation } from '../util/validateConversation.js'; +import { isDirectConversation, isMe } from '../util/whatTypeOfConversation.js'; +import { createLogger } from '../logging/log.js'; +import { dropNull } from '../util/dropNull.js'; +import type { ProcessedAttachment } from '../textsecure/Types.js'; +import { downloadAttachment } from '../textsecure/downloadAttachment.js'; +import { strictAssert } from '../util/assert.js'; +import type { ReencryptedAttachmentV2 } from '../AttachmentCrypto.js'; +import { SECOND } from '../util/durations/index.js'; +import { AttachmentVariant } from '../types/Attachment.js'; +import { MediaTier } from '../types/AttachmentDownload.js'; +import { waitForOnline } from '../util/waitForOnline.js'; const log = createLogger('contactSync'); diff --git a/ts/services/distributionListLoader.ts b/ts/services/distributionListLoader.ts index 2c270990a36..dcef4b4ca6e 100644 --- a/ts/services/distributionListLoader.ts +++ b/ts/services/distributionListLoader.ts @@ -1,10 +1,10 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { DataReader } from '../sql/Client'; -import type { StoryDistributionWithMembersType } from '../sql/Interface'; -import type { StoryDistributionListDataType } from '../state/ducks/storyDistributionLists'; -import { strictAssert } from '../util/assert'; +import { DataReader } from '../sql/Client.js'; +import type { StoryDistributionWithMembersType } from '../sql/Interface.js'; +import type { StoryDistributionListDataType } from '../state/ducks/storyDistributionLists.js'; +import { strictAssert } from '../util/assert.js'; let distributionLists: Array | undefined; diff --git a/ts/services/donations.ts b/ts/services/donations.ts index ebeb11e3e62..535a2f6f574 100644 --- a/ts/services/donations.ts +++ b/ts/services/donations.ts @@ -14,25 +14,25 @@ import { } from '@signalapp/libsignal-client/zkgroup'; import * as countryCodes from 'country-codes-list'; -import * as Bytes from '../Bytes'; -import * as Errors from '../types/errors'; -import { getRandomBytes, sha256 } from '../Crypto'; -import { DataWriter } from '../sql/Client'; -import { createLogger } from '../logging/log'; -import { getProfile } from '../util/getProfile'; -import { donationValidationCompleteRoute } from '../util/signalRoutes'; -import { safeParseStrict, safeParseUnknown } from '../util/schemas'; -import { missingCaseError } from '../util/missingCaseError'; -import { exponentialBackoffSleepTime } from '../util/exponentialBackoff'; -import { sleeper } from '../util/sleeper'; -import { isInPast, isOlderThan } from '../util/timestamp'; -import { DAY, DurationInSeconds } from '../util/durations'; -import { waitForOnline } from '../util/waitForOnline'; +import * as Bytes from '../Bytes.js'; +import * as Errors from '../types/errors.js'; +import { getRandomBytes, sha256 } from '../Crypto.js'; +import { DataWriter } from '../sql/Client.js'; +import { createLogger } from '../logging/log.js'; +import { getProfile } from '../util/getProfile.js'; +import { donationValidationCompleteRoute } from '../util/signalRoutes.js'; +import { safeParseStrict, safeParseUnknown } from '../util/schemas.js'; +import { missingCaseError } from '../util/missingCaseError.js'; +import { exponentialBackoffSleepTime } from '../util/exponentialBackoff.js'; +import { sleeper } from '../util/sleeper.js'; +import { isInPast, isOlderThan } from '../util/timestamp.js'; +import { DAY, DurationInSeconds } from '../util/durations/index.js'; +import { waitForOnline } from '../util/waitForOnline.js'; import { donationErrorTypeSchema, donationStateSchema, donationWorkflowSchema, -} from '../types/Donations'; +} from '../types/Donations.js'; import type { CardDetail, @@ -41,10 +41,10 @@ import type { DonationWorkflow, ReceiptContext, StripeDonationAmount, -} from '../types/Donations'; -import { ToastType } from '../types/Toast'; -import { NavTab, SettingsPage } from '../types/Nav'; -import { getRegionCodeForNumber } from '../util/libphonenumberUtil'; +} from '../types/Donations.js'; +import { ToastType } from '../types/Toast.js'; +import { NavTab, SettingsPage } from '../types/Nav.js'; +import { getRegionCodeForNumber } from '../util/libphonenumberUtil.js'; const { createDonationReceipt } = DataWriter; diff --git a/ts/services/donationsLoader.ts b/ts/services/donationsLoader.ts index 8b61fcd37bf..fefb050a062 100644 --- a/ts/services/donationsLoader.ts +++ b/ts/services/donationsLoader.ts @@ -1,13 +1,13 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { DataReader } from '../sql/Client'; -import { strictAssert } from '../util/assert'; +import { DataReader } from '../sql/Client.js'; +import { strictAssert } from '../util/assert.js'; -import { _getWorkflowFromStorage } from './donations'; +import { _getWorkflowFromStorage } from './donations.js'; -import type { DonationReceipt } from '../types/Donations'; -import type { DonationsStateType } from '../state/ducks/donations'; +import type { DonationReceipt } from '../types/Donations.js'; +import type { DonationsStateType } from '../state/ducks/donations.js'; let donationReceipts: Array | undefined; diff --git a/ts/services/expiring/chatFolderCleanupService.ts b/ts/services/expiring/chatFolderCleanupService.ts index afa2a1e451f..03fcf71c5f7 100644 --- a/ts/services/expiring/chatFolderCleanupService.ts +++ b/ts/services/expiring/chatFolderCleanupService.ts @@ -1,9 +1,9 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { DataReader, DataWriter } from '../../sql/Client'; -import { getMessageQueueTime } from '../../util/getMessageQueueTime'; -import { createExpiringEntityCleanupService } from './createExpiringEntityCleanupService'; -import * as RemoteConfig from '../../RemoteConfig'; +import { DataReader, DataWriter } from '../../sql/Client.js'; +import { getMessageQueueTime } from '../../util/getMessageQueueTime.js'; +import { createExpiringEntityCleanupService } from './createExpiringEntityCleanupService.js'; +import * as RemoteConfig from '../../RemoteConfig.js'; export const chatFolderCleanupService = createExpiringEntityCleanupService({ logPrefix: 'ChatFolders', diff --git a/ts/services/expiring/createExpiringEntityCleanupService.ts b/ts/services/expiring/createExpiringEntityCleanupService.ts index 8aed43e437a..ab7968a4b6c 100644 --- a/ts/services/expiring/createExpiringEntityCleanupService.ts +++ b/ts/services/expiring/createExpiringEntityCleanupService.ts @@ -1,12 +1,12 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { getEnvironment, isTestEnvironment } from '../../environment'; -import { createLogger } from '../../logging/log'; -import * as Errors from '../../types/errors'; -import { strictAssert } from '../../util/assert'; -import { drop } from '../../util/drop'; -import { missingCaseError } from '../../util/missingCaseError'; -import { longTimeoutAsync } from '../../util/timeout'; +import { getEnvironment, isTestEnvironment } from '../../environment.js'; +import { createLogger } from '../../logging/log.js'; +import * as Errors from '../../types/errors.js'; +import { strictAssert } from '../../util/assert.js'; +import { drop } from '../../util/drop.js'; +import { missingCaseError } from '../../util/missingCaseError.js'; +import { longTimeoutAsync } from '../../util/timeout.js'; const parentLog = createLogger('ExpiringEntityCleanupService'); diff --git a/ts/services/expiringMessagesDeletion.ts b/ts/services/expiringMessagesDeletion.ts index dbbbbde7697..3c7cec0c64b 100644 --- a/ts/services/expiringMessagesDeletion.ts +++ b/ts/services/expiringMessagesDeletion.ts @@ -4,15 +4,15 @@ import { batch } from 'react-redux'; import { debounce } from 'lodash'; -import * as Errors from '../types/errors'; -import { createLogger } from '../logging/log'; -import { DataReader, DataWriter } from '../sql/Client'; -import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary'; -import { sleep } from '../util/sleep'; -import { SECOND } from '../util/durations'; -import { MessageModel } from '../models/messages'; -import { cleanupMessages } from '../util/cleanup'; -import { drop } from '../util/drop'; +import * as Errors from '../types/errors.js'; +import { createLogger } from '../logging/log.js'; +import { DataReader, DataWriter } from '../sql/Client.js'; +import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary.js'; +import { sleep } from '../util/sleep.js'; +import { SECOND } from '../util/durations/index.js'; +import { MessageModel } from '../models/messages.js'; +import { cleanupMessages } from '../util/cleanup.js'; +import { drop } from '../util/drop.js'; const log = createLogger('expiringMessagesDeletion'); diff --git a/ts/services/gifsLoader.ts b/ts/services/gifsLoader.ts index aa405a7ce14..7c4fda44ace 100644 --- a/ts/services/gifsLoader.ts +++ b/ts/services/gifsLoader.ts @@ -1,9 +1,9 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { DataReader } from '../sql/Client'; -import type { GifsStateType } from '../state/ducks/gifs'; -import { MAX_RECENT_GIFS } from '../state/ducks/gifs'; -import { strictAssert } from '../util/assert'; +import { DataReader } from '../sql/Client.js'; +import type { GifsStateType } from '../state/ducks/gifs.js'; +import { MAX_RECENT_GIFS } from '../state/ducks/gifs.js'; +import { strictAssert } from '../util/assert.js'; let state: GifsStateType; diff --git a/ts/services/globalMessageAudio.ts b/ts/services/globalMessageAudio.ts index b6f3560a41d..201f003686f 100644 --- a/ts/services/globalMessageAudio.ts +++ b/ts/services/globalMessageAudio.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { noop } from 'lodash'; -import { isAbortError } from '../util/isAbortError'; +import { isAbortError } from '../util/isAbortError.js'; /** * Wrapper around a global HTMLAudioElement that can update the diff --git a/ts/services/groupCredentialFetcher.ts b/ts/services/groupCredentialFetcher.ts index c04069a09ac..2f815ba490b 100644 --- a/ts/services/groupCredentialFetcher.ts +++ b/ts/services/groupCredentialFetcher.ts @@ -8,18 +8,18 @@ import { GenericServerPublicParams, } from '@signalapp/libsignal-client/zkgroup'; -import { getClientZkAuthOperations } from '../util/zkgroup'; +import { getClientZkAuthOperations } from '../util/zkgroup.js'; -import type { GroupCredentialType } from '../textsecure/WebAPI'; -import { strictAssert } from '../util/assert'; -import * as durations from '../util/durations'; -import { BackOff } from '../util/BackOff'; -import { sleep } from '../util/sleep'; -import { toDayMillis } from '../util/timestamp'; -import { toTaggedPni } from '../types/ServiceId'; -import { toPniObject, toAciObject } from '../util/ServiceId'; -import { createLogger } from '../logging/log'; -import * as Bytes from '../Bytes'; +import type { GroupCredentialType } from '../textsecure/WebAPI.js'; +import { strictAssert } from '../util/assert.js'; +import * as durations from '../util/durations/index.js'; +import { BackOff } from '../util/BackOff.js'; +import { sleep } from '../util/sleep.js'; +import { toDayMillis } from '../util/timestamp.js'; +import { toTaggedPni } from '../types/ServiceId.js'; +import { toPniObject, toAciObject } from '../util/ServiceId.js'; +import { createLogger } from '../logging/log.js'; +import * as Bytes from '../Bytes.js'; const log = createLogger('groupCredentialFetcher'); diff --git a/ts/services/keyboardLayout.ts b/ts/services/keyboardLayout.ts index 00b974a4cc3..d18105e7c54 100644 --- a/ts/services/keyboardLayout.ts +++ b/ts/services/keyboardLayout.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { strictAssert } from '../util/assert'; +import { strictAssert } from '../util/assert.js'; type LayoutMapType = { get(code: string): string | undefined }; diff --git a/ts/services/messageStateCleanup.ts b/ts/services/messageStateCleanup.ts index 28b595cd037..4bb6bdfcd11 100644 --- a/ts/services/messageStateCleanup.ts +++ b/ts/services/messageStateCleanup.ts @@ -1,9 +1,9 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import * as durations from '../util/durations'; -import { isEnabled } from '../RemoteConfig'; -import { MessageCache } from './MessageCache'; +import * as durations from '../util/durations/index.js'; +import { isEnabled } from '../RemoteConfig.js'; +import { MessageCache } from './MessageCache.js'; const TEN_MINUTES = 10 * durations.MINUTE; diff --git a/ts/services/networkObserver.ts b/ts/services/networkObserver.ts index 0cf5caa1329..4fb1a3a7c9e 100644 --- a/ts/services/networkObserver.ts +++ b/ts/services/networkObserver.ts @@ -4,12 +4,12 @@ import type { SetNetworkStatusPayloadType, NetworkActionType, -} from '../state/ducks/network'; -import { createLogger } from '../logging/log'; -import { SECOND } from '../util/durations'; -import { electronLookup } from '../util/dns'; -import { drop } from '../util/drop'; -import { SocketStatus } from '../types/SocketStatus'; +} from '../state/ducks/network.js'; +import { createLogger } from '../logging/log.js'; +import { SECOND } from '../util/durations/index.js'; +import { electronLookup } from '../util/dns.js'; +import { drop } from '../util/drop.js'; +import { SocketStatus } from '../types/SocketStatus.js'; const log = createLogger('networkObserver'); diff --git a/ts/services/notificationProfilesService.ts b/ts/services/notificationProfilesService.ts index 89e47610761..353368fea80 100644 --- a/ts/services/notificationProfilesService.ts +++ b/ts/services/notificationProfilesService.ts @@ -3,25 +3,25 @@ import { debounce, isEqual, isNumber } from 'lodash'; -import { createLogger } from '../logging/log'; +import { createLogger } from '../logging/log.js'; -import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary'; -import { isInPast, isMoreRecentThan } from '../util/timestamp'; -import { getMessageQueueTime } from '../util/getMessageQueueTime'; -import { drop } from '../util/drop'; -import { DataReader, DataWriter } from '../sql/Client'; +import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary.js'; +import { isInPast, isMoreRecentThan } from '../util/timestamp.js'; +import { getMessageQueueTime } from '../util/getMessageQueueTime.js'; +import { drop } from '../util/drop.js'; +import { DataReader, DataWriter } from '../sql/Client.js'; import { findNextProfileEvent, redactNotificationProfileId, type NotificationProfileType, -} from '../types/NotificationProfile'; +} from '../types/NotificationProfile.js'; import { getCurrentState, getDeletedProfiles, getOverride, getProfiles, -} from '../state/selectors/notificationProfiles'; -import { safeSetTimeout } from '../util/timeout'; +} from '../state/selectors/notificationProfiles.js'; +import { safeSetTimeout } from '../util/timeout.js'; const log = createLogger('notificationProfilesService'); diff --git a/ts/services/notifications.ts b/ts/services/notifications.ts index 0f745554374..8ac1240c6b9 100644 --- a/ts/services/notifications.ts +++ b/ts/services/notifications.ts @@ -1,21 +1,21 @@ // Copyright 2015 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import os from 'os'; +import os from 'node:os'; import { debounce } from 'lodash'; -import EventEmitter from 'events'; +import EventEmitter from 'node:events'; import { v4 as getGuid } from 'uuid'; -import { Sound, SoundType } from '../util/Sound'; -import { shouldHideExpiringMessageBody } from '../types/Settings'; -import OS from '../util/os/osMain'; -import { createLogger } from '../logging/log'; -import { makeEnumParser } from '../util/enum'; -import { missingCaseError } from '../util/missingCaseError'; -import { toLogFormat } from '../types/errors'; -import type { StorageInterface } from '../types/Storage.d'; -import type { LocalizerType } from '../types/Util'; -import { drop } from '../util/drop'; +import { Sound, SoundType } from '../util/Sound.js'; +import { shouldHideExpiringMessageBody } from '../types/Settings.js'; +import OS from '../util/os/osMain.js'; +import { createLogger } from '../logging/log.js'; +import { makeEnumParser } from '../util/enum.js'; +import { missingCaseError } from '../util/missingCaseError.js'; +import { toLogFormat } from '../types/errors.js'; +import type { StorageInterface } from '../types/Storage.d.ts'; +import type { LocalizerType } from '../types/Util.js'; +import { drop } from '../util/drop.js'; const log = createLogger('notifications'); diff --git a/ts/services/ourProfileKey.ts b/ts/services/ourProfileKey.ts index c417383fcbd..eba7062a19d 100644 --- a/ts/services/ourProfileKey.ts +++ b/ts/services/ourProfileKey.ts @@ -1,10 +1,10 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { assertDev, strictAssert } from '../util/assert'; -import { createLogger } from '../logging/log'; +import { assertDev, strictAssert } from '../util/assert.js'; +import { createLogger } from '../logging/log.js'; -import type { StorageInterface } from '../types/Storage.d'; +import type { StorageInterface } from '../types/Storage.d.ts'; const log = createLogger('ourProfileKey'); diff --git a/ts/services/profiles.ts b/ts/services/profiles.ts index 11c2de204d5..f4ab8a3772c 100644 --- a/ts/services/profiles.ts +++ b/ts/services/profiles.ts @@ -9,41 +9,41 @@ import PQueue from 'p-queue'; import { IdentityChange } from '@signalapp/libsignal-client'; import type { ReadonlyDeep } from 'type-fest'; -import type { ConversationModel } from '../models/conversations'; -import type { CapabilitiesType, ProfileType } from '../textsecure/WebAPI'; -import MessageSender from '../textsecure/SendMessage'; -import type { ServiceIdString } from '../types/ServiceId'; -import { DataWriter } from '../sql/Client'; -import { createLogger } from '../logging/log'; -import * as Errors from '../types/errors'; -import * as Bytes from '../Bytes'; -import { explodePromise } from '../util/explodePromise'; -import { isRecord } from '../util/isRecord'; -import { sleep } from '../util/sleep'; -import { MINUTE, SECOND } from '../util/durations'; +import type { ConversationModel } from '../models/conversations.js'; +import type { CapabilitiesType, ProfileType } from '../textsecure/WebAPI.js'; +import MessageSender from '../textsecure/SendMessage.js'; +import type { ServiceIdString } from '../types/ServiceId.js'; +import { DataWriter } from '../sql/Client.js'; +import { createLogger } from '../logging/log.js'; +import * as Errors from '../types/errors.js'; +import * as Bytes from '../Bytes.js'; +import { explodePromise } from '../util/explodePromise.js'; +import { isRecord } from '../util/isRecord.js'; +import { sleep } from '../util/sleep.js'; +import { MINUTE, SECOND } from '../util/durations/index.js'; import { generateProfileKeyCredentialRequest, getClientZkProfileOperations, handleProfileKeyCredential, -} from '../util/zkgroup'; -import { isMe } from '../util/whatTypeOfConversation'; -import { parseBadgesFromServer } from '../badges/parseBadgesFromServer'; -import { strictAssert } from '../util/assert'; -import { drop } from '../util/drop'; -import { findRetryAfterTimeFromError } from '../jobs/helpers/findRetryAfterTimeFromError'; -import { singleProtoJobQueue } from '../jobs/singleProtoJobQueue'; -import { SEALED_SENDER } from '../types/SealedSender'; -import { HTTPError } from '../textsecure/Errors'; -import { Address } from '../types/Address'; -import { QualifiedAddress } from '../types/QualifiedAddress'; -import { trimForDisplay, verifyAccessKey, decryptProfile } from '../Crypto'; -import type { ConversationLastProfileType } from '../model-types'; -import type { GroupSendToken } from '../types/GroupSendEndorsements'; +} from '../util/zkgroup.js'; +import { isMe } from '../util/whatTypeOfConversation.js'; +import { parseBadgesFromServer } from '../badges/parseBadgesFromServer.js'; +import { strictAssert } from '../util/assert.js'; +import { drop } from '../util/drop.js'; +import { findRetryAfterTimeFromError } from '../jobs/helpers/findRetryAfterTimeFromError.js'; +import { singleProtoJobQueue } from '../jobs/singleProtoJobQueue.js'; +import { SEALED_SENDER } from '../types/SealedSender.js'; +import { HTTPError } from '../textsecure/Errors.js'; +import { Address } from '../types/Address.js'; +import { QualifiedAddress } from '../types/QualifiedAddress.js'; +import { trimForDisplay, verifyAccessKey, decryptProfile } from '../Crypto.js'; +import type { ConversationLastProfileType } from '../model-types.js'; +import type { GroupSendToken } from '../types/GroupSendEndorsements.js'; import { maybeCreateGroupSendEndorsementState, onFailedToSendWithEndorsements, -} from '../util/groupSendEndorsements'; -import { ProfileDecryptError } from '../types/errors'; +} from '../util/groupSendEndorsements.js'; +import { ProfileDecryptError } from '../types/errors.js'; const log = createLogger('profiles'); diff --git a/ts/services/releaseNotesFetcher.ts b/ts/services/releaseNotesFetcher.ts index 5abcd187709..7ac9fe0072d 100644 --- a/ts/services/releaseNotesFetcher.ts +++ b/ts/services/releaseNotesFetcher.ts @@ -4,30 +4,30 @@ import semver from 'semver'; import { last } from 'lodash'; -import * as durations from '../util/durations'; -import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary'; -import * as Registration from '../util/registration'; -import { createLogger } from '../logging/log'; -import * as Errors from '../types/errors'; -import { HTTPError } from '../textsecure/Errors'; -import { drop } from '../util/drop'; -import { strictAssert } from '../util/assert'; -import type { MessageAttributesType } from '../model-types'; -import { ReadStatus } from '../messages/MessageReadStatus'; -import { incrementMessageCounter } from '../util/incrementMessageCounter'; -import { SeenStatus } from '../MessageSeenStatus'; -import { saveNewMessageBatcher } from '../util/messageBatcher'; -import { generateMessageId } from '../util/generateMessageId'; -import type { RawBodyRange } from '../types/BodyRange'; -import { BodyRange } from '../types/BodyRange'; +import * as durations from '../util/durations/index.js'; +import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary.js'; +import * as Registration from '../util/registration.js'; +import { createLogger } from '../logging/log.js'; +import * as Errors from '../types/errors.js'; +import { HTTPError } from '../textsecure/Errors.js'; +import { drop } from '../util/drop.js'; +import { strictAssert } from '../util/assert.js'; +import type { MessageAttributesType } from '../model-types.js'; +import { ReadStatus } from '../messages/MessageReadStatus.js'; +import { incrementMessageCounter } from '../util/incrementMessageCounter.js'; +import { SeenStatus } from '../MessageSeenStatus.js'; +import { saveNewMessageBatcher } from '../util/messageBatcher.js'; +import { generateMessageId } from '../util/generateMessageId.js'; +import type { RawBodyRange } from '../types/BodyRange.js'; +import { BodyRange } from '../types/BodyRange.js'; import type { ReleaseNotesManifestResponseType, ReleaseNoteResponseType, -} from '../textsecure/WebAPI'; -import type { WithRequiredProperties } from '../types/Util'; -import { MessageModel } from '../models/messages'; -import { stringToMIMEType } from '../types/MIME'; -import { isNotNil } from '../util/isNotNil'; +} from '../textsecure/WebAPI.js'; +import type { WithRequiredProperties } from '../types/Util.js'; +import { MessageModel } from '../models/messages.js'; +import { stringToMIMEType } from '../types/MIME.js'; +import { isNotNil } from '../util/isNotNil.js'; const log = createLogger('releaseNotesFetcher'); diff --git a/ts/services/senderCertificate.ts b/ts/services/senderCertificate.ts index e99289f2968..8bedc16490f 100644 --- a/ts/services/senderCertificate.ts +++ b/ts/services/senderCertificate.ts @@ -3,20 +3,20 @@ import { SenderCertificate } from '@signalapp/libsignal-client'; -import type { SerializedCertificateType } from '../textsecure/OutgoingMessage'; +import type { SerializedCertificateType } from '../textsecure/OutgoingMessage.js'; import { SenderCertificateMode, serializedCertificateSchema, -} from '../textsecure/OutgoingMessage'; -import * as Bytes from '../Bytes'; -import { assertDev } from '../util/assert'; -import { missingCaseError } from '../util/missingCaseError'; -import { waitForOnline } from '../util/waitForOnline'; -import { createLogger } from '../logging/log'; -import type { StorageInterface } from '../types/Storage.d'; -import * as Errors from '../types/errors'; -import type { WebAPIType } from '../textsecure/WebAPI'; -import { safeParseUnknown } from '../util/schemas'; +} from '../textsecure/OutgoingMessage.js'; +import * as Bytes from '../Bytes.js'; +import { assertDev } from '../util/assert.js'; +import { missingCaseError } from '../util/missingCaseError.js'; +import { waitForOnline } from '../util/waitForOnline.js'; +import { createLogger } from '../logging/log.js'; +import type { StorageInterface } from '../types/Storage.d.ts'; +import * as Errors from '../types/errors.js'; +import type { WebAPIType } from '../textsecure/WebAPI.js'; +import { safeParseUnknown } from '../util/schemas.js'; const log = createLogger('senderCertificate'); diff --git a/ts/services/singleServePromise.ts b/ts/services/singleServePromise.ts index 7bf84804ff7..61af5f31b65 100644 --- a/ts/services/singleServePromise.ts +++ b/ts/services/singleServePromise.ts @@ -3,7 +3,7 @@ import { v4 as generateUuid } from 'uuid'; -import type { ExplodePromiseResultType } from '../util/explodePromise'; +import type { ExplodePromiseResultType } from '../util/explodePromise.js'; export type SingleServePromiseIdString = string & { __single_serve: never }; diff --git a/ts/services/storage.ts b/ts/services/storage.ts index 3d08245caa5..dd9b18296aa 100644 --- a/ts/services/storage.ts +++ b/ts/services/storage.ts @@ -5,8 +5,8 @@ import { debounce, isNumber, chunk } from 'lodash'; import pMap from 'p-map'; import Long from 'long'; -import { DataReader, DataWriter } from '../sql/Client'; -import * as Bytes from '../Bytes'; +import { DataReader, DataWriter } from '../sql/Client.js'; +import * as Bytes from '../Bytes.js'; import { getRandomBytes, deriveStorageItemKey, @@ -15,7 +15,7 @@ import { decryptProfile, deriveMasterKeyFromGroupV1, deriveStorageServiceKey, -} from '../Crypto'; +} from '../Crypto.js'; import { mergeAccountRecord, mergeContactRecord, @@ -34,61 +34,61 @@ import { toDefunctOrPendingCallLinkRecord, toChatFolderRecord, mergeChatFolderRecord, -} from './storageRecordOps'; -import type { MergeResultType } from './storageRecordOps'; -import { MAX_READ_KEYS } from './storageConstants'; -import type { ConversationModel } from '../models/conversations'; -import { strictAssert } from '../util/assert'; -import { drop } from '../util/drop'; -import { dropNull } from '../util/dropNull'; -import * as durations from '../util/durations'; -import { BackOff } from '../util/BackOff'; -import { storageJobQueue } from '../util/JobQueue'; -import { sleep } from '../util/sleep'; -import { isMoreRecentThan, isOlderThan } from '../util/timestamp'; -import { map, filter } from '../util/iterables'; -import { getMessageQueueTime } from '../util/getMessageQueueTime'; -import { ourProfileKeyService } from './ourProfileKey'; +} from './storageRecordOps.js'; +import type { MergeResultType } from './storageRecordOps.js'; +import { MAX_READ_KEYS } from './storageConstants.js'; +import type { ConversationModel } from '../models/conversations.js'; +import { strictAssert } from '../util/assert.js'; +import { drop } from '../util/drop.js'; +import { dropNull } from '../util/dropNull.js'; +import * as durations from '../util/durations/index.js'; +import { BackOff } from '../util/BackOff.js'; +import { storageJobQueue } from '../util/JobQueue.js'; +import { sleep } from '../util/sleep.js'; +import { isMoreRecentThan, isOlderThan } from '../util/timestamp.js'; +import { map, filter } from '../util/iterables.js'; +import { getMessageQueueTime } from '../util/getMessageQueueTime.js'; +import { ourProfileKeyService } from './ourProfileKey.js'; import { ConversationTypes, isDirectConversation, typeofConversation, -} from '../util/whatTypeOfConversation'; -import { SignalService as Proto } from '../protobuf'; -import { createLogger } from '../logging/log'; -import { singleProtoJobQueue } from '../jobs/singleProtoJobQueue'; -import * as Errors from '../types/errors'; +} from '../util/whatTypeOfConversation.js'; +import { SignalService as Proto } from '../protobuf/index.js'; +import { createLogger } from '../logging/log.js'; +import { singleProtoJobQueue } from '../jobs/singleProtoJobQueue.js'; +import * as Errors from '../types/errors.js'; import type { ExtendedStorageID, RemoteRecord, UnknownRecord, -} from '../types/StorageService.d'; -import MessageSender from '../textsecure/SendMessage'; +} from '../types/StorageService.d.ts'; +import MessageSender from '../textsecure/SendMessage.js'; import type { StoryDistributionWithMembersType, StorageServiceFieldsType, StickerPackType, UninstalledStickerPackType, -} from '../sql/Interface'; -import { MY_STORY_ID } from '../types/Stories'; -import { isNotNil } from '../util/isNotNil'; -import { isSignalConversation } from '../util/isSignalConversation'; -import { redactExtendedStorageID, redactStorageID } from '../util/privacy'; +} from '../sql/Interface.js'; +import { MY_STORY_ID } from '../types/Stories.js'; +import { isNotNil } from '../util/isNotNil.js'; +import { isSignalConversation } from '../util/isSignalConversation.js'; +import { redactExtendedStorageID, redactStorageID } from '../util/privacy.js'; import type { CallLinkRecord, DefunctCallLinkType, PendingCallLinkType, -} from '../types/CallLink'; +} from '../types/CallLink.js'; import { callLinkFromRecord, getRoomIdFromRootKeyString, -} from '../util/callLinksRingrtc'; -import { fromPniUuidBytesOrUntaggedString } from '../util/ServiceId'; -import { isDone as isRegistrationDone } from '../util/registration'; -import { callLinkRefreshJobQueue } from '../jobs/callLinkRefreshJobQueue'; -import { isMockEnvironment } from '../environment'; -import { validateConversation } from '../util/validateConversation'; -import type { ChatFolder } from '../types/ChatFolder'; +} from '../util/callLinksRingrtc.js'; +import { fromPniUuidBytesOrUntaggedString } from '../util/ServiceId.js'; +import { isDone as isRegistrationDone } from '../util/registration.js'; +import { callLinkRefreshJobQueue } from '../jobs/callLinkRefreshJobQueue.js'; +import { isMockEnvironment } from '../environment.js'; +import { validateConversation } from '../util/validateConversation.js'; +import type { ChatFolder } from '../types/ChatFolder.js'; const log = createLogger('storage'); diff --git a/ts/services/storageRecordOps.ts b/ts/services/storageRecordOps.ts index 9a9fbc31280..3343c59776b 100644 --- a/ts/services/storageRecordOps.ts +++ b/ts/services/storageRecordOps.ts @@ -5,72 +5,72 @@ import { isEqual } from 'lodash'; import Long from 'long'; import { ServiceId } from '@signalapp/libsignal-client'; -import { uuidToBytes, bytesToUuid } from '../util/uuidToBytes'; -import { deriveMasterKeyFromGroupV1 } from '../Crypto'; -import * as Bytes from '../Bytes'; +import { uuidToBytes, bytesToUuid } from '../util/uuidToBytes.js'; +import { deriveMasterKeyFromGroupV1 } from '../Crypto.js'; +import * as Bytes from '../Bytes.js'; import { deriveGroupFields, waitThenMaybeUpdateGroup, waitThenRespondToGroupV2Migration, -} from '../groups'; -import { assertDev, strictAssert } from '../util/assert'; -import { dropNull } from '../util/dropNull'; -import { missingCaseError } from '../util/missingCaseError'; -import { isNotNil } from '../util/isNotNil'; +} from '../groups.js'; +import { assertDev, strictAssert } from '../util/assert.js'; +import { dropNull } from '../util/dropNull.js'; +import { missingCaseError } from '../util/missingCaseError.js'; +import { isNotNil } from '../util/isNotNil.js'; import { PhoneNumberSharingMode, parsePhoneNumberSharingMode, -} from '../util/phoneNumberSharingMode'; +} from '../util/phoneNumberSharingMode.js'; import { PhoneNumberDiscoverability, parsePhoneNumberDiscoverability, -} from '../util/phoneNumberDiscoverability'; -import { arePinnedConversationsEqual } from '../util/arePinnedConversationsEqual'; -import type { ConversationModel } from '../models/conversations'; +} from '../util/phoneNumberDiscoverability.js'; +import { arePinnedConversationsEqual } from '../util/arePinnedConversationsEqual.js'; +import type { ConversationModel } from '../models/conversations.js'; import { getSafeLongFromTimestamp, getTimestampFromLong, -} from '../util/timestampLongUtils'; -import { canHaveUsername } from '../util/getTitle'; +} from '../util/timestampLongUtils.js'; +import { canHaveUsername } from '../util/getTitle.js'; import { get as getUniversalExpireTimer, set as setUniversalExpireTimer, -} from '../util/universalExpireTimer'; -import { ourProfileKeyService } from './ourProfileKey'; +} from '../util/universalExpireTimer.js'; +import { ourProfileKeyService } from './ourProfileKey.js'; import { isDirectConversation, isGroupV1, isGroupV2, -} from '../util/whatTypeOfConversation'; -import { DurationInSeconds } from '../util/durations'; -import * as preferredReactionEmoji from '../reactions/preferredReactionEmoji'; -import { SignalService as Proto } from '../protobuf'; -import { createLogger } from '../logging/log'; -import { normalizeStoryDistributionId } from '../types/StoryDistributionId'; -import type { StoryDistributionIdString } from '../types/StoryDistributionId'; -import type { ServiceIdString } from '../types/ServiceId'; +} from '../util/whatTypeOfConversation.js'; +import { DurationInSeconds } from '../util/durations/index.js'; +import * as preferredReactionEmoji from '../reactions/preferredReactionEmoji.js'; +import { SignalService as Proto } from '../protobuf/index.js'; +import { createLogger } from '../logging/log.js'; +import { normalizeStoryDistributionId } from '../types/StoryDistributionId.js'; +import type { StoryDistributionIdString } from '../types/StoryDistributionId.js'; +import type { ServiceIdString } from '../types/ServiceId.js'; import { ServiceIdKind, normalizeServiceId, toUntaggedPni, -} from '../types/ServiceId'; -import { isAciString } from '../util/isAciString'; -import * as Stickers from '../types/Stickers'; +} from '../types/ServiceId.js'; +import { isAciString } from '../util/isAciString.js'; +import * as Stickers from '../types/Stickers.js'; import type { StoryDistributionWithMembersType, StickerPackInfoType, -} from '../sql/Interface'; -import { DataReader, DataWriter } from '../sql/Client'; -import { MY_STORY_ID, StorySendMode } from '../types/Stories'; -import { findAndDeleteOnboardingStoryIfExists } from '../util/findAndDeleteOnboardingStoryIfExists'; -import { downloadOnboardingStory } from '../util/downloadOnboardingStory'; -import { drop } from '../util/drop'; -import { redactExtendedStorageID } from '../util/privacy'; +} from '../sql/Interface.js'; +import { DataReader, DataWriter } from '../sql/Client.js'; +import { MY_STORY_ID, StorySendMode } from '../types/Stories.js'; +import { findAndDeleteOnboardingStoryIfExists } from '../util/findAndDeleteOnboardingStoryIfExists.js'; +import { downloadOnboardingStory } from '../util/downloadOnboardingStory.js'; +import { drop } from '../util/drop.js'; +import { redactExtendedStorageID } from '../util/privacy.js'; import type { CallLinkRecord, DefunctCallLinkType, PendingCallLinkType, -} from '../types/CallLink'; +} from '../types/CallLink.js'; import { callLinkFromRecord, fromEpochBytes, @@ -78,16 +78,16 @@ import { getRoomIdFromRootKeyString, toRootKeyBytes, toEpochBytes, -} from '../util/callLinksRingrtc'; -import { fromAdminKeyBytes, toAdminKeyBytes } from '../util/callLinks'; -import { isOlderThan } from '../util/timestamp'; -import { getMessageQueueTime } from '../util/getMessageQueueTime'; -import { callLinkRefreshJobQueue } from '../jobs/callLinkRefreshJobQueue'; +} from '../util/callLinksRingrtc.js'; +import { fromAdminKeyBytes, toAdminKeyBytes } from '../util/callLinks.js'; +import { isOlderThan } from '../util/timestamp.js'; +import { getMessageQueueTime } from '../util/getMessageQueueTime.js'; +import { callLinkRefreshJobQueue } from '../jobs/callLinkRefreshJobQueue.js'; import { generateBackupsSubscriberData, saveBackupsSubscriberData, saveBackupTier, -} from '../util/backupSubscriptionData'; +} from '../util/backupSubscriptionData.js'; import { toAciObject, toPniObject, @@ -95,22 +95,22 @@ import { fromServiceIdBinaryOrString, fromAciUuidBytesOrString, fromPniUuidBytesOrUntaggedString, -} from '../util/ServiceId'; -import { isProtoBinaryEncodingEnabled } from '../util/isProtoBinaryEncodingEnabled'; -import { getLinkPreviewSetting } from '../types/LinkPreview'; +} from '../util/ServiceId.js'; +import { isProtoBinaryEncodingEnabled } from '../util/isProtoBinaryEncodingEnabled.js'; +import { getLinkPreviewSetting } from '../types/LinkPreview.js'; import { getReadReceiptSetting, getSealedSenderIndicatorSetting, getTypingIndicatorSetting, -} from '../types/Util'; -import { MessageRequestResponseSource } from '../types/MessageRequestResponseEvent'; -import type { ChatFolder, ChatFolderId } from '../types/ChatFolder'; +} from '../types/Util.js'; +import { MessageRequestResponseSource } from '../types/MessageRequestResponseEvent.js'; +import type { ChatFolder, ChatFolderId } from '../types/ChatFolder.js'; import { CHAT_FOLDER_DELETED_POSITION, ChatFolderType, -} from '../types/ChatFolder'; -import { deriveGroupID, deriveGroupSecretParams } from '../util/zkgroup'; -import { chatFolderCleanupService } from './expiring/chatFolderCleanupService'; +} from '../types/ChatFolder.js'; +import { deriveGroupID, deriveGroupSecretParams } from '../util/zkgroup.js'; +import { chatFolderCleanupService } from './expiring/chatFolderCleanupService.js'; const log = createLogger('storageRecordOps'); diff --git a/ts/services/storyLoader.ts b/ts/services/storyLoader.ts index 0f33db95454..f13571afdf4 100644 --- a/ts/services/storyLoader.ts +++ b/ts/services/storyLoader.ts @@ -2,22 +2,22 @@ // SPDX-License-Identifier: AGPL-3.0-only import { pick } from 'lodash'; -import type { ReadonlyMessageAttributesType } from '../model-types.d'; -import type { StoryDataType } from '../state/ducks/stories'; -import * as durations from '../util/durations'; -import { createLogger } from '../logging/log'; -import { DataReader } from '../sql/Client'; -import type { GetAllStoriesResultType } from '../sql/Interface'; +import type { ReadonlyMessageAttributesType } from '../model-types.d.ts'; +import type { StoryDataType } from '../state/ducks/stories.js'; +import * as durations from '../util/durations/index.js'; +import { createLogger } from '../logging/log.js'; +import { DataReader } from '../sql/Client.js'; +import type { GetAllStoriesResultType } from '../sql/Interface.js'; import { getAttachmentsForMessage, getPropsForAttachment, -} from '../state/selectors/message'; -import type { LinkPreviewType } from '../types/message/LinkPreviews'; -import { isNotNil } from '../util/isNotNil'; -import { strictAssert } from '../util/assert'; -import { dropNull } from '../util/dropNull'; -import { DurationInSeconds } from '../util/durations'; -import { SIGNAL_ACI } from '../types/SignalConversation'; +} from '../state/selectors/message.js'; +import type { LinkPreviewType } from '../types/message/LinkPreviews.js'; +import { isNotNil } from '../util/isNotNil.js'; +import { strictAssert } from '../util/assert.js'; +import { dropNull } from '../util/dropNull.js'; +import { DurationInSeconds } from '../util/durations/index.js'; +import { SIGNAL_ACI } from '../types/SignalConversation.js'; const log = createLogger('storyLoader'); diff --git a/ts/services/tapToViewMessagesDeletionService.ts b/ts/services/tapToViewMessagesDeletionService.ts index 33dcd98da77..bb7e6a9e173 100644 --- a/ts/services/tapToViewMessagesDeletionService.ts +++ b/ts/services/tapToViewMessagesDeletionService.ts @@ -2,17 +2,17 @@ // SPDX-License-Identifier: AGPL-3.0-only import { debounce } from 'lodash'; -import { DataReader } from '../sql/Client'; -import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary'; -import { getMessageQueueTime } from '../util/getMessageQueueTime'; -import * as Errors from '../types/errors'; -import { strictAssert } from '../util/assert'; -import { toBoundedDate } from '../util/timestamp'; -import { getMessageIdForLogging } from '../util/idForLogging'; -import { eraseMessageContents } from '../util/cleanup'; -import { drop } from '../util/drop'; -import { MessageModel } from '../models/messages'; -import { createLogger } from '../logging/log'; +import { DataReader } from '../sql/Client.js'; +import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary.js'; +import { getMessageQueueTime } from '../util/getMessageQueueTime.js'; +import * as Errors from '../types/errors.js'; +import { strictAssert } from '../util/assert.js'; +import { toBoundedDate } from '../util/timestamp.js'; +import { getMessageIdForLogging } from '../util/idForLogging.js'; +import { eraseMessageContents } from '../util/cleanup.js'; +import { drop } from '../util/drop.js'; +import { MessageModel } from '../models/messages.js'; +import { createLogger } from '../logging/log.js'; const log = createLogger('tapToViewMessagesDeletionService'); diff --git a/ts/services/updateListener.ts b/ts/services/updateListener.ts index 97cb18abf72..442ec1c6528 100644 --- a/ts/services/updateListener.ts +++ b/ts/services/updateListener.ts @@ -2,11 +2,11 @@ // SPDX-License-Identifier: AGPL-3.0-only import { ipcRenderer } from 'electron'; -import type { DialogType } from '../types/Dialogs'; +import type { DialogType } from '../types/Dialogs.js'; import type { UpdateDialogOptionsType, ShowUpdateDialogActionType, -} from '../state/ducks/updates'; +} from '../state/ducks/updates.js'; type UpdatesActions = { showUpdateDialog: ( diff --git a/ts/services/userLoader.ts b/ts/services/userLoader.ts index f8346f93d3d..de3c1d896eb 100644 --- a/ts/services/userLoader.ts +++ b/ts/services/userLoader.ts @@ -1,12 +1,12 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { strictAssert } from '../util/assert'; -import { getThemeType } from '../util/getThemeType'; +import { strictAssert } from '../util/assert.js'; +import { getThemeType } from '../util/getThemeType.js'; -import type { MenuOptionsType } from '../types/menu'; -import type { MainWindowStatsType } from '../windows/context'; -import type { ThemeType } from '../types/Util'; +import type { MenuOptionsType } from '../types/menu.js'; +import type { MainWindowStatsType } from '../windows/context.js'; +import type { ThemeType } from '../types/Util.js'; let mainWindowStats: MainWindowStatsType | undefined; let menuOptions: MenuOptionsType | undefined; diff --git a/ts/services/username.ts b/ts/services/username.ts index e83f238bff2..bb3f2be50ee 100644 --- a/ts/services/username.ts +++ b/ts/services/username.ts @@ -7,26 +7,26 @@ import { ErrorCode, } from '@signalapp/libsignal-client'; -import { singleProtoJobQueue } from '../jobs/singleProtoJobQueue'; -import { strictAssert } from '../util/assert'; -import { sleep } from '../util/sleep'; -import { getMinNickname, getMaxNickname } from '../util/Username'; -import { bytesToUuid, uuidToBytes } from '../util/uuidToBytes'; -import type { UsernameReservationType } from '../types/Username'; +import { singleProtoJobQueue } from '../jobs/singleProtoJobQueue.js'; +import { strictAssert } from '../util/assert.js'; +import { sleep } from '../util/sleep.js'; +import { getMinNickname, getMaxNickname } from '../util/Username.js'; +import { bytesToUuid, uuidToBytes } from '../util/uuidToBytes.js'; +import type { UsernameReservationType } from '../types/Username.js'; import { ReserveUsernameError, ConfirmUsernameResult, getNickname, getDiscriminator, isCaseChange, -} from '../types/Username'; -import * as Errors from '../types/errors'; -import { createLogger } from '../logging/log'; -import MessageSender from '../textsecure/SendMessage'; -import { HTTPError } from '../textsecure/Errors'; -import { findRetryAfterTimeFromError } from '../jobs/helpers/findRetryAfterTimeFromError'; -import * as Bytes from '../Bytes'; -import { storageServiceUploadJob } from './storage'; +} from '../types/Username.js'; +import * as Errors from '../types/errors.js'; +import { createLogger } from '../logging/log.js'; +import MessageSender from '../textsecure/SendMessage.js'; +import { HTTPError } from '../textsecure/Errors.js'; +import { findRetryAfterTimeFromError } from '../jobs/helpers/findRetryAfterTimeFromError.js'; +import * as Bytes from '../Bytes.js'; +import { storageServiceUploadJob } from './storage.js'; const log = createLogger('username'); diff --git a/ts/services/usernameIntegrity.ts b/ts/services/usernameIntegrity.ts index 8e207605390..4a3e0d51558 100644 --- a/ts/services/usernameIntegrity.ts +++ b/ts/services/usernameIntegrity.ts @@ -4,22 +4,22 @@ import pTimeout from 'p-timeout'; import { usernames } from '@signalapp/libsignal-client'; -import * as Errors from '../types/errors'; -import { strictAssert } from '../util/assert'; -import { isDone as isRegistrationDone } from '../util/registration'; -import { getConversation } from '../util/getConversation'; -import { MINUTE, DAY } from '../util/durations'; -import { drop } from '../util/drop'; -import { explodePromise } from '../util/explodePromise'; -import { BackOff, FIBONACCI_TIMEOUTS } from '../util/BackOff'; -import { storageJobQueue } from '../util/JobQueue'; -import { getProfile } from '../util/getProfile'; -import { isSharingPhoneNumberWithEverybody } from '../util/phoneNumberSharingMode'; -import { bytesToUuid } from '../util/uuidToBytes'; -import { createLogger } from '../logging/log'; -import * as Bytes from '../Bytes'; -import { runStorageServiceSyncJob } from './storage'; -import { writeProfile } from './writeProfile'; +import * as Errors from '../types/errors.js'; +import { strictAssert } from '../util/assert.js'; +import { isDone as isRegistrationDone } from '../util/registration.js'; +import { getConversation } from '../util/getConversation.js'; +import { MINUTE, DAY } from '../util/durations/index.js'; +import { drop } from '../util/drop.js'; +import { explodePromise } from '../util/explodePromise.js'; +import { BackOff, FIBONACCI_TIMEOUTS } from '../util/BackOff.js'; +import { storageJobQueue } from '../util/JobQueue.js'; +import { getProfile } from '../util/getProfile.js'; +import { isSharingPhoneNumberWithEverybody } from '../util/phoneNumberSharingMode.js'; +import { bytesToUuid } from '../util/uuidToBytes.js'; +import { createLogger } from '../logging/log.js'; +import * as Bytes from '../Bytes.js'; +import { runStorageServiceSyncJob } from './storage.js'; +import { writeProfile } from './writeProfile.js'; const log = createLogger('usernameIntegrity'); diff --git a/ts/services/writeProfile.ts b/ts/services/writeProfile.ts index eb7fb0d6605..a8e43500e3e 100644 --- a/ts/services/writeProfile.ts +++ b/ts/services/writeProfile.ts @@ -1,23 +1,23 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { DataWriter } from '../sql/Client'; -import type { ConversationType } from '../state/ducks/conversations'; -import * as Errors from '../types/errors'; -import { createLogger } from '../logging/log'; -import { computeHash } from '../Crypto'; -import { encryptProfileData } from '../util/encryptProfileData'; -import { getProfile } from '../util/getProfile'; -import { singleProtoJobQueue } from '../jobs/singleProtoJobQueue'; -import { strictAssert } from '../util/assert'; -import { isWhitespace } from '../util/whitespaceStringUtil'; -import { imagePathToBytes } from '../util/imagePathToBytes'; -import { getLocalAvatarUrl } from '../util/avatarUtils'; +import { DataWriter } from '../sql/Client.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import * as Errors from '../types/errors.js'; +import { createLogger } from '../logging/log.js'; +import { computeHash } from '../Crypto.js'; +import { encryptProfileData } from '../util/encryptProfileData.js'; +import { getProfile } from '../util/getProfile.js'; +import { singleProtoJobQueue } from '../jobs/singleProtoJobQueue.js'; +import { strictAssert } from '../util/assert.js'; +import { isWhitespace } from '../util/whitespaceStringUtil.js'; +import { imagePathToBytes } from '../util/imagePathToBytes.js'; +import { getLocalAvatarUrl } from '../util/avatarUtils.js'; import type { AvatarUpdateOptionsType, AvatarUpdateType, -} from '../types/Avatar'; -import MessageSender from '../textsecure/SendMessage'; +} from '../types/Avatar.js'; +import MessageSender from '../textsecure/SendMessage.js'; const log = createLogger('writeProfile'); diff --git a/ts/setAppLoadingScreenMessage.ts b/ts/setAppLoadingScreenMessage.ts index 447872dc40e..515bd81aba6 100644 --- a/ts/setAppLoadingScreenMessage.ts +++ b/ts/setAppLoadingScreenMessage.ts @@ -1,7 +1,7 @@ // Copyright 2018 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { LocalizerType } from './types/Util'; +import type { LocalizerType } from './types/Util.js'; const DISPLAY_THRESHOLD = 3000; // milliseconds const SELECTOR = '.app-loading-screen .message'; diff --git a/ts/shims/deleteAllData.ts b/ts/shims/deleteAllData.ts index 8ca5012ec1c..8405921204f 100644 --- a/ts/shims/deleteAllData.ts +++ b/ts/shims/deleteAllData.ts @@ -1,10 +1,10 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log'; -import { DataWriter } from '../sql/Client'; -import { deleteAllLogs } from '../util/deleteAllLogs'; -import * as Errors from '../types/errors'; +import { createLogger } from '../logging/log.js'; +import { DataWriter } from '../sql/Client.js'; +import { deleteAllLogs } from '../util/deleteAllLogs.js'; +import * as Errors from '../types/errors.js'; const log = createLogger('deleteAllData'); diff --git a/ts/shims/dispatchItemsMiddleware.ts b/ts/shims/dispatchItemsMiddleware.ts index b102cf5aa54..54a683fe6a3 100644 --- a/ts/shims/dispatchItemsMiddleware.ts +++ b/ts/shims/dispatchItemsMiddleware.ts @@ -8,7 +8,7 @@ import { COLORS_CHANGED, COLOR_SELECTED, SET_VOICE_NOTE_PLAYBACK_RATE, -} from '../state/ducks/conversations'; +} from '../state/ducks/conversations.js'; export const dispatchItemsMiddleware: Middleware = ({ getState }) => diff --git a/ts/shims/events.ts b/ts/shims/events.ts index 9f1436e1e01..739413dc492 100644 --- a/ts/shims/events.ts +++ b/ts/shims/events.ts @@ -1,9 +1,9 @@ // Copyright 2019 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import createTaskWithTimeout from '../textsecure/TaskWithTimeout'; -import { MINUTE } from '../util/durations'; -import { explodePromise } from '../util/explodePromise'; +import createTaskWithTimeout from '../textsecure/TaskWithTimeout.js'; +import { MINUTE } from '../util/durations/index.js'; +import { explodePromise } from '../util/explodePromise.js'; // Matching Whisper.events.trigger API // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/ts/shims/getUserTheme.ts b/ts/shims/getUserTheme.ts index c2b05409f5d..77f14129a58 100644 --- a/ts/shims/getUserTheme.ts +++ b/ts/shims/getUserTheme.ts @@ -1,8 +1,8 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ThemeType } from '../types/Util'; -import { getTheme } from '../state/selectors/user'; +import type { ThemeType } from '../types/Util.js'; +import { getTheme } from '../state/selectors/user.js'; export function getUserTheme(): ThemeType { return getTheme(window.reduxStore.getState()); diff --git a/ts/shims/renderClearingDataView.tsx b/ts/shims/renderClearingDataView.tsx index 11bd7ff2e00..5f2469cd740 100644 --- a/ts/shims/renderClearingDataView.tsx +++ b/ts/shims/renderClearingDataView.tsx @@ -4,11 +4,11 @@ import React, { StrictMode } from 'react'; import { createRoot } from 'react-dom/client'; -import { ClearingData } from '../components/ClearingData'; -import { strictAssert } from '../util/assert'; -import { deleteAllData } from './deleteAllData'; -import { FunDefaultEnglishEmojiLocalizationProvider } from '../components/fun/FunEmojiLocalizationProvider'; -import { AxoProvider } from '../axo/AxoProvider'; +import { ClearingData } from '../components/ClearingData.js'; +import { strictAssert } from '../util/assert.js'; +import { deleteAllData } from './deleteAllData.js'; +import { FunDefaultEnglishEmojiLocalizationProvider } from '../components/fun/FunEmojiLocalizationProvider.js'; +import { AxoProvider } from '../axo/AxoProvider.js'; export function renderClearingDataView(): void { const appContainer = document.getElementById('app-container'); diff --git a/ts/shims/storage.ts b/ts/shims/storage.ts index 174bae0c516..a14a865a716 100644 --- a/ts/shims/storage.ts +++ b/ts/shims/storage.ts @@ -1,7 +1,7 @@ // Copyright 2019 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { StorageAccessType } from '../types/Storage.d'; +import type { StorageAccessType } from '../types/Storage.d.ts'; // Matching window.storage.put API export async function put( diff --git a/ts/shims/textsecure.ts b/ts/shims/textsecure.ts index 06781c67b08..d32f03bf712 100644 --- a/ts/shims/textsecure.ts +++ b/ts/shims/textsecure.ts @@ -1,10 +1,10 @@ // Copyright 2019 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log'; -import { singleProtoJobQueue } from '../jobs/singleProtoJobQueue'; -import * as Errors from '../types/errors'; -import MessageSender from '../textsecure/SendMessage'; +import { createLogger } from '../logging/log.js'; +import { singleProtoJobQueue } from '../jobs/singleProtoJobQueue.js'; +import * as Errors from '../types/errors.js'; +import MessageSender from '../textsecure/SendMessage.js'; const log = createLogger('textsecure'); diff --git a/ts/shims/themeChanged.ts b/ts/shims/themeChanged.ts index e996ce09618..d4e54eda454 100644 --- a/ts/shims/themeChanged.ts +++ b/ts/shims/themeChanged.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { getThemeType } from '../util/getThemeType'; +import { getThemeType } from '../util/getThemeType.js'; export async function themeChanged(): Promise { if (window.reduxActions && window.reduxActions.user) { diff --git a/ts/signal.ts b/ts/signal.ts index 7eae2643092..72e66eb9697 100644 --- a/ts/signal.ts +++ b/ts/signal.ts @@ -5,56 +5,59 @@ import type { ReadonlyDeep } from 'type-fest'; -import * as Crypto from './Crypto'; -import * as Curve from './Curve'; -import * as Groups from './groups'; -import OS from './util/os/osMain'; -import { isProduction } from './util/version'; -import * as RemoteConfig from './RemoteConfig'; -import { DataReader, DataWriter } from './sql/Client'; +import * as Crypto from './Crypto.js'; +import * as Curve from './Curve.js'; +import * as Groups from './groups.js'; +import OS from './util/os/osMain.js'; +import { isProduction } from './util/version.js'; +import * as RemoteConfig from './RemoteConfig.js'; +import { DataReader, DataWriter } from './sql/Client.js'; // Components -import { ConfirmationDialog } from './components/ConfirmationDialog'; +import { ConfirmationDialog } from './components/ConfirmationDialog.js'; // State -import { createApp } from './state/roots/createApp'; -import { createSafetyNumberViewer } from './state/roots/createSafetyNumberViewer'; +import { createApp } from './state/roots/createApp.js'; +import { createSafetyNumberViewer } from './state/roots/createSafetyNumberViewer.js'; // Types -import * as TypesAttachment from './types/Attachment'; -import * as VisualAttachment from './types/VisualAttachment'; -import * as MessageType from './types/Message2'; -import { Address } from './types/Address'; -import { QualifiedAddress } from './types/QualifiedAddress'; +import * as TypesAttachment from './types/Attachment.js'; +import * as VisualAttachment from './types/VisualAttachment.js'; +import * as MessageType from './types/Message2.js'; +import { Address } from './types/Address.js'; +import { QualifiedAddress } from './types/QualifiedAddress.js'; // Processes / Services -import { initializeGroupCredentialFetcher } from './services/groupCredentialFetcher'; -import { initializeNetworkObserver } from './services/networkObserver'; -import { initializeUpdateListener } from './services/updateListener'; -import { calling } from './services/calling'; -import * as storage from './services/storage'; -import { backupsService } from './services/backups'; -import * as donations from './services/donations'; +import { initializeGroupCredentialFetcher } from './services/groupCredentialFetcher.js'; +import { initializeNetworkObserver } from './services/networkObserver.js'; +import { initializeUpdateListener } from './services/updateListener.js'; +import { calling } from './services/calling.js'; +import * as storage from './services/storage.js'; +import { backupsService } from './services/backups/index.js'; +import * as donations from './services/donations.js'; -import type { LoggerType } from './types/Logging'; +import type { LoggerType } from './types/Logging.js'; import type { AttachmentType, AttachmentWithHydratedData, AddressableAttachmentType, LocalAttachmentV2Type, -} from './types/Attachment'; -import type { MessageAttributesType, QuotedMessageType } from './model-types.d'; -import type { SignalCoreType } from './window.d'; +} from './types/Attachment.js'; +import type { + MessageAttributesType, + QuotedMessageType, +} from './model-types.d.ts'; +import type { SignalCoreType } from './window.d.ts'; import type { EmbeddedContactType, EmbeddedContactWithHydratedAvatar, -} from './types/EmbeddedContact'; +} from './types/EmbeddedContact.js'; import type { LinkPreviewType, LinkPreviewWithHydratedData, -} from './types/message/LinkPreviews'; -import type { StickerType, StickerWithHydratedData } from './types/Stickers'; -import { beforeNavigateService } from './services/BeforeNavigate'; +} from './types/message/LinkPreviews.js'; +import type { StickerType, StickerWithHydratedData } from './types/Stickers.js'; +import { beforeNavigateService } from './services/BeforeNavigate.js'; type EncryptedReader = ( attachment: Partial diff --git a/ts/sql/Client.ts b/ts/sql/Client.ts index 6dba611ac63..d3da45d09dc 100644 --- a/ts/sql/Client.ts +++ b/ts/sql/Client.ts @@ -9,27 +9,27 @@ import type { ReadonlyDeep } from 'type-fest'; // Note: nothing imported here can come back and require Client.ts, and that includes // their imports too. That circularity causes problems. Anything that would do that needs // to be passed in, like cleanupMessages below. -import * as Bytes from '../Bytes'; -import { createLogger } from '../logging/log'; -import * as Errors from '../types/errors'; +import * as Bytes from '../Bytes.js'; +import { createLogger } from '../logging/log.js'; +import * as Errors from '../types/errors.js'; -import { deleteExternalFiles } from '../types/Conversation'; -import { createBatcher } from '../util/batcher'; -import { assertDev, softAssert } from '../util/assert'; -import { mapObjectWithSpec } from '../util/mapObjectWithSpec'; -import { cleanDataForIpc } from './cleanDataForIpc'; -import createTaskWithTimeout from '../textsecure/TaskWithTimeout'; -import { isValidUuid, isValidUuidV7 } from '../util/isValidUuid'; -import { formatJobForInsert } from '../jobs/formatJobForInsert'; -import { AccessType, ipcInvoke, doShutdown, removeDB } from './channels'; -import { getMessageIdForLogging } from '../util/idForLogging'; -import { incrementMessageCounter } from '../util/incrementMessageCounter'; -import { generateSnippetAroundMention } from '../util/search'; -import { drop } from '../util/drop'; +import { deleteExternalFiles } from '../types/Conversation.js'; +import { createBatcher } from '../util/batcher.js'; +import { assertDev, softAssert } from '../util/assert.js'; +import { mapObjectWithSpec } from '../util/mapObjectWithSpec.js'; +import { cleanDataForIpc } from './cleanDataForIpc.js'; +import createTaskWithTimeout from '../textsecure/TaskWithTimeout.js'; +import { isValidUuid, isValidUuidV7 } from '../util/isValidUuid.js'; +import { formatJobForInsert } from '../jobs/formatJobForInsert.js'; +import { AccessType, ipcInvoke, doShutdown, removeDB } from './channels.js'; +import { getMessageIdForLogging } from '../util/idForLogging.js'; +import { incrementMessageCounter } from '../util/incrementMessageCounter.js'; +import { generateSnippetAroundMention } from '../util/search.js'; +import { drop } from '../util/drop.js'; -import type { ObjectMappingSpecType } from '../util/mapObjectWithSpec'; -import type { AciString, ServiceIdString } from '../types/ServiceId'; -import type { StoredJob } from '../jobs/types'; +import type { ObjectMappingSpecType } from '../util/mapObjectWithSpec.js'; +import type { AciString, ServiceIdString } from '../types/ServiceId.js'; +import type { StoredJob } from '../jobs/types.js'; import type { ClientInterfaceWrap, AdjacentMessagesByConversationOptionsType, @@ -60,14 +60,14 @@ import type { StoredKyberPreKeyType, ClientOnlyReadableInterface, ClientOnlyWritableInterface, -} from './Interface'; -import { AttachmentDownloadSource } from './Interface'; -import type { MessageAttributesType } from '../model-types'; -import type { AttachmentDownloadJobType } from '../types/AttachmentDownload'; +} from './Interface.js'; +import { AttachmentDownloadSource } from './Interface.js'; +import type { MessageAttributesType } from '../model-types.js'; +import type { AttachmentDownloadJobType } from '../types/AttachmentDownload.js'; import { throttledUpdateBackupMediaDownloadProgress, updateBackupMediaDownloadProgress, -} from '../util/updateBackupMediaDownloadProgress'; +} from '../util/updateBackupMediaDownloadProgress.js'; const log = createLogger('Client'); diff --git a/ts/sql/Interface.ts b/ts/sql/Interface.ts index 6a317778a56..56a0bc9bccd 100644 --- a/ts/sql/Interface.ts +++ b/ts/sql/Interface.ts @@ -4,59 +4,66 @@ import type { Database, RowType } from '@signalapp/sqlcipher'; import type { ReadonlyDeep } from 'type-fest'; -import { strictAssert } from '../util/assert'; +import { strictAssert } from '../util/assert.js'; import type { ConversationAttributesType, MessageAttributesType, SenderKeyInfoType, -} from '../model-types.d'; -import type { StoredJob } from '../jobs/types'; -import type { ReactionType, ReactionReadStatus } from '../types/Reactions'; -import type { ConversationColorType, CustomColorType } from '../types/Colors'; -import type { StorageAccessType } from '../types/Storage.d'; -import type { BytesToStrings } from '../types/Util'; -import type { QualifiedAddressStringType } from '../types/QualifiedAddress'; -import type { StoryDistributionIdString } from '../types/StoryDistributionId'; -import type { AciString, PniString, ServiceIdString } from '../types/ServiceId'; -import type { BadgeType } from '../badges/types'; -import type { ReadStatus } from '../messages/MessageReadStatus'; -import type { RawBodyRange } from '../types/BodyRange'; +} from '../model-types.d.ts'; +import type { StoredJob } from '../jobs/types.js'; +import type { ReactionType, ReactionReadStatus } from '../types/Reactions.js'; +import type { + ConversationColorType, + CustomColorType, +} from '../types/Colors.js'; +import type { StorageAccessType } from '../types/Storage.d.ts'; +import type { BytesToStrings } from '../types/Util.js'; +import type { QualifiedAddressStringType } from '../types/QualifiedAddress.js'; +import type { StoryDistributionIdString } from '../types/StoryDistributionId.js'; +import type { + AciString, + PniString, + ServiceIdString, +} from '../types/ServiceId.js'; +import type { BadgeType } from '../badges/types.js'; +import type { ReadStatus } from '../messages/MessageReadStatus.js'; +import type { RawBodyRange } from '../types/BodyRange.js'; import type { GetMessagesBetweenOptions, MaybeStaleCallHistory, -} from './Server'; -import type { MessageTimestamps } from '../state/ducks/conversations'; +} from './Server.js'; +import type { MessageTimestamps } from '../state/ducks/conversations.js'; import type { CallHistoryDetails, CallHistoryFilter, CallHistoryGroup, CallHistoryPagination, CallLogEventTarget, -} from '../types/CallDisposition'; +} from '../types/CallDisposition.js'; import type { CallLinkRecord, CallLinkStateType, CallLinkType, DefunctCallLinkType, -} from '../types/CallLink'; +} from '../types/CallLink.js'; import type { AttachmentDownloadJobType, AttachmentDownloadJobTypeType, -} from '../types/AttachmentDownload'; +} from '../types/AttachmentDownload.js'; import type { GroupSendEndorsementsData, GroupSendMemberEndorsementRecord, -} from '../types/GroupSendEndorsements'; -import type { SyncTaskType } from '../util/syncTasks'; -import type { AttachmentBackupJobType } from '../types/AttachmentBackup'; -import type { AttachmentType } from '../types/Attachment'; -import type { MediaItemMessageType } from '../types/MediaItem'; -import type { GifType } from '../components/fun/panels/FunPanelGifs'; -import type { NotificationProfileType } from '../types/NotificationProfile'; -import type { DonationReceipt } from '../types/Donations'; -import type { InsertOrUpdateCallLinkFromSyncResult } from './server/callLinks'; -import type { ChatFolderId, ChatFolder } from '../types/ChatFolder'; +} from '../types/GroupSendEndorsements.js'; +import type { SyncTaskType } from '../util/syncTasks.js'; +import type { AttachmentBackupJobType } from '../types/AttachmentBackup.js'; +import type { AttachmentType } from '../types/Attachment.js'; +import type { MediaItemMessageType } from '../types/MediaItem.js'; +import type { GifType } from '../components/fun/panels/FunPanelGifs.js'; +import type { NotificationProfileType } from '../types/NotificationProfile.js'; +import type { DonationReceipt } from '../types/Donations.js'; +import type { InsertOrUpdateCallLinkFromSyncResult } from './server/callLinks.js'; +import type { ChatFolderId, ChatFolder } from '../types/ChatFolder.js'; export type ReadableDB = Database & { __readable_db: never }; export type WritableDB = ReadableDB & { __writable_db: never }; diff --git a/ts/sql/Server.ts b/ts/sql/Server.ts index cb2f6d7b3a3..e2aa018e3d3 100644 --- a/ts/sql/Server.ts +++ b/ts/sql/Server.ts @@ -6,9 +6,9 @@ // TODO(indutny): format queries import type { RowType } from '@signalapp/sqlcipher'; import SQL, { setLogger as setSqliteLogger } from '@signalapp/sqlcipher'; -import { randomBytes } from 'crypto'; +import { randomBytes } from 'node:crypto'; import { mkdirSync, rmSync } from 'node:fs'; -import { join } from 'path'; +import { join } from 'node:path'; import type { ReadonlyDeep } from 'type-fest'; import { z } from 'zod'; @@ -30,40 +30,40 @@ import { pick, } from 'lodash'; -import { parseBadgeCategory } from '../badges/BadgeCategory'; +import { parseBadgeCategory } from '../badges/BadgeCategory.js'; import { parseBadgeImageTheme, type BadgeImageTheme, -} from '../badges/BadgeImageTheme'; -import type { BadgeImageType, BadgeType } from '../badges/types'; -import type { StoredJob } from '../jobs/types'; -import { formatCountForLogging } from '../logging/formatCountForLogging'; -import { ReadStatus } from '../messages/MessageReadStatus'; +} from '../badges/BadgeImageTheme.js'; +import type { BadgeImageType, BadgeType } from '../badges/types.js'; +import type { StoredJob } from '../jobs/types.js'; +import { formatCountForLogging } from '../logging/formatCountForLogging.js'; +import { ReadStatus } from '../messages/MessageReadStatus.js'; import type { GroupV2MemberType, MessageAttributesType, -} from '../model-types.d'; -import type { ReactionType } from '../types/Reactions'; -import { ReactionReadStatus } from '../types/Reactions'; -import type { AciString, ServiceIdString } from '../types/ServiceId'; -import { isServiceIdString } from '../types/ServiceId'; -import { STORAGE_UI_KEYS } from '../types/StorageUIKeys'; -import type { StoryDistributionIdString } from '../types/StoryDistributionId'; -import * as Errors from '../types/errors'; -import { assertDev, strictAssert } from '../util/assert'; -import { combineNames } from '../util/combineNames'; -import { consoleLogger } from '../util/consoleLogger'; +} from '../model-types.d.ts'; +import type { ReactionType } from '../types/Reactions.js'; +import { ReactionReadStatus } from '../types/Reactions.js'; +import type { AciString, ServiceIdString } from '../types/ServiceId.js'; +import { isServiceIdString } from '../types/ServiceId.js'; +import { STORAGE_UI_KEYS } from '../types/StorageUIKeys.js'; +import type { StoryDistributionIdString } from '../types/StoryDistributionId.js'; +import * as Errors from '../types/errors.js'; +import { assertDev, strictAssert } from '../util/assert.js'; +import { combineNames } from '../util/combineNames.js'; +import { consoleLogger } from '../util/consoleLogger.js'; import { dropNull, shallowConvertUndefinedToNull, type ShallowNullToUndefined, type ShallowUndefinedToNull, -} from '../util/dropNull'; -import { isNormalNumber } from '../util/isNormalNumber'; -import { isNotNil } from '../util/isNotNil'; -import { parseIntOrThrow } from '../util/parseIntOrThrow'; -import { updateSchema } from './migrations'; -import type { JSONRows } from './util'; +} from '../util/dropNull.js'; +import { isNormalNumber } from '../util/isNormalNumber.js'; +import { isNotNil } from '../util/isNotNil.js'; +import { parseIntOrThrow } from '../util/parseIntOrThrow.js'; +import { updateSchema } from './migrations/index.js'; +import type { JSONRows } from './util.js'; import { batchMultiVarQuery, bulkAdd, @@ -84,32 +84,32 @@ import { sqlJoin, QueryFragment, convertOptionalBooleanToInteger, -} from './util'; +} from './util.js'; import { hydrateMessage, hydrateMessages, convertAttachmentDBFieldsToAttachmentType, getAttachmentReferencesForMessages, ROOT_MESSAGE_ATTACHMENT_EDIT_HISTORY_INDEX, -} from './hydration'; +} from './hydration.js'; -import { SeenStatus } from '../MessageSeenStatus'; +import { SeenStatus } from '../MessageSeenStatus.js'; import { attachmentBackupJobSchema, type AttachmentBackupJobType, -} from '../types/AttachmentBackup'; +} from '../types/AttachmentBackup.js'; import { attachmentDownloadJobSchema, type AttachmentDownloadJobTypeType, type AttachmentDownloadJobType, -} from '../types/AttachmentDownload'; +} from '../types/AttachmentDownload.js'; import type { CallHistoryDetails, CallHistoryFilter, CallHistoryGroup, CallHistoryPagination, CallLogEventTarget, -} from '../types/CallDisposition'; +} from '../types/CallDisposition.js'; import { CallDirection, CallHistoryFilterStatus, @@ -120,21 +120,21 @@ import { GroupCallStatus, callHistoryDetailsSchema, callHistoryGroupSchema, -} from '../types/CallDisposition'; -import { redactGenericText } from '../util/privacy'; +} from '../types/CallDisposition.js'; +import { redactGenericText } from '../util/privacy.js'; import { parseLoose, parseStrict, parseUnknown, safeParseUnknown, -} from '../util/schemas'; +} from '../util/schemas.js'; import { SNIPPET_LEFT_PLACEHOLDER, SNIPPET_RIGHT_PLACEHOLDER, SNIPPET_TRUNCATION_PLACEHOLDER, -} from '../util/search'; -import type { SyncTaskType } from '../util/syncTasks'; -import { MAX_SYNC_TASK_ATTEMPTS } from '../util/syncTasks.types'; +} from '../util/search.js'; +import type { SyncTaskType } from '../util/syncTasks.js'; +import { MAX_SYNC_TASK_ATTEMPTS } from '../util/syncTasks.types.js'; import type { AdjacentMessagesByConversationOptionsType, BackupCdnMediaObjectType, @@ -202,13 +202,13 @@ import type { ServerMessageSearchResultType, MessageCountBySchemaVersionType, BackupAttachmentDownloadProgress, -} from './Interface'; +} from './Interface.js'; import { AttachmentDownloadSource, MESSAGE_COLUMNS, MESSAGE_ATTACHMENT_COLUMNS, MESSAGE_NON_PRIMARY_KEY_COLUMNS, -} from './Interface'; +} from './Interface.js'; import { _removeAllCallLinks, beginDeleteAllCallLinks, @@ -233,21 +233,21 @@ import { updateCallLinkState, updateCallLinkStateAndEpoch, updateDefunctCallLink, -} from './server/callLinks'; +} from './server/callLinks.js'; import { _deleteAllDonationReceipts, createDonationReceipt, deleteDonationReceiptById, getAllDonationReceipts, getDonationReceiptById, -} from './server/donationReceipts'; +} from './server/donationReceipts.js'; import { deleteAllEndorsementsForGroup, getGroupSendCombinedEndorsementExpiration, getGroupSendEndorsementsData, getGroupSendMemberEndorsement, replaceAllEndorsementsForGroup, -} from './server/groupSendEndorsements'; +} from './server/groupSendEndorsements.js'; import { getAllChatFolders, getCurrentChatFolders, @@ -259,20 +259,23 @@ import { updateChatFolderPositions, updateChatFolderDeletedAtTimestampMsFromSync, deleteExpiredChatFolders, -} from './server/chatFolders'; -import { INITIAL_EXPIRE_TIMER_VERSION } from '../util/expirationTimer'; -import type { GifType } from '../components/fun/panels/FunPanelGifs'; -import type { NotificationProfileType } from '../types/NotificationProfile'; -import * as durations from '../util/durations'; +} from './server/chatFolders.js'; +import { INITIAL_EXPIRE_TIMER_VERSION } from '../util/expirationTimer.js'; +import type { GifType } from '../components/fun/panels/FunPanelGifs.js'; +import type { NotificationProfileType } from '../types/NotificationProfile.js'; +import * as durations from '../util/durations/index.js'; import { isFile, isVisualMedia, type AttachmentType, -} from '../types/Attachment'; -import { generateMessageId } from '../util/generateMessageId'; -import type { ConversationColorType, CustomColorType } from '../types/Colors'; -import { sqlLogger } from './sqlLogger'; -import { permissiveMessageAttachmentSchema } from './server/messageAttachments'; +} from '../types/Attachment.js'; +import { generateMessageId } from '../util/generateMessageId.js'; +import type { + ConversationColorType, + CustomColorType, +} from '../types/Colors.js'; +import { sqlLogger } from './sqlLogger.js'; +import { permissiveMessageAttachmentSchema } from './server/messageAttachments.js'; type ConversationRow = Readonly<{ json: string; diff --git a/ts/sql/channels.ts b/ts/sql/channels.ts index 830b28aa644..e3f85f4679a 100644 --- a/ts/sql/channels.ts +++ b/ts/sql/channels.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import { ipcRenderer } from 'electron'; -import { createLogger } from '../logging/log'; -import createTaskWithTimeout from '../textsecure/TaskWithTimeout'; -import { explodePromise } from '../util/explodePromise'; -import { missingCaseError } from '../util/missingCaseError'; +import { createLogger } from '../logging/log.js'; +import createTaskWithTimeout from '../textsecure/TaskWithTimeout.js'; +import { explodePromise } from '../util/explodePromise.js'; +import { missingCaseError } from '../util/missingCaseError.js'; const log = createLogger('channels'); diff --git a/ts/sql/cleanDataForIpc.ts b/ts/sql/cleanDataForIpc.ts index 0c2969fd653..0739a59282f 100644 --- a/ts/sql/cleanDataForIpc.ts +++ b/ts/sql/cleanDataForIpc.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import { isPlainObject } from 'lodash'; -import { createLogger } from '../logging/log'; +import { createLogger } from '../logging/log.js'; -import { isIterable } from '../util/iterables'; +import { isIterable } from '../util/iterables.js'; const log = createLogger('cleanDataForIpc'); diff --git a/ts/sql/hydration.ts b/ts/sql/hydration.ts index 23b16590a0b..371b92b8891 100644 --- a/ts/sql/hydration.ts +++ b/ts/sql/hydration.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import { groupBy } from 'lodash'; -import type { ReadStatus } from '../messages/MessageReadStatus'; -import type { SeenStatus } from '../MessageSeenStatus'; -import type { ServiceIdString } from '../types/ServiceId'; -import { dropNull, shallowDropNull } from '../util/dropNull'; +import type { ReadStatus } from '../messages/MessageReadStatus.js'; +import type { SeenStatus } from '../MessageSeenStatus.js'; +import type { ServiceIdString } from '../types/ServiceId.js'; +import { dropNull, shallowDropNull } from '../util/dropNull.js'; /* eslint-disable camelcase */ @@ -15,24 +15,24 @@ import type { MESSAGE_COLUMNS, ReadableDB, MessageAttachmentDBType, -} from './Interface'; +} from './Interface.js'; import { batchMultiVarQuery, convertOptionalIntegerToBoolean, jsonToObject, sql, sqlJoin, -} from './util'; -import { type AttachmentType } from '../types/Attachment'; +} from './util.js'; +import { type AttachmentType } from '../types/Attachment.js'; import { APPLICATION_OCTET_STREAM, IMAGE_JPEG, IMAGE_PNG, stringToMIMEType, -} from '../types/MIME'; -import { strictAssert } from '../util/assert'; -import type { MessageAttributesType } from '../model-types'; -import { createLogger } from '../logging/log'; +} from '../types/MIME.js'; +import { strictAssert } from '../util/assert.js'; +import type { MessageAttributesType } from '../model-types.js'; +import { createLogger } from '../logging/log.js'; export const ROOT_MESSAGE_ATTACHMENT_EDIT_HISTORY_INDEX = -1; diff --git a/ts/sql/main.ts b/ts/sql/main.ts index 1b5234de5d8..56b526811a1 100644 --- a/ts/sql/main.ts +++ b/ts/sql/main.ts @@ -1,20 +1,20 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { join } from 'path'; -import { Worker } from 'worker_threads'; -import { format } from 'util'; +import { join } from 'node:path'; +import { Worker } from 'node:worker_threads'; +import { format } from 'node:util'; import { app } from 'electron'; -import { strictAssert } from '../util/assert'; -import { explodePromise } from '../util/explodePromise'; -import type { LoggerType } from '../types/Logging'; -import * as Errors from '../types/errors'; -import { SqliteErrorKind } from './errors'; +import { strictAssert } from '../util/assert.js'; +import { explodePromise } from '../util/explodePromise.js'; +import type { LoggerType } from '../types/Logging.js'; +import * as Errors from '../types/errors.js'; +import { SqliteErrorKind } from './errors.js'; import type { ServerReadableDirectInterface, ServerWritableDirectInterface, -} from './Interface'; +} from './Interface.js'; const MIN_TRACE_DURATION = 40; diff --git a/ts/sql/mainWorker.ts b/ts/sql/mainWorker.ts index 5c3ba8d3e47..8e715739273 100644 --- a/ts/sql/mainWorker.ts +++ b/ts/sql/mainWorker.ts @@ -1,13 +1,13 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { parentPort } from 'worker_threads'; +import { parentPort } from 'node:worker_threads'; -import type { WrappedWorkerRequest, WrappedWorkerResponse } from './main'; -import type { WritableDB } from './Interface'; -import { initialize, DataReader, DataWriter, removeDB } from './Server'; -import { SqliteErrorKind, parseSqliteError } from './errors'; -import { sqlLogger as logger } from './sqlLogger'; +import type { WrappedWorkerRequest, WrappedWorkerResponse } from './main.js'; +import type { WritableDB } from './Interface.js'; +import { initialize, DataReader, DataWriter, removeDB } from './Server.js'; +import { SqliteErrorKind, parseSqliteError } from './errors.js'; +import { sqlLogger as logger } from './sqlLogger.js'; if (!parentPort) { throw new Error('Must run as a worker thread'); diff --git a/ts/sql/migrations/1000-mark-unread-call-history-messages-as-unseen.ts b/ts/sql/migrations/1000-mark-unread-call-history-messages-as-unseen.ts index 8bb371f5be3..432c841d25f 100644 --- a/ts/sql/migrations/1000-mark-unread-call-history-messages-as-unseen.ts +++ b/ts/sql/migrations/1000-mark-unread-call-history-messages-as-unseen.ts @@ -3,10 +3,10 @@ import type { Database } from '@signalapp/sqlcipher'; -import { ReadStatus } from '../../messages/MessageReadStatus'; -import { SeenStatus } from '../../MessageSeenStatus'; -import { strictAssert } from '../../util/assert'; -import { sql, sqlConstant } from '../util'; +import { ReadStatus } from '../../messages/MessageReadStatus.js'; +import { SeenStatus } from '../../MessageSeenStatus.js'; +import { strictAssert } from '../../util/assert.js'; +import { sql, sqlConstant } from '../util.js'; const READ_STATUS_UNREAD = sqlConstant(ReadStatus.Unread); const READ_STATUS_READ = sqlConstant(ReadStatus.Read); diff --git a/ts/sql/migrations/1010-call-links-table.ts b/ts/sql/migrations/1010-call-links-table.ts index 8e2645e400a..58566ce0b92 100644 --- a/ts/sql/migrations/1010-call-links-table.ts +++ b/ts/sql/migrations/1010-call-links-table.ts @@ -3,7 +3,7 @@ import type { Database } from '@signalapp/sqlcipher'; -import { sql } from '../util'; +import { sql } from '../util.js'; export default function updateToSchemaVersion1010(db: Database): void { const [createTable] = sql` diff --git a/ts/sql/migrations/1020-self-merges.ts b/ts/sql/migrations/1020-self-merges.ts index a1b3efb9e83..0be2cf91e64 100644 --- a/ts/sql/migrations/1020-self-merges.ts +++ b/ts/sql/migrations/1020-self-merges.ts @@ -1,10 +1,10 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { LoggerType } from '../../types/Logging'; -import { sql } from '../util'; -import type { WritableDB } from '../Interface'; -import { getOurUuid } from './41-uuid-keys'; +import type { LoggerType } from '../../types/Logging.js'; +import { sql } from '../util.js'; +import type { WritableDB } from '../Interface.js'; +import { getOurUuid } from './41-uuid-keys.js'; export default function updateToSchemaVersion1020( db: WritableDB, diff --git a/ts/sql/migrations/1030-unblock-event.ts b/ts/sql/migrations/1030-unblock-event.ts index 1fe1f5c3db8..1bacca336d3 100644 --- a/ts/sql/migrations/1030-unblock-event.ts +++ b/ts/sql/migrations/1030-unblock-event.ts @@ -3,7 +3,7 @@ import type { Database } from '@signalapp/sqlcipher'; -import { sql, sqlFragment } from '../util'; +import { sql, sqlFragment } from '../util.js'; export default function updateToSchemaVersion1030(db: Database): void { // From migration 81 diff --git a/ts/sql/migrations/1040-undownloaded-backed-up-media.ts b/ts/sql/migrations/1040-undownloaded-backed-up-media.ts index 3d491eccc39..7472d586a4e 100644 --- a/ts/sql/migrations/1040-undownloaded-backed-up-media.ts +++ b/ts/sql/migrations/1040-undownloaded-backed-up-media.ts @@ -4,21 +4,21 @@ import type { Database } from '@signalapp/sqlcipher'; import * as z from 'zod'; -import type { LoggerType } from '../../types/Logging'; +import type { LoggerType } from '../../types/Logging.js'; import { attachmentDownloadTypeSchema, type AttachmentDownloadJobType, type AttachmentDownloadJobTypeType, -} from '../../types/AttachmentDownload'; -import type { AttachmentType } from '../../types/Attachment'; -import { jsonToObject, objectToJSON, sql } from '../util'; -import { AttachmentDownloadSource } from '../Interface'; -import { parsePartial } from '../../util/schemas'; -import { MIMETypeSchema } from '../../types/MIME'; +} from '../../types/AttachmentDownload.js'; +import type { AttachmentType } from '../../types/Attachment.js'; +import { jsonToObject, objectToJSON, sql } from '../util.js'; +import { AttachmentDownloadSource } from '../Interface.js'; +import { parsePartial } from '../../util/schemas.js'; +import { MIMETypeSchema } from '../../types/MIME.js'; import { jobManagerJobSchema, type JobManagerJobType, -} from '../../jobs/JobManager'; +} from '../../jobs/JobManager.js'; export type _AttachmentDownloadJobTypeV1030 = { attachment: AttachmentType; diff --git a/ts/sql/migrations/1050-group-send-endorsements.ts b/ts/sql/migrations/1050-group-send-endorsements.ts index 1962e6807d8..ed7760b4ede 100644 --- a/ts/sql/migrations/1050-group-send-endorsements.ts +++ b/ts/sql/migrations/1050-group-send-endorsements.ts @@ -3,7 +3,7 @@ import type { Database } from '@signalapp/sqlcipher'; -import { sql } from '../util'; +import { sql } from '../util.js'; export default function updateToSchemaVersion1050(db: Database): void { const [createTables] = sql` diff --git a/ts/sql/migrations/1100-optimize-mark-call-history-read-in-conversation.ts b/ts/sql/migrations/1100-optimize-mark-call-history-read-in-conversation.ts index e9b1545807f..25b6e5854c2 100644 --- a/ts/sql/migrations/1100-optimize-mark-call-history-read-in-conversation.ts +++ b/ts/sql/migrations/1100-optimize-mark-call-history-read-in-conversation.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { Database } from '@signalapp/sqlcipher'; -import { sql } from '../util'; +import { sql } from '../util.js'; export default function updateToSchemaVersion1100(db: Database): void { const [query] = sql` diff --git a/ts/sql/migrations/1160-optimize-calls-unread-count.ts b/ts/sql/migrations/1160-optimize-calls-unread-count.ts index 64de29914f7..32d8325884a 100644 --- a/ts/sql/migrations/1160-optimize-calls-unread-count.ts +++ b/ts/sql/migrations/1160-optimize-calls-unread-count.ts @@ -1,8 +1,8 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import type { Database } from '@signalapp/sqlcipher'; -import { sql, sqlConstant } from '../util'; -import { CallDirection, CallStatusValue } from '../../types/CallDisposition'; +import { sql, sqlConstant } from '../util.js'; +import { CallDirection, CallStatusValue } from '../../types/CallDisposition.js'; const CALL_STATUS_MISSED = sqlConstant(CallStatusValue.Missed); const CALL_DIRECTION_INCOMING = sqlConstant(CallDirection.Incoming); diff --git a/ts/sql/migrations/1170-update-call-history-unread-index.ts b/ts/sql/migrations/1170-update-call-history-unread-index.ts index e70bc262a14..1382e12622d 100644 --- a/ts/sql/migrations/1170-update-call-history-unread-index.ts +++ b/ts/sql/migrations/1170-update-call-history-unread-index.ts @@ -1,7 +1,7 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import type { Database } from '@signalapp/sqlcipher'; -import { sql } from '../util'; +import { sql } from '../util.js'; export default function updateToSchemaVersion1170(db: Database): void { const [query] = sql` diff --git a/ts/sql/migrations/1180-add-attachment-download-source.ts b/ts/sql/migrations/1180-add-attachment-download-source.ts index bbef0bbe339..eab54216fdc 100644 --- a/ts/sql/migrations/1180-add-attachment-download-source.ts +++ b/ts/sql/migrations/1180-add-attachment-download-source.ts @@ -1,7 +1,7 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import type { Database } from '@signalapp/sqlcipher'; -import { AttachmentDownloadSource } from '../Interface'; +import { AttachmentDownloadSource } from '../Interface.js'; export default function updateToSchemaVersion1180(db: Database): void { db.exec(` diff --git a/ts/sql/migrations/1220-blob-sessions.ts b/ts/sql/migrations/1220-blob-sessions.ts index d49f6f97926..ea5a9b9c80b 100644 --- a/ts/sql/migrations/1220-blob-sessions.ts +++ b/ts/sql/migrations/1220-blob-sessions.ts @@ -1,16 +1,16 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import assert from 'assert'; +import assert from 'node:assert'; import z from 'zod'; import type { Database } from '@signalapp/sqlcipher'; -import type { LoggerType } from '../../types/Logging'; -import * as Errors from '../../types/errors'; +import type { LoggerType } from '../../types/Logging.js'; +import * as Errors from '../../types/errors.js'; import { sessionRecordToProtobuf, sessionStructureToBytes, -} from '../../util/sessionTranslation'; -import { getOwn } from '../../util/getOwn'; -import { missingCaseError } from '../../util/missingCaseError'; +} from '../../util/sessionTranslation.js'; +import { getOwn } from '../../util/getOwn.js'; +import { missingCaseError } from '../../util/missingCaseError.js'; export const version = 1220; diff --git a/ts/sql/migrations/1240-defunct-call-links-table.ts b/ts/sql/migrations/1240-defunct-call-links-table.ts index c52a6b1e64d..643bb40e1cc 100644 --- a/ts/sql/migrations/1240-defunct-call-links-table.ts +++ b/ts/sql/migrations/1240-defunct-call-links-table.ts @@ -3,7 +3,7 @@ import type { Database } from '@signalapp/sqlcipher'; -import { sql } from '../util'; +import { sql } from '../util.js'; export default function updateToSchemaVersion1240(db: Database): void { const [createTable] = sql` diff --git a/ts/sql/migrations/1260-sync-tasks-rowid.ts b/ts/sql/migrations/1260-sync-tasks-rowid.ts index 7e795717025..42dde75c959 100644 --- a/ts/sql/migrations/1260-sync-tasks-rowid.ts +++ b/ts/sql/migrations/1260-sync-tasks-rowid.ts @@ -1,7 +1,7 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import type { Database } from '@signalapp/sqlcipher'; -import { sql } from '../util'; +import { sql } from '../util.js'; export default function updateToSchemaVersion1260(db: Database): void { const [query] = sql` diff --git a/ts/sql/migrations/1270-normalize-messages.ts b/ts/sql/migrations/1270-normalize-messages.ts index 3d3199a6c7b..770f3629054 100644 --- a/ts/sql/migrations/1270-normalize-messages.ts +++ b/ts/sql/migrations/1270-normalize-messages.ts @@ -1,7 +1,7 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import type { Database } from '@signalapp/sqlcipher'; -import { sql } from '../util'; +import { sql } from '../util.js'; export default function updateToSchemaVersion1270(db: Database): void { const [query] = sql` diff --git a/ts/sql/migrations/1280-blob-unprocessed.ts b/ts/sql/migrations/1280-blob-unprocessed.ts index 5a3f360f885..615d15ef860 100644 --- a/ts/sql/migrations/1280-blob-unprocessed.ts +++ b/ts/sql/migrations/1280-blob-unprocessed.ts @@ -2,17 +2,17 @@ // SPDX-License-Identifier: AGPL-3.0-only import { v7 as getGuid } from 'uuid'; -import type { LoggerType } from '../../types/Logging'; +import type { LoggerType } from '../../types/Logging.js'; import { normalizePni, normalizeServiceId, toTaggedPni, isUntaggedPniString, -} from '../../types/ServiceId'; -import { Migrations as Proto } from '../../protobuf'; -import { sql } from '../util'; -import type { WritableDB } from '../Interface'; -import { getOurUuid } from './41-uuid-keys'; +} from '../../types/ServiceId.js'; +import { Migrations as Proto } from '../../protobuf/index.js'; +import { sql } from '../util.js'; +import type { WritableDB } from '../Interface.js'; +import { getOurUuid } from './41-uuid-keys.js'; export default function updateToSchemaVersion1280( db: WritableDB, diff --git a/ts/sql/migrations/1290-int-unprocessed-source-device.ts b/ts/sql/migrations/1290-int-unprocessed-source-device.ts index 7534b654742..567dd63b663 100644 --- a/ts/sql/migrations/1290-int-unprocessed-source-device.ts +++ b/ts/sql/migrations/1290-int-unprocessed-source-device.ts @@ -1,7 +1,7 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { sql } from '../util'; -import type { WritableDB } from '../Interface'; +import { sql } from '../util.js'; +import type { WritableDB } from '../Interface.js'; export default function updateToSchemaVersion1290(db: WritableDB): void { const [query] = sql` diff --git a/ts/sql/migrations/1300-sticker-pack-refs.ts b/ts/sql/migrations/1300-sticker-pack-refs.ts index 03e4703ee7e..44d8c3cc0be 100644 --- a/ts/sql/migrations/1300-sticker-pack-refs.ts +++ b/ts/sql/migrations/1300-sticker-pack-refs.ts @@ -1,7 +1,7 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { sql } from '../util'; -import type { WritableDB } from '../Interface'; +import { sql } from '../util.js'; +import type { WritableDB } from '../Interface.js'; export default function updateToSchemaVersion1300(db: WritableDB): void { const [query] = sql` diff --git a/ts/sql/migrations/1310-muted-fixup.ts b/ts/sql/migrations/1310-muted-fixup.ts index f4ff81b4ae4..3b385b7a379 100644 --- a/ts/sql/migrations/1310-muted-fixup.ts +++ b/ts/sql/migrations/1310-muted-fixup.ts @@ -1,8 +1,8 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { LoggerType } from '../../types/Logging'; -import { sql } from '../util'; -import type { WritableDB } from '../Interface'; +import type { LoggerType } from '../../types/Logging.js'; +import { sql } from '../util.js'; +import type { WritableDB } from '../Interface.js'; // Value from ts/util/timestamp.ts at the time of creation of this migration const MAX_SAFE_DATE = 8640000000000000; diff --git a/ts/sql/migrations/1320-unprocessed-received-at-date.ts b/ts/sql/migrations/1320-unprocessed-received-at-date.ts index 61f669a532f..bbab852a3bc 100644 --- a/ts/sql/migrations/1320-unprocessed-received-at-date.ts +++ b/ts/sql/migrations/1320-unprocessed-received-at-date.ts @@ -1,8 +1,8 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { sql } from '../util'; -import type { WritableDB } from '../Interface'; +import { sql } from '../util.js'; +import type { WritableDB } from '../Interface.js'; export default function updateToSchemaVersion1320(db: WritableDB): void { const [query] = sql` diff --git a/ts/sql/migrations/1330-sync-tasks-type-index.ts b/ts/sql/migrations/1330-sync-tasks-type-index.ts index 99195bb648a..4219460679b 100644 --- a/ts/sql/migrations/1330-sync-tasks-type-index.ts +++ b/ts/sql/migrations/1330-sync-tasks-type-index.ts @@ -1,7 +1,7 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import type { Database } from '@signalapp/sqlcipher'; -import { sql } from '../util'; +import { sql } from '../util.js'; export default function updateToSchemaVersion1330(db: Database): void { const [query] = sql` diff --git a/ts/sql/migrations/1340-recent-gifs.ts b/ts/sql/migrations/1340-recent-gifs.ts index 29a064cd4a2..528795bb8b7 100644 --- a/ts/sql/migrations/1340-recent-gifs.ts +++ b/ts/sql/migrations/1340-recent-gifs.ts @@ -1,7 +1,7 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import type { Database } from '@signalapp/sqlcipher'; -import { sql } from '../util'; +import { sql } from '../util.js'; export default function updateToSchemaVersion1340(db: Database): void { const [query] = sql` diff --git a/ts/sql/migrations/1350-notification-profiles.ts b/ts/sql/migrations/1350-notification-profiles.ts index b7c13a2e535..c333ee04dc5 100644 --- a/ts/sql/migrations/1350-notification-profiles.ts +++ b/ts/sql/migrations/1350-notification-profiles.ts @@ -1,7 +1,7 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import type { Database } from '@signalapp/sqlcipher'; -import { sql } from '../util'; +import { sql } from '../util.js'; export default function updateToSchemaVersion1350(db: Database): void { const [query] = sql` diff --git a/ts/sql/migrations/1360-attachments.ts b/ts/sql/migrations/1360-attachments.ts index 6321c3c6b2a..c51102b5c9a 100644 --- a/ts/sql/migrations/1360-attachments.ts +++ b/ts/sql/migrations/1360-attachments.ts @@ -1,7 +1,7 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { WritableDB } from '../Interface'; +import type { WritableDB } from '../Interface.js'; export default function updateToSchemaVersion1360(db: WritableDB): void { db.exec(` diff --git a/ts/sql/migrations/1370-message-attachment-indexes.ts b/ts/sql/migrations/1370-message-attachment-indexes.ts index 8ba33999878..e21040964b7 100644 --- a/ts/sql/migrations/1370-message-attachment-indexes.ts +++ b/ts/sql/migrations/1370-message-attachment-indexes.ts @@ -1,7 +1,7 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { WritableDB } from '../Interface'; +import type { WritableDB } from '../Interface.js'; export default function updateToSchemaVersion1370(db: WritableDB): void { db.exec(` diff --git a/ts/sql/migrations/1380-donation-receipts.ts b/ts/sql/migrations/1380-donation-receipts.ts index 2203d1b5306..452e9de0431 100644 --- a/ts/sql/migrations/1380-donation-receipts.ts +++ b/ts/sql/migrations/1380-donation-receipts.ts @@ -1,7 +1,7 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { WritableDB } from '../Interface'; +import type { WritableDB } from '../Interface.js'; export default function updateToSchemaVersion1380(db: WritableDB): void { db.exec(` diff --git a/ts/sql/migrations/1390-attachment-download-keys.ts b/ts/sql/migrations/1390-attachment-download-keys.ts index aaf6281fa2e..24f8acf42c4 100644 --- a/ts/sql/migrations/1390-attachment-download-keys.ts +++ b/ts/sql/migrations/1390-attachment-download-keys.ts @@ -1,7 +1,7 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { type WritableDB } from '../Interface'; +import { type WritableDB } from '../Interface.js'; export default function updateToSchemaVersion1390(db: WritableDB): void { // TODO: DESKTOP-8879 Digest column is only used for deduplication purposes; here we diff --git a/ts/sql/migrations/1400-simplify-receipts.ts b/ts/sql/migrations/1400-simplify-receipts.ts index fb7b03f28a2..82c95bcb569 100644 --- a/ts/sql/migrations/1400-simplify-receipts.ts +++ b/ts/sql/migrations/1400-simplify-receipts.ts @@ -1,7 +1,7 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { WritableDB } from '../Interface'; +import type { WritableDB } from '../Interface.js'; export default function updateToSchemaVersion1400(db: WritableDB): void { db.exec(` diff --git a/ts/sql/migrations/1410-remove-wallpaper.ts b/ts/sql/migrations/1410-remove-wallpaper.ts index be55616f500..37b239e665d 100644 --- a/ts/sql/migrations/1410-remove-wallpaper.ts +++ b/ts/sql/migrations/1410-remove-wallpaper.ts @@ -1,7 +1,7 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { type WritableDB } from '../Interface'; +import { type WritableDB } from '../Interface.js'; export default function updateToSchemaVersion1410(db: WritableDB): void { db.exec(` diff --git a/ts/sql/migrations/1420-backup-downloads.ts b/ts/sql/migrations/1420-backup-downloads.ts index 392aac878a8..59c5367b2e5 100644 --- a/ts/sql/migrations/1420-backup-downloads.ts +++ b/ts/sql/migrations/1420-backup-downloads.ts @@ -1,7 +1,7 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { AttachmentDownloadSource, type WritableDB } from '../Interface'; +import { AttachmentDownloadSource, type WritableDB } from '../Interface.js'; export default function updateToSchemaVersion1420(db: WritableDB): void { db.exec(` diff --git a/ts/sql/migrations/1430-call-links-epoch-id.ts b/ts/sql/migrations/1430-call-links-epoch-id.ts index 409c2040d87..f0e53575042 100644 --- a/ts/sql/migrations/1430-call-links-epoch-id.ts +++ b/ts/sql/migrations/1430-call-links-epoch-id.ts @@ -1,7 +1,7 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { type WritableDB } from '../Interface'; +import { type WritableDB } from '../Interface.js'; export default function updateToSchemaVersion1430(db: WritableDB): void { db.exec(` diff --git a/ts/sql/migrations/1440-chat-folders.ts b/ts/sql/migrations/1440-chat-folders.ts index c1e32cd48f3..8b71140c0c3 100644 --- a/ts/sql/migrations/1440-chat-folders.ts +++ b/ts/sql/migrations/1440-chat-folders.ts @@ -1,7 +1,7 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { WritableDB } from '../Interface'; -import { sql } from '../util'; +import type { WritableDB } from '../Interface.js'; +import { sql } from '../util.js'; export default function updateToSchemaVersion1440(db: WritableDB): void { const [query] = sql` diff --git a/ts/sql/migrations/1450-all-media.ts b/ts/sql/migrations/1450-all-media.ts index e2ac73ca080..506f8eba0cf 100644 --- a/ts/sql/migrations/1450-all-media.ts +++ b/ts/sql/migrations/1450-all-media.ts @@ -1,7 +1,7 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { WritableDB } from '../Interface'; +import type { WritableDB } from '../Interface.js'; export default function updateToSchemaVersion1450(db: WritableDB): void { db.exec(` diff --git a/ts/sql/migrations/1460-attachment-duration.ts b/ts/sql/migrations/1460-attachment-duration.ts index 346b90429d5..bdb01ce7615 100644 --- a/ts/sql/migrations/1460-attachment-duration.ts +++ b/ts/sql/migrations/1460-attachment-duration.ts @@ -1,7 +1,7 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { WritableDB } from '../Interface'; +import type { WritableDB } from '../Interface.js'; export default function updateToSchemaVersion1460(db: WritableDB): void { db.exec(` diff --git a/ts/sql/migrations/41-uuid-keys.ts b/ts/sql/migrations/41-uuid-keys.ts index dce7a02881a..f61e9a66672 100644 --- a/ts/sql/migrations/41-uuid-keys.ts +++ b/ts/sql/migrations/41-uuid-keys.ts @@ -1,11 +1,11 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { LoggerType } from '../../types/Logging'; -import { isValidUuid } from '../../util/isValidUuid'; -import Helpers from '../../textsecure/Helpers'; -import { createOrUpdate, getById, removeById } from '../util'; -import type { ItemKeyType, ReadableDB, WritableDB } from '../Interface'; +import type { LoggerType } from '../../types/Logging.js'; +import { isValidUuid } from '../../util/isValidUuid.js'; +import Helpers from '../../textsecure/Helpers.js'; +import { createOrUpdate, getById, removeById } from '../util.js'; +import type { ItemKeyType, ReadableDB, WritableDB } from '../Interface.js'; export function getOurUuid(db: ReadableDB): string | undefined { const UUID_ID: ItemKeyType = 'uuid_id'; diff --git a/ts/sql/migrations/42-stale-reactions.ts b/ts/sql/migrations/42-stale-reactions.ts index 99b1c231fa2..394a00dbd75 100644 --- a/ts/sql/migrations/42-stale-reactions.ts +++ b/ts/sql/migrations/42-stale-reactions.ts @@ -1,9 +1,9 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { batchMultiVarQuery } from '../util'; -import type { WritableDB } from '../Interface'; -import type { LoggerType } from '../../types/Logging'; +import { batchMultiVarQuery } from '../util.js'; +import type { WritableDB } from '../Interface.js'; +import type { LoggerType } from '../../types/Logging.js'; export default function updateToSchemaVersion42( db: WritableDB, diff --git a/ts/sql/migrations/43-gv2-uuid.ts b/ts/sql/migrations/43-gv2-uuid.ts index a78919809c1..cd93ab073a6 100644 --- a/ts/sql/migrations/43-gv2-uuid.ts +++ b/ts/sql/migrations/43-gv2-uuid.ts @@ -3,18 +3,18 @@ import { omit } from 'lodash'; -import type { LoggerType } from '../../types/Logging'; -import type { AciString, ServiceIdString } from '../../types/ServiceId'; -import { normalizeAci } from '../../util/normalizeAci'; -import { isNotNil } from '../../util/isNotNil'; -import { assertDev } from '../../util/assert'; +import type { LoggerType } from '../../types/Logging.js'; +import type { AciString, ServiceIdString } from '../../types/ServiceId.js'; +import { normalizeAci } from '../../util/normalizeAci.js'; +import { isNotNil } from '../../util/isNotNil.js'; +import { assertDev } from '../../util/assert.js'; import { TableIterator, getCountFromTable, jsonToObject, objectToJSON, -} from '../util'; -import type { WritableDB } from '../Interface'; +} from '../util.js'; +import type { WritableDB } from '../Interface.js'; type MessageType = Readonly<{ id: string; diff --git a/ts/sql/migrations/47-further-optimize.ts b/ts/sql/migrations/47-further-optimize.ts index df6a2a4d998..11e6cf1f47b 100644 --- a/ts/sql/migrations/47-further-optimize.ts +++ b/ts/sql/migrations/47-further-optimize.ts @@ -1,9 +1,9 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { getOurUuid } from './41-uuid-keys'; -import type { LoggerType } from '../../types/Logging'; -import type { WritableDB } from '../Interface'; +import { getOurUuid } from './41-uuid-keys.js'; +import type { LoggerType } from '../../types/Logging.js'; +import type { WritableDB } from '../Interface.js'; export default function updateToSchemaVersion47( db: WritableDB, diff --git a/ts/sql/migrations/51-centralize-conversation-jobs.ts b/ts/sql/migrations/51-centralize-conversation-jobs.ts index fb7afd301d1..8def084cd19 100644 --- a/ts/sql/migrations/51-centralize-conversation-jobs.ts +++ b/ts/sql/migrations/51-centralize-conversation-jobs.ts @@ -1,10 +1,10 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { LoggerType } from '../../types/Logging'; -import { isRecord } from '../../util/isRecord'; -import type { WritableDB } from '../Interface'; -import { getJobsInQueue, insertJob } from '../Server'; +import type { LoggerType } from '../../types/Logging.js'; +import { isRecord } from '../../util/isRecord.js'; +import type { WritableDB } from '../Interface.js'; +import { getJobsInQueue, insertJob } from '../Server.js'; export default function updateToSchemaVersion51( db: WritableDB, diff --git a/ts/sql/migrations/53-gv2-banned-members.ts b/ts/sql/migrations/53-gv2-banned-members.ts index 45a7971f035..042b8d7cdb8 100644 --- a/ts/sql/migrations/53-gv2-banned-members.ts +++ b/ts/sql/migrations/53-gv2-banned-members.ts @@ -3,8 +3,8 @@ import type { Database } from '@signalapp/sqlcipher'; -import type { LoggerType } from '../../types/Logging'; -import { jsonToObject } from '../util'; +import type { LoggerType } from '../../types/Logging.js'; +import { jsonToObject } from '../util.js'; export default function updateToSchemaVersion53( db: Database, diff --git a/ts/sql/migrations/55-report-message-aci.ts b/ts/sql/migrations/55-report-message-aci.ts index 8dd55faf821..60c3fbef818 100644 --- a/ts/sql/migrations/55-report-message-aci.ts +++ b/ts/sql/migrations/55-report-message-aci.ts @@ -1,11 +1,11 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { LoggerType } from '../../types/Logging'; -import { getJobsInQueue, insertJob } from '../Server'; -import type { WritableDB } from '../Interface'; -import { isRecord } from '../../util/isRecord'; -import { isIterable } from '../../util/iterables'; +import type { LoggerType } from '../../types/Logging.js'; +import { getJobsInQueue, insertJob } from '../Server.js'; +import type { WritableDB } from '../Interface.js'; +import { isRecord } from '../../util/isRecord.js'; +import { isIterable } from '../../util/iterables.js'; export default function updateToSchemaVersion55( db: WritableDB, diff --git a/ts/sql/migrations/56-add-unseen-to-message.ts b/ts/sql/migrations/56-add-unseen-to-message.ts index 45b74321eb3..3a19b819bec 100644 --- a/ts/sql/migrations/56-add-unseen-to-message.ts +++ b/ts/sql/migrations/56-add-unseen-to-message.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { Database } from '@signalapp/sqlcipher'; -import { ReadStatus } from '../../messages/MessageReadStatus'; -import { SeenStatus } from '../../MessageSeenStatus'; +import { ReadStatus } from '../../messages/MessageReadStatus.js'; +import { SeenStatus } from '../../MessageSeenStatus.js'; export default function updateToSchemaVersion56(db: Database): void { db.exec( diff --git a/ts/sql/migrations/58-update-unread.ts b/ts/sql/migrations/58-update-unread.ts index eba540047e3..c01335d61df 100644 --- a/ts/sql/migrations/58-update-unread.ts +++ b/ts/sql/migrations/58-update-unread.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { Database } from '@signalapp/sqlcipher'; -import { ReadStatus } from '../../messages/MessageReadStatus'; -import { SeenStatus } from '../../MessageSeenStatus'; +import { ReadStatus } from '../../messages/MessageReadStatus.js'; +import { SeenStatus } from '../../MessageSeenStatus.js'; export default function updateToSchemaVersion58(db: Database): void { db.exec( diff --git a/ts/sql/migrations/78-merge-receipt-jobs.ts b/ts/sql/migrations/78-merge-receipt-jobs.ts index ea9c72d88d7..60b10d86679 100644 --- a/ts/sql/migrations/78-merge-receipt-jobs.ts +++ b/ts/sql/migrations/78-merge-receipt-jobs.ts @@ -1,10 +1,10 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { LoggerType } from '../../types/Logging'; -import { isRecord } from '../../util/isRecord'; -import type { WritableDB } from '../Interface'; -import { getJobsInQueue, insertJob } from '../Server'; +import type { LoggerType } from '../../types/Logging.js'; +import { isRecord } from '../../util/isRecord.js'; +import type { WritableDB } from '../Interface.js'; +import { getJobsInQueue, insertJob } from '../Server.js'; export default function updateToSchemaVersion78( db: WritableDB, diff --git a/ts/sql/migrations/87-cleanup.ts b/ts/sql/migrations/87-cleanup.ts index d6e1c86caf2..d5b31fff378 100644 --- a/ts/sql/migrations/87-cleanup.ts +++ b/ts/sql/migrations/87-cleanup.ts @@ -3,9 +3,9 @@ import type { Database } from '@signalapp/sqlcipher'; -import { cleanKeys } from './920-clean-more-keys'; -import type { LoggerType } from '../../types/Logging'; -import { sqlFragment } from '../util'; +import { cleanKeys } from './920-clean-more-keys.js'; +import type { LoggerType } from '../../types/Logging.js'; +import { sqlFragment } from '../util.js'; // Note: for many users, this is not what ran for them as migration 87. You can see that // migration here: https://github.com/signalapp/Signal-Desktop/commit/671e16ae1f869627f355113d6397ccb62d5461d2 diff --git a/ts/sql/migrations/88-service-ids.ts b/ts/sql/migrations/88-service-ids.ts index 3268809af28..46a273599f9 100644 --- a/ts/sql/migrations/88-service-ids.ts +++ b/ts/sql/migrations/88-service-ids.ts @@ -4,16 +4,16 @@ import type { Database } from '@signalapp/sqlcipher'; import { omit } from 'lodash'; -import type { LoggerType } from '../../types/Logging'; +import type { LoggerType } from '../../types/Logging.js'; import type { ServiceIdString, AciString, PniString, -} from '../../types/ServiceId'; -import { normalizeServiceId, normalizePni } from '../../types/ServiceId'; -import { normalizeAci } from '../../util/normalizeAci'; -import type { JSONWithUnknownFields } from '../../types/Util'; -import { isNotNil } from '../../util/isNotNil'; +} from '../../types/ServiceId.js'; +import { normalizeServiceId, normalizePni } from '../../types/ServiceId.js'; +import { normalizeAci } from '../../util/normalizeAci.js'; +import type { JSONWithUnknownFields } from '../../types/Util.js'; +import { isNotNil } from '../../util/isNotNil.js'; // // Main migration function that does the following: diff --git a/ts/sql/migrations/89-call-history.ts b/ts/sql/migrations/89-call-history.ts index ba6288de7d1..2eaee0da174 100644 --- a/ts/sql/migrations/89-call-history.ts +++ b/ts/sql/migrations/89-call-history.ts @@ -7,10 +7,10 @@ import { v4 as generateUuid } from 'uuid'; import { isObject } from 'lodash'; import type { SetOptional } from 'type-fest'; -import type { LoggerType } from '../../types/Logging'; -import { jsonToObject, sql } from '../util'; -import { getOurUuid } from './41-uuid-keys'; -import type { CallHistoryDetails } from '../../types/CallDisposition'; +import type { LoggerType } from '../../types/Logging.js'; +import { jsonToObject, sql } from '../util.js'; +import { getOurUuid } from './41-uuid-keys.js'; +import type { CallHistoryDetails } from '../../types/CallDisposition.js'; import { DirectCallStatus, CallDirection, @@ -18,12 +18,16 @@ import { GroupCallStatus, callHistoryDetailsSchema, CallMode, -} from '../../types/CallDisposition'; -import type { WritableDB, MessageType, ConversationType } from '../Interface'; -import { strictAssert } from '../../util/assert'; -import { missingCaseError } from '../../util/missingCaseError'; -import { isAciString } from '../../util/isAciString'; -import { safeParseStrict } from '../../util/schemas'; +} from '../../types/CallDisposition.js'; +import type { + WritableDB, + MessageType, + ConversationType, +} from '../Interface.js'; +import { strictAssert } from '../../util/assert.js'; +import { missingCaseError } from '../../util/missingCaseError.js'; +import { isAciString } from '../../util/isAciString.js'; +import { safeParseStrict } from '../../util/schemas.js'; // Legacy type for calls that never had a call id type DirectCallHistoryDetailsType = { diff --git a/ts/sql/migrations/90-delete-story-reply-screenshot.ts b/ts/sql/migrations/90-delete-story-reply-screenshot.ts index c0c4fdf23eb..3bd6a3b2b2f 100644 --- a/ts/sql/migrations/90-delete-story-reply-screenshot.ts +++ b/ts/sql/migrations/90-delete-story-reply-screenshot.ts @@ -3,8 +3,8 @@ import type { Database } from '@signalapp/sqlcipher'; -import type { LoggerType } from '../../types/Logging'; -import { sql } from '../util'; +import type { LoggerType } from '../../types/Logging.js'; +import { sql } from '../util.js'; export default function updateToSchemaVersion90( db: Database, diff --git a/ts/sql/migrations/91-clean-keys.ts b/ts/sql/migrations/91-clean-keys.ts index 3e13254c77e..aa604adde22 100644 --- a/ts/sql/migrations/91-clean-keys.ts +++ b/ts/sql/migrations/91-clean-keys.ts @@ -3,11 +3,11 @@ import type { Database, RunResult } from '@signalapp/sqlcipher'; -import type { LoggerType } from '../../types/Logging'; -import { sql } from '../util'; -import type { PniString } from '../../types/ServiceId'; -import { normalizePni } from '../../types/ServiceId'; -import * as Errors from '../../types/errors'; +import type { LoggerType } from '../../types/Logging.js'; +import { sql } from '../util.js'; +import type { PniString } from '../../types/ServiceId.js'; +import { normalizePni } from '../../types/ServiceId.js'; +import * as Errors from '../../types/errors.js'; export default function updateToSchemaVersion91( db: Database, diff --git a/ts/sql/migrations/920-clean-more-keys.ts b/ts/sql/migrations/920-clean-more-keys.ts index f461194c86f..5568aafdcea 100644 --- a/ts/sql/migrations/920-clean-more-keys.ts +++ b/ts/sql/migrations/920-clean-more-keys.ts @@ -3,13 +3,13 @@ import type { Database, RunResult } from '@signalapp/sqlcipher'; -import type { LoggerType } from '../../types/Logging'; -import type { QueryFragment } from '../util'; -import type { PniString } from '../../types/ServiceId'; +import type { LoggerType } from '../../types/Logging.js'; +import type { QueryFragment } from '../util.js'; +import type { PniString } from '../../types/ServiceId.js'; -import { sql, sqlFragment } from '../util'; -import { normalizePni } from '../../types/ServiceId'; -import * as Errors from '../../types/errors'; +import { sql, sqlFragment } from '../util.js'; +import { normalizePni } from '../../types/ServiceId.js'; +import * as Errors from '../../types/errors.js'; export default function updateToSchemaVersion920( db: Database, diff --git a/ts/sql/migrations/960-untag-pni.ts b/ts/sql/migrations/960-untag-pni.ts index b464ee8e277..5da3a7f846e 100644 --- a/ts/sql/migrations/960-untag-pni.ts +++ b/ts/sql/migrations/960-untag-pni.ts @@ -3,15 +3,15 @@ import type { Database } from '@signalapp/sqlcipher'; -import type { LoggerType } from '../../types/Logging'; +import type { LoggerType } from '../../types/Logging.js'; import type { ServiceIdString, AciString, PniString, -} from '../../types/ServiceId'; -import { normalizePni } from '../../types/ServiceId'; -import { normalizeAci } from '../../util/normalizeAci'; -import type { JSONWithUnknownFields } from '../../types/Util'; +} from '../../types/ServiceId.js'; +import { normalizePni } from '../../types/ServiceId.js'; +import { normalizeAci } from '../../util/normalizeAci.js'; +import type { JSONWithUnknownFields } from '../../types/Util.js'; export default function updateToSchemaVersion960( db: Database, diff --git a/ts/sql/migrations/index.ts b/ts/sql/migrations/index.ts index 8258b0722d8..9872a52927d 100644 --- a/ts/sql/migrations/index.ts +++ b/ts/sql/migrations/index.ts @@ -5,7 +5,7 @@ import type { Database } from '@signalapp/sqlcipher'; import { keyBy } from 'lodash'; import { v4 as generateUuid } from 'uuid'; -import type { LoggerType } from '../../types/Logging'; +import type { LoggerType } from '../../types/Logging.js'; import { getSchemaVersion, getUserVersion, @@ -13,117 +13,117 @@ import { getSQLiteVersion, objectToJSON, jsonToObject, -} from '../util'; -import type { WritableDB } from '../Interface'; +} from '../util.js'; +import type { WritableDB } from '../Interface.js'; -import updateToSchemaVersion41 from './41-uuid-keys'; -import updateToSchemaVersion42 from './42-stale-reactions'; -import updateToSchemaVersion43 from './43-gv2-uuid'; -import updateToSchemaVersion44 from './44-badges'; -import updateToSchemaVersion45 from './45-stories'; -import updateToSchemaVersion46 from './46-optimize-stories'; -import updateToSchemaVersion47 from './47-further-optimize'; -import updateToSchemaVersion48 from './48-fix-user-initiated-index'; -import updateToSchemaVersion49 from './49-fix-preview-index'; -import updateToSchemaVersion50 from './50-fix-messages-unread-index'; -import updateToSchemaVersion51 from './51-centralize-conversation-jobs'; -import updateToSchemaVersion52 from './52-optimize-stories'; -import updateToSchemaVersion53 from './53-gv2-banned-members'; -import updateToSchemaVersion54 from './54-unprocessed-received-at-counter'; -import updateToSchemaVersion55 from './55-report-message-aci'; -import updateToSchemaVersion56 from './56-add-unseen-to-message'; -import updateToSchemaVersion57 from './57-rm-message-history-unsynced'; -import updateToSchemaVersion58 from './58-update-unread'; -import updateToSchemaVersion59 from './59-unprocessed-received-at-counter-index'; -import updateToSchemaVersion60 from './60-update-expiring-index'; -import updateToSchemaVersion61 from './61-distribution-list-storage'; -import updateToSchemaVersion62 from './62-add-urgent-to-send-log'; -import updateToSchemaVersion63 from './63-add-urgent-to-unprocessed'; -import updateToSchemaVersion64 from './64-uuid-column-for-pre-keys'; -import updateToSchemaVersion65 from './65-add-storage-id-to-stickers'; -import updateToSchemaVersion66 from './66-add-pni-signature-to-sent-protos'; -import updateToSchemaVersion67 from './67-add-story-to-unprocessed'; -import updateToSchemaVersion68 from './68-drop-deprecated-columns'; -import updateToSchemaVersion69 from './69-group-call-ring-cancellations'; -import updateToSchemaVersion70 from './70-story-reply-index'; -import updateToSchemaVersion71 from './71-merge-notifications'; -import updateToSchemaVersion72 from './72-optimize-call-id-message-lookup'; -import updateToSchemaVersion73 from './73-remove-phone-number-discovery'; -import updateToSchemaVersion74 from './74-optimize-convo-open'; -import updateToSchemaVersion75 from './75-noop'; -import updateToSchemaVersion76 from './76-optimize-convo-open-2'; -import updateToSchemaVersion77 from './77-signal-tokenizer'; -import updateToSchemaVersion78 from './78-merge-receipt-jobs'; -import updateToSchemaVersion79 from './79-paging-lightbox'; -import updateToSchemaVersion80 from './80-edited-messages'; -import updateToSchemaVersion81 from './81-contact-removed-notification'; -import updateToSchemaVersion82 from './82-edited-messages-read-index'; -import updateToSchemaVersion83 from './83-mentions'; -import updateToSchemaVersion84 from './84-all-mentions'; -import updateToSchemaVersion85 from './85-add-kyber-keys'; -import updateToSchemaVersion86 from './86-story-replies-index'; -import updateToSchemaVersion87 from './87-cleanup'; -import updateToSchemaVersion88 from './88-service-ids'; -import updateToSchemaVersion89 from './89-call-history'; -import updateToSchemaVersion90 from './90-delete-story-reply-screenshot'; -import updateToSchemaVersion91 from './91-clean-keys'; -import updateToSchemaVersion920 from './920-clean-more-keys'; -import updateToSchemaVersion930 from './930-fts5-secure-delete'; -import updateToSchemaVersion940 from './940-fts5-revert'; -import updateToSchemaVersion950 from './950-fts5-secure-delete'; -import updateToSchemaVersion960 from './960-untag-pni'; -import updateToSchemaVersion970 from './970-fts5-optimize'; -import updateToSchemaVersion980 from './980-reaction-timestamp'; -import updateToSchemaVersion990 from './990-phone-number-sharing'; -import updateToSchemaVersion1000 from './1000-mark-unread-call-history-messages-as-unseen'; -import updateToSchemaVersion1010 from './1010-call-links-table'; -import updateToSchemaVersion1020 from './1020-self-merges'; -import updateToSchemaVersion1030 from './1030-unblock-event'; -import updateToSchemaVersion1040 from './1040-undownloaded-backed-up-media'; -import updateToSchemaVersion1050 from './1050-group-send-endorsements'; -import updateToSchemaVersion1060 from './1060-addressable-messages-and-sync-tasks'; -import updateToSchemaVersion1070 from './1070-attachment-backup'; -import updateToSchemaVersion1080 from './1080-nondisappearing-addressable'; -import updateToSchemaVersion1090 from './1090-message-delete-indexes'; -import updateToSchemaVersion1100 from './1100-optimize-mark-call-history-read-in-conversation'; -import updateToSchemaVersion1110 from './1110-sticker-local-key'; -import updateToSchemaVersion1120 from './1120-messages-foreign-keys-indexes'; -import updateToSchemaVersion1130 from './1130-isStory-index'; -import updateToSchemaVersion1140 from './1140-call-links-deleted-column'; -import updateToSchemaVersion1150 from './1150-expire-timer-version'; -import updateToSchemaVersion1160 from './1160-optimize-calls-unread-count'; -import updateToSchemaVersion1170 from './1170-update-call-history-unread-index'; -import updateToSchemaVersion1180 from './1180-add-attachment-download-source'; -import updateToSchemaVersion1190 from './1190-call-links-storage'; -import updateToSchemaVersion1200 from './1200-attachment-download-source-index'; -import updateToSchemaVersion1210 from './1210-call-history-started-id'; -import updateToSchemaVersion1220 from './1220-blob-sessions'; -import updateToSchemaVersion1230 from './1230-call-links-admin-key-index'; -import updateToSchemaVersion1240 from './1240-defunct-call-links-table'; -import updateToSchemaVersion1250 from './1250-defunct-call-links-storage'; -import updateToSchemaVersion1260 from './1260-sync-tasks-rowid'; -import updateToSchemaVersion1270 from './1270-normalize-messages'; -import updateToSchemaVersion1280 from './1280-blob-unprocessed'; -import updateToSchemaVersion1290 from './1290-int-unprocessed-source-device'; -import updateToSchemaVersion1300 from './1300-sticker-pack-refs'; -import updateToSchemaVersion1310 from './1310-muted-fixup'; -import updateToSchemaVersion1320 from './1320-unprocessed-received-at-date'; -import updateToSchemaVersion1330 from './1330-sync-tasks-type-index'; -import updateToSchemaVersion1340 from './1340-recent-gifs'; -import updateToSchemaVersion1350 from './1350-notification-profiles'; -import updateToSchemaVersion1360 from './1360-attachments'; -import updateToSchemaVersion1370 from './1370-message-attachment-indexes'; -import updateToSchemaVersion1380 from './1380-donation-receipts'; -import updateToSchemaVersion1390 from './1390-attachment-download-keys'; -import updateToSchemaVersion1400 from './1400-simplify-receipts'; -import updateToSchemaVersion1410 from './1410-remove-wallpaper'; -import updateToSchemaVersion1420 from './1420-backup-downloads'; -import updateToSchemaVersion1430 from './1430-call-links-epoch-id'; -import updateToSchemaVersion1440 from './1440-chat-folders'; -import updateToSchemaVersion1450 from './1450-all-media'; -import updateToSchemaVersion1460 from './1460-attachment-duration'; +import updateToSchemaVersion41 from './41-uuid-keys.js'; +import updateToSchemaVersion42 from './42-stale-reactions.js'; +import updateToSchemaVersion43 from './43-gv2-uuid.js'; +import updateToSchemaVersion44 from './44-badges.js'; +import updateToSchemaVersion45 from './45-stories.js'; +import updateToSchemaVersion46 from './46-optimize-stories.js'; +import updateToSchemaVersion47 from './47-further-optimize.js'; +import updateToSchemaVersion48 from './48-fix-user-initiated-index.js'; +import updateToSchemaVersion49 from './49-fix-preview-index.js'; +import updateToSchemaVersion50 from './50-fix-messages-unread-index.js'; +import updateToSchemaVersion51 from './51-centralize-conversation-jobs.js'; +import updateToSchemaVersion52 from './52-optimize-stories.js'; +import updateToSchemaVersion53 from './53-gv2-banned-members.js'; +import updateToSchemaVersion54 from './54-unprocessed-received-at-counter.js'; +import updateToSchemaVersion55 from './55-report-message-aci.js'; +import updateToSchemaVersion56 from './56-add-unseen-to-message.js'; +import updateToSchemaVersion57 from './57-rm-message-history-unsynced.js'; +import updateToSchemaVersion58 from './58-update-unread.js'; +import updateToSchemaVersion59 from './59-unprocessed-received-at-counter-index.js'; +import updateToSchemaVersion60 from './60-update-expiring-index.js'; +import updateToSchemaVersion61 from './61-distribution-list-storage.js'; +import updateToSchemaVersion62 from './62-add-urgent-to-send-log.js'; +import updateToSchemaVersion63 from './63-add-urgent-to-unprocessed.js'; +import updateToSchemaVersion64 from './64-uuid-column-for-pre-keys.js'; +import updateToSchemaVersion65 from './65-add-storage-id-to-stickers.js'; +import updateToSchemaVersion66 from './66-add-pni-signature-to-sent-protos.js'; +import updateToSchemaVersion67 from './67-add-story-to-unprocessed.js'; +import updateToSchemaVersion68 from './68-drop-deprecated-columns.js'; +import updateToSchemaVersion69 from './69-group-call-ring-cancellations.js'; +import updateToSchemaVersion70 from './70-story-reply-index.js'; +import updateToSchemaVersion71 from './71-merge-notifications.js'; +import updateToSchemaVersion72 from './72-optimize-call-id-message-lookup.js'; +import updateToSchemaVersion73 from './73-remove-phone-number-discovery.js'; +import updateToSchemaVersion74 from './74-optimize-convo-open.js'; +import updateToSchemaVersion75 from './75-noop.js'; +import updateToSchemaVersion76 from './76-optimize-convo-open-2.js'; +import updateToSchemaVersion77 from './77-signal-tokenizer.js'; +import updateToSchemaVersion78 from './78-merge-receipt-jobs.js'; +import updateToSchemaVersion79 from './79-paging-lightbox.js'; +import updateToSchemaVersion80 from './80-edited-messages.js'; +import updateToSchemaVersion81 from './81-contact-removed-notification.js'; +import updateToSchemaVersion82 from './82-edited-messages-read-index.js'; +import updateToSchemaVersion83 from './83-mentions.js'; +import updateToSchemaVersion84 from './84-all-mentions.js'; +import updateToSchemaVersion85 from './85-add-kyber-keys.js'; +import updateToSchemaVersion86 from './86-story-replies-index.js'; +import updateToSchemaVersion87 from './87-cleanup.js'; +import updateToSchemaVersion88 from './88-service-ids.js'; +import updateToSchemaVersion89 from './89-call-history.js'; +import updateToSchemaVersion90 from './90-delete-story-reply-screenshot.js'; +import updateToSchemaVersion91 from './91-clean-keys.js'; +import updateToSchemaVersion920 from './920-clean-more-keys.js'; +import updateToSchemaVersion930 from './930-fts5-secure-delete.js'; +import updateToSchemaVersion940 from './940-fts5-revert.js'; +import updateToSchemaVersion950 from './950-fts5-secure-delete.js'; +import updateToSchemaVersion960 from './960-untag-pni.js'; +import updateToSchemaVersion970 from './970-fts5-optimize.js'; +import updateToSchemaVersion980 from './980-reaction-timestamp.js'; +import updateToSchemaVersion990 from './990-phone-number-sharing.js'; +import updateToSchemaVersion1000 from './1000-mark-unread-call-history-messages-as-unseen.js'; +import updateToSchemaVersion1010 from './1010-call-links-table.js'; +import updateToSchemaVersion1020 from './1020-self-merges.js'; +import updateToSchemaVersion1030 from './1030-unblock-event.js'; +import updateToSchemaVersion1040 from './1040-undownloaded-backed-up-media.js'; +import updateToSchemaVersion1050 from './1050-group-send-endorsements.js'; +import updateToSchemaVersion1060 from './1060-addressable-messages-and-sync-tasks.js'; +import updateToSchemaVersion1070 from './1070-attachment-backup.js'; +import updateToSchemaVersion1080 from './1080-nondisappearing-addressable.js'; +import updateToSchemaVersion1090 from './1090-message-delete-indexes.js'; +import updateToSchemaVersion1100 from './1100-optimize-mark-call-history-read-in-conversation.js'; +import updateToSchemaVersion1110 from './1110-sticker-local-key.js'; +import updateToSchemaVersion1120 from './1120-messages-foreign-keys-indexes.js'; +import updateToSchemaVersion1130 from './1130-isStory-index.js'; +import updateToSchemaVersion1140 from './1140-call-links-deleted-column.js'; +import updateToSchemaVersion1150 from './1150-expire-timer-version.js'; +import updateToSchemaVersion1160 from './1160-optimize-calls-unread-count.js'; +import updateToSchemaVersion1170 from './1170-update-call-history-unread-index.js'; +import updateToSchemaVersion1180 from './1180-add-attachment-download-source.js'; +import updateToSchemaVersion1190 from './1190-call-links-storage.js'; +import updateToSchemaVersion1200 from './1200-attachment-download-source-index.js'; +import updateToSchemaVersion1210 from './1210-call-history-started-id.js'; +import updateToSchemaVersion1220 from './1220-blob-sessions.js'; +import updateToSchemaVersion1230 from './1230-call-links-admin-key-index.js'; +import updateToSchemaVersion1240 from './1240-defunct-call-links-table.js'; +import updateToSchemaVersion1250 from './1250-defunct-call-links-storage.js'; +import updateToSchemaVersion1260 from './1260-sync-tasks-rowid.js'; +import updateToSchemaVersion1270 from './1270-normalize-messages.js'; +import updateToSchemaVersion1280 from './1280-blob-unprocessed.js'; +import updateToSchemaVersion1290 from './1290-int-unprocessed-source-device.js'; +import updateToSchemaVersion1300 from './1300-sticker-pack-refs.js'; +import updateToSchemaVersion1310 from './1310-muted-fixup.js'; +import updateToSchemaVersion1320 from './1320-unprocessed-received-at-date.js'; +import updateToSchemaVersion1330 from './1330-sync-tasks-type-index.js'; +import updateToSchemaVersion1340 from './1340-recent-gifs.js'; +import updateToSchemaVersion1350 from './1350-notification-profiles.js'; +import updateToSchemaVersion1360 from './1360-attachments.js'; +import updateToSchemaVersion1370 from './1370-message-attachment-indexes.js'; +import updateToSchemaVersion1380 from './1380-donation-receipts.js'; +import updateToSchemaVersion1390 from './1390-attachment-download-keys.js'; +import updateToSchemaVersion1400 from './1400-simplify-receipts.js'; +import updateToSchemaVersion1410 from './1410-remove-wallpaper.js'; +import updateToSchemaVersion1420 from './1420-backup-downloads.js'; +import updateToSchemaVersion1430 from './1430-call-links-epoch-id.js'; +import updateToSchemaVersion1440 from './1440-chat-folders.js'; +import updateToSchemaVersion1450 from './1450-all-media.js'; +import updateToSchemaVersion1460 from './1460-attachment-duration.js'; -import { DataWriter } from '../Server'; +import { DataWriter } from '../Server.js'; function updateToSchemaVersion1(db: Database): void { db.exec(` diff --git a/ts/sql/server/callLinks.ts b/ts/sql/server/callLinks.ts index b3c42999dc5..b45bc3448de 100644 --- a/ts/sql/server/callLinks.ts +++ b/ts/sql/server/callLinks.ts @@ -2,31 +2,34 @@ // SPDX-License-Identifier: AGPL-3.0-only import { CallLinkRootKey } from '@signalapp/ringrtc'; -import * as Bytes from '../../Bytes'; +import * as Bytes from '../../Bytes.js'; import type { CallLinkRecord, CallLinkStateType, CallLinkType, DefunctCallLinkType, -} from '../../types/CallLink'; +} from '../../types/CallLink.js'; import { callLinkRestrictionsSchema, callLinkRecordSchema, defunctCallLinkRecordSchema, -} from '../../types/CallLink'; -import { toAdminKeyBytes } from '../../util/callLinks'; +} from '../../types/CallLink.js'; +import { toAdminKeyBytes } from '../../util/callLinks.js'; import { callLinkToRecord, callLinkFromRecord, defunctCallLinkToRecord, defunctCallLinkFromRecord, toEpochBytes, -} from '../../util/callLinksRingrtc'; -import type { ReadableDB, WritableDB } from '../Interface'; -import { sql } from '../util'; -import { strictAssert } from '../../util/assert'; -import { CallStatusValue, DirectCallStatus } from '../../types/CallDisposition'; -import { parseStrict, parseUnknown } from '../../util/schemas'; +} from '../../util/callLinksRingrtc.js'; +import type { ReadableDB, WritableDB } from '../Interface.js'; +import { sql } from '../util.js'; +import { strictAssert } from '../../util/assert.js'; +import { + CallStatusValue, + DirectCallStatus, +} from '../../types/CallDisposition.js'; +import { parseStrict, parseUnknown } from '../../util/schemas.js'; export function callLinkExists(db: ReadableDB, roomId: string): boolean { const [query, params] = sql` diff --git a/ts/sql/server/chatFolders.ts b/ts/sql/server/chatFolders.ts index 00a8cde97e2..7ac6f65a039 100644 --- a/ts/sql/server/chatFolders.ts +++ b/ts/sql/server/chatFolders.ts @@ -4,9 +4,9 @@ import { type ChatFolderId, type ChatFolder, CHAT_FOLDER_DELETED_POSITION, -} from '../../types/ChatFolder'; -import type { ReadableDB, WritableDB } from '../Interface'; -import { sql } from '../util'; +} from '../../types/ChatFolder.js'; +import type { ReadableDB, WritableDB } from '../Interface.js'; +import { sql } from '../util.js'; export type ChatFolderRow = Readonly< Omit< diff --git a/ts/sql/server/donationReceipts.ts b/ts/sql/server/donationReceipts.ts index 085b9663ba2..869cee903f5 100644 --- a/ts/sql/server/donationReceipts.ts +++ b/ts/sql/server/donationReceipts.ts @@ -1,10 +1,10 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { sql } from '../util'; +import { sql } from '../util.js'; -import type { DonationReceipt } from '../../types/Donations'; -import type { ReadableDB, WritableDB } from '../Interface'; +import type { DonationReceipt } from '../../types/Donations.js'; +import type { ReadableDB, WritableDB } from '../Interface.js'; export function getAllDonationReceipts(db: ReadableDB): Array { const donationReceipts = db diff --git a/ts/sql/server/groupSendEndorsements.ts b/ts/sql/server/groupSendEndorsements.ts index ee9b0bd690b..84f7080cb7d 100644 --- a/ts/sql/server/groupSendEndorsements.ts +++ b/ts/sql/server/groupSendEndorsements.ts @@ -5,17 +5,17 @@ import type { GroupSendCombinedEndorsementRecord, GroupSendEndorsementsData, GroupSendMemberEndorsementRecord, -} from '../../types/GroupSendEndorsements'; +} from '../../types/GroupSendEndorsements.js'; import { groupSendEndorsementExpirationSchema, groupSendMemberEndorsementSchema, groupSendEndorsementsDataSchema, -} from '../../types/GroupSendEndorsements'; -import type { ReadableDB, WritableDB } from '../Interface'; -import { sql } from '../util'; -import type { AciString } from '../../types/ServiceId'; -import { strictAssert } from '../../util/assert'; -import { parseLoose, parseUnknown } from '../../util/schemas'; +} from '../../types/GroupSendEndorsements.js'; +import type { ReadableDB, WritableDB } from '../Interface.js'; +import { sql } from '../util.js'; +import type { AciString } from '../../types/ServiceId.js'; +import { strictAssert } from '../../util/assert.js'; +import { parseLoose, parseUnknown } from '../../util/schemas.js'; /** * We don't need to store more than one endorsement per group or per member. diff --git a/ts/sql/server/messageAttachments.ts b/ts/sql/server/messageAttachments.ts index 45f05e0f4c7..7009edf506d 100644 --- a/ts/sql/server/messageAttachments.ts +++ b/ts/sql/server/messageAttachments.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import { z } from 'zod'; -import { convertUndefinedToNull } from '../../util/dropNull'; -import { attachmentDownloadTypeSchema } from '../../types/AttachmentDownload'; -import { APPLICATION_OCTET_STREAM } from '../../types/MIME'; -import type { MessageAttachmentDBType } from '../Interface'; +import { convertUndefinedToNull } from '../../util/dropNull.js'; +import { attachmentDownloadTypeSchema } from '../../types/AttachmentDownload.js'; +import { APPLICATION_OCTET_STREAM } from '../../types/MIME.js'; +import type { MessageAttachmentDBType } from '../Interface.js'; const permissiveStringOrNull = z .string() diff --git a/ts/sql/sqlLogger.ts b/ts/sql/sqlLogger.ts index cde06aa26e8..f65a89595a0 100644 --- a/ts/sql/sqlLogger.ts +++ b/ts/sql/sqlLogger.ts @@ -3,10 +3,10 @@ import { parentPort } from 'node:worker_threads'; import { format } from 'node:util'; -import type { LoggerType } from '../types/Logging'; -import type { WrappedWorkerLogEntry, WrappedWorkerResponse } from './main'; -import { consoleLogger } from '../util/consoleLogger'; -import { strictAssert } from '../util/assert'; +import type { LoggerType } from '../types/Logging.js'; +import type { WrappedWorkerLogEntry, WrappedWorkerResponse } from './main.js'; +import { consoleLogger } from '../util/consoleLogger.js'; +import { strictAssert } from '../util/assert.js'; class SQLLogger { #msgPrefix: string; diff --git a/ts/sql/util.ts b/ts/sql/util.ts index 8dbff8b2e74..910eadfe9e9 100644 --- a/ts/sql/util.ts +++ b/ts/sql/util.ts @@ -4,8 +4,8 @@ import { isNumber, last } from 'lodash'; -import type { ReadableDB, WritableDB } from './Interface'; -import type { LoggerType } from '../types/Logging'; +import type { ReadableDB, WritableDB } from './Interface.js'; +import type { LoggerType } from '../types/Logging.js'; export type JSONRow = Readonly<{ json: string }>; export type JSONRows = Array; diff --git a/ts/state/actions.ts b/ts/state/actions.ts index b842c23aecb..c4408238571 100644 --- a/ts/state/actions.ts +++ b/ts/state/actions.ts @@ -1,41 +1,41 @@ // Copyright 2019 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { actions as accounts } from './ducks/accounts'; -import { actions as app } from './ducks/app'; -import { actions as audioPlayer } from './ducks/audioPlayer'; -import { actions as audioRecorder } from './ducks/audioRecorder'; -import { actions as badges } from './ducks/badges'; -import { actions as callHistory } from './ducks/callHistory'; -import { actions as calling } from './ducks/calling'; -import { actions as chatFolders } from './ducks/chatFolders'; -import { actions as composer } from './ducks/composer'; -import { actions as conversations } from './ducks/conversations'; -import { actions as crashReports } from './ducks/crashReports'; -import { actions as donations } from './ducks/donations'; -import { actions as emojis } from './ducks/emojis'; -import { actions as expiration } from './ducks/expiration'; -import { actions as gifs } from './ducks/gifs'; -import { actions as globalModals } from './ducks/globalModals'; -import { actions as inbox } from './ducks/inbox'; -import { actions as installer } from './ducks/installer'; -import { actions as items } from './ducks/items'; -import { actions as lightbox } from './ducks/lightbox'; -import { actions as linkPreviews } from './ducks/linkPreviews'; -import { actions as mediaGallery } from './ducks/mediaGallery'; -import { actions as nav } from './ducks/nav'; -import { actions as network } from './ducks/network'; -import { actions as notificationProfiles } from './ducks/notificationProfiles'; -import { actions as safetyNumber } from './ducks/safetyNumber'; -import { actions as search } from './ducks/search'; -import { actions as stickers } from './ducks/stickers'; -import { actions as stories } from './ducks/stories'; -import { actions as storyDistributionLists } from './ducks/storyDistributionLists'; -import { actions as toast } from './ducks/toast'; -import { actions as updates } from './ducks/updates'; -import { actions as user } from './ducks/user'; -import { actions as username } from './ducks/username'; -import type { ReduxActions } from './types'; +import { actions as accounts } from './ducks/accounts.js'; +import { actions as app } from './ducks/app.js'; +import { actions as audioPlayer } from './ducks/audioPlayer.js'; +import { actions as audioRecorder } from './ducks/audioRecorder.js'; +import { actions as badges } from './ducks/badges.js'; +import { actions as callHistory } from './ducks/callHistory.js'; +import { actions as calling } from './ducks/calling.js'; +import { actions as chatFolders } from './ducks/chatFolders.js'; +import { actions as composer } from './ducks/composer.js'; +import { actions as conversations } from './ducks/conversations.js'; +import { actions as crashReports } from './ducks/crashReports.js'; +import { actions as donations } from './ducks/donations.js'; +import { actions as emojis } from './ducks/emojis.js'; +import { actions as expiration } from './ducks/expiration.js'; +import { actions as gifs } from './ducks/gifs.js'; +import { actions as globalModals } from './ducks/globalModals.js'; +import { actions as inbox } from './ducks/inbox.js'; +import { actions as installer } from './ducks/installer.js'; +import { actions as items } from './ducks/items.js'; +import { actions as lightbox } from './ducks/lightbox.js'; +import { actions as linkPreviews } from './ducks/linkPreviews.js'; +import { actions as mediaGallery } from './ducks/mediaGallery.js'; +import { actions as nav } from './ducks/nav.js'; +import { actions as network } from './ducks/network.js'; +import { actions as notificationProfiles } from './ducks/notificationProfiles.js'; +import { actions as safetyNumber } from './ducks/safetyNumber.js'; +import { actions as search } from './ducks/search.js'; +import { actions as stickers } from './ducks/stickers.js'; +import { actions as stories } from './ducks/stories.js'; +import { actions as storyDistributionLists } from './ducks/storyDistributionLists.js'; +import { actions as toast } from './ducks/toast.js'; +import { actions as updates } from './ducks/updates.js'; +import { actions as user } from './ducks/user.js'; +import { actions as username } from './ducks/username.js'; +import type { ReduxActions } from './types.js'; export const actionCreators: ReduxActions = { accounts, diff --git a/ts/state/createStore.ts b/ts/state/createStore.ts index 284ce7128dc..815d0fa9ca7 100644 --- a/ts/state/createStore.ts +++ b/ts/state/createStore.ts @@ -8,13 +8,13 @@ import promise from 'redux-promise-middleware'; import { thunk } from 'redux-thunk'; import { createLogger as createReduxLogger } from 'redux-logger'; -import { createLogger } from '../logging/log'; -import type { StateType } from './reducer'; -import { reducer } from './reducer'; -import { dispatchItemsMiddleware } from '../shims/dispatchItemsMiddleware'; -import { isOlderThan } from '../util/timestamp'; -import { SECOND } from '../util/durations'; -import { getEnvironment } from '../environment'; +import { createLogger } from '../logging/log.js'; +import type { StateType } from './reducer.js'; +import { reducer } from './reducer.js'; +import { dispatchItemsMiddleware } from '../shims/dispatchItemsMiddleware.js'; +import { isOlderThan } from '../util/timestamp.js'; +import { SECOND } from '../util/durations/index.js'; +import { getEnvironment } from '../environment.js'; const log = createLogger('createStore'); diff --git a/ts/state/ducks/accounts.ts b/ts/state/ducks/accounts.ts index 58b501602fd..3903c492d28 100644 --- a/ts/state/ducks/accounts.ts +++ b/ts/state/ducks/accounts.ts @@ -4,16 +4,16 @@ import type { ThunkAction } from 'redux-thunk'; import type { ReadonlyDeep } from 'type-fest'; -import * as Errors from '../../types/errors'; -import { createLogger } from '../../logging/log'; +import * as Errors from '../../types/errors.js'; +import { createLogger } from '../../logging/log.js'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions'; -import type { StateType as RootStateType } from '../reducer'; -import type { ServiceIdString } from '../../types/ServiceId'; -import { getServiceIdsForE164s } from '../../util/getServiceIdsForE164s'; -import { useBoundActions } from '../../hooks/useBoundActions'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; +import type { StateType as RootStateType } from '../reducer.js'; +import type { ServiceIdString } from '../../types/ServiceId.js'; +import { getServiceIdsForE164s } from '../../util/getServiceIdsForE164s.js'; +import { useBoundActions } from '../../hooks/useBoundActions.js'; -import type { NoopActionType } from './noop'; +import type { NoopActionType } from './noop.js'; const log = createLogger('accounts'); diff --git a/ts/state/ducks/app.ts b/ts/state/ducks/app.ts index f1fb6ff8c72..9a03ca0963d 100644 --- a/ts/state/ducks/app.ts +++ b/ts/state/ducks/app.ts @@ -3,17 +3,17 @@ import type { ThunkAction } from 'redux-thunk'; import type { ReadonlyDeep } from 'type-fest'; -import type { StateType as RootStateType } from '../reducer'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions'; -import { useBoundActions } from '../../hooks/useBoundActions'; -import { createLogger } from '../../logging/log'; -import { getEnvironment, Environment } from '../../environment'; +import type { StateType as RootStateType } from '../reducer.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; +import { useBoundActions } from '../../hooks/useBoundActions.js'; +import { createLogger } from '../../logging/log.js'; +import { getEnvironment, Environment } from '../../environment.js'; import { START_INSTALLER, type StartInstallerActionType, SHOW_BACKUP_IMPORT, type ShowBackupImportActionType, -} from './installer'; +} from './installer.js'; const log = createLogger('app'); diff --git a/ts/state/ducks/audioPlayer.ts b/ts/state/ducks/audioPlayer.ts index 6a4c66f9db9..da0fcb0efea 100644 --- a/ts/state/ducks/audioPlayer.ts +++ b/ts/state/ducks/audioPlayer.ts @@ -3,16 +3,16 @@ import type { ThunkAction } from 'redux-thunk'; import type { ReadonlyDeep } from 'type-fest'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions'; -import { useBoundActions } from '../../hooks/useBoundActions'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; +import { useBoundActions } from '../../hooks/useBoundActions.js'; -import type { StateType as RootStateType } from '../reducer'; -import { setVoiceNotePlaybackRate } from './conversations'; -import { extractVoiceNoteForPlayback } from '../selectors/audioPlayer'; +import type { StateType as RootStateType } from '../reducer.js'; +import { setVoiceNotePlaybackRate } from './conversations.js'; +import { extractVoiceNoteForPlayback } from '../selectors/audioPlayer.js'; import type { VoiceNoteAndConsecutiveForPlayback, VoiceNoteForPlayback, -} from '../selectors/audioPlayer'; +} from '../selectors/audioPlayer.js'; import type { MessagesAddedActionType, @@ -20,11 +20,11 @@ import type { MessageChangedActionType, TargetedConversationChangedActionType, ConversationsUpdatedActionType, -} from './conversations'; -import { createLogger } from '../../logging/log'; -import { isAudio } from '../../types/Attachment'; -import { getLocalAttachmentUrl } from '../../util/getLocalAttachmentUrl'; -import { assertDev } from '../../util/assert'; +} from './conversations.js'; +import { createLogger } from '../../logging/log.js'; +import { isAudio } from '../../types/Attachment.js'; +import { getLocalAttachmentUrl } from '../../util/getLocalAttachmentUrl.js'; +import { assertDev } from '../../util/assert.js'; const log = createLogger('audioPlayer'); diff --git a/ts/state/ducks/audioRecorder.ts b/ts/state/ducks/audioRecorder.ts index 8da308ad2b4..2f1576671fb 100644 --- a/ts/state/ducks/audioRecorder.ts +++ b/ts/state/ducks/audioRecorder.ts @@ -5,22 +5,22 @@ import type { ThunkAction } from 'redux-thunk'; import { v4 as generateUuid } from 'uuid'; import type { ReadonlyDeep } from 'type-fest'; -import { createLogger } from '../../logging/log'; -import type { InMemoryAttachmentDraftType } from '../../types/Attachment'; -import { SignalService as Proto } from '../../protobuf'; -import type { StateType as RootStateType } from '../reducer'; -import { fileToBytes } from '../../util/fileToBytes'; -import { recorder } from '../../services/audioRecorder'; -import { stringToMIMEType } from '../../types/MIME'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions'; -import { useBoundActions } from '../../hooks/useBoundActions'; -import { getComposerStateForConversation } from './composer'; +import { createLogger } from '../../logging/log.js'; +import type { InMemoryAttachmentDraftType } from '../../types/Attachment.js'; +import { SignalService as Proto } from '../../protobuf/index.js'; +import type { StateType as RootStateType } from '../reducer.js'; +import { fileToBytes } from '../../util/fileToBytes.js'; +import { recorder } from '../../services/audioRecorder.js'; +import { stringToMIMEType } from '../../types/MIME.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; +import { useBoundActions } from '../../hooks/useBoundActions.js'; +import { getComposerStateForConversation } from './composer.js'; -import * as Errors from '../../types/errors'; +import * as Errors from '../../types/errors.js'; import { ErrorDialogAudioRecorderType, RecordingState, -} from '../../types/AudioRecorder'; +} from '../../types/AudioRecorder.js'; const log = createLogger('audioRecorder'); diff --git a/ts/state/ducks/badges.ts b/ts/state/ducks/badges.ts index 800975bb6fb..c17a16916b0 100644 --- a/ts/state/ducks/badges.ts +++ b/ts/state/ducks/badges.ts @@ -4,13 +4,13 @@ import type { ThunkAction } from 'redux-thunk'; import { isEqual, mapValues } from 'lodash'; import type { ReadonlyDeep } from 'type-fest'; -import { DataWriter } from '../../sql/Client'; -import type { StateType as RootStateType } from '../reducer'; -import type { BadgeType, BadgeImageType } from '../../badges/types'; -import { getOwn } from '../../util/getOwn'; -import { badgeImageFileDownloader } from '../../badges/badgeImageFileDownloader'; -import { useBoundActions } from '../../hooks/useBoundActions'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions'; +import { DataWriter } from '../../sql/Client.js'; +import type { StateType as RootStateType } from '../reducer.js'; +import type { BadgeType, BadgeImageType } from '../../badges/types.js'; +import { getOwn } from '../../util/getOwn.js'; +import { badgeImageFileDownloader } from '../../badges/badgeImageFileDownloader.js'; +import { useBoundActions } from '../../hooks/useBoundActions.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; /** * This duck deals with badge data. Some assumptions it makes: diff --git a/ts/state/ducks/callHistory.ts b/ts/state/ducks/callHistory.ts index f16f57f4b76..7909b2a5850 100644 --- a/ts/state/ducks/callHistory.ts +++ b/ts/state/ducks/callHistory.ts @@ -4,38 +4,38 @@ import type { ReadonlyDeep } from 'type-fest'; import type { ThunkAction, ThunkDispatch } from 'redux-thunk'; import { debounce, omit } from 'lodash'; -import type { StateType as RootStateType } from '../reducer'; +import type { StateType as RootStateType } from '../reducer.js'; import { clearCallHistoryDataAndSync, markAllCallHistoryReadAndSync, -} from '../../util/callDisposition'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions'; -import { useBoundActions } from '../../hooks/useBoundActions'; -import type { ToastActionType } from './toast'; -import { showToast } from './toast'; -import { DataReader, DataWriter } from '../../sql/Client'; -import { ToastType } from '../../types/Toast'; +} from '../../util/callDisposition.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; +import { useBoundActions } from '../../hooks/useBoundActions.js'; +import type { ToastActionType } from './toast.js'; +import { showToast } from './toast.js'; +import { DataReader, DataWriter } from '../../sql/Client.js'; +import { ToastType } from '../../types/Toast.js'; import { ClearCallHistoryResult, type CallHistoryDetails, -} from '../../types/CallDisposition'; -import { createLogger } from '../../logging/log'; -import * as Errors from '../../types/errors'; +} from '../../types/CallDisposition.js'; +import { createLogger } from '../../logging/log.js'; +import * as Errors from '../../types/errors.js'; import { getCallHistoryLatestCall, getCallHistorySelector, -} from '../selectors/callHistory'; +} from '../selectors/callHistory.js'; import { getCallsHistoryForRedux, getCallsHistoryUnreadCountForRedux, loadCallHistory, -} from '../../services/callHistoryLoader'; -import { makeLookup } from '../../util/makeLookup'; -import { missingCaseError } from '../../util/missingCaseError'; -import { getIntl } from '../selectors/user'; -import { ButtonVariant } from '../../components/Button'; -import type { ShowErrorModalActionType } from './globalModals'; -import { SHOW_ERROR_MODAL } from './globalModals'; +} from '../../services/callHistoryLoader.js'; +import { makeLookup } from '../../util/makeLookup.js'; +import { missingCaseError } from '../../util/missingCaseError.js'; +import { getIntl } from '../selectors/user.js'; +import { ButtonVariant } from '../../components/Button.js'; +import type { ShowErrorModalActionType } from './globalModals.js'; +import { SHOW_ERROR_MODAL } from './globalModals.js'; const log = createLogger('callHistory'); diff --git a/ts/state/ducks/calling.ts b/ts/state/ducks/calling.ts index 11c40812382..26532522de4 100644 --- a/ts/state/ducks/calling.ts +++ b/ts/state/ducks/calling.ts @@ -10,20 +10,20 @@ import { GroupCallEndReason, type Reaction as CallReaction, } from '@signalapp/ringrtc'; -import { getOwn } from '../../util/getOwn'; -import * as Errors from '../../types/errors'; -import { getIntl, getPlatform } from '../selectors/user'; -import { isConversationTooBigToRing } from '../../conversations/isConversationTooBigToRing'; -import { missingCaseError } from '../../util/missingCaseError'; -import { drop } from '../../util/drop'; +import { getOwn } from '../../util/getOwn.js'; +import * as Errors from '../../types/errors.js'; +import { getIntl, getPlatform } from '../selectors/user.js'; +import { isConversationTooBigToRing } from '../../conversations/isConversationTooBigToRing.js'; +import { missingCaseError } from '../../util/missingCaseError.js'; +import { drop } from '../../util/drop.js'; import { DesktopCapturer, isNativeMacScreenShareSupported, type DesktopCapturerBaton, -} from '../../util/desktopCapturer'; -import { calling } from '../../services/calling'; -import { truncateAudioLevel } from '../../calling/truncateAudioLevel'; -import type { StateType as RootStateType } from '../reducer'; +} from '../../util/desktopCapturer.js'; +import { calling } from '../../services/calling.js'; +import { truncateAudioLevel } from '../../calling/truncateAudioLevel.js'; +import type { StateType as RootStateType } from '../reducer.js'; import type { ActiveCallReaction, ActiveCallReactionsType, @@ -33,13 +33,13 @@ import type { ObservedRemoteMuteType, PresentedSource, PresentableSource, -} from '../../types/Calling'; +} from '../../types/Calling.js'; import { isCallLinkAdmin, type CallLinkRestrictions, type CallLinkStateType, type CallLinkType, -} from '../../types/CallLink'; +} from '../../types/CallLink.js'; import { CALLING_REACTIONS_LIFETIME, MAX_CALLING_REACTIONS, @@ -49,66 +49,69 @@ import { CallState, GroupCallConnectionState, GroupCallJoinState, -} from '../../types/Calling'; -import { CallMode } from '../../types/CallDisposition'; -import { callingTones } from '../../util/callingTones'; -import { requestCameraPermissions } from '../../util/callingPermissions'; +} from '../../types/Calling.js'; +import { CallMode } from '../../types/CallDisposition.js'; +import { callingTones } from '../../util/callingTones.js'; +import { requestCameraPermissions } from '../../util/callingPermissions.js'; import { CALL_LINK_DEFAULT_STATE, toAdminKeyBytes, toCallHistoryFromUnusedCallLink, -} from '../../util/callLinks'; -import { getRoomIdFromRootKey } from '../../util/callLinksRingrtc'; -import { sendCallLinkUpdateSync } from '../../util/sendCallLinkUpdateSync'; -import { sleep } from '../../util/sleep'; -import { LatestQueue } from '../../util/LatestQueue'; -import type { AciString, ServiceIdString } from '../../types/ServiceId'; +} from '../../util/callLinks.js'; +import { getRoomIdFromRootKey } from '../../util/callLinksRingrtc.js'; +import { sendCallLinkUpdateSync } from '../../util/sendCallLinkUpdateSync.js'; +import { sleep } from '../../util/sleep.js'; +import { LatestQueue } from '../../util/LatestQueue.js'; +import type { AciString, ServiceIdString } from '../../types/ServiceId.js'; import type { ConversationsUpdatedActionType, ConversationRemovedActionType, -} from './conversations'; -import { getConversationCallMode, updateLastMessage } from './conversations'; -import { createLogger } from '../../logging/log'; -import { strictAssert } from '../../util/assert'; -import { waitForOnline } from '../../util/waitForOnline'; -import * as mapUtil from '../../util/mapUtil'; -import { isCallSafe } from '../../util/isCallSafe'; -import { isDirectConversation } from '../../util/whatTypeOfConversation'; -import { SHOW_TOAST } from './toast'; -import { ToastType } from '../../types/Toast'; -import type { ShowToastActionType } from './toast'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions'; -import { useBoundActions } from '../../hooks/useBoundActions'; +} from './conversations.js'; +import { getConversationCallMode, updateLastMessage } from './conversations.js'; +import { createLogger } from '../../logging/log.js'; +import { strictAssert } from '../../util/assert.js'; +import { waitForOnline } from '../../util/waitForOnline.js'; +import * as mapUtil from '../../util/mapUtil.js'; +import { isCallSafe } from '../../util/isCallSafe.js'; +import { isDirectConversation } from '../../util/whatTypeOfConversation.js'; +import { SHOW_TOAST } from './toast.js'; +import { ToastType } from '../../types/Toast.js'; +import type { ShowToastActionType } from './toast.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; +import { useBoundActions } from '../../hooks/useBoundActions.js'; import { isAnybodyElseInGroupCall, isAnybodyInGroupCall, MAX_CALL_PARTICIPANTS_FOR_DEFAULT_MUTE, -} from './callingHelpers'; -import { SafetyNumberChangeSource } from '../../components/SafetyNumberChangeDialog'; +} from './callingHelpers.js'; +import { SafetyNumberChangeSource } from '../../components/SafetyNumberChangeDialog.js'; import { isGroupOrAdhocCallMode, isGroupOrAdhocCallState, -} from '../../util/isGroupOrAdhocCall'; +} from '../../util/isGroupOrAdhocCall.js'; import type { ShowErrorModalActionType, ToggleConfirmLeaveCallModalActionType, -} from './globalModals'; -import { SHOW_ERROR_MODAL, toggleConfirmLeaveCallModal } from './globalModals'; -import { ButtonVariant } from '../../components/Button'; -import { getConversationIdForLogging } from '../../util/idForLogging'; -import { DataReader, DataWriter } from '../../sql/Client'; -import { isAciString } from '../../util/isAciString'; -import type { CallHistoryAdd } from './callHistory'; -import { addCallHistory, reloadCallHistory } from './callHistory'; -import { saveDraftRecordingIfNeeded } from './composer'; -import type { StartCallData } from '../../components/ConfirmLeaveCallModal'; +} from './globalModals.js'; +import { + SHOW_ERROR_MODAL, + toggleConfirmLeaveCallModal, +} from './globalModals.js'; +import { ButtonVariant } from '../../components/Button.js'; +import { getConversationIdForLogging } from '../../util/idForLogging.js'; +import { DataReader, DataWriter } from '../../sql/Client.js'; +import { isAciString } from '../../util/isAciString.js'; +import type { CallHistoryAdd } from './callHistory.js'; +import { addCallHistory, reloadCallHistory } from './callHistory.js'; +import { saveDraftRecordingIfNeeded } from './composer.js'; +import type { StartCallData } from '../../components/ConfirmLeaveCallModal.js'; import { getCallLinksByRoomId, getPresentingSource, -} from '../selectors/calling'; -import { storageServiceUploadJob } from '../../services/storage'; -import { CallLinkFinalizeDeleteManager } from '../../jobs/CallLinkFinalizeDeleteManager'; -import { callLinkRefreshJobQueue } from '../../jobs/callLinkRefreshJobQueue'; +} from '../selectors/calling.js'; +import { storageServiceUploadJob } from '../../services/storage.js'; +import { CallLinkFinalizeDeleteManager } from '../../jobs/CallLinkFinalizeDeleteManager.js'; +import { callLinkRefreshJobQueue } from '../../jobs/callLinkRefreshJobQueue.js'; const log = createLogger('calling'); diff --git a/ts/state/ducks/callingHelpers.ts b/ts/state/ducks/callingHelpers.ts index 5de1e90f4fb..d6275adb0b6 100644 --- a/ts/state/ducks/callingHelpers.ts +++ b/ts/state/ducks/callingHelpers.ts @@ -7,11 +7,11 @@ import { CallState, GroupCallConnectionState, GroupCallJoinState, -} from '../../types/Calling'; -import { CallMode } from '../../types/CallDisposition'; +} from '../../types/Calling.js'; +import { CallMode } from '../../types/CallDisposition.js'; -import type { CallingConversationType } from '../../types/Calling'; -import type { AciString } from '../../types/ServiceId'; +import type { CallingConversationType } from '../../types/Calling.js'; +import type { AciString } from '../../types/ServiceId.js'; import type { DirectCallStateType, CallsByConversationType, @@ -19,7 +19,7 @@ import type { GroupCallStateType, GroupCallParticipantInfoType, ActiveCallStateType, -} from './calling'; +} from './calling.js'; export const MAX_CALL_PARTICIPANTS_FOR_DEFAULT_MUTE = 8; diff --git a/ts/state/ducks/chatFolders.ts b/ts/state/ducks/chatFolders.ts index 44f45801469..6e3f66c7433 100644 --- a/ts/state/ducks/chatFolders.ts +++ b/ts/state/ducks/chatFolders.ts @@ -3,22 +3,22 @@ import type { ReadonlyDeep } from 'type-fest'; import { v4 as generateUuid } from 'uuid'; import type { ThunkAction } from 'redux-thunk'; -import type { StateType as RootStateType } from '../reducer'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions'; -import { useBoundActions } from '../../hooks/useBoundActions'; +import type { StateType as RootStateType } from '../reducer.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; +import { useBoundActions } from '../../hooks/useBoundActions.js'; import { ChatFolderParamsSchema, type ChatFolder, type ChatFolderId, type ChatFolderParams, -} from '../../types/ChatFolder'; -import { getCurrentChatFolders } from '../selectors/chatFolders'; -import { DataWriter } from '../../sql/Client'; -import { strictAssert } from '../../util/assert'; -import { storageServiceUploadJob } from '../../services/storage'; -import { parseStrict } from '../../util/schemas'; -import { chatFolderCleanupService } from '../../services/expiring/chatFolderCleanupService'; -import { drop } from '../../util/drop'; +} from '../../types/ChatFolder.js'; +import { getCurrentChatFolders } from '../selectors/chatFolders.js'; +import { DataWriter } from '../../sql/Client.js'; +import { strictAssert } from '../../util/assert.js'; +import { storageServiceUploadJob } from '../../services/storage.js'; +import { parseStrict } from '../../util/schemas.js'; +import { chatFolderCleanupService } from '../../services/expiring/chatFolderCleanupService.js'; +import { drop } from '../../util/drop.js'; export type ChatFoldersState = ReadonlyDeep<{ currentChatFolders: ReadonlyArray; diff --git a/ts/state/ducks/composer.ts b/ts/state/ducks/composer.ts index 1fb89bb3f94..b4ca5fedcc4 100644 --- a/ts/state/ducks/composer.ts +++ b/ts/state/ducks/composer.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import path from 'path'; +import path from 'node:path'; import { debounce, isEqual } from 'lodash'; import type { ThunkAction, ThunkDispatch } from 'redux-thunk'; import { v4 as generateUuid } from 'uuid'; @@ -11,39 +11,39 @@ import type { ReadonlyDeep } from 'type-fest'; import type { AddLinkPreviewActionType, RemoveLinkPreviewActionType, -} from './linkPreviews'; +} from './linkPreviews.js'; import { type AttachmentType, type AttachmentDraftType, type InMemoryAttachmentDraftType, isVideoAttachment, isImageAttachment, -} from '../../types/Attachment'; -import { DataReader, DataWriter } from '../../sql/Client'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions'; -import type { DraftBodyRanges } from '../../types/BodyRange'; -import type { LinkPreviewForUIType } from '../../types/message/LinkPreviews'; -import type { ReadonlyMessageAttributesType } from '../../model-types.d'; -import type { NoopActionType } from './noop'; -import type { ShowToastActionType } from './toast'; -import type { StateType as RootStateType } from '../reducer'; -import { createLogger } from '../../logging/log'; -import * as Errors from '../../types/errors'; +} from '../../types/Attachment.js'; +import { DataReader, DataWriter } from '../../sql/Client.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; +import type { DraftBodyRanges } from '../../types/BodyRange.js'; +import type { LinkPreviewForUIType } from '../../types/message/LinkPreviews.js'; +import type { ReadonlyMessageAttributesType } from '../../model-types.d.ts'; +import type { NoopActionType } from './noop.js'; +import type { ShowToastActionType } from './toast.js'; +import type { StateType as RootStateType } from '../reducer.js'; +import { createLogger } from '../../logging/log.js'; +import * as Errors from '../../types/errors.js'; import { ADD_PREVIEW as ADD_LINK_PREVIEW, REMOVE_PREVIEW as REMOVE_LINK_PREVIEW, -} from './linkPreviews'; -import { LinkPreviewSourceType } from '../../types/LinkPreview'; -import type { AciString } from '../../types/ServiceId'; -import { completeRecording, getIsRecording } from './audioRecorder'; -import { SHOW_TOAST } from './toast'; -import type { AnyToast } from '../../types/Toast'; -import { ToastType } from '../../types/Toast'; -import { SafetyNumberChangeSource } from '../../components/SafetyNumberChangeDialog'; -import { assignWithNoUnnecessaryAllocation } from '../../util/assignWithNoUnnecessaryAllocation'; -import { blockSendUntilConversationsAreVerified } from '../../util/blockSendUntilConversationsAreVerified'; -import { clearConversationDraftAttachments } from '../../util/clearConversationDraftAttachments'; -import { deleteDraftAttachment } from '../../util/deleteDraftAttachment'; +} from './linkPreviews.js'; +import { LinkPreviewSourceType } from '../../types/LinkPreview.js'; +import type { AciString } from '../../types/ServiceId.js'; +import { completeRecording, getIsRecording } from './audioRecorder.js'; +import { SHOW_TOAST } from './toast.js'; +import type { AnyToast } from '../../types/Toast.js'; +import { ToastType } from '../../types/Toast.js'; +import { SafetyNumberChangeSource } from '../../components/SafetyNumberChangeDialog.js'; +import { assignWithNoUnnecessaryAllocation } from '../../util/assignWithNoUnnecessaryAllocation.js'; +import { blockSendUntilConversationsAreVerified } from '../../util/blockSendUntilConversationsAreVerified.js'; +import { clearConversationDraftAttachments } from '../../util/clearConversationDraftAttachments.js'; +import { deleteDraftAttachment } from '../../util/deleteDraftAttachment.js'; import { getLinkPreviewForSend, hasLinkPreviewLoaded, @@ -51,50 +51,50 @@ import { removeLinkPreview, resetLinkPreview, suspendLinkPreviews, -} from '../../services/LinkPreview'; +} from '../../services/LinkPreview.js'; import { getMaximumOutgoingAttachmentSizeInKb, getRenderDetailsForLimit, KIBIBYTE, -} from '../../types/AttachmentSize'; -import { getValue as getRemoteConfigValue } from '../../RemoteConfig'; -import { getRecipientsByConversation } from '../../util/getRecipientsByConversation'; -import { processAttachment } from '../../util/processAttachment'; -import { hasDraftAttachments } from '../../util/hasDraftAttachments'; -import { isFileDangerous } from '../../util/isFileDangerous'; -import { stringToMIMEType } from '../../types/MIME'; -import { isNotNil } from '../../util/isNotNil'; -import { replaceIndex } from '../../util/replaceIndex'; -import { resolveAttachmentDraftData } from '../../util/resolveAttachmentDraftData'; -import { resolveDraftAttachmentOnDisk } from '../../util/resolveDraftAttachmentOnDisk'; -import { shouldShowInvalidMessageToast } from '../../util/shouldShowInvalidMessageToast'; -import { writeDraftAttachment } from '../../util/writeDraftAttachment'; -import { getMessageById } from '../../messages/getMessageById'; -import { canReply, isNormalBubble } from '../selectors/message'; -import { getAuthorId } from '../../messages/helpers'; -import { getConversationSelector } from '../selectors/conversations'; -import { enqueueReactionForSend } from '../../reactions/enqueueReactionForSend'; -import { useBoundActions } from '../../hooks/useBoundActions'; +} from '../../types/AttachmentSize.js'; +import { getValue as getRemoteConfigValue } from '../../RemoteConfig.js'; +import { getRecipientsByConversation } from '../../util/getRecipientsByConversation.js'; +import { processAttachment } from '../../util/processAttachment.js'; +import { hasDraftAttachments } from '../../util/hasDraftAttachments.js'; +import { isFileDangerous } from '../../util/isFileDangerous.js'; +import { stringToMIMEType } from '../../types/MIME.js'; +import { isNotNil } from '../../util/isNotNil.js'; +import { replaceIndex } from '../../util/replaceIndex.js'; +import { resolveAttachmentDraftData } from '../../util/resolveAttachmentDraftData.js'; +import { resolveDraftAttachmentOnDisk } from '../../util/resolveDraftAttachmentOnDisk.js'; +import { shouldShowInvalidMessageToast } from '../../util/shouldShowInvalidMessageToast.js'; +import { writeDraftAttachment } from '../../util/writeDraftAttachment.js'; +import { getMessageById } from '../../messages/getMessageById.js'; +import { canReply, isNormalBubble } from '../selectors/message.js'; +import { getAuthorId } from '../../messages/helpers.js'; +import { getConversationSelector } from '../selectors/conversations.js'; +import { enqueueReactionForSend } from '../../reactions/enqueueReactionForSend.js'; +import { useBoundActions } from '../../hooks/useBoundActions.js'; import { CONVERSATION_UNLOADED, TARGETED_CONVERSATION_CHANGED, scrollToMessage, -} from './conversations'; +} from './conversations.js'; import type { ConversationUnloadedActionType, TargetedConversationChangedActionType, ScrollToMessageActionType, -} from './conversations'; -import { longRunningTaskWrapper } from '../../util/longRunningTaskWrapper'; -import { drop } from '../../util/drop'; -import { strictAssert } from '../../util/assert'; -import { makeQuote } from '../../util/makeQuote'; -import { sendEditedMessage as doSendEditedMessage } from '../../util/sendEditedMessage'; -import { Sound, SoundType } from '../../util/Sound'; +} from './conversations.js'; +import { longRunningTaskWrapper } from '../../util/longRunningTaskWrapper.js'; +import { drop } from '../../util/drop.js'; +import { strictAssert } from '../../util/assert.js'; +import { makeQuote } from '../../util/makeQuote.js'; +import { sendEditedMessage as doSendEditedMessage } from '../../util/sendEditedMessage.js'; +import { Sound, SoundType } from '../../util/Sound.js'; import { isImageTypeSupported, isVideoTypeSupported, -} from '../../util/GoogleChrome'; +} from '../../util/GoogleChrome.js'; const log = createLogger('composer'); diff --git a/ts/state/ducks/conversations.ts b/ts/state/ducks/conversations.ts index 2b854b07e35..9a031bbf17f 100644 --- a/ts/state/ducks/conversations.ts +++ b/ts/state/ducks/conversations.ts @@ -17,75 +17,75 @@ import type { PhoneNumber } from 'google-libphonenumber'; import { clipboard, ipcRenderer } from 'electron'; import type { ReadonlyDeep } from 'type-fest'; -import { DataReader, DataWriter } from '../../sql/Client'; -import type { AttachmentType } from '../../types/Attachment'; -import type { StateType as RootStateType } from '../reducer'; -import * as groups from '../../groups'; -import { createLogger } from '../../logging/log'; -import { calling } from '../../services/calling'; -import { getOwn } from '../../util/getOwn'; -import { assertDev, strictAssert } from '../../util/assert'; -import { drop } from '../../util/drop'; -import type { DurationInSeconds } from '../../util/durations'; -import * as universalExpireTimer from '../../util/universalExpireTimer'; -import * as Attachment from '../../types/Attachment'; -import type { LocalizerType } from '../../types/I18N'; -import { AttachmentDownloadUrgency } from '../../types/AttachmentDownload'; -import { isFileDangerous } from '../../util/isFileDangerous'; -import { getLocalAttachmentUrl } from '../../util/getLocalAttachmentUrl'; -import { instance as libphonenumberInstance } from '../../util/libphonenumberInstance'; +import { DataReader, DataWriter } from '../../sql/Client.js'; +import type { AttachmentType } from '../../types/Attachment.js'; +import type { StateType as RootStateType } from '../reducer.js'; +import * as groups from '../../groups.js'; +import { createLogger } from '../../logging/log.js'; +import { calling } from '../../services/calling.js'; +import { getOwn } from '../../util/getOwn.js'; +import { assertDev, strictAssert } from '../../util/assert.js'; +import { drop } from '../../util/drop.js'; +import type { DurationInSeconds } from '../../util/durations/index.js'; +import * as universalExpireTimer from '../../util/universalExpireTimer.js'; +import * as Attachment from '../../types/Attachment.js'; +import type { LocalizerType } from '../../types/I18N.js'; +import { AttachmentDownloadUrgency } from '../../types/AttachmentDownload.js'; +import { isFileDangerous } from '../../util/isFileDangerous.js'; +import { getLocalAttachmentUrl } from '../../util/getLocalAttachmentUrl.js'; +import { instance as libphonenumberInstance } from '../../util/libphonenumberInstance.js'; import type { ShowSendAnywayDialogActionType, ShowErrorModalActionType, -} from './globalModals'; -import { SHOW_SEND_ANYWAY_DIALOG, SHOW_ERROR_MODAL } from './globalModals'; +} from './globalModals.js'; +import { SHOW_SEND_ANYWAY_DIALOG, SHOW_ERROR_MODAL } from './globalModals.js'; import { MODIFY_LIST, DELETE_LIST, HIDE_MY_STORIES_FROM, VIEWERS_CHANGED, -} from './storyDistributionLists'; -import type { StoryDistributionListsActionType } from './storyDistributionLists'; +} from './storyDistributionLists.js'; +import type { StoryDistributionListsActionType } from './storyDistributionLists.js'; import type { UUIDFetchStateKeyType, UUIDFetchStateType, -} from '../../util/uuidFetchState'; +} from '../../util/uuidFetchState.js'; import type { AvatarColorType, ConversationColorType, CustomColorType, -} from '../../types/Colors'; +} from '../../types/Colors.js'; import type { ConversationAttributesType, DraftEditMessageType, LastMessageStatus, ReadonlyMessageAttributesType, -} from '../../model-types.d'; +} from '../../model-types.d.ts'; import type { DraftBodyRanges, HydratedBodyRangesType, -} from '../../types/BodyRange'; -import { CallMode } from '../../types/CallDisposition'; -import type { MediaItemType } from '../../types/MediaItem'; -import type { StoryDistributionIdString } from '../../types/StoryDistributionId'; -import { normalizeStoryDistributionId } from '../../types/StoryDistributionId'; +} from '../../types/BodyRange.js'; +import { CallMode } from '../../types/CallDisposition.js'; +import type { MediaItemType } from '../../types/MediaItem.js'; +import type { StoryDistributionIdString } from '../../types/StoryDistributionId.js'; +import { normalizeStoryDistributionId } from '../../types/StoryDistributionId.js'; import type { ServiceIdString, AciString, PniString, -} from '../../types/ServiceId'; -import { isAciString } from '../../util/isAciString'; -import { MY_STORY_ID, StorySendMode } from '../../types/Stories'; -import * as Errors from '../../types/errors'; +} from '../../types/ServiceId.js'; +import { isAciString } from '../../util/isAciString.js'; +import { MY_STORY_ID, StorySendMode } from '../../types/Stories.js'; +import * as Errors from '../../types/errors.js'; import { getGroupSizeRecommendedLimit, getGroupSizeHardLimit, -} from '../../groups/limits'; -import { isMessageUnread } from '../../util/isMessageUnread'; -import { toggleSelectedContactForGroupAddition } from '../../groups/toggleSelectedContactForGroupAddition'; -import type { GroupNameCollisionsWithIdsByTitle } from '../../util/groupMemberNameCollisions'; -import { writeProfile } from '../../services/writeProfile'; +} from '../../groups/limits.js'; +import { isMessageUnread } from '../../util/isMessageUnread.js'; +import { toggleSelectedContactForGroupAddition } from '../../groups/toggleSelectedContactForGroupAddition.js'; +import type { GroupNameCollisionsWithIdsByTitle } from '../../util/groupMemberNameCollisions.js'; +import { writeProfile } from '../../services/writeProfile.js'; import { getConversationServiceIdsStoppingSend, getConversationIdsStoppedForVerification, @@ -93,76 +93,80 @@ import { getMe, getMessagesByConversation, getPendingAvatarDownloadSelector, -} from '../selectors/conversations'; -import { getIntl } from '../selectors/user'; +} from '../selectors/conversations.js'; +import { getIntl } from '../selectors/user.js'; import type { AvatarDataType, AvatarUpdateOptionsType, -} from '../../types/Avatar'; -import { getDefaultAvatars } from '../../types/Avatar'; -import { getAvatarData } from '../../util/getAvatarData'; -import { isSameAvatarData } from '../../util/isSameAvatarData'; -import { longRunningTaskWrapper } from '../../util/longRunningTaskWrapper'; +} from '../../types/Avatar.js'; +import { getDefaultAvatars } from '../../types/Avatar.js'; +import { getAvatarData } from '../../util/getAvatarData.js'; +import { isSameAvatarData } from '../../util/isSameAvatarData.js'; +import { longRunningTaskWrapper } from '../../util/longRunningTaskWrapper.js'; import { ComposerStep, ConversationVerificationState, OneTimeModalState, TargetedMessageSource, -} from './conversationsEnums'; -import { markViewed as messageUpdaterMarkViewed } from '../../services/MessageUpdater'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions'; -import { useBoundActions } from '../../hooks/useBoundActions'; +} from './conversationsEnums.js'; +import { markViewed as messageUpdaterMarkViewed } from '../../services/MessageUpdater.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; +import { useBoundActions } from '../../hooks/useBoundActions.js'; -import type { NoopActionType } from './noop'; +import type { NoopActionType } from './noop.js'; import { conversationJobQueue, conversationQueueJobEnum, -} from '../../jobs/conversationJobQueue'; -import type { TimelineMessageLoadingState } from '../../util/timelineUtil'; +} from '../../jobs/conversationJobQueue.js'; +import type { TimelineMessageLoadingState } from '../../util/timelineUtil.js'; import { isDirectConversation, isGroup, isGroupV2, isMe, -} from '../../util/whatTypeOfConversation'; -import { missingCaseError } from '../../util/missingCaseError'; -import { viewSyncJobQueue } from '../../jobs/viewSyncJobQueue'; -import { ReadStatus } from '../../messages/MessageReadStatus'; -import { isIncoming, isStory, processBodyRanges } from '../selectors/message'; -import { getActiveCall, getActiveCallState } from '../selectors/calling'; -import { sendDeleteForEveryoneMessage } from '../../util/sendDeleteForEveryoneMessage'; -import type { ShowToastActionType } from './toast'; -import { SHOW_TOAST } from './toast'; -import { ToastType } from '../../types/Toast'; -import { isMemberRequestingToJoin } from '../../util/groupMembershipUtils'; -import { removePendingMember } from '../../util/removePendingMember'; -import { denyPendingApprovalRequest } from '../../util/denyPendingApprovalRequest'; -import { SignalService as Proto } from '../../protobuf'; -import { addReportSpamJob } from '../../jobs/helpers/addReportSpamJob'; -import { reportSpamJobQueue } from '../../jobs/reportSpamJobQueue'; +} from '../../util/whatTypeOfConversation.js'; +import { missingCaseError } from '../../util/missingCaseError.js'; +import { viewSyncJobQueue } from '../../jobs/viewSyncJobQueue.js'; +import { ReadStatus } from '../../messages/MessageReadStatus.js'; +import { + isIncoming, + isStory, + processBodyRanges, +} from '../selectors/message.js'; +import { getActiveCall, getActiveCallState } from '../selectors/calling.js'; +import { sendDeleteForEveryoneMessage } from '../../util/sendDeleteForEveryoneMessage.js'; +import type { ShowToastActionType } from './toast.js'; +import { SHOW_TOAST } from './toast.js'; +import { ToastType } from '../../types/Toast.js'; +import { isMemberRequestingToJoin } from '../../util/groupMembershipUtils.js'; +import { removePendingMember } from '../../util/removePendingMember.js'; +import { denyPendingApprovalRequest } from '../../util/denyPendingApprovalRequest.js'; +import { SignalService as Proto } from '../../protobuf/index.js'; +import { addReportSpamJob } from '../../jobs/helpers/addReportSpamJob.js'; +import { reportSpamJobQueue } from '../../jobs/reportSpamJobQueue.js'; import { modifyGroupV2, buildAddMembersChange, buildPromotePendingAdminApprovalMemberChange, buildUpdateAttributesChange, initiateMigrationToGroupV2 as doInitiateMigrationToGroupV2, -} from '../../groups'; -import { getMessageById } from '../../messages/getMessageById'; -import type { PanelRenderType, PanelRequestType } from '../../types/Panels'; -import type { ConversationQueueJobData } from '../../jobs/conversationJobQueue'; -import { isOlderThan } from '../../util/timestamp'; -import { DAY } from '../../util/durations'; -import { isNotNil } from '../../util/isNotNil'; -import { PanelType } from '../../types/Panels'; -import { startConversation } from '../../util/startConversation'; -import { getMessageSentTimestamp } from '../../util/getMessageSentTimestamp'; -import { removeLinkPreview } from '../../services/LinkPreview'; +} from '../../groups.js'; +import { getMessageById } from '../../messages/getMessageById.js'; +import type { PanelRenderType, PanelRequestType } from '../../types/Panels.js'; +import type { ConversationQueueJobData } from '../../jobs/conversationJobQueue.js'; +import { isOlderThan } from '../../util/timestamp.js'; +import { DAY } from '../../util/durations/index.js'; +import { isNotNil } from '../../util/isNotNil.js'; +import { PanelType } from '../../types/Panels.js'; +import { startConversation } from '../../util/startConversation.js'; +import { getMessageSentTimestamp } from '../../util/getMessageSentTimestamp.js'; +import { removeLinkPreview } from '../../services/LinkPreview.js'; import type { ReplaceAttachmentsActionType, ResetComposerActionType, SetFocusActionType, SetQuotedMessageActionType, -} from './composer'; +} from './composer.js'; import { SET_FOCUS, replaceAttachments, @@ -170,52 +174,56 @@ import { setQuoteByMessageId, resetComposer, saveDraftRecordingIfNeeded, -} from './composer'; -import { ReceiptType } from '../../types/Receipt'; -import { Sound, SoundType } from '../../util/Sound'; +} from './composer.js'; +import { ReceiptType } from '../../types/Receipt.js'; +import { Sound, SoundType } from '../../util/Sound.js'; import { canEditMessage, isWithinMaxEdits, MESSAGE_MAX_EDIT_COUNT, -} from '../../util/canEditMessage'; -import type { ChangeLocationAction } from './nav'; -import { CHANGE_LOCATION, changeLocation, actions as navActions } from './nav'; -import { NavTab, ProfileEditorPage, SettingsPage } from '../../types/Nav'; -import { sortByMessageOrder } from '../../types/ForwardDraft'; -import { getAddedByForOurPendingInvitation } from '../../util/getAddedByForOurPendingInvitation'; +} from '../../util/canEditMessage.js'; +import type { ChangeLocationAction } from './nav.js'; +import { + CHANGE_LOCATION, + changeLocation, + actions as navActions, +} from './nav.js'; +import { NavTab, ProfileEditorPage, SettingsPage } from '../../types/Nav.js'; +import { sortByMessageOrder } from '../../types/ForwardDraft.js'; +import { getAddedByForOurPendingInvitation } from '../../util/getAddedByForOurPendingInvitation.js'; import { getConversationIdForLogging, getMessageIdForLogging, -} from '../../util/idForLogging'; -import { singleProtoJobQueue } from '../../jobs/singleProtoJobQueue'; -import MessageSender from '../../textsecure/SendMessage'; -import { AttachmentDownloadManager } from '../../jobs/AttachmentDownloadManager'; +} from '../../util/idForLogging.js'; +import { singleProtoJobQueue } from '../../jobs/singleProtoJobQueue.js'; +import MessageSender from '../../textsecure/SendMessage.js'; +import { AttachmentDownloadManager } from '../../jobs/AttachmentDownloadManager.js'; import type { DeleteForMeSyncEventData, AddressableMessage, -} from '../../textsecure/messageReceiverEvents'; +} from '../../textsecure/messageReceiverEvents.js'; import { getConversationIdentifier, getAddressableMessage, -} from '../../util/syncIdentifiers'; -import { MAX_MESSAGE_COUNT } from '../../util/deleteForMe.types'; -import { markCallHistoryReadInConversation } from './callHistory'; -import type { CapabilitiesType } from '../../textsecure/WebAPI'; -import { actions as searchActions } from './search'; -import type { SearchActionType } from './search'; -import { getNotificationTextForMessage } from '../../util/getNotificationTextForMessage'; -import { doubleCheckMissingQuoteReference as doDoubleCheckMissingQuoteReference } from '../../util/doubleCheckMissingQuoteReference'; -import { queueAttachmentDownloads } from '../../util/queueAttachmentDownloads'; -import { markAttachmentAsCorrupted as doMarkAttachmentAsCorrupted } from '../../messageModifiers/AttachmentDownloads'; +} from '../../util/syncIdentifiers.js'; +import { MAX_MESSAGE_COUNT } from '../../util/deleteForMe.types.js'; +import { markCallHistoryReadInConversation } from './callHistory.js'; +import type { CapabilitiesType } from '../../textsecure/WebAPI.js'; +import { actions as searchActions } from './search.js'; +import type { SearchActionType } from './search.js'; +import { getNotificationTextForMessage } from '../../util/getNotificationTextForMessage.js'; +import { doubleCheckMissingQuoteReference as doDoubleCheckMissingQuoteReference } from '../../util/doubleCheckMissingQuoteReference.js'; +import { queueAttachmentDownloads } from '../../util/queueAttachmentDownloads.js'; +import { markAttachmentAsCorrupted as doMarkAttachmentAsCorrupted } from '../../messageModifiers/AttachmentDownloads.js'; import { isSent, SendActionType, sendStateReducer, -} from '../../messages/MessageSendState'; -import { markFailed } from '../../test-node/util/messageFailures'; -import { cleanupMessages } from '../../util/cleanup'; -import type { ConversationModel } from '../../models/conversations'; -import { MessageRequestResponseSource } from '../../types/MessageRequestResponseEvent'; +} from '../../messages/MessageSendState.js'; +import { markFailed } from '../../test-node/util/messageFailures.js'; +import { cleanupMessages } from '../../util/cleanup.js'; +import type { ConversationModel } from '../../models/conversations.js'; +import { MessageRequestResponseSource } from '../../types/MessageRequestResponseEvent.js'; const log = createLogger('conversations'); diff --git a/ts/state/ducks/crashReports.ts b/ts/state/ducks/crashReports.ts index fbd939e8c84..539da6fe968 100644 --- a/ts/state/ducks/crashReports.ts +++ b/ts/state/ducks/crashReports.ts @@ -4,15 +4,15 @@ import type { ReadonlyDeep } from 'type-fest'; import type { ThunkAction } from 'redux-thunk'; -import { createLogger } from '../../logging/log'; -import * as Errors from '../../types/errors'; -import { ToastType } from '../../types/Toast'; -import type { StateType as RootStateType } from '../reducer'; -import { showToast } from './toast'; -import type { ShowToastActionType } from './toast'; -import type { PromiseAction } from '../util'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions'; -import { useBoundActions } from '../../hooks/useBoundActions'; +import { createLogger } from '../../logging/log.js'; +import * as Errors from '../../types/errors.js'; +import { ToastType } from '../../types/Toast.js'; +import type { StateType as RootStateType } from '../reducer.js'; +import { showToast } from './toast.js'; +import type { ShowToastActionType } from './toast.js'; +import type { PromiseAction } from '../util.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; +import { useBoundActions } from '../../hooks/useBoundActions.js'; const log = createLogger('crashReports'); diff --git a/ts/state/ducks/donations.ts b/ts/state/ducks/donations.ts index d7dcc104ddb..6492ff5dd7f 100644 --- a/ts/state/ducks/donations.ts +++ b/ts/state/ducks/donations.ts @@ -4,32 +4,32 @@ import type { ReadonlyDeep } from 'type-fest'; import type { ThunkAction } from 'redux-thunk'; -import { useBoundActions } from '../../hooks/useBoundActions'; -import { createLogger } from '../../logging/log'; -import * as Errors from '../../types/errors'; -import { isStagingServer } from '../../util/isStagingServer'; -import { DataWriter } from '../../sql/Client'; -import * as donations from '../../services/donations'; -import { donationStateSchema } from '../../types/Donations'; -import { drop } from '../../util/drop'; -import { storageServiceUploadJob } from '../../services/storage'; -import { getMe } from '../selectors/conversations'; -import { - type SetProfileUpdateErrorActionType, - actions as conversationActions, -} from './conversations'; +import { useBoundActions } from '../../hooks/useBoundActions.js'; +import { createLogger } from '../../logging/log.js'; +import * as Errors from '../../types/errors.js'; +import { isStagingServer } from '../../util/isStagingServer.js'; +import { DataWriter } from '../../sql/Client.js'; +import * as donations from '../../services/donations.js'; +import { donationStateSchema } from '../../types/Donations.js'; +import { drop } from '../../util/drop.js'; +import { storageServiceUploadJob } from '../../services/storage.js'; +import { getMe } from '../selectors/conversations.js'; +import { actions as conversationActions } from './conversations.js'; +import type { + ProfileDataType, + SetProfileUpdateErrorActionType, +} from './conversations.js'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; import type { CardDetail, DonationErrorType, DonationReceipt, DonationWorkflow, StripeDonationAmount, -} from '../../types/Donations'; -import type { BadgeType } from '../../badges/types'; -import type { ProfileDataType } from './conversations'; -import type { StateType as RootStateType } from '../reducer'; +} from '../../types/Donations.js'; +import type { BadgeType } from '../../badges/types.js'; +import type { StateType as RootStateType } from '../reducer.js'; const log = createLogger('donations'); diff --git a/ts/state/ducks/emojis.ts b/ts/state/ducks/emojis.ts index 526076d2fa2..6e9fce075e0 100644 --- a/ts/state/ducks/emojis.ts +++ b/ts/state/ducks/emojis.ts @@ -4,10 +4,10 @@ import { take, uniq } from 'lodash'; import type { ThunkAction } from 'redux-thunk'; import type { ReadonlyDeep } from 'type-fest'; -import type { EmojiPickDataType } from '../../components/emoji/EmojiPicker'; -import { DataWriter } from '../../sql/Client'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions'; -import { useBoundActions } from '../../hooks/useBoundActions'; +import type { EmojiPickDataType } from '../../components/emoji/EmojiPicker.js'; +import { DataWriter } from '../../sql/Client.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; +import { useBoundActions } from '../../hooks/useBoundActions.js'; const { updateEmojiUsage } = DataWriter; diff --git a/ts/state/ducks/gifs.ts b/ts/state/ducks/gifs.ts index 88c8138082b..ca7de8472df 100644 --- a/ts/state/ducks/gifs.ts +++ b/ts/state/ducks/gifs.ts @@ -3,12 +3,12 @@ import type { ReadonlyDeep } from 'type-fest'; import type { ThunkAction } from 'redux-thunk'; import { take } from 'lodash'; -import type { GifType } from '../../components/fun/panels/FunPanelGifs'; -import { DataWriter } from '../../sql/Client'; +import type { GifType } from '../../components/fun/panels/FunPanelGifs.js'; +import { DataWriter } from '../../sql/Client.js'; import { type BoundActionCreatorsMapObject, useBoundActions, -} from '../../hooks/useBoundActions'; +} from '../../hooks/useBoundActions.js'; const { addRecentGif, removeRecentGif } = DataWriter; diff --git a/ts/state/ducks/globalModals.ts b/ts/state/ducks/globalModals.ts index 2aa259891c2..2c09a8bece4 100644 --- a/ts/state/ducks/globalModals.ts +++ b/ts/state/ducks/globalModals.ts @@ -3,63 +3,63 @@ import type { ThunkAction } from 'redux-thunk'; import type { ReadonlyDeep } from 'type-fest'; -import OS from '../../util/os/osMain'; -import type { ExplodePromiseResultType } from '../../util/explodePromise'; +import OS from '../../util/os/osMain.js'; +import type { ExplodePromiseResultType } from '../../util/explodePromise.js'; import type { GroupV2PendingMemberType, ReadonlyMessageAttributesType, -} from '../../model-types.d'; +} from '../../model-types.d.ts'; import type { MessageChangedActionType, MessageDeletedActionType, MessageExpiredActionType, -} from './conversations'; -import type { MessagePropsType } from '../selectors/message'; -import type { RecipientsByConversation } from './stories'; -import type { SafetyNumberChangeSource } from '../../components/SafetyNumberChangeDialog'; -import type { StateType as RootStateType } from '../reducer'; -import * as SingleServePromise from '../../services/singleServePromise'; -import * as Stickers from '../../types/Stickers'; -import { UsernameOnboardingState } from '../../types/globalModals'; -import { createLogger } from '../../logging/log'; +} from './conversations.js'; +import type { MessagePropsType } from '../selectors/message.js'; +import type { RecipientsByConversation } from './stories.js'; +import type { SafetyNumberChangeSource } from '../../components/SafetyNumberChangeDialog.js'; +import type { StateType as RootStateType } from '../reducer.js'; +import * as SingleServePromise from '../../services/singleServePromise.js'; +import * as Stickers from '../../types/Stickers.js'; +import { UsernameOnboardingState } from '../../types/globalModals.js'; +import { createLogger } from '../../logging/log.js'; import { getMessagePropsSelector, getPropsForAttachment, -} from '../selectors/message'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions'; -import { longRunningTaskWrapper } from '../../util/longRunningTaskWrapper'; -import { useBoundActions } from '../../hooks/useBoundActions'; -import { isGroupV1 } from '../../util/whatTypeOfConversation'; -import { sleep } from '../../util/sleep'; -import { SECOND } from '../../util/durations'; -import { getGroupMigrationMembers } from '../../groups'; +} from '../selectors/message.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; +import { longRunningTaskWrapper } from '../../util/longRunningTaskWrapper.js'; +import { useBoundActions } from '../../hooks/useBoundActions.js'; +import { isGroupV1 } from '../../util/whatTypeOfConversation.js'; +import { sleep } from '../../util/sleep.js'; +import { SECOND } from '../../util/durations/index.js'; +import { getGroupMigrationMembers } from '../../groups.js'; import { MESSAGE_CHANGED, MESSAGE_DELETED, MESSAGE_EXPIRED, actions as conversationsActions, -} from './conversations'; -import { isDownloaded } from '../../types/Attachment'; -import { isPermanentlyUndownloadable } from '../../jobs/AttachmentDownloadManager'; -import type { ButtonVariant } from '../../components/Button'; -import type { MessageRequestState } from '../../components/conversation/MessageRequestActionsConfirmation'; -import type { MessageForwardDraft } from '../../types/ForwardDraft'; -import { hydrateRanges } from '../../types/BodyRange'; +} from './conversations.js'; +import { isDownloaded } from '../../types/Attachment.js'; +import { isPermanentlyUndownloadable } from '../../jobs/AttachmentDownloadManager.js'; +import type { ButtonVariant } from '../../components/Button.js'; +import type { MessageRequestState } from '../../components/conversation/MessageRequestActionsConfirmation.js'; +import type { MessageForwardDraft } from '../../types/ForwardDraft.js'; +import { hydrateRanges } from '../../types/BodyRange.js'; import { getConversationSelector, type GetConversationByIdType, -} from '../selectors/conversations'; -import { missingCaseError } from '../../util/missingCaseError'; -import { ForwardMessagesModalType } from '../../components/ForwardMessagesModal'; -import type { CallLinkType } from '../../types/CallLink'; -import type { LocalizerType } from '../../types/I18N'; -import { linkCallRoute } from '../../util/signalRoutes'; -import type { StartCallData } from '../../components/ConfirmLeaveCallModal'; -import { getMessageById } from '../../messages/getMessageById'; -import type { DataPropsType as TapToViewNotAvailablePropsType } from '../../components/TapToViewNotAvailableModal'; -import type { DataPropsType as BackfillFailureModalPropsType } from '../../components/BackfillFailureModal'; -import type { SmartDraftGifMessageSendModalProps } from '../smart/DraftGifMessageSendModal'; -import { onCriticalIdlePrimaryDeviceModalDismissed } from '../../util/handleServerAlerts'; +} from '../selectors/conversations.js'; +import { missingCaseError } from '../../util/missingCaseError.js'; +import { ForwardMessagesModalType } from '../../components/ForwardMessagesModal.js'; +import type { CallLinkType } from '../../types/CallLink.js'; +import type { LocalizerType } from '../../types/I18N.js'; +import { linkCallRoute } from '../../util/signalRoutes.js'; +import type { StartCallData } from '../../components/ConfirmLeaveCallModal.js'; +import { getMessageById } from '../../messages/getMessageById.js'; +import type { DataPropsType as TapToViewNotAvailablePropsType } from '../../components/TapToViewNotAvailableModal.js'; +import type { DataPropsType as BackfillFailureModalPropsType } from '../../components/BackfillFailureModal.js'; +import type { SmartDraftGifMessageSendModalProps } from '../smart/DraftGifMessageSendModal.js'; +import { onCriticalIdlePrimaryDeviceModalDismissed } from '../../util/handleServerAlerts.js'; const log = createLogger('globalModals'); diff --git a/ts/state/ducks/installer.ts b/ts/state/ducks/installer.ts index 077e7a1e584..26274fcdffe 100644 --- a/ts/state/ducks/installer.ts +++ b/ts/state/ducks/installer.ts @@ -4,31 +4,31 @@ import type { ThunkAction } from 'redux-thunk'; import type { ReadonlyDeep } from 'type-fest'; -import type { StateType as RootStateType } from '../reducer'; +import type { StateType as RootStateType } from '../reducer.js'; import { type InstallScreenBackupError, InstallScreenBackupStep, InstallScreenStep, InstallScreenError, InstallScreenQRCodeError, -} from '../../types/InstallScreen'; -import * as Errors from '../../types/errors'; -import { type Loadable, LoadingState } from '../../util/loadable'; -import { isRecord } from '../../util/isRecord'; -import { strictAssert } from '../../util/assert'; -import * as Registration from '../../util/registration'; -import { missingCaseError } from '../../util/missingCaseError'; -import { HTTPError } from '../../textsecure/Errors'; +} from '../../types/InstallScreen.js'; +import * as Errors from '../../types/errors.js'; +import { type Loadable, LoadingState } from '../../util/loadable.js'; +import { isRecord } from '../../util/isRecord.js'; +import { strictAssert } from '../../util/assert.js'; +import * as Registration from '../../util/registration.js'; +import { missingCaseError } from '../../util/missingCaseError.js'; +import { HTTPError } from '../../textsecure/Errors.js'; import { Provisioner, EventKind as ProvisionEventKind, type EnvelopeType as ProvisionEnvelopeType, -} from '../../textsecure/Provisioner'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions'; -import { useBoundActions } from '../../hooks/useBoundActions'; -import { createLogger } from '../../logging/log'; -import { backupsService } from '../../services/backups'; -import OS from '../../util/os/osMain'; +} from '../../textsecure/Provisioner.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; +import { useBoundActions } from '../../hooks/useBoundActions.js'; +import { createLogger } from '../../logging/log.js'; +import { backupsService } from '../../services/backups/index.js'; +import OS from '../../util/os/osMain.js'; const log = createLogger('installer'); diff --git a/ts/state/ducks/items.ts b/ts/state/ducks/items.ts index cb78d20f86c..aaaeb948145 100644 --- a/ts/state/ducks/items.ts +++ b/ts/state/ducks/items.ts @@ -5,21 +5,21 @@ import { omit } from 'lodash'; import { v4 as getGuid } from 'uuid'; import type { ThunkAction } from 'redux-thunk'; import type { ReadonlyDeep } from 'type-fest'; -import type { StateType as RootStateType } from '../reducer'; -import * as storageShim from '../../shims/storage'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions'; -import { useBoundActions } from '../../hooks/useBoundActions'; -import { drop } from '../../util/drop'; +import type { StateType as RootStateType } from '../reducer.js'; +import * as storageShim from '../../shims/storage.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; +import { useBoundActions } from '../../hooks/useBoundActions.js'; +import { drop } from '../../util/drop.js'; import type { ConversationColorType, CustomColorType, -} from '../../types/Colors'; -import { ConversationColors } from '../../types/Colors'; -import { reloadSelectedConversation } from '../../shims/reloadSelectedConversation'; -import type { StorageAccessType } from '../../types/Storage.d'; -import { actions as conversationActions } from './conversations'; -import type { ConfigMapType as RemoteConfigType } from '../../RemoteConfig'; -import type { EmojiSkinTone } from '../../components/fun/data/emojis'; +} from '../../types/Colors.js'; +import { ConversationColors } from '../../types/Colors.js'; +import { reloadSelectedConversation } from '../../shims/reloadSelectedConversation.js'; +import type { StorageAccessType } from '../../types/Storage.d.ts'; +import { actions as conversationActions } from './conversations.js'; +import type { ConfigMapType as RemoteConfigType } from '../../RemoteConfig.js'; +import type { EmojiSkinTone } from '../../components/fun/data/emojis.js'; // State diff --git a/ts/state/ducks/lightbox.ts b/ts/state/ducks/lightbox.ts index 00a409182a7..92c264805eb 100644 --- a/ts/state/ducks/lightbox.ts +++ b/ts/state/ducks/lightbox.ts @@ -4,50 +4,50 @@ import type { ThunkAction } from 'redux-thunk'; import type { ReadonlyDeep } from 'type-fest'; -import type { AttachmentType } from '../../types/Attachment'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions'; -import type { MediaItemType } from '../../types/MediaItem'; +import type { AttachmentType } from '../../types/Attachment.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; +import type { MediaItemType } from '../../types/MediaItem.js'; import type { MessageChangedActionType, MessageDeletedActionType, MessageExpiredActionType, -} from './conversations'; -import type { ShowStickerPackPreviewActionType } from './globalModals'; -import type { ShowToastActionType } from './toast'; -import type { StateType as RootStateType } from '../reducer'; +} from './conversations.js'; +import type { ShowStickerPackPreviewActionType } from './globalModals.js'; +import type { ShowToastActionType } from './toast.js'; +import type { StateType as RootStateType } from '../reducer.js'; -import { createLogger } from '../../logging/log'; -import { getMessageById } from '../../messages/getMessageById'; -import type { ReadonlyMessageAttributesType } from '../../model-types.d'; +import { createLogger } from '../../logging/log.js'; +import { getMessageById } from '../../messages/getMessageById.js'; +import type { ReadonlyMessageAttributesType } from '../../model-types.d.ts'; import { getUndownloadedAttachmentSignature, isIncremental, -} from '../../types/Attachment'; +} from '../../types/Attachment.js'; import { isImageTypeSupported, isVideoTypeSupported, -} from '../../util/GoogleChrome'; +} from '../../util/GoogleChrome.js'; import { getLocalAttachmentUrl, AttachmentDisposition, -} from '../../util/getLocalAttachmentUrl'; -import { isTapToView, getPropsForAttachment } from '../selectors/message'; -import { SHOW_TOAST } from './toast'; -import { ToastType } from '../../types/Toast'; +} from '../../util/getLocalAttachmentUrl.js'; +import { isTapToView, getPropsForAttachment } from '../selectors/message.js'; +import { SHOW_TOAST } from './toast.js'; +import { ToastType } from '../../types/Toast.js'; import { MESSAGE_CHANGED, MESSAGE_DELETED, MESSAGE_EXPIRED, saveAttachmentFromMessage, -} from './conversations'; -import { showStickerPackPreview } from './globalModals'; -import { useBoundActions } from '../../hooks/useBoundActions'; -import { DataReader } from '../../sql/Client'; -import { deleteDownloadsJobQueue } from '../../jobs/deleteDownloadsJobQueue'; -import { AttachmentDownloadUrgency } from '../../types/AttachmentDownload'; -import { queueAttachmentDownloadsAndMaybeSaveMessage } from '../../util/queueAttachmentDownloads'; -import { getMessageIdForLogging } from '../../util/idForLogging'; -import { markViewOnceMessageViewed } from '../../services/MessageUpdater'; +} from './conversations.js'; +import { showStickerPackPreview } from './globalModals.js'; +import { useBoundActions } from '../../hooks/useBoundActions.js'; +import { DataReader } from '../../sql/Client.js'; +import { deleteDownloadsJobQueue } from '../../jobs/deleteDownloadsJobQueue.js'; +import { AttachmentDownloadUrgency } from '../../types/AttachmentDownload.js'; +import { queueAttachmentDownloadsAndMaybeSaveMessage } from '../../util/queueAttachmentDownloads.js'; +import { getMessageIdForLogging } from '../../util/idForLogging.js'; +import { markViewOnceMessageViewed } from '../../services/MessageUpdater.js'; const log = createLogger('lightbox'); diff --git a/ts/state/ducks/linkPreviews.ts b/ts/state/ducks/linkPreviews.ts index 74e2a1f8408..b002e184eaa 100644 --- a/ts/state/ducks/linkPreviews.ts +++ b/ts/state/ducks/linkPreviews.ts @@ -4,21 +4,21 @@ import type { ThunkAction } from 'redux-thunk'; import type { ReadonlyDeep } from 'type-fest'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; import type { LinkPreviewType, LinkPreviewForUIType, -} from '../../types/message/LinkPreviews'; -import type { AttachmentForUIType } from '../../types/Attachment'; -import type { MaybeGrabLinkPreviewOptionsType } from '../../types/LinkPreview'; -import type { NoopActionType } from './noop'; -import type { StateType as RootStateType } from '../reducer'; -import { LinkPreviewSourceType } from '../../types/LinkPreview'; -import { assignWithNoUnnecessaryAllocation } from '../../util/assignWithNoUnnecessaryAllocation'; -import { maybeGrabLinkPreview } from '../../services/LinkPreview'; -import { strictAssert } from '../../util/assert'; -import { useBoundActions } from '../../hooks/useBoundActions'; -import { getPropsForAttachment } from '../selectors/message'; +} from '../../types/message/LinkPreviews.js'; +import type { AttachmentForUIType } from '../../types/Attachment.js'; +import type { MaybeGrabLinkPreviewOptionsType } from '../../types/LinkPreview.js'; +import type { NoopActionType } from './noop.js'; +import type { StateType as RootStateType } from '../reducer.js'; +import { LinkPreviewSourceType } from '../../types/LinkPreview.js'; +import { assignWithNoUnnecessaryAllocation } from '../../util/assignWithNoUnnecessaryAllocation.js'; +import { maybeGrabLinkPreview } from '../../services/LinkPreview.js'; +import { strictAssert } from '../../util/assert.js'; +import { useBoundActions } from '../../hooks/useBoundActions.js'; +import { getPropsForAttachment } from '../selectors/message.js'; // State diff --git a/ts/state/ducks/mediaGallery.ts b/ts/state/ducks/mediaGallery.ts index 7a35de0a5e6..e8504cc081b 100644 --- a/ts/state/ducks/mediaGallery.ts +++ b/ts/state/ducks/mediaGallery.ts @@ -5,29 +5,29 @@ import { orderBy } from 'lodash'; import type { ThunkAction } from 'redux-thunk'; import type { ReadonlyDeep } from 'type-fest'; -import { createLogger } from '../../logging/log'; -import { DataReader } from '../../sql/Client'; -import type { MediaItemDBType } from '../../sql/Interface'; +import { createLogger } from '../../logging/log.js'; +import { DataReader } from '../../sql/Client.js'; +import type { MediaItemDBType } from '../../sql/Interface.js'; import { CONVERSATION_UNLOADED, MESSAGE_CHANGED, MESSAGE_DELETED, MESSAGE_EXPIRED, -} from './conversations'; -import { isNotNil } from '../../util/isNotNil'; -import { useBoundActions } from '../../hooks/useBoundActions'; +} from './conversations.js'; +import { isNotNil } from '../../util/isNotNil.js'; +import { useBoundActions } from '../../hooks/useBoundActions.js'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; import type { ConversationUnloadedActionType, MessageChangedActionType, MessageDeletedActionType, MessageExpiredActionType, -} from './conversations'; -import type { MediaItemType } from '../../types/MediaItem'; -import type { StateType as RootStateType } from '../reducer'; -import type { MessageAttributesType, MessageType } from '../../model-types'; -import { isTapToView, getPropsForAttachment } from '../selectors/message'; +} from './conversations.js'; +import type { MediaItemType } from '../../types/MediaItem.js'; +import type { StateType as RootStateType } from '../reducer.js'; +import type { MessageAttributesType, MessageType } from '../../model-types.js'; +import { isTapToView, getPropsForAttachment } from '../selectors/message.js'; const log = createLogger('mediaGallery'); diff --git a/ts/state/ducks/nav.ts b/ts/state/ducks/nav.ts index 79c5896004d..8cdb0a2861c 100644 --- a/ts/state/ducks/nav.ts +++ b/ts/state/ducks/nav.ts @@ -4,13 +4,13 @@ import type { ReadonlyDeep } from 'type-fest'; import type { ThunkAction } from 'redux-thunk'; -import { createLogger } from '../../logging/log'; -import { useBoundActions } from '../../hooks/useBoundActions'; -import { NavTab, SettingsPage } from '../../types/Nav'; +import { createLogger } from '../../logging/log.js'; +import { useBoundActions } from '../../hooks/useBoundActions.js'; +import { NavTab, SettingsPage } from '../../types/Nav.js'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions'; -import type { StateType as RootStateType } from '../reducer'; -import type { Location } from '../../types/Nav'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; +import type { StateType as RootStateType } from '../reducer.js'; +import type { Location } from '../../types/Nav.js'; const log = createLogger('nav'); diff --git a/ts/state/ducks/network.ts b/ts/state/ducks/network.ts index 1df9b41071d..04fc1d1d5d5 100644 --- a/ts/state/ducks/network.ts +++ b/ts/state/ducks/network.ts @@ -2,11 +2,11 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { ReadonlyDeep } from 'type-fest'; -import { SocketStatus } from '../../types/SocketStatus'; -import { trigger } from '../../shims/events'; -import { assignWithNoUnnecessaryAllocation } from '../../util/assignWithNoUnnecessaryAllocation'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions'; -import { useBoundActions } from '../../hooks/useBoundActions'; +import { SocketStatus } from '../../types/SocketStatus.js'; +import { trigger } from '../../shims/events.js'; +import { assignWithNoUnnecessaryAllocation } from '../../util/assignWithNoUnnecessaryAllocation.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; +import { useBoundActions } from '../../hooks/useBoundActions.js'; // State diff --git a/ts/state/ducks/notificationProfiles.ts b/ts/state/ducks/notificationProfiles.ts index e46f342379f..7ade99366c0 100644 --- a/ts/state/ducks/notificationProfiles.ts +++ b/ts/state/ducks/notificationProfiles.ts @@ -4,20 +4,20 @@ import type { ReadonlyDeep } from 'type-fest'; import type { ThunkAction } from 'redux-thunk'; -import { update as updateProfileService } from '../../services/notificationProfilesService'; -import { strictAssert } from '../../util/assert'; +import { update as updateProfileService } from '../../services/notificationProfilesService.js'; +import { strictAssert } from '../../util/assert.js'; import { type BoundActionCreatorsMapObject, useBoundActions, -} from '../../hooks/useBoundActions'; -import { DataWriter } from '../../sql/Client'; -import { sortProfiles } from '../../types/NotificationProfile'; +} from '../../hooks/useBoundActions.js'; +import { DataWriter } from '../../sql/Client.js'; +import { sortProfiles } from '../../types/NotificationProfile.js'; import type { NextProfileEvent, NotificationProfileOverride, NotificationProfileType, -} from '../../types/NotificationProfile'; +} from '../../types/NotificationProfile.js'; const { updateNotificationProfile, diff --git a/ts/state/ducks/preferredReactions.ts b/ts/state/ducks/preferredReactions.ts index c21b404d25b..703c93dba28 100644 --- a/ts/state/ducks/preferredReactions.ts +++ b/ts/state/ducks/preferredReactions.ts @@ -4,17 +4,17 @@ import type { ThunkAction } from 'redux-thunk'; import { omit } from 'lodash'; import type { ReadonlyDeep } from 'type-fest'; -import { createLogger } from '../../logging/log'; -import * as Errors from '../../types/errors'; -import { replaceIndex } from '../../util/replaceIndex'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions'; -import { useBoundActions } from '../../hooks/useBoundActions'; -import type { StateType as RootStateType } from '../reducer'; -import { DEFAULT_PREFERRED_REACTION_EMOJI_SHORT_NAMES } from '../../reactions/constants'; -import { getPreferredReactionEmoji } from '../../reactions/preferredReactionEmoji'; -import { getEmojiSkinToneDefault } from '../selectors/items'; -import { convertShortName } from '../../components/emoji/lib'; -import { EmojiSkinTone } from '../../components/fun/data/emojis'; +import { createLogger } from '../../logging/log.js'; +import * as Errors from '../../types/errors.js'; +import { replaceIndex } from '../../util/replaceIndex.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; +import { useBoundActions } from '../../hooks/useBoundActions.js'; +import type { StateType as RootStateType } from '../reducer.js'; +import { DEFAULT_PREFERRED_REACTION_EMOJI_SHORT_NAMES } from '../../reactions/constants.js'; +import { getPreferredReactionEmoji } from '../../reactions/preferredReactionEmoji.js'; +import { getEmojiSkinToneDefault } from '../selectors/items.js'; +import { convertShortName } from '../../components/emoji/lib.js'; +import { EmojiSkinTone } from '../../components/fun/data/emojis.js'; const log = createLogger('preferredReactions'); diff --git a/ts/state/ducks/safetyNumber.ts b/ts/state/ducks/safetyNumber.ts index 05e1413c798..d3b3036aa4d 100644 --- a/ts/state/ducks/safetyNumber.ts +++ b/ts/state/ducks/safetyNumber.ts @@ -5,18 +5,18 @@ import type { ReadonlyDeep } from 'type-fest'; import type { ThunkAction } from 'redux-thunk'; import { omit } from 'lodash'; -import { generateSafetyNumber } from '../../util/safetyNumber'; -import type { SafetyNumberType } from '../../types/safetyNumber'; -import type { ConversationType } from './conversations'; +import { generateSafetyNumber } from '../../util/safetyNumber.js'; +import type { SafetyNumberType } from '../../types/safetyNumber.js'; +import type { ConversationType } from './conversations.js'; import { reloadProfiles, toggleVerification, -} from '../../shims/contactVerification'; -import { createLogger } from '../../logging/log'; -import * as Errors from '../../types/errors'; -import type { StateType as RootStateType } from '../reducer'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions'; -import { useBoundActions } from '../../hooks/useBoundActions'; +} from '../../shims/contactVerification.js'; +import { createLogger } from '../../logging/log.js'; +import * as Errors from '../../types/errors.js'; +import type { StateType as RootStateType } from '../reducer.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; +import { useBoundActions } from '../../hooks/useBoundActions.js'; const log = createLogger('safetyNumber'); diff --git a/ts/state/ducks/search.ts b/ts/state/ducks/search.ts index 1c73928512f..bf45b7be6f1 100644 --- a/ts/state/ducks/search.ts +++ b/ts/state/ducks/search.ts @@ -5,15 +5,15 @@ import type { ThunkAction, ThunkDispatch } from 'redux-thunk'; import { debounce, omit, reject } from 'lodash'; import type { ReadonlyDeep } from 'type-fest'; -import type { StateType as RootStateType } from '../reducer'; -import { filterAndSortConversations } from '../../util/filterAndSortConversations'; -import type { ClientSearchResultMessageType } from '../../sql/Interface'; -import { DataReader } from '../../sql/Client'; -import { makeLookup } from '../../util/makeLookup'; -import { isNotNil } from '../../util/isNotNil'; -import type { ServiceIdString } from '../../types/ServiceId'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions'; -import { useBoundActions } from '../../hooks/useBoundActions'; +import type { StateType as RootStateType } from '../reducer.js'; +import { filterAndSortConversations } from '../../util/filterAndSortConversations.js'; +import type { ClientSearchResultMessageType } from '../../sql/Interface.js'; +import { DataReader } from '../../sql/Client.js'; +import { makeLookup } from '../../util/makeLookup.js'; +import { isNotNil } from '../../util/isNotNil.js'; +import type { ServiceIdString } from '../../types/ServiceId.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; +import { useBoundActions } from '../../hooks/useBoundActions.js'; import type { ConversationType, @@ -24,33 +24,33 @@ import type { ShowArchivedConversationsActionType, MessageType, ConversationLookupType, -} from './conversations'; +} from './conversations.js'; import { getFilterByUnread, getIsActivelySearching, getQuery, getSearchConversation, -} from '../selectors/search'; -import { getAllConversations } from '../selectors/conversations'; +} from '../selectors/search.js'; +import { getAllConversations } from '../selectors/conversations.js'; import { getIntl, getRegionCode, getUserConversationId, -} from '../selectors/user'; -import { strictAssert } from '../../util/assert'; +} from '../selectors/user.js'; +import { strictAssert } from '../../util/assert.js'; import { CONVERSATION_UNLOADED, TARGETED_CONVERSATION_CHANGED, -} from './conversations'; -import { removeDiacritics } from '../../util/removeDiacritics'; -import { createLogger } from '../../logging/log'; -import { searchConversationTitles } from '../../util/searchConversationTitles'; -import { isDirectConversation } from '../../util/whatTypeOfConversation'; -import { isConversationSMSOnly } from '../../util/isConversationSMSOnly'; +} from './conversations.js'; +import { removeDiacritics } from '../../util/removeDiacritics.js'; +import { createLogger } from '../../logging/log.js'; +import { searchConversationTitles } from '../../util/searchConversationTitles.js'; +import { isDirectConversation } from '../../util/whatTypeOfConversation.js'; +import { isConversationSMSOnly } from '../../util/isConversationSMSOnly.js'; import { countConversationUnreadStats, hasUnread, -} from '../../util/countUnreadStats'; +} from '../../util/countUnreadStats.js'; const log = createLogger('search'); diff --git a/ts/state/ducks/stickers.ts b/ts/state/ducks/stickers.ts index e81ffb66e5e..973aae8dcb0 100644 --- a/ts/state/ducks/stickers.ts +++ b/ts/state/ducks/stickers.ts @@ -8,23 +8,26 @@ import type { StickerPackStatusType, StickerType as StickerDBType, StickerPackType as StickerPackDBType, -} from '../../sql/Interface'; -import { DataReader, DataWriter } from '../../sql/Client'; -import type { ActionSourceType, RecentStickerType } from '../../types/Stickers'; +} from '../../sql/Interface.js'; +import { DataReader, DataWriter } from '../../sql/Client.js'; +import type { + ActionSourceType, + RecentStickerType, +} from '../../types/Stickers.js'; import { downloadStickerPack as externalDownloadStickerPack, maybeDeletePack, -} from '../../types/Stickers'; -import { drop } from '../../util/drop'; -import { storageServiceUploadJob } from '../../services/storage'; -import { sendStickerPackSync } from '../../shims/textsecure'; -import { trigger } from '../../shims/events'; -import { ERASE_STORAGE_SERVICE } from './user'; -import type { EraseStorageServiceStateAction } from './user'; +} from '../../types/Stickers.js'; +import { drop } from '../../util/drop.js'; +import { storageServiceUploadJob } from '../../services/storage.js'; +import { sendStickerPackSync } from '../../shims/textsecure.js'; +import { trigger } from '../../shims/events.js'; +import { ERASE_STORAGE_SERVICE } from './user.js'; +import type { EraseStorageServiceStateAction } from './user.js'; -import type { NoopActionType } from './noop'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions'; -import { useBoundActions } from '../../hooks/useBoundActions'; +import type { NoopActionType } from './noop.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; +import { useBoundActions } from '../../hooks/useBoundActions.js'; const { getRecentStickers } = DataReader; const { updateStickerLastUsed } = DataWriter; diff --git a/ts/state/ducks/stories.ts b/ts/state/ducks/stories.ts index c42c49f9761..9bc7ac48312 100644 --- a/ts/state/ducks/stories.ts +++ b/ts/state/ducks/stories.ts @@ -5,77 +5,84 @@ import type { ThunkAction, ThunkDispatch } from 'redux-thunk'; import { isEqual, pick } from 'lodash'; import type { ReadonlyDeep } from 'type-fest'; -import * as Errors from '../../types/errors'; -import type { AttachmentType } from '../../types/Attachment'; -import type { DraftBodyRanges } from '../../types/BodyRange'; -import type { ReadonlyMessageAttributesType } from '../../model-types.d'; +import * as Errors from '../../types/errors.js'; +import type { AttachmentType } from '../../types/Attachment.js'; +import type { DraftBodyRanges } from '../../types/BodyRange.js'; +import type { ReadonlyMessageAttributesType } from '../../model-types.d.ts'; import type { MessageChangedActionType, MessageDeletedActionType, MessagesAddedActionType, TargetedConversationChangedActionType, -} from './conversations'; -import type { NoopActionType } from './noop'; -import type { StateType as RootStateType } from '../reducer'; -import type { StoryViewTargetType, StoryViewType } from '../../types/Stories'; -import type { SyncType } from '../../jobs/helpers/syncHelpers'; -import type { StoryDistributionIdString } from '../../types/StoryDistributionId'; -import type { ServiceIdString } from '../../types/ServiceId'; -import { isAciString } from '../../util/isAciString'; -import { createLogger } from '../../logging/log'; -import { TARGETED_CONVERSATION_CHANGED } from './conversations'; -import { SIGNAL_ACI } from '../../types/SignalConversation'; -import { DataReader, DataWriter } from '../../sql/Client'; -import { ReadStatus } from '../../messages/MessageReadStatus'; -import { SendStatus } from '../../messages/MessageSendState'; -import { SafetyNumberChangeSource } from '../../components/SafetyNumberChangeDialog'; +} from './conversations.js'; +import type { NoopActionType } from './noop.js'; +import type { StateType as RootStateType } from '../reducer.js'; +import type { + StoryViewTargetType, + StoryViewType, +} from '../../types/Stories.js'; +import type { SyncType } from '../../jobs/helpers/syncHelpers.js'; +import type { StoryDistributionIdString } from '../../types/StoryDistributionId.js'; +import type { ServiceIdString } from '../../types/ServiceId.js'; +import { isAciString } from '../../util/isAciString.js'; +import { createLogger } from '../../logging/log.js'; +import { TARGETED_CONVERSATION_CHANGED } from './conversations.js'; +import { SIGNAL_ACI } from '../../types/SignalConversation.js'; +import { DataReader, DataWriter } from '../../sql/Client.js'; +import { ReadStatus } from '../../messages/MessageReadStatus.js'; +import { SendStatus } from '../../messages/MessageSendState.js'; +import { SafetyNumberChangeSource } from '../../components/SafetyNumberChangeDialog.js'; import { areStoryViewReceiptsEnabled, StoryViewDirectionType, StoryViewModeType, -} from '../../types/Stories'; -import { assertDev, strictAssert } from '../../util/assert'; -import { drop } from '../../util/drop'; -import { blockSendUntilConversationsAreVerified } from '../../util/blockSendUntilConversationsAreVerified'; -import { deleteStoryForEveryone as doDeleteStoryForEveryone } from '../../util/deleteStoryForEveryone'; -import { deleteGroupStoryReplyForEveryone as doDeleteGroupStoryReplyForEveryone } from '../../util/deleteGroupStoryReplyForEveryone'; -import { enqueueReactionForSend } from '../../reactions/enqueueReactionForSend'; -import { getMessageById } from '../../messages/getMessageById'; -import { markOnboardingStoryAsRead } from '../../util/markOnboardingStoryAsRead'; -import { markViewed } from '../../services/MessageUpdater'; -import { queueAttachmentDownloads } from '../../util/queueAttachmentDownloads'; -import { replaceIndex } from '../../util/replaceIndex'; -import type { DurationInSeconds } from '../../util/durations'; -import { hasFailed, isDownloaded, isDownloading } from '../../types/Attachment'; +} from '../../types/Stories.js'; +import { assertDev, strictAssert } from '../../util/assert.js'; +import { drop } from '../../util/drop.js'; +import { blockSendUntilConversationsAreVerified } from '../../util/blockSendUntilConversationsAreVerified.js'; +import { deleteStoryForEveryone as doDeleteStoryForEveryone } from '../../util/deleteStoryForEveryone.js'; +import { deleteGroupStoryReplyForEveryone as doDeleteGroupStoryReplyForEveryone } from '../../util/deleteGroupStoryReplyForEveryone.js'; +import { enqueueReactionForSend } from '../../reactions/enqueueReactionForSend.js'; +import { getMessageById } from '../../messages/getMessageById.js'; +import { markOnboardingStoryAsRead } from '../../util/markOnboardingStoryAsRead.js'; +import { markViewed } from '../../services/MessageUpdater.js'; +import { queueAttachmentDownloads } from '../../util/queueAttachmentDownloads.js'; +import { replaceIndex } from '../../util/replaceIndex.js'; +import type { DurationInSeconds } from '../../util/durations/index.js'; +import { + hasFailed, + isDownloaded, + isDownloading, +} from '../../types/Attachment.js'; import { getConversationSelector, getHideStoryConversationIds, -} from '../selectors/conversations'; +} from '../selectors/conversations.js'; import { getStories, getStoryDownloadableAttachment, -} from '../selectors/stories'; -import { setStoriesDisabled as utilSetStoriesDisabled } from '../../util/stories'; -import { getStoryDataFromMessageAttributes } from '../../services/storyLoader'; -import { isGroup } from '../../util/whatTypeOfConversation'; -import { isNotNil } from '../../util/isNotNil'; -import { isStory } from '../../messages/helpers'; -import { sendStoryMessage as doSendStoryMessage } from '../../util/sendStoryMessage'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions'; -import { useBoundActions } from '../../hooks/useBoundActions'; -import { verifyStoryListMembers as doVerifyStoryListMembers } from '../../util/verifyStoryListMembers'; -import { viewSyncJobQueue } from '../../jobs/viewSyncJobQueue'; -import { getOwn } from '../../util/getOwn'; -import { SHOW_TOAST } from './toast'; -import { ToastType } from '../../types/Toast'; -import type { ShowToastActionType } from './toast'; +} from '../selectors/stories.js'; +import { setStoriesDisabled as utilSetStoriesDisabled } from '../../util/stories.js'; +import { getStoryDataFromMessageAttributes } from '../../services/storyLoader.js'; +import { isGroup } from '../../util/whatTypeOfConversation.js'; +import { isNotNil } from '../../util/isNotNil.js'; +import { isStory } from '../../messages/helpers.js'; +import { sendStoryMessage as doSendStoryMessage } from '../../util/sendStoryMessage.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; +import { useBoundActions } from '../../hooks/useBoundActions.js'; +import { verifyStoryListMembers as doVerifyStoryListMembers } from '../../util/verifyStoryListMembers.js'; +import { viewSyncJobQueue } from '../../jobs/viewSyncJobQueue.js'; +import { getOwn } from '../../util/getOwn.js'; +import { SHOW_TOAST } from './toast.js'; +import { ToastType } from '../../types/Toast.js'; +import type { ShowToastActionType } from './toast.js'; import { conversationJobQueue, conversationQueueJobEnum, -} from '../../jobs/conversationJobQueue'; -import { ReceiptType } from '../../types/Receipt'; -import { cleanupMessages } from '../../util/cleanup'; -import { AttachmentDownloadUrgency } from '../../types/AttachmentDownload'; +} from '../../jobs/conversationJobQueue.js'; +import { ReceiptType } from '../../types/Receipt.js'; +import { cleanupMessages } from '../../util/cleanup.js'; +import { AttachmentDownloadUrgency } from '../../types/AttachmentDownload.js'; const log = createLogger('stories'); diff --git a/ts/state/ducks/storyDistributionLists.ts b/ts/state/ducks/storyDistributionLists.ts index cac8ceca527..7aa4d76207e 100644 --- a/ts/state/ducks/storyDistributionLists.ts +++ b/ts/state/ducks/storyDistributionLists.ts @@ -5,19 +5,19 @@ import { omit } from 'lodash'; import type { ThunkAction } from 'redux-thunk'; import type { ReadonlyDeep } from 'type-fest'; -import type { StateType as RootStateType } from '../reducer'; -import type { StoryDistributionWithMembersType } from '../../sql/Interface'; -import type { StoryDistributionIdString } from '../../types/StoryDistributionId'; -import type { ServiceIdString } from '../../types/ServiceId'; -import { createLogger } from '../../logging/log'; -import { DataReader, DataWriter } from '../../sql/Client'; -import { MY_STORY_ID } from '../../types/Stories'; -import { generateStoryDistributionId } from '../../types/StoryDistributionId'; -import { deleteStoryForEveryone } from '../../util/deleteStoryForEveryone'; -import { replaceIndex } from '../../util/replaceIndex'; -import { storageServiceUploadJob } from '../../services/storage'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions'; -import { useBoundActions } from '../../hooks/useBoundActions'; +import type { StateType as RootStateType } from '../reducer.js'; +import type { StoryDistributionWithMembersType } from '../../sql/Interface.js'; +import type { StoryDistributionIdString } from '../../types/StoryDistributionId.js'; +import type { ServiceIdString } from '../../types/ServiceId.js'; +import { createLogger } from '../../logging/log.js'; +import { DataReader, DataWriter } from '../../sql/Client.js'; +import { MY_STORY_ID } from '../../types/Stories.js'; +import { generateStoryDistributionId } from '../../types/StoryDistributionId.js'; +import { deleteStoryForEveryone } from '../../util/deleteStoryForEveryone.js'; +import { replaceIndex } from '../../util/replaceIndex.js'; +import { storageServiceUploadJob } from '../../services/storage.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; +import { useBoundActions } from '../../hooks/useBoundActions.js'; const log = createLogger('storyDistributionLists'); diff --git a/ts/state/ducks/toast.ts b/ts/state/ducks/toast.ts index b92ab3f5e2b..1c926ac62a7 100644 --- a/ts/state/ducks/toast.ts +++ b/ts/state/ducks/toast.ts @@ -4,10 +4,10 @@ import { ipcRenderer } from 'electron'; import type { ReadonlyDeep } from 'type-fest'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions'; -import type { NoopActionType } from './noop'; -import { useBoundActions } from '../../hooks/useBoundActions'; -import type { AnyToast } from '../../types/Toast'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; +import type { NoopActionType } from './noop.js'; +import { useBoundActions } from '../../hooks/useBoundActions.js'; +import type { AnyToast } from '../../types/Toast.js'; // State diff --git a/ts/state/ducks/updates.ts b/ts/state/ducks/updates.ts index 3fef9f736dc..6722ccfb4df 100644 --- a/ts/state/ducks/updates.ts +++ b/ts/state/ducks/updates.ts @@ -3,12 +3,12 @@ import type { ThunkAction } from 'redux-thunk'; import type { ReadonlyDeep } from 'type-fest'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions'; -import { useBoundActions } from '../../hooks/useBoundActions'; -import * as updateIpc from '../../shims/updateIpc'; -import { DialogType } from '../../types/Dialogs'; -import { DAY } from '../../util/durations'; -import type { StateType as RootStateType } from '../reducer'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; +import { useBoundActions } from '../../hooks/useBoundActions.js'; +import * as updateIpc from '../../shims/updateIpc.js'; +import { DialogType } from '../../types/Dialogs.js'; +import { DAY } from '../../util/durations/index.js'; +import type { StateType as RootStateType } from '../reducer.js'; // State diff --git a/ts/state/ducks/user.ts b/ts/state/ducks/user.ts index 6d5797e8c81..5bc2b80fa9e 100644 --- a/ts/state/ducks/user.ts +++ b/ts/state/ducks/user.ts @@ -2,16 +2,16 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { ReadonlyDeep } from 'type-fest'; -import { trigger } from '../../shims/events'; -import type { LocaleMessagesType } from '../../types/I18N'; -import type { LocalizerType } from '../../types/Util'; -import type { MenuOptionsType } from '../../types/menu'; -import type { NoopActionType } from './noop'; -import type { AciString, PniString } from '../../types/ServiceId'; -import OS from '../../util/os/osMain'; -import { ThemeType } from '../../types/Util'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions'; -import { useBoundActions } from '../../hooks/useBoundActions'; +import { trigger } from '../../shims/events.js'; +import type { LocaleMessagesType } from '../../types/I18N.js'; +import type { LocalizerType } from '../../types/Util.js'; +import type { MenuOptionsType } from '../../types/menu.js'; +import type { NoopActionType } from './noop.js'; +import type { AciString, PniString } from '../../types/ServiceId.js'; +import OS from '../../util/os/osMain.js'; +import { ThemeType } from '../../types/Util.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; +import { useBoundActions } from '../../hooks/useBoundActions.js'; // State diff --git a/ts/state/ducks/username.ts b/ts/state/ducks/username.ts index 508877ad5db..3f24baadf9c 100644 --- a/ts/state/ducks/username.ts +++ b/ts/state/ducks/username.ts @@ -4,32 +4,32 @@ import type { ThunkAction } from 'redux-thunk'; import type { ReadonlyDeep } from 'type-fest'; -import type { UsernameReservationType } from '../../types/Username'; +import type { UsernameReservationType } from '../../types/Username.js'; import { ReserveUsernameError, ConfirmUsernameResult, -} from '../../types/Username'; -import * as usernameServices from '../../services/username'; -import { storageServiceUploadJob } from '../../services/storage'; -import type { ReserveUsernameResultType } from '../../services/username'; -import { missingCaseError } from '../../util/missingCaseError'; -import { sleep } from '../../util/sleep'; -import { assertDev } from '../../util/assert'; -import type { StateType as RootStateType } from '../reducer'; -import type { PromiseAction } from '../util'; -import { getMe } from '../selectors/conversations'; -import { getUsernameCorrupted } from '../selectors/items'; +} from '../../types/Username.js'; +import * as usernameServices from '../../services/username.js'; +import { storageServiceUploadJob } from '../../services/storage.js'; +import type { ReserveUsernameResultType } from '../../services/username.js'; +import { missingCaseError } from '../../util/missingCaseError.js'; +import { sleep } from '../../util/sleep.js'; +import { assertDev } from '../../util/assert.js'; +import type { StateType as RootStateType } from '../reducer.js'; +import type { PromiseAction } from '../util.js'; +import { getMe } from '../selectors/conversations.js'; +import { getUsernameCorrupted } from '../selectors/items.js'; import { UsernameEditState, UsernameLinkState, UsernameReservationState, UsernameReservationError, -} from './usernameEnums'; -import { showToast } from './toast'; -import { ToastType } from '../../types/Toast'; -import type { ToastActionType } from './toast'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions'; -import { useBoundActions } from '../../hooks/useBoundActions'; +} from './usernameEnums.js'; +import { showToast } from './toast.js'; +import { ToastType } from '../../types/Toast.js'; +import type { ToastActionType } from './toast.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; +import { useBoundActions } from '../../hooks/useBoundActions.js'; export type UsernameReservationStateType = ReadonlyDeep<{ state: UsernameReservationState; diff --git a/ts/state/getInitialState.ts b/ts/state/getInitialState.ts index 04848efa884..8ee6fb524db 100644 --- a/ts/state/getInitialState.ts +++ b/ts/state/getInitialState.ts @@ -1,57 +1,57 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { getEmptyState as accountsEmptyState } from './ducks/accounts'; -import { getEmptyState as appEmptyState } from './ducks/app'; -import { getEmptyState as audioPlayerEmptyState } from './ducks/audioPlayer'; -import { getEmptyState as audioRecorderEmptyState } from './ducks/audioRecorder'; -import { getEmptyState as badgesEmptyState } from './ducks/badges'; -import { getEmptyState as callHistoryEmptyState } from './ducks/callHistory'; -import { getEmptyState as callingEmptyState } from './ducks/calling'; -import { getEmptyState as chatFoldersEmptyState } from './ducks/chatFolders'; -import { getEmptyState as composerEmptyState } from './ducks/composer'; -import { getEmptyState as conversationsEmptyState } from './ducks/conversations'; -import { getEmptyState as crashReportsEmptyState } from './ducks/crashReports'; -import { getEmptyState as donationsEmptyState } from './ducks/donations'; -import { getEmptyState as emojiEmptyState } from './ducks/emojis'; -import { getEmptyState as expirationEmptyState } from './ducks/expiration'; -import { getEmptyState as gifsEmptyState } from './ducks/gifs'; -import { getEmptyState as globalModalsEmptyState } from './ducks/globalModals'; -import { getEmptyState as inboxEmptyState } from './ducks/inbox'; -import { getEmptyState as installerEmptyState } from './ducks/installer'; -import { getEmptyState as itemsEmptyState } from './ducks/items'; -import { getEmptyState as lightboxEmptyState } from './ducks/lightbox'; -import { getEmptyState as linkPreviewsEmptyState } from './ducks/linkPreviews'; -import { getEmptyState as mediaGalleryEmptyState } from './ducks/mediaGallery'; -import { getEmptyState as navEmptyState } from './ducks/nav'; -import { getEmptyState as networkEmptyState } from './ducks/network'; -import { getEmptyState as notificationProfilesEmptyState } from './ducks/notificationProfiles'; -import { getEmptyState as preferredReactionsEmptyState } from './ducks/preferredReactions'; -import { getEmptyState as safetyNumberEmptyState } from './ducks/safetyNumber'; -import { getEmptyState as searchEmptyState } from './ducks/search'; -import { getEmptyState as stickersEmptyState } from './ducks/stickers'; -import { getEmptyState as storiesEmptyState } from './ducks/stories'; -import { getEmptyState as storyDistributionListsEmptyState } from './ducks/storyDistributionLists'; -import { getEmptyState as toastEmptyState } from './ducks/toast'; -import { getEmptyState as updatesEmptyState } from './ducks/updates'; -import { getEmptyState as userEmptyState } from './ducks/user'; -import { getEmptyState as usernameEmptyState } from './ducks/username'; +import { getEmptyState as accountsEmptyState } from './ducks/accounts.js'; +import { getEmptyState as appEmptyState } from './ducks/app.js'; +import { getEmptyState as audioPlayerEmptyState } from './ducks/audioPlayer.js'; +import { getEmptyState as audioRecorderEmptyState } from './ducks/audioRecorder.js'; +import { getEmptyState as badgesEmptyState } from './ducks/badges.js'; +import { getEmptyState as callHistoryEmptyState } from './ducks/callHistory.js'; +import { getEmptyState as callingEmptyState } from './ducks/calling.js'; +import { getEmptyState as chatFoldersEmptyState } from './ducks/chatFolders.js'; +import { getEmptyState as composerEmptyState } from './ducks/composer.js'; +import { getEmptyState as conversationsEmptyState } from './ducks/conversations.js'; +import { getEmptyState as crashReportsEmptyState } from './ducks/crashReports.js'; +import { getEmptyState as donationsEmptyState } from './ducks/donations.js'; +import { getEmptyState as emojiEmptyState } from './ducks/emojis.js'; +import { getEmptyState as expirationEmptyState } from './ducks/expiration.js'; +import { getEmptyState as gifsEmptyState } from './ducks/gifs.js'; +import { getEmptyState as globalModalsEmptyState } from './ducks/globalModals.js'; +import { getEmptyState as inboxEmptyState } from './ducks/inbox.js'; +import { getEmptyState as installerEmptyState } from './ducks/installer.js'; +import { getEmptyState as itemsEmptyState } from './ducks/items.js'; +import { getEmptyState as lightboxEmptyState } from './ducks/lightbox.js'; +import { getEmptyState as linkPreviewsEmptyState } from './ducks/linkPreviews.js'; +import { getEmptyState as mediaGalleryEmptyState } from './ducks/mediaGallery.js'; +import { getEmptyState as navEmptyState } from './ducks/nav.js'; +import { getEmptyState as networkEmptyState } from './ducks/network.js'; +import { getEmptyState as notificationProfilesEmptyState } from './ducks/notificationProfiles.js'; +import { getEmptyState as preferredReactionsEmptyState } from './ducks/preferredReactions.js'; +import { getEmptyState as safetyNumberEmptyState } from './ducks/safetyNumber.js'; +import { getEmptyState as searchEmptyState } from './ducks/search.js'; +import { getEmptyState as stickersEmptyState } from './ducks/stickers.js'; +import { getEmptyState as storiesEmptyState } from './ducks/stories.js'; +import { getEmptyState as storyDistributionListsEmptyState } from './ducks/storyDistributionLists.js'; +import { getEmptyState as toastEmptyState } from './ducks/toast.js'; +import { getEmptyState as updatesEmptyState } from './ducks/updates.js'; +import { getEmptyState as userEmptyState } from './ducks/user.js'; +import { getEmptyState as usernameEmptyState } from './ducks/username.js'; -import OS from '../util/os/osMain'; -import { getInteractionMode } from '../services/InteractionMode'; -import { makeLookup } from '../util/makeLookup'; +import OS from '../util/os/osMain.js'; +import { getInteractionMode } from '../services/InteractionMode.js'; +import { makeLookup } from '../util/makeLookup.js'; -import type { StateType } from './reducer'; -import type { MainWindowStatsType } from '../windows/context'; -import type { ConversationsStateType } from './ducks/conversations'; -import type { MenuOptionsType } from '../types/menu'; +import type { StateType } from './reducer.js'; +import type { MainWindowStatsType } from '../windows/context.js'; +import type { ConversationsStateType } from './ducks/conversations.js'; +import type { MenuOptionsType } from '../types/menu.js'; import type { StoryDistributionListDataType, StoryDistributionListStateType, -} from './ducks/storyDistributionLists'; -import type { ThemeType } from '../types/Util'; -import type { UserStateType } from './ducks/user'; -import type { ReduxInitData } from './initializeRedux'; +} from './ducks/storyDistributionLists.js'; +import type { ThemeType } from '../types/Util.js'; +import type { UserStateType } from './ducks/user.js'; +import type { ReduxInitData } from './initializeRedux.js'; export function getInitialState( { diff --git a/ts/state/initializeRedux.ts b/ts/state/initializeRedux.ts index f0b54fb3c99..016925247a2 100644 --- a/ts/state/initializeRedux.ts +++ b/ts/state/initializeRedux.ts @@ -2,24 +2,24 @@ // SPDX-License-Identifier: AGPL-3.0-only import { bindActionCreators } from 'redux'; -import { actionCreators } from './actions'; -import { createStore } from './createStore'; -import { getInitialState } from './getInitialState'; +import { actionCreators } from './actions.js'; +import { createStore } from './createStore.js'; +import { getInitialState } from './getInitialState.js'; -import type { BadgesStateType } from './ducks/badges'; -import type { CallHistoryDetails } from '../types/CallDisposition'; -import type { DonationsStateType } from './ducks/donations'; -import type { MainWindowStatsType } from '../windows/context'; -import type { MenuOptionsType } from '../types/menu'; -import type { StoryDataType } from './ducks/stories'; -import type { StoryDistributionListDataType } from './ducks/storyDistributionLists'; -import type { ThemeType } from '../types/Util'; -import type { CallLinkType } from '../types/CallLink'; -import type { RecentEmojiObjectType } from '../util/loadRecentEmojis'; -import type { StickersStateType } from './ducks/stickers'; -import type { GifsStateType } from './ducks/gifs'; -import type { NotificationProfileType } from '../types/NotificationProfile'; -import type { ChatFolder } from '../types/ChatFolder'; +import type { BadgesStateType } from './ducks/badges.js'; +import type { CallHistoryDetails } from '../types/CallDisposition.js'; +import type { DonationsStateType } from './ducks/donations.js'; +import type { MainWindowStatsType } from '../windows/context.js'; +import type { MenuOptionsType } from '../types/menu.js'; +import type { StoryDataType } from './ducks/stories.js'; +import type { StoryDistributionListDataType } from './ducks/storyDistributionLists.js'; +import type { ThemeType } from '../types/Util.js'; +import type { CallLinkType } from '../types/CallLink.js'; +import type { RecentEmojiObjectType } from '../util/loadRecentEmojis.js'; +import type { StickersStateType } from './ducks/stickers.js'; +import type { GifsStateType } from './ducks/gifs.js'; +import type { NotificationProfileType } from '../types/NotificationProfile.js'; +import type { ChatFolder } from '../types/ChatFolder.js'; export type ReduxInitData = { badgesState: BadgesStateType; diff --git a/ts/state/reducer.ts b/ts/state/reducer.ts index c6f8f4907ae..4fe84b15455 100644 --- a/ts/state/reducer.ts +++ b/ts/state/reducer.ts @@ -3,41 +3,41 @@ import { combineReducers } from 'redux'; -import { reducer as accounts } from './ducks/accounts'; -import { reducer as app } from './ducks/app'; -import { reducer as audioPlayer } from './ducks/audioPlayer'; -import { reducer as audioRecorder } from './ducks/audioRecorder'; -import { reducer as badges } from './ducks/badges'; -import { reducer as calling } from './ducks/calling'; -import { reducer as callHistory } from './ducks/callHistory'; -import { reducer as chatFolders } from './ducks/chatFolders'; -import { reducer as composer } from './ducks/composer'; -import { reducer as conversations } from './ducks/conversations'; -import { reducer as crashReports } from './ducks/crashReports'; -import { reducer as donations } from './ducks/donations'; -import { reducer as emojis } from './ducks/emojis'; -import { reducer as expiration } from './ducks/expiration'; -import { reducer as gifs } from './ducks/gifs'; -import { reducer as globalModals } from './ducks/globalModals'; -import { reducer as inbox } from './ducks/inbox'; -import { reducer as installer } from './ducks/installer'; -import { reducer as items } from './ducks/items'; -import { reducer as lightbox } from './ducks/lightbox'; -import { reducer as linkPreviews } from './ducks/linkPreviews'; -import { reducer as mediaGallery } from './ducks/mediaGallery'; -import { reducer as nav } from './ducks/nav'; -import { reducer as network } from './ducks/network'; -import { reducer as notificationProfiles } from './ducks/notificationProfiles'; -import { reducer as preferredReactions } from './ducks/preferredReactions'; -import { reducer as safetyNumber } from './ducks/safetyNumber'; -import { reducer as search } from './ducks/search'; -import { reducer as stickers } from './ducks/stickers'; -import { reducer as stories } from './ducks/stories'; -import { reducer as storyDistributionLists } from './ducks/storyDistributionLists'; -import { reducer as toast } from './ducks/toast'; -import { reducer as updates } from './ducks/updates'; -import { reducer as user } from './ducks/user'; -import { reducer as username } from './ducks/username'; +import { reducer as accounts } from './ducks/accounts.js'; +import { reducer as app } from './ducks/app.js'; +import { reducer as audioPlayer } from './ducks/audioPlayer.js'; +import { reducer as audioRecorder } from './ducks/audioRecorder.js'; +import { reducer as badges } from './ducks/badges.js'; +import { reducer as calling } from './ducks/calling.js'; +import { reducer as callHistory } from './ducks/callHistory.js'; +import { reducer as chatFolders } from './ducks/chatFolders.js'; +import { reducer as composer } from './ducks/composer.js'; +import { reducer as conversations } from './ducks/conversations.js'; +import { reducer as crashReports } from './ducks/crashReports.js'; +import { reducer as donations } from './ducks/donations.js'; +import { reducer as emojis } from './ducks/emojis.js'; +import { reducer as expiration } from './ducks/expiration.js'; +import { reducer as gifs } from './ducks/gifs.js'; +import { reducer as globalModals } from './ducks/globalModals.js'; +import { reducer as inbox } from './ducks/inbox.js'; +import { reducer as installer } from './ducks/installer.js'; +import { reducer as items } from './ducks/items.js'; +import { reducer as lightbox } from './ducks/lightbox.js'; +import { reducer as linkPreviews } from './ducks/linkPreviews.js'; +import { reducer as mediaGallery } from './ducks/mediaGallery.js'; +import { reducer as nav } from './ducks/nav.js'; +import { reducer as network } from './ducks/network.js'; +import { reducer as notificationProfiles } from './ducks/notificationProfiles.js'; +import { reducer as preferredReactions } from './ducks/preferredReactions.js'; +import { reducer as safetyNumber } from './ducks/safetyNumber.js'; +import { reducer as search } from './ducks/search.js'; +import { reducer as stickers } from './ducks/stickers.js'; +import { reducer as stories } from './ducks/stories.js'; +import { reducer as storyDistributionLists } from './ducks/storyDistributionLists.js'; +import { reducer as toast } from './ducks/toast.js'; +import { reducer as updates } from './ducks/updates.js'; +import { reducer as user } from './ducks/user.js'; +import { reducer as username } from './ducks/username.js'; export const reducer = combineReducers({ accounts, diff --git a/ts/state/reinitializeRedux.ts b/ts/state/reinitializeRedux.ts index e0f86f5ec01..de49db8a607 100644 --- a/ts/state/reinitializeRedux.ts +++ b/ts/state/reinitializeRedux.ts @@ -3,12 +3,12 @@ import type { UnknownAction } from 'redux'; -import { createLogger } from '../logging/log'; -import { getInitialState } from './getInitialState'; -import { reducer as normalReducer } from './reducer'; +import { createLogger } from '../logging/log.js'; +import { getInitialState } from './getInitialState.js'; +import { reducer as normalReducer } from './reducer.js'; -import type { StateType } from './reducer'; -import type { ReduxInitData } from './initializeRedux'; +import type { StateType } from './reducer.js'; +import type { ReduxInitData } from './initializeRedux.js'; const log = createLogger('reinitializeRedux'); diff --git a/ts/state/roots/createApp.tsx b/ts/state/roots/createApp.tsx index 9cdad384c29..2c60ae565c9 100644 --- a/ts/state/roots/createApp.tsx +++ b/ts/state/roots/createApp.tsx @@ -7,8 +7,8 @@ import { Provider } from 'react-redux'; import type { Store } from 'redux'; -import { SmartApp } from '../smart/App'; -import { SmartVoiceNotesPlaybackProvider } from '../smart/VoiceNotesPlaybackProvider'; +import { SmartApp } from '../smart/App.js'; +import { SmartVoiceNotesPlaybackProvider } from '../smart/VoiceNotesPlaybackProvider.js'; export const createApp = (store: Store): ReactElement => ( diff --git a/ts/state/roots/createGroupV2JoinModal.tsx b/ts/state/roots/createGroupV2JoinModal.tsx index 90f5cd3e1b2..a9fb65e2993 100644 --- a/ts/state/roots/createGroupV2JoinModal.tsx +++ b/ts/state/roots/createGroupV2JoinModal.tsx @@ -8,10 +8,10 @@ import { Provider } from 'react-redux'; import type { Store } from 'redux'; -import { ModalHost } from '../../components/ModalHost'; -import type { SmartGroupV2JoinDialogProps } from '../smart/GroupV2JoinDialog'; -import { SmartGroupV2JoinDialog } from '../smart/GroupV2JoinDialog'; -import { FunEmojiLocalizationProvider } from '../../components/fun/FunEmojiLocalizationProvider'; +import { ModalHost } from '../../components/ModalHost.js'; +import type { SmartGroupV2JoinDialogProps } from '../smart/GroupV2JoinDialog.js'; +import { SmartGroupV2JoinDialog } from '../smart/GroupV2JoinDialog.js'; +import { FunEmojiLocalizationProvider } from '../../components/fun/FunEmojiLocalizationProvider.js'; export const createGroupV2JoinModal = ( store: Store, diff --git a/ts/state/roots/createSafetyNumberViewer.tsx b/ts/state/roots/createSafetyNumberViewer.tsx index 8aecb0013ad..de875ba2fbc 100644 --- a/ts/state/roots/createSafetyNumberViewer.tsx +++ b/ts/state/roots/createSafetyNumberViewer.tsx @@ -6,8 +6,8 @@ import { Provider } from 'react-redux'; import type { Store } from 'redux'; -import type { SafetyNumberProps } from '../../components/SafetyNumberChangeDialog'; -import { SmartSafetyNumberViewer } from '../smart/SafetyNumberViewer'; +import type { SafetyNumberProps } from '../../components/SafetyNumberChangeDialog.js'; +import { SmartSafetyNumberViewer } from '../smart/SafetyNumberViewer.js'; export const createSafetyNumberViewer = ( store: Store, diff --git a/ts/state/selectors/accounts.ts b/ts/state/selectors/accounts.ts index 07153db10fe..7e6eaeee228 100644 --- a/ts/state/selectors/accounts.ts +++ b/ts/state/selectors/accounts.ts @@ -3,9 +3,9 @@ import { createSelector } from 'reselect'; -import type { StateType } from '../reducer'; -import type { AccountsStateType } from '../ducks/accounts'; -import type { ServiceIdString } from '../../types/ServiceId'; +import type { StateType } from '../reducer.js'; +import type { AccountsStateType } from '../ducks/accounts.js'; +import type { ServiceIdString } from '../../types/ServiceId.js'; export const getAccounts = (state: StateType): AccountsStateType => state.accounts; diff --git a/ts/state/selectors/app.ts b/ts/state/selectors/app.ts index 1ceb9364edc..ddd66e1d6e6 100644 --- a/ts/state/selectors/app.ts +++ b/ts/state/selectors/app.ts @@ -1,8 +1,8 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import { createSelector } from 'reselect'; -import type { StateType } from '../reducer'; -import type { AppStateType } from '../ducks/app'; +import type { StateType } from '../reducer.js'; +import type { AppStateType } from '../ducks/app.js'; export const getApp = (state: StateType): AppStateType => state.app; diff --git a/ts/state/selectors/audioPlayer.ts b/ts/state/selectors/audioPlayer.ts index 068d2f0ebe9..3f27409ad61 100644 --- a/ts/state/selectors/audioPlayer.ts +++ b/ts/state/selectors/audioPlayer.ts @@ -7,24 +7,28 @@ import { getUserACI, getUserConversationId, getUserNumber, -} from './user'; -import { getMessagePropStatus, getSource, getSourceServiceId } from './message'; +} from './user.js'; +import { + getMessagePropStatus, + getSource, + getSourceServiceId, +} from './message.js'; import { getConversationByIdSelector, getConversations, getConversationSelector, getSelectedConversationId, -} from './conversations'; -import type { StateType } from '../reducer'; -import { createLogger } from '../../logging/log'; -import { getLocalAttachmentUrl } from '../../util/getLocalAttachmentUrl'; -import type { MessageWithUIFieldsType } from '../ducks/conversations'; -import type { ReadonlyMessageAttributesType } from '../../model-types.d'; -import { getMessageIdForLogging } from '../../util/idForLogging'; -import * as Attachment from '../../types/Attachment'; -import type { ActiveAudioPlayerStateType } from '../ducks/audioPlayer'; -import { isPlayed } from '../../types/Attachment'; -import type { ServiceIdString } from '../../types/ServiceId'; +} from './conversations.js'; +import type { StateType } from '../reducer.js'; +import { createLogger } from '../../logging/log.js'; +import { getLocalAttachmentUrl } from '../../util/getLocalAttachmentUrl.js'; +import type { MessageWithUIFieldsType } from '../ducks/conversations.js'; +import type { ReadonlyMessageAttributesType } from '../../model-types.d.ts'; +import { getMessageIdForLogging } from '../../util/idForLogging.js'; +import * as Attachment from '../../types/Attachment.js'; +import type { ActiveAudioPlayerStateType } from '../ducks/audioPlayer.js'; +import { isPlayed } from '../../types/Attachment.js'; +import type { ServiceIdString } from '../../types/ServiceId.js'; const log = createLogger('audioPlayer'); diff --git a/ts/state/selectors/audioRecorder.ts b/ts/state/selectors/audioRecorder.ts index 737c2d285a9..d9f7d562d8f 100644 --- a/ts/state/selectors/audioRecorder.ts +++ b/ts/state/selectors/audioRecorder.ts @@ -1,8 +1,8 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import { createSelector } from 'reselect'; -import type { StateType } from '../reducer'; -import type { AudioRecorderStateType } from '../ducks/audioRecorder'; +import type { StateType } from '../reducer.js'; +import type { AudioRecorderStateType } from '../ducks/audioRecorder.js'; export function getAudioRecorder(state: StateType): AudioRecorderStateType { return state.audioRecorder; diff --git a/ts/state/selectors/badges.ts b/ts/state/selectors/badges.ts index 270e27bf824..3e2406cdd81 100644 --- a/ts/state/selectors/badges.ts +++ b/ts/state/selectors/badges.ts @@ -3,12 +3,12 @@ import { createSelector } from 'reselect'; import { mapValues } from 'lodash'; -import { createLogger } from '../../logging/log'; -import type { StateType } from '../reducer'; -import type { BadgesStateType } from '../ducks/badges'; -import type { BadgeType } from '../../badges/types'; -import { getOwn } from '../../util/getOwn'; -import type { ConversationType } from '../ducks/conversations'; +import { createLogger } from '../../logging/log.js'; +import type { StateType } from '../reducer.js'; +import type { BadgesStateType } from '../ducks/badges.js'; +import type { BadgeType } from '../../badges/types.js'; +import { getOwn } from '../../util/getOwn.js'; +import type { ConversationType } from '../ducks/conversations.js'; const log = createLogger('badges'); diff --git a/ts/state/selectors/callHistory.ts b/ts/state/selectors/callHistory.ts index 6d921f23e46..0cdbbf6800a 100644 --- a/ts/state/selectors/callHistory.ts +++ b/ts/state/selectors/callHistory.ts @@ -2,14 +2,14 @@ // SPDX-License-Identifier: AGPL-3.0-only import { createSelector } from 'reselect'; -import type { CallHistoryState } from '../ducks/callHistory'; -import type { StateType } from '../reducer'; +import type { CallHistoryState } from '../ducks/callHistory.js'; +import type { StateType } from '../reducer.js'; import { AdhocCallStatus, CallType, type CallHistoryDetails, -} from '../../types/CallDisposition'; -import { getOwn } from '../../util/getOwn'; +} from '../../types/CallDisposition.js'; +import { getOwn } from '../../util/getOwn.js'; const getCallHistory = (state: StateType): CallHistoryState => state.callHistory; diff --git a/ts/state/selectors/calling.ts b/ts/state/selectors/calling.ts index 4557d330b7d..8dccb712ea0 100644 --- a/ts/state/selectors/calling.ts +++ b/ts/state/selectors/calling.ts @@ -3,7 +3,7 @@ import { createSelector } from 'reselect'; -import type { StateType } from '../reducer'; +import type { StateType } from '../reducer.js'; import type { CallingStateType, CallsByConversationType, @@ -12,14 +12,14 @@ import type { DirectCallStateType, GroupCallStateType, ActiveCallStateType, -} from '../ducks/calling'; -import { getRingingCall as getRingingCallHelper } from '../ducks/callingHelpers'; -import type { PresentedSource } from '../../types/Calling'; -import { CallMode } from '../../types/CallDisposition'; -import { isCallLinkAdmin, type CallLinkType } from '../../types/CallLink'; -import { getUserACI } from './user'; -import { getOwn } from '../../util/getOwn'; -import type { AciString } from '../../types/ServiceId'; +} from '../ducks/calling.js'; +import { getRingingCall as getRingingCallHelper } from '../ducks/callingHelpers.js'; +import type { PresentedSource } from '../../types/Calling.js'; +import { CallMode } from '../../types/CallDisposition.js'; +import { isCallLinkAdmin, type CallLinkType } from '../../types/CallLink.js'; +import { getUserACI } from './user.js'; +import { getOwn } from '../../util/getOwn.js'; +import type { AciString } from '../../types/ServiceId.js'; export type CallStateType = DirectCallStateType | GroupCallStateType; diff --git a/ts/state/selectors/chatFolders.ts b/ts/state/selectors/chatFolders.ts index c1e9bb6d548..b7d6322226d 100644 --- a/ts/state/selectors/chatFolders.ts +++ b/ts/state/selectors/chatFolders.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import { createSelector } from 'reselect'; -import type { StateType } from '../reducer'; -import type { ChatFoldersState } from '../ducks/chatFolders'; +import type { StateType } from '../reducer.js'; +import type { ChatFoldersState } from '../ducks/chatFolders.js'; export function getChatFoldersState(state: StateType): ChatFoldersState { return state.chatFolders; diff --git a/ts/state/selectors/composer.ts b/ts/state/selectors/composer.ts index ce3e5627ee8..5fd15c14701 100644 --- a/ts/state/selectors/composer.ts +++ b/ts/state/selectors/composer.ts @@ -3,12 +3,12 @@ import { createSelector } from 'reselect'; -import type { StateType } from '../reducer'; +import type { StateType } from '../reducer.js'; import type { ComposerStateType, QuotedMessageForComposerType, -} from '../ducks/composer'; -import { getComposerStateForConversation } from '../ducks/composer'; +} from '../ducks/composer.js'; +import { getComposerStateForConversation } from '../ducks/composer.js'; export const getComposerState = (state: StateType): ComposerStateType => state.composer; diff --git a/ts/state/selectors/conversations-extra.ts b/ts/state/selectors/conversations-extra.ts index 3cf6c238757..45075dcce4f 100644 --- a/ts/state/selectors/conversations-extra.ts +++ b/ts/state/selectors/conversations-extra.ts @@ -6,19 +6,19 @@ import { createSelector } from 'reselect'; -import { normalizeStoryDistributionId } from '../../types/StoryDistributionId'; -import type { ContactsByStory } from '../../components/SafetyNumberChangeDialog'; -import type { ConversationVerificationData } from '../ducks/conversations'; -import type { StoryDistributionListDataType } from '../ducks/storyDistributionLists'; -import type { GetConversationByIdType } from './conversations'; +import { normalizeStoryDistributionId } from '../../types/StoryDistributionId.js'; +import type { ContactsByStory } from '../../components/SafetyNumberChangeDialog.js'; +import type { ConversationVerificationData } from '../ducks/conversations.js'; +import type { StoryDistributionListDataType } from '../ducks/storyDistributionLists.js'; +import type { GetConversationByIdType } from './conversations.js'; -import { isGroup } from '../../util/whatTypeOfConversation'; +import { isGroup } from '../../util/whatTypeOfConversation.js'; import { getConversationSelector, getConversationVerificationData, -} from './conversations'; -import { ConversationVerificationState } from '../ducks/conversationsEnums'; -import { getDistributionListSelector } from './storyDistributionLists'; +} from './conversations.js'; +import { ConversationVerificationState } from '../ducks/conversationsEnums.js'; +import { getDistributionListSelector } from './storyDistributionLists.js'; export const getByDistributionListConversationsStoppingSend = createSelector( getConversationSelector, diff --git a/ts/state/selectors/conversations.ts b/ts/state/selectors/conversations.ts index 201da258097..3025a2517f4 100644 --- a/ts/state/selectors/conversations.ts +++ b/ts/state/selectors/conversations.ts @@ -5,7 +5,7 @@ import memoizee from 'memoizee'; import { isNumber, pick } from 'lodash'; import { createSelector } from 'reselect'; -import type { StateType } from '../reducer'; +import type { StateType } from '../reducer.js'; import type { ConversationLookupType, @@ -17,57 +17,57 @@ import type { MessagesByConversationType, MessageTimestamps, PreJoinConversationType, -} from '../ducks/conversations'; -import type { StoriesStateType, StoryDataType } from '../ducks/stories'; +} from '../ducks/conversations.js'; +import type { StoriesStateType, StoryDataType } from '../ducks/stories.js'; import { ComposerStep, OneTimeModalState, ConversationVerificationState, -} from '../ducks/conversationsEnums'; -import { getOwn } from '../../util/getOwn'; -import type { UUIDFetchStateType } from '../../util/uuidFetchState'; -import { deconstructLookup } from '../../util/deconstructLookup'; -import type { PropsDataType as TimelinePropsType } from '../../components/conversation/Timeline'; -import { assertDev } from '../../util/assert'; -import { isConversationUnregistered } from '../../util/isConversationUnregistered'; -import { filterAndSortConversations } from '../../util/filterAndSortConversations'; -import type { ContactNameColorType } from '../../types/Colors'; -import { ContactNameColors } from '../../types/Colors'; -import type { AvatarDataType } from '../../types/Avatar'; -import type { AciString, ServiceIdString } from '../../types/ServiceId'; -import { normalizeServiceId } from '../../types/ServiceId'; -import { isInSystemContacts } from '../../util/isInSystemContacts'; -import { isSignalConnection } from '../../util/getSignalConnections'; -import { sortByTitle } from '../../util/sortByTitle'; -import { DurationInSeconds } from '../../util/durations'; +} from '../ducks/conversationsEnums.js'; +import { getOwn } from '../../util/getOwn.js'; +import type { UUIDFetchStateType } from '../../util/uuidFetchState.js'; +import { deconstructLookup } from '../../util/deconstructLookup.js'; +import type { PropsDataType as TimelinePropsType } from '../../components/conversation/Timeline.js'; +import { assertDev } from '../../util/assert.js'; +import { isConversationUnregistered } from '../../util/isConversationUnregistered.js'; +import { filterAndSortConversations } from '../../util/filterAndSortConversations.js'; +import type { ContactNameColorType } from '../../types/Colors.js'; +import { ContactNameColors } from '../../types/Colors.js'; +import type { AvatarDataType } from '../../types/Avatar.js'; +import type { AciString, ServiceIdString } from '../../types/ServiceId.js'; +import { normalizeServiceId } from '../../types/ServiceId.js'; +import { isInSystemContacts } from '../../util/isInSystemContacts.js'; +import { isSignalConnection } from '../../util/getSignalConnections.js'; +import { sortByTitle } from '../../util/sortByTitle.js'; +import { DurationInSeconds } from '../../util/durations/index.js'; import { isDirectConversation, isGroupV1, isGroupV2, -} from '../../util/whatTypeOfConversation'; -import { isGroupInStoryMode } from '../../util/isGroupInStoryMode'; +} from '../../util/whatTypeOfConversation.js'; +import { isGroupInStoryMode } from '../../util/isGroupInStoryMode.js'; import { getIntl, getRegionCode, getUserConversationId, getUserNumber, -} from './user'; -import { getPinnedConversationIds } from './items'; -import { createLogger } from '../../logging/log'; -import { TimelineMessageLoadingState } from '../../util/timelineUtil'; -import { isSignalConversation } from '../../util/isSignalConversation'; -import { reduce } from '../../util/iterables'; -import { getConversationTitleForPanelType } from '../../util/getConversationTitleForPanelType'; -import type { PanelRenderType } from '../../types/Panels'; -import type { HasStories } from '../../types/Stories'; -import { getHasStoriesSelector } from './stories2'; -import { canEditMessage } from '../../util/canEditMessage'; -import { isOutgoing } from '../../messages/helpers'; +} from './user.js'; +import { getPinnedConversationIds } from './items.js'; +import { createLogger } from '../../logging/log.js'; +import { TimelineMessageLoadingState } from '../../util/timelineUtil.js'; +import { isSignalConversation } from '../../util/isSignalConversation.js'; +import { reduce } from '../../util/iterables.js'; +import { getConversationTitleForPanelType } from '../../util/getConversationTitleForPanelType.js'; +import type { PanelRenderType } from '../../types/Panels.js'; +import type { HasStories } from '../../types/Stories.js'; +import { getHasStoriesSelector } from './stories2.js'; +import { canEditMessage } from '../../util/canEditMessage.js'; +import { isOutgoing } from '../../messages/helpers.js'; import { countAllConversationsUnreadStats, type UnreadStats, -} from '../../util/countUnreadStats'; +} from '../../util/countUnreadStats.js'; const log = createLogger('conversations'); diff --git a/ts/state/selectors/crashReports.ts b/ts/state/selectors/crashReports.ts index a3fa9bccb8b..b0cd1870fc1 100644 --- a/ts/state/selectors/crashReports.ts +++ b/ts/state/selectors/crashReports.ts @@ -1,8 +1,8 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import { createSelector } from 'reselect'; -import type { StateType } from '../reducer'; -import type { CrashReportsStateType } from '../ducks/crashReports'; +import type { StateType } from '../reducer.js'; +import type { CrashReportsStateType } from '../ducks/crashReports.js'; const getCrashReports = (state: StateType): CrashReportsStateType => state.crashReports; diff --git a/ts/state/selectors/emojis.ts b/ts/state/selectors/emojis.ts index 74b33dcee7a..6c5048b8505 100644 --- a/ts/state/selectors/emojis.ts +++ b/ts/state/selectors/emojis.ts @@ -3,8 +3,8 @@ import { createSelector } from 'reselect'; import { useSelector } from 'react-redux'; -import type { StateType } from '../reducer'; -import { isEmojiEnglishShortName } from '../../components/fun/data/emojis'; +import type { StateType } from '../reducer.js'; +import { isEmojiEnglishShortName } from '../../components/fun/data/emojis.js'; export const selectRecentEmojis = createSelector( ({ emojis }: StateType) => emojis.recents, diff --git a/ts/state/selectors/expiration.ts b/ts/state/selectors/expiration.ts index b31cad37e96..b9fd9483ba1 100644 --- a/ts/state/selectors/expiration.ts +++ b/ts/state/selectors/expiration.ts @@ -3,14 +3,14 @@ import { createSelector } from 'reselect'; -import { createLogger } from '../../logging/log'; -import type { StateType } from '../reducer'; -import type { ExpirationStateType } from '../ducks/expiration'; -import { getRemoteBuildExpiration, getAutoDownloadUpdate } from './items'; +import { createLogger } from '../../logging/log.js'; +import type { StateType } from '../reducer.js'; +import type { ExpirationStateType } from '../ducks/expiration.js'; +import { getRemoteBuildExpiration, getAutoDownloadUpdate } from './items.js'; import { getBuildExpirationTimestamp, hasBuildExpired, -} from '../../util/buildExpiration'; +} from '../../util/buildExpiration.js'; const log = createLogger('expiration'); diff --git a/ts/state/selectors/gifs.ts b/ts/state/selectors/gifs.ts index 3344ca7ae38..a5bb8f5a274 100644 --- a/ts/state/selectors/gifs.ts +++ b/ts/state/selectors/gifs.ts @@ -1,8 +1,8 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import { createSelector } from 'reselect'; -import type { StateType } from '../reducer'; -import type { GifsStateType } from '../ducks/gifs'; +import type { StateType } from '../reducer.js'; +import type { GifsStateType } from '../ducks/gifs.js'; export const selectGifs = (state: StateType): GifsStateType => state.gifs; diff --git a/ts/state/selectors/globalModals.ts b/ts/state/selectors/globalModals.ts index 12428bee343..a79961ecf2a 100644 --- a/ts/state/selectors/globalModals.ts +++ b/ts/state/selectors/globalModals.ts @@ -3,9 +3,9 @@ import { createSelector } from 'reselect'; -import type { StateType } from '../reducer'; -import type { GlobalModalsStateType } from '../ducks/globalModals'; -import { UsernameOnboardingState } from '../../types/globalModals'; +import type { StateType } from '../reducer.js'; +import type { GlobalModalsStateType } from '../ducks/globalModals.js'; +import { UsernameOnboardingState } from '../../types/globalModals.js'; export const getGlobalModalsState = (state: StateType): GlobalModalsStateType => state.globalModals; diff --git a/ts/state/selectors/inbox.ts b/ts/state/selectors/inbox.ts index d3f15b9de28..d414bff8695 100644 --- a/ts/state/selectors/inbox.ts +++ b/ts/state/selectors/inbox.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { createSelector } from 'reselect'; -import type { StateType } from '../reducer'; +import type { StateType } from '../reducer.js'; const getInboxState = (state: StateType) => state.inbox; diff --git a/ts/state/selectors/installer.ts b/ts/state/selectors/installer.ts index 6e9f82d2566..80f9875974b 100644 --- a/ts/state/selectors/installer.ts +++ b/ts/state/selectors/installer.ts @@ -1,8 +1,8 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { StateType } from '../reducer'; -import type { InstallerStateType } from '../ducks/installer'; +import type { StateType } from '../reducer.js'; +import type { InstallerStateType } from '../ducks/installer.js'; export const getInstallerState = (state: StateType): InstallerStateType => state.installer; diff --git a/ts/state/selectors/items.ts b/ts/state/selectors/items.ts index 9ad85d494b7..945fd87ce71 100644 --- a/ts/state/selectors/items.ts +++ b/ts/state/selectors/items.ts @@ -3,27 +3,27 @@ import { createSelector } from 'reselect'; -import { ITEM_NAME as UNIVERSAL_EXPIRE_TIMER_ITEM } from '../../util/universalExpireTimer'; -import { innerIsBucketValueEnabled } from '../../RemoteConfig'; -import type { ConfigKeyType, ConfigMapType } from '../../RemoteConfig'; -import type { StateType } from '../reducer'; -import type { ItemsStateType } from '../ducks/items'; +import { ITEM_NAME as UNIVERSAL_EXPIRE_TIMER_ITEM } from '../../util/universalExpireTimer.js'; +import { innerIsBucketValueEnabled } from '../../RemoteConfig.js'; +import type { ConfigKeyType, ConfigMapType } from '../../RemoteConfig.js'; +import type { StateType } from '../reducer.js'; +import type { ItemsStateType } from '../ducks/items.js'; import type { ConversationColorType, CustomColorType, -} from '../../types/Colors'; -import type { AciString } from '../../types/ServiceId'; -import { DEFAULT_CONVERSATION_COLOR } from '../../types/Colors'; -import { getPreferredReactionEmoji as getPreferredReactionEmojiFromStoredValue } from '../../reactions/preferredReactionEmoji'; -import { DurationInSeconds } from '../../util/durations'; -import * as Bytes from '../../Bytes'; -import { contactByEncryptedUsernameRoute } from '../../util/signalRoutes'; -import { isNotUpdatable } from '../../util/version'; +} from '../../types/Colors.js'; +import type { AciString } from '../../types/ServiceId.js'; +import { DEFAULT_CONVERSATION_COLOR } from '../../types/Colors.js'; +import { getPreferredReactionEmoji as getPreferredReactionEmojiFromStoredValue } from '../../reactions/preferredReactionEmoji.js'; +import { DurationInSeconds } from '../../util/durations/index.js'; +import * as Bytes from '../../Bytes.js'; +import { contactByEncryptedUsernameRoute } from '../../util/signalRoutes.js'; +import { isNotUpdatable } from '../../util/version.js'; import { EmojiSkinTone, isValidEmojiSkinTone, -} from '../../components/fun/data/emojis'; -import { BackupLevel } from '../../services/backups/types'; +} from '../../components/fun/data/emojis.js'; +import { BackupLevel } from '../../services/backups/types.js'; const DEFAULT_PREFERRED_LEFT_PANE_WIDTH = 320; diff --git a/ts/state/selectors/lightbox.ts b/ts/state/selectors/lightbox.ts index b9c8bf51738..0e470504202 100644 --- a/ts/state/selectors/lightbox.ts +++ b/ts/state/selectors/lightbox.ts @@ -3,9 +3,9 @@ import { createSelector } from 'reselect'; import type { ReadonlyDeep } from 'type-fest'; -import type { MediaItemType } from '../../types/MediaItem'; -import type { StateType } from '../reducer'; -import type { LightboxStateType } from '../ducks/lightbox'; +import type { MediaItemType } from '../../types/MediaItem.js'; +import type { StateType } from '../reducer.js'; +import type { LightboxStateType } from '../ducks/lightbox.js'; export const getLightboxState = (state: StateType): LightboxStateType => state.lightbox; diff --git a/ts/state/selectors/linkPreviews.ts b/ts/state/selectors/linkPreviews.ts index ec69f5e566a..4e19584d232 100644 --- a/ts/state/selectors/linkPreviews.ts +++ b/ts/state/selectors/linkPreviews.ts @@ -3,8 +3,8 @@ import { createSelector } from 'reselect'; -import type { LinkPreviewSourceType } from '../../types/LinkPreview'; -import type { StateType } from '../reducer'; +import type { LinkPreviewSourceType } from '../../types/LinkPreview.js'; +import type { StateType } from '../reducer.js'; export const getLinkPreview = createSelector( ({ linkPreviews }: StateType) => linkPreviews, diff --git a/ts/state/selectors/mediaGallery.ts b/ts/state/selectors/mediaGallery.ts index 440de1eb087..342c9131417 100644 --- a/ts/state/selectors/mediaGallery.ts +++ b/ts/state/selectors/mediaGallery.ts @@ -1,8 +1,8 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { StateType } from '../reducer'; -import type { MediaGalleryStateType } from '../ducks/mediaGallery'; +import type { StateType } from '../reducer.js'; +import type { MediaGalleryStateType } from '../ducks/mediaGallery.js'; export const getMediaGalleryState = (state: StateType): MediaGalleryStateType => state.mediaGallery; diff --git a/ts/state/selectors/message.ts b/ts/state/selectors/message.ts index 5e0d4923eed..a4d4df98ad6 100644 --- a/ts/state/selectors/message.ts +++ b/ts/state/selectors/message.ts @@ -8,89 +8,89 @@ import emojiRegex from 'emoji-regex'; import LinkifyIt from 'linkify-it'; import type { ReadonlyDeep } from 'type-fest'; -import type { StateType } from '../reducer'; +import type { StateType } from '../reducer.js'; import type { LastMessageStatus, ReadonlyMessageAttributesType, MessageReactionType, QuotedAttachmentType, ShallowChallengeError, -} from '../../model-types.d'; +} from '../../model-types.d.ts'; import type { Contact as SmartMessageDetailContact, OwnProps as SmartMessageDetailPropsType, -} from '../smart/MessageDetail'; -import type { TimelineItemType } from '../../components/conversation/TimelineItem'; -import type { PropsData } from '../../components/conversation/Message'; -import type { PropsData as TimelineMessagePropsData } from '../../components/conversation/TimelineMessage'; -import { TextDirection } from '../../components/conversation/Message'; -import type { PropsData as TimerNotificationProps } from '../../components/conversation/TimerNotification'; -import type { PropsData as ChangeNumberNotificationProps } from '../../components/conversation/ChangeNumberNotification'; -import type { PropsData as JoinedSignalNotificationProps } from '../../components/conversation/JoinedSignalNotification'; -import type { PropsData as SafetyNumberNotificationProps } from '../../components/conversation/SafetyNumberNotification'; -import type { PropsData as VerificationNotificationProps } from '../../components/conversation/VerificationNotification'; -import type { PropsData as TitleTransitionNotificationProps } from '../../components/conversation/TitleTransitionNotification'; -import type { PropsDataType as GroupsV2Props } from '../../components/conversation/GroupV2Change'; -import type { PropsDataType as GroupV1MigrationPropsType } from '../../components/conversation/GroupV1Migration'; -import type { PropsDataType as DeliveryIssuePropsType } from '../../components/conversation/DeliveryIssueNotification'; -import type { PropsType as PaymentEventNotificationPropsType } from '../../components/conversation/PaymentEventNotification'; -import type { PropsDataType as ConversationMergePropsType } from '../../components/conversation/ConversationMergeNotification'; -import type { PropsDataType as PhoneNumberDiscoveryPropsType } from '../../components/conversation/PhoneNumberDiscoveryNotification'; +} from '../smart/MessageDetail.js'; +import type { TimelineItemType } from '../../components/conversation/TimelineItem.js'; +import type { PropsData } from '../../components/conversation/Message.js'; +import type { PropsData as TimelineMessagePropsData } from '../../components/conversation/TimelineMessage.js'; +import { TextDirection } from '../../components/conversation/Message.js'; +import type { PropsData as TimerNotificationProps } from '../../components/conversation/TimerNotification.js'; +import type { PropsData as ChangeNumberNotificationProps } from '../../components/conversation/ChangeNumberNotification.js'; +import type { PropsData as JoinedSignalNotificationProps } from '../../components/conversation/JoinedSignalNotification.js'; +import type { PropsData as SafetyNumberNotificationProps } from '../../components/conversation/SafetyNumberNotification.js'; +import type { PropsData as VerificationNotificationProps } from '../../components/conversation/VerificationNotification.js'; +import type { PropsData as TitleTransitionNotificationProps } from '../../components/conversation/TitleTransitionNotification.js'; +import type { PropsDataType as GroupsV2Props } from '../../components/conversation/GroupV2Change.js'; +import type { PropsDataType as GroupV1MigrationPropsType } from '../../components/conversation/GroupV1Migration.js'; +import type { PropsDataType as DeliveryIssuePropsType } from '../../components/conversation/DeliveryIssueNotification.js'; +import type { PropsType as PaymentEventNotificationPropsType } from '../../components/conversation/PaymentEventNotification.js'; +import type { PropsDataType as ConversationMergePropsType } from '../../components/conversation/ConversationMergeNotification.js'; +import type { PropsDataType as PhoneNumberDiscoveryPropsType } from '../../components/conversation/PhoneNumberDiscoveryNotification.js'; import type { PropsData as GroupNotificationProps, ChangeType, -} from '../../components/conversation/GroupNotification'; -import type { PropsType as ProfileChangeNotificationPropsType } from '../../components/conversation/ProfileChangeNotification'; +} from '../../components/conversation/GroupNotification.js'; +import type { PropsType as ProfileChangeNotificationPropsType } from '../../components/conversation/ProfileChangeNotification.js'; import { getSafeDomain, isCallLink, isStickerPack, -} from '../../types/LinkPreview'; +} from '../../types/LinkPreview.js'; import type { AciString, PniString, ServiceIdString, -} from '../../types/ServiceId'; +} from '../../types/ServiceId.js'; -import type { EmbeddedContactForUIType } from '../../types/EmbeddedContact'; -import { embeddedContactSelector } from '../../types/EmbeddedContact'; -import type { HydratedBodyRangesType } from '../../types/BodyRange'; -import { hydrateRanges } from '../../types/BodyRange'; -import type { AssertProps } from '../../types/Util'; -import type { LinkPreviewForUIType } from '../../types/message/LinkPreviews'; -import { getMentionsRegex } from '../../types/Message'; -import { SignalService as Proto } from '../../protobuf'; +import type { EmbeddedContactForUIType } from '../../types/EmbeddedContact.js'; +import { embeddedContactSelector } from '../../types/EmbeddedContact.js'; +import type { HydratedBodyRangesType } from '../../types/BodyRange.js'; +import { hydrateRanges } from '../../types/BodyRange.js'; +import type { AssertProps } from '../../types/Util.js'; +import type { LinkPreviewForUIType } from '../../types/message/LinkPreviews.js'; +import { getMentionsRegex } from '../../types/Message.js'; +import { SignalService as Proto } from '../../protobuf/index.js'; import type { AttachmentForUIType, AttachmentType, -} from '../../types/Attachment'; +} from '../../types/Attachment.js'; import { isVoiceMessage, isIncremental, defaultBlurHash, -} from '../../types/Attachment'; -import type { AttachmentDownloadJobTypeType } from '../../types/AttachmentDownload'; -import { type DefaultConversationColorType } from '../../types/Colors'; -import { ReadStatus } from '../../messages/MessageReadStatus'; +} from '../../types/Attachment.js'; +import type { AttachmentDownloadJobTypeType } from '../../types/AttachmentDownload.js'; +import { type DefaultConversationColorType } from '../../types/Colors.js'; +import { ReadStatus } from '../../messages/MessageReadStatus.js'; -import type { CallingNotificationType } from '../../util/callingNotification'; -import { getRecipients } from '../../util/getRecipients'; -import { getOwn } from '../../util/getOwn'; -import { isNotNil } from '../../util/isNotNil'; -import { isMoreRecentThan } from '../../util/timestamp'; -import * as iterables from '../../util/iterables'; -import { strictAssert } from '../../util/assert'; -import { canEditMessage } from '../../util/canEditMessage'; +import type { CallingNotificationType } from '../../util/callingNotification.js'; +import { getRecipients } from '../../util/getRecipients.js'; +import { getOwn } from '../../util/getOwn.js'; +import { isNotNil } from '../../util/isNotNil.js'; +import { isMoreRecentThan } from '../../util/timestamp.js'; +import * as iterables from '../../util/iterables.js'; +import { strictAssert } from '../../util/assert.js'; +import { canEditMessage } from '../../util/canEditMessage.js'; import { getLocalAttachmentUrl, AttachmentDisposition, -} from '../../util/getLocalAttachmentUrl'; -import { isPermanentlyUndownloadable } from '../../jobs/AttachmentDownloadManager'; +} from '../../util/getLocalAttachmentUrl.js'; +import { isPermanentlyUndownloadable } from '../../jobs/AttachmentDownloadManager.js'; -import { getAccountSelector } from './accounts'; -import { getDefaultConversationColor } from './items'; +import { getAccountSelector } from './accounts.js'; +import { getDefaultConversationColor } from './items.js'; import { getConversationSelector, getSelectedMessageIds, @@ -99,7 +99,7 @@ import { getMessages, getCachedConversationMemberColorsSelector, getContactNameColor, -} from './conversations'; +} from './conversations.js'; import { getIntl, getRegionCode, @@ -107,16 +107,16 @@ import { getUserPNI, getUserConversationId, getUserNumber, -} from './user'; +} from './user.js'; import type { ConversationType, MessageWithUIFieldsType, -} from '../ducks/conversations'; +} from '../ducks/conversations.js'; -import type { AccountSelectorType } from './accounts'; -import type { CallSelectorType, CallStateType } from './calling'; -import type { GetConversationByIdType } from './conversations'; +import type { AccountSelectorType } from './accounts.js'; +import type { CallSelectorType, CallStateType } from './calling.js'; +import type { GetConversationByIdType } from './conversations.js'; import { SendStatus, isDelivered, @@ -128,35 +128,35 @@ import { someRecipientSendStatus, getHighestSuccessfulRecipientStatus, someSendStatus, -} from '../../messages/MessageSendState'; -import { createLogger } from '../../logging/log'; -import { getConversationColorAttributes } from '../../util/getConversationColorAttributes'; -import { DAY, DurationInSeconds } from '../../util/durations'; -import { getStoryReplyText } from '../../util/getStoryReplyText'; -import type { MessageAttributesWithPaymentEvent } from '../../messages/helpers'; +} from '../../messages/MessageSendState.js'; +import { createLogger } from '../../logging/log.js'; +import { getConversationColorAttributes } from '../../util/getConversationColorAttributes.js'; +import { DAY, DurationInSeconds } from '../../util/durations/index.js'; +import { getStoryReplyText } from '../../util/getStoryReplyText.js'; +import type { MessageAttributesWithPaymentEvent } from '../../messages/helpers.js'; import { isIncoming, isOutgoing, messageHasPaymentEvent, isStory, -} from '../../messages/helpers'; +} from '../../messages/helpers.js'; -import { calculateExpirationTimestamp } from '../../util/expirationTimer'; -import { isSignalConversation } from '../../util/isSignalConversation'; -import type { AnyPaymentEvent } from '../../types/Payment'; -import { isPaymentNotificationEvent } from '../../types/Payment'; +import { calculateExpirationTimestamp } from '../../util/expirationTimer.js'; +import { isSignalConversation } from '../../util/isSignalConversation.js'; +import type { AnyPaymentEvent } from '../../types/Payment.js'; +import { isPaymentNotificationEvent } from '../../types/Payment.js'; import { getTitleNoDefault, getTitle, getNumber, renderNumber, -} from '../../util/getTitle'; -import { getMessageSentTimestamp } from '../../util/getMessageSentTimestamp'; -import type { CallHistorySelectorType } from './callHistory'; -import { CallMode, CallDirection } from '../../types/CallDisposition'; -import { getCallIdFromEra } from '../../util/callDisposition'; -import { LONG_MESSAGE } from '../../types/MIME'; -import type { MessageRequestResponseNotificationData } from '../../components/conversation/MessageRequestResponseNotification'; +} from '../../util/getTitle.js'; +import { getMessageSentTimestamp } from '../../util/getMessageSentTimestamp.js'; +import type { CallHistorySelectorType } from './callHistory.js'; +import { CallMode, CallDirection } from '../../types/CallDisposition.js'; +import { getCallIdFromEra } from '../../util/callDisposition.js'; +import { LONG_MESSAGE } from '../../types/MIME.js'; +import type { MessageRequestResponseNotificationData } from '../../components/conversation/MessageRequestResponseNotification.js'; const log = createLogger('message'); diff --git a/ts/state/selectors/nav.ts b/ts/state/selectors/nav.ts index b2c6b93e21a..d7dfd6c33f1 100644 --- a/ts/state/selectors/nav.ts +++ b/ts/state/selectors/nav.ts @@ -2,14 +2,14 @@ // SPDX-License-Identifier: AGPL-3.0-only import { createSelector } from 'reselect'; -import { getAllConversationsUnreadStats } from './conversations'; -import { getStoriesNotificationCount } from './stories'; -import { getCallHistoryUnreadCount } from './callHistory'; -import { NavTab } from '../../types/Nav'; +import { getAllConversationsUnreadStats } from './conversations.js'; +import { getStoriesNotificationCount } from './stories.js'; +import { getCallHistoryUnreadCount } from './callHistory.js'; +import { NavTab } from '../../types/Nav.js'; -import type { StateType } from '../reducer'; -import type { NavStateType } from '../ducks/nav'; -import type { UnreadStats } from '../../util/countUnreadStats'; +import type { StateType } from '../reducer.js'; +import type { NavStateType } from '../ducks/nav.js'; +import type { UnreadStats } from '../../util/countUnreadStats.js'; function getNav(state: StateType): NavStateType { return state.nav; diff --git a/ts/state/selectors/network.ts b/ts/state/selectors/network.ts index 43fa59f9281..e93a5d2f44c 100644 --- a/ts/state/selectors/network.ts +++ b/ts/state/selectors/network.ts @@ -3,9 +3,9 @@ import { createSelector } from 'reselect'; -import type { StateType } from '../reducer'; -import type { NetworkStateType } from '../ducks/network'; -import { isDone } from '../../util/registration'; +import type { StateType } from '../reducer.js'; +import type { NetworkStateType } from '../ducks/network.js'; +import { isDone } from '../../util/registration.js'; const getNetwork = (state: StateType): NetworkStateType => state.network; diff --git a/ts/state/selectors/notificationProfiles.ts b/ts/state/selectors/notificationProfiles.ts index 6ca4fd175c3..a7ca44c6845 100644 --- a/ts/state/selectors/notificationProfiles.ts +++ b/ts/state/selectors/notificationProfiles.ts @@ -5,16 +5,16 @@ import { createSelector } from 'reselect'; -import { createLogger } from '../../logging/log'; +import { createLogger } from '../../logging/log.js'; -import type { StateType } from '../reducer'; -import type { NotificationProfilesStateType } from '../ducks/notificationProfiles'; +import type { StateType } from '../reducer.js'; +import type { NotificationProfilesStateType } from '../ducks/notificationProfiles.js'; import { redactNotificationProfileId, type NextProfileEvent, type NotificationProfileOverride, type NotificationProfileType, -} from '../../types/NotificationProfile'; +} from '../../types/NotificationProfile.js'; const log = createLogger('notificationProfiles'); diff --git a/ts/state/selectors/preferredReactions.ts b/ts/state/selectors/preferredReactions.ts index 992e2c85b41..a419e4d58a9 100644 --- a/ts/state/selectors/preferredReactions.ts +++ b/ts/state/selectors/preferredReactions.ts @@ -3,8 +3,8 @@ import { createSelector } from 'reselect'; -import type { StateType } from '../reducer'; -import type { PreferredReactionsStateType } from '../ducks/preferredReactions'; +import type { StateType } from '../reducer.js'; +import type { PreferredReactionsStateType } from '../ducks/preferredReactions.js'; const getPreferredReactionsState = ( state: Readonly diff --git a/ts/state/selectors/safetyNumber.ts b/ts/state/selectors/safetyNumber.ts index d4083ef5baf..f762f025780 100644 --- a/ts/state/selectors/safetyNumber.ts +++ b/ts/state/selectors/safetyNumber.ts @@ -3,11 +3,11 @@ import { createSelector } from 'reselect'; -import type { StateType } from '../reducer'; +import type { StateType } from '../reducer.js'; import type { SafetyNumberContactType, SafetyNumberStateType, -} from '../ducks/safetyNumber'; +} from '../ducks/safetyNumber.js'; const getSafetyNumber = (state: StateType): SafetyNumberStateType => state.safetyNumber; diff --git a/ts/state/selectors/search.ts b/ts/state/selectors/search.ts index 0f08bee764b..e21af717196 100644 --- a/ts/state/selectors/search.ts +++ b/ts/state/selectors/search.ts @@ -4,34 +4,34 @@ import memoizee from 'memoizee'; import { createSelector } from 'reselect'; -import { deconstructLookup } from '../../util/deconstructLookup'; +import { deconstructLookup } from '../../util/deconstructLookup.js'; -import type { StateType } from '../reducer'; +import type { StateType } from '../reducer.js'; import type { MessageSearchResultLookupType, MessageSearchResultType, SearchStateType, -} from '../ducks/search'; +} from '../ducks/search.js'; import type { ConversationLookupType, ConversationType, -} from '../ducks/conversations'; +} from '../ducks/conversations.js'; -import type { LeftPaneSearchPropsType } from '../../components/leftPane/LeftPaneSearchHelper'; -import type { PropsDataType as MessageSearchResultPropsDataType } from '../../components/conversationList/MessageSearchResult'; +import type { LeftPaneSearchPropsType } from '../../components/leftPane/LeftPaneSearchHelper.js'; +import type { PropsDataType as MessageSearchResultPropsDataType } from '../../components/conversationList/MessageSearchResult.js'; -import { getIntl, getUserConversationId } from './user'; -import type { GetConversationByIdType } from './conversations'; +import { getIntl, getUserConversationId } from './user.js'; +import type { GetConversationByIdType } from './conversations.js'; import { getConversationLookup, getConversationSelector, getSelectedConversationId, -} from './conversations'; +} from './conversations.js'; -import { hydrateRanges } from '../../types/BodyRange'; -import { createLogger } from '../../logging/log'; -import { getOwn } from '../../util/getOwn'; +import { hydrateRanges } from '../../types/BodyRange.js'; +import { createLogger } from '../../logging/log.js'; +import { getOwn } from '../../util/getOwn.js'; const log = createLogger('search'); diff --git a/ts/state/selectors/stickers.ts b/ts/state/selectors/stickers.ts index e30db3072ff..479c8fd043d 100644 --- a/ts/state/selectors/stickers.ts +++ b/ts/state/selectors/stickers.ts @@ -5,21 +5,21 @@ import type { Dictionary } from 'lodash'; import { compact, filter, map, orderBy, reject, sortBy, values } from 'lodash'; import { createSelector } from 'reselect'; -import type { RecentStickerType } from '../../types/Stickers'; +import type { RecentStickerType } from '../../types/Stickers.js'; import { getLocalAttachmentUrl, AttachmentDisposition, -} from '../../util/getLocalAttachmentUrl'; +} from '../../util/getLocalAttachmentUrl.js'; import type { StickerType as StickerDBType, StickerPackType as StickerPackDBType, -} from '../../sql/Interface'; -import type { StateType } from '../reducer'; +} from '../../sql/Interface.js'; +import type { StateType } from '../reducer.js'; import type { StickersStateType, StickerPackType, StickerType, -} from '../ducks/stickers'; +} from '../ducks/stickers.js'; const getSticker = ( packs: Dictionary, diff --git a/ts/state/selectors/stories.ts b/ts/state/selectors/stories.ts index e457d959391..e541e7481be 100644 --- a/ts/state/selectors/stories.ts +++ b/ts/state/selectors/stories.ts @@ -4,9 +4,9 @@ import { createSelector } from 'reselect'; import { pick } from 'lodash'; -import type { GetConversationByIdType } from './conversations'; -import type { ConversationType } from '../ducks/conversations'; -import type { AttachmentType } from '../../types/Attachment'; +import type { GetConversationByIdType } from './conversations.js'; +import type { ConversationType } from '../ducks/conversations.js'; +import type { AttachmentType } from '../../types/Attachment.js'; import type { ConversationStoryType, MyStoryType, @@ -14,37 +14,37 @@ import type { StoryDistributionListWithMembersDataType, StorySendStateType, StoryViewType, -} from '../../types/Stories'; -import type { StateType } from '../reducer'; +} from '../../types/Stories.js'; +import type { StateType } from '../reducer.js'; import type { SelectedStoryDataType, StoryDataType, StoriesStateType, AddStoryData, -} from '../ducks/stories'; -import { MY_STORY_ID, ResolvedSendStatus } from '../../types/Stories'; -import { ReadStatus } from '../../messages/MessageReadStatus'; -import { SendStatus } from '../../messages/MessageSendState'; -import { canReply } from './message'; +} from '../ducks/stories.js'; +import { MY_STORY_ID, ResolvedSendStatus } from '../../types/Stories.js'; +import { ReadStatus } from '../../messages/MessageReadStatus.js'; +import { SendStatus } from '../../messages/MessageSendState.js'; +import { canReply } from './message.js'; import { getContactNameColorSelector, getConversationSelector, getHideStoryConversationIds, getMe, PLACEHOLDER_CONTACT_ID, -} from './conversations'; -import { getUserConversationId } from './user'; -import { getDistributionListSelector } from './storyDistributionLists'; -import { calculateExpirationTimestamp } from '../../util/expirationTimer'; -import { getMessageIdForLogging } from '../../util/idForLogging'; -import { createLogger } from '../../logging/log'; -import { SIGNAL_ACI } from '../../types/SignalConversation'; +} from './conversations.js'; +import { getUserConversationId } from './user.js'; +import { getDistributionListSelector } from './storyDistributionLists.js'; +import { calculateExpirationTimestamp } from '../../util/expirationTimer.js'; +import { getMessageIdForLogging } from '../../util/idForLogging.js'; +import { createLogger } from '../../logging/log.js'; +import { SIGNAL_ACI } from '../../types/SignalConversation.js'; import { reduceStorySendStatus, resolveStorySendStatus, -} from '../../util/resolveStorySendStatus'; -import { BodyRange, hydrateRanges } from '../../types/BodyRange'; -import { getStoriesEnabled } from './items'; +} from '../../util/resolveStorySendStatus.js'; +import { BodyRange, hydrateRanges } from '../../types/BodyRange.js'; +import { getStoriesEnabled } from './items.js'; const log = createLogger('stories'); diff --git a/ts/state/selectors/stories2.ts b/ts/state/selectors/stories2.ts index 916856740ee..7cf4ede7ec9 100644 --- a/ts/state/selectors/stories2.ts +++ b/ts/state/selectors/stories2.ts @@ -2,12 +2,12 @@ // SPDX-License-Identifier: AGPL-3.0-only import { createSelector } from 'reselect'; -import { ReadStatus } from '../../messages/MessageReadStatus'; -import { HasStories } from '../../types/Stories'; -import { getStoriesEnabled } from './items'; +import { ReadStatus } from '../../messages/MessageReadStatus.js'; +import { HasStories } from '../../types/Stories.js'; +import { getStoriesEnabled } from './items.js'; -import type { StateType } from '../reducer'; -import type { StoriesStateType } from '../ducks/stories'; +import type { StateType } from '../reducer.js'; +import type { StoriesStateType } from '../ducks/stories.js'; const getStoriesState = (state: StateType): StoriesStateType => state.stories; diff --git a/ts/state/selectors/storyDistributionLists.ts b/ts/state/selectors/storyDistributionLists.ts index e812e9306d8..cd3f30aa21d 100644 --- a/ts/state/selectors/storyDistributionLists.ts +++ b/ts/state/selectors/storyDistributionLists.ts @@ -3,11 +3,11 @@ import { createSelector } from 'reselect'; -import type { StateType } from '../reducer'; -import type { StoryDistributionListDataType } from '../ducks/storyDistributionLists'; -import type { StoryDistributionListWithMembersDataType } from '../../types/Stories'; -import { getConversationSelector } from './conversations'; -import { MY_STORY_ID } from '../../types/Stories'; +import type { StateType } from '../reducer.js'; +import type { StoryDistributionListDataType } from '../ducks/storyDistributionLists.js'; +import type { StoryDistributionListWithMembersDataType } from '../../types/Stories.js'; +import { getConversationSelector } from './conversations.js'; +import { MY_STORY_ID } from '../../types/Stories.js'; export const getDistributionLists = ( state: StateType diff --git a/ts/state/selectors/timeline.ts b/ts/state/selectors/timeline.ts index 8a660776278..112ac4a3461 100644 --- a/ts/state/selectors/timeline.ts +++ b/ts/state/selectors/timeline.ts @@ -2,29 +2,29 @@ // SPDX-License-Identifier: AGPL-3.0-only import { useSelector } from 'react-redux'; -import type { TimelineItemType } from '../../components/conversation/TimelineItem'; +import type { TimelineItemType } from '../../components/conversation/TimelineItem.js'; -import type { StateType } from '../reducer'; +import type { StateType } from '../reducer.js'; import { getConversationSelector, getTargetedMessage, getSelectedMessageIds, getMessages, getCachedConversationMemberColorsSelector, -} from './conversations'; -import { getAccountSelector } from './accounts'; +} from './conversations.js'; +import { getAccountSelector } from './accounts.js'; import { getRegionCode, getUserConversationId, getUserNumber, getUserACI, getUserPNI, -} from './user'; -import { getDefaultConversationColor } from './items'; -import { getActiveCall, getCallSelector } from './calling'; -import { getPropsForBubble } from './message'; -import { getCallHistorySelector } from './callHistory'; -import { useProxySelector } from '../../hooks/useProxySelector'; +} from './user.js'; +import { getDefaultConversationColor } from './items.js'; +import { getActiveCall, getCallSelector } from './calling.js'; +import { getPropsForBubble } from './message.js'; +import { getCallHistorySelector } from './callHistory.js'; +import { useProxySelector } from '../../hooks/useProxySelector.js'; const getTimelineItem = ( state: StateType, diff --git a/ts/state/selectors/toast.ts b/ts/state/selectors/toast.ts index ad6a6c75947..738643ba6cb 100644 --- a/ts/state/selectors/toast.ts +++ b/ts/state/selectors/toast.ts @@ -1,8 +1,8 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import { createSelector } from 'reselect'; -import type { StateType } from '../reducer'; -import type { ToastStateType } from '../ducks/toast'; +import type { StateType } from '../reducer.js'; +import type { ToastStateType } from '../ducks/toast.js'; export function getToastState(state: StateType): ToastStateType { return state.toast; diff --git a/ts/state/selectors/updates.ts b/ts/state/selectors/updates.ts index d628232e800..29d555b3583 100644 --- a/ts/state/selectors/updates.ts +++ b/ts/state/selectors/updates.ts @@ -3,10 +3,10 @@ import { createSelector } from 'reselect'; -import { DialogType } from '../../types/Dialogs'; +import { DialogType } from '../../types/Dialogs.js'; -import type { StateType } from '../reducer'; -import type { UpdatesStateType } from '../ducks/updates'; +import type { StateType } from '../reducer.js'; +import type { UpdatesStateType } from '../ducks/updates.js'; export const getUpdatesState = (state: Readonly): UpdatesStateType => state.updates; diff --git a/ts/state/selectors/user.ts b/ts/state/selectors/user.ts index 3093c9338ae..9fd3dc93f4f 100644 --- a/ts/state/selectors/user.ts +++ b/ts/state/selectors/user.ts @@ -3,16 +3,16 @@ import { createSelector } from 'reselect'; -import { type LocalizerType, ThemeType } from '../../types/Util'; -import type { AciString, PniString } from '../../types/ServiceId'; -import type { LocaleMessagesType } from '../../types/I18N'; -import type { MenuOptionsType } from '../../types/menu'; +import { type LocalizerType, ThemeType } from '../../types/Util.js'; +import type { AciString, PniString } from '../../types/ServiceId.js'; +import type { LocaleMessagesType } from '../../types/I18N.js'; +import type { MenuOptionsType } from '../../types/menu.js'; -import type { StateType } from '../reducer'; -import type { CallingStateType } from '../ducks/calling'; -import type { UserStateType } from '../ducks/user'; +import type { StateType } from '../reducer.js'; +import type { CallingStateType } from '../ducks/calling.js'; +import type { UserStateType } from '../ducks/user.js'; -import { isNightly, isBeta } from '../../util/version'; +import { isNightly, isBeta } from '../../util/version.js'; export const getUser = (state: StateType): UserStateType => state.user; diff --git a/ts/state/selectors/username.ts b/ts/state/selectors/username.ts index bb0bf8f69de..c384ac7d90d 100644 --- a/ts/state/selectors/username.ts +++ b/ts/state/selectors/username.ts @@ -3,18 +3,18 @@ import { createSelector } from 'reselect'; -import type { UsernameReservationType } from '../../types/Username'; -import type { StateType } from '../reducer'; +import type { UsernameReservationType } from '../../types/Username.js'; +import type { StateType } from '../reducer.js'; import type { UsernameStateType, UsernameReservationStateType, -} from '../ducks/username'; +} from '../ducks/username.js'; import type { UsernameEditState, UsernameLinkState, UsernameReservationState, UsernameReservationError, -} from '../ducks/usernameEnums'; +} from '../ducks/usernameEnums.js'; export const getUsernameState = (state: StateType): UsernameStateType => state.username; diff --git a/ts/state/smart/AboutContactModal.tsx b/ts/state/smart/AboutContactModal.tsx index 118fc7bf2e6..980df63b681 100644 --- a/ts/state/smart/AboutContactModal.tsx +++ b/ts/state/smart/AboutContactModal.tsx @@ -2,19 +2,19 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; -import { AboutContactModal } from '../../components/conversation/AboutContactModal'; -import { isSignalConnection } from '../../util/getSignalConnections'; -import { getIntl } from '../selectors/user'; -import { getGlobalModalsState } from '../selectors/globalModals'; +import { AboutContactModal } from '../../components/conversation/AboutContactModal.js'; +import { isSignalConnection } from '../../util/getSignalConnections.js'; +import { getIntl } from '../selectors/user.js'; +import { getGlobalModalsState } from '../selectors/globalModals.js'; import { getConversationSelector, getPendingAvatarDownloadSelector, -} from '../selectors/conversations'; -import type { ConversationType } from '../ducks/conversations'; -import { useConversationsActions } from '../ducks/conversations'; -import { useGlobalModalActions } from '../ducks/globalModals'; -import { strictAssert } from '../../util/assert'; -import { getAddedByForOurPendingInvitation } from '../../util/getAddedByForOurPendingInvitation'; +} from '../selectors/conversations.js'; +import type { ConversationType } from '../ducks/conversations.js'; +import { useConversationsActions } from '../ducks/conversations.js'; +import { useGlobalModalActions } from '../ducks/globalModals.js'; +import { strictAssert } from '../../util/assert.js'; +import { getAddedByForOurPendingInvitation } from '../../util/getAddedByForOurPendingInvitation.js'; function isFromOrAddedByTrustedContact( conversation: ConversationType diff --git a/ts/state/smart/AddUserToAnotherGroupModal.tsx b/ts/state/smart/AddUserToAnotherGroupModal.tsx index a729ae1d06d..08e55ef3202 100644 --- a/ts/state/smart/AddUserToAnotherGroupModal.tsx +++ b/ts/state/smart/AddUserToAnotherGroupModal.tsx @@ -3,15 +3,15 @@ import { useSelector } from 'react-redux'; import React, { memo } from 'react'; -import { AddUserToAnotherGroupModal } from '../../components/AddUserToAnotherGroupModal'; +import { AddUserToAnotherGroupModal } from '../../components/AddUserToAnotherGroupModal.js'; import { getAllGroupsWithInviteAccess, getContactSelector, -} from '../selectors/conversations'; -import { getIntl, getRegionCode } from '../selectors/user'; -import { useToastActions } from '../ducks/toast'; -import { useGlobalModalActions } from '../ducks/globalModals'; -import { useConversationsActions } from '../ducks/conversations'; +} from '../selectors/conversations.js'; +import { getIntl, getRegionCode } from '../selectors/user.js'; +import { useToastActions } from '../ducks/toast.js'; +import { useGlobalModalActions } from '../ducks/globalModals.js'; +import { useConversationsActions } from '../ducks/conversations.js'; export type SmartAddUserToAnotherGroupModalProps = Readonly<{ contactID: string; diff --git a/ts/state/smart/AllMedia.tsx b/ts/state/smart/AllMedia.tsx index bfa66097f9a..cffaa97d253 100644 --- a/ts/state/smart/AllMedia.tsx +++ b/ts/state/smart/AllMedia.tsx @@ -2,12 +2,12 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { MediaGallery } from '../../components/conversation/media-gallery/MediaGallery'; -import { getMediaGalleryState } from '../selectors/mediaGallery'; -import { getIntl, getTheme } from '../selectors/user'; -import { useConversationsActions } from '../ducks/conversations'; -import { useLightboxActions } from '../ducks/lightbox'; -import { useMediaGalleryActions } from '../ducks/mediaGallery'; +import { MediaGallery } from '../../components/conversation/media-gallery/MediaGallery.js'; +import { getMediaGalleryState } from '../selectors/mediaGallery.js'; +import { getIntl, getTheme } from '../selectors/user.js'; +import { useConversationsActions } from '../ducks/conversations.js'; +import { useLightboxActions } from '../ducks/lightbox.js'; +import { useMediaGalleryActions } from '../ducks/mediaGallery.js'; export type PropsType = { conversationId: string; diff --git a/ts/state/smart/App.tsx b/ts/state/smart/App.tsx index 90d1a71ea79..8fd28f35267 100644 --- a/ts/state/smart/App.tsx +++ b/ts/state/smart/App.tsx @@ -2,32 +2,32 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import type { VerificationTransport } from '../../types/VerificationTransport'; -import { DataWriter } from '../../sql/Client'; -import { App } from '../../components/App'; -import OS from '../../util/os/osMain'; -import { getConversation } from '../../util/getConversation'; -import { getChallengeURL } from '../../challenge'; -import { writeProfile } from '../../services/writeProfile'; -import { strictAssert } from '../../util/assert'; -import { SmartCallManager } from './CallManager'; -import { SmartGlobalModalContainer } from './GlobalModalContainer'; -import { SmartLightbox } from './Lightbox'; -import { SmartStoryViewer } from './StoryViewer'; +import type { VerificationTransport } from '../../types/VerificationTransport.js'; +import { DataWriter } from '../../sql/Client.js'; +import { App } from '../../components/App.js'; +import OS from '../../util/os/osMain.js'; +import { getConversation } from '../../util/getConversation.js'; +import { getChallengeURL } from '../../challenge.js'; +import { writeProfile } from '../../services/writeProfile.js'; +import { strictAssert } from '../../util/assert.js'; +import { SmartCallManager } from './CallManager.js'; +import { SmartGlobalModalContainer } from './GlobalModalContainer.js'; +import { SmartLightbox } from './Lightbox.js'; +import { SmartStoryViewer } from './StoryViewer.js'; import { getIsMainWindowMaximized, getIsMainWindowFullScreen, getTheme, -} from '../selectors/user'; -import { hasSelectedStoryData as getHasSelectedStoryData } from '../selectors/stories'; -import { useAppActions } from '../ducks/app'; -import { useConversationsActions } from '../ducks/conversations'; -import { useStoriesActions } from '../ducks/stories'; -import { ErrorBoundary } from '../../components/ErrorBoundary'; -import { ModalContainer } from '../../components/ModalContainer'; -import { SmartInbox } from './Inbox'; -import { getApp } from '../selectors/app'; -import { SmartFunProvider } from './FunProvider'; +} from '../selectors/user.js'; +import { hasSelectedStoryData as getHasSelectedStoryData } from '../selectors/stories.js'; +import { useAppActions } from '../ducks/app.js'; +import { useConversationsActions } from '../ducks/conversations.js'; +import { useStoriesActions } from '../ducks/stories.js'; +import { ErrorBoundary } from '../../components/ErrorBoundary.js'; +import { ModalContainer } from '../../components/ModalContainer.js'; +import { SmartInbox } from './Inbox.js'; +import { getApp } from '../selectors/app.js'; +import { SmartFunProvider } from './FunProvider.js'; function renderInbox(): JSX.Element { return ; diff --git a/ts/state/smart/CallLinkAddNameModal.tsx b/ts/state/smart/CallLinkAddNameModal.tsx index 5c79f9f5fad..26486e841b3 100644 --- a/ts/state/smart/CallLinkAddNameModal.tsx +++ b/ts/state/smart/CallLinkAddNameModal.tsx @@ -2,15 +2,15 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo, useCallback, useMemo } from 'react'; import { useSelector } from 'react-redux'; -import { useCallingActions } from '../ducks/calling'; -import { getCallLinkSelector } from '../selectors/calling'; -import { createLogger } from '../../logging/log'; -import { getIntl } from '../selectors/user'; -import { useGlobalModalActions } from '../ducks/globalModals'; -import { getCallLinkAddNameModalRoomId } from '../selectors/globalModals'; -import { strictAssert } from '../../util/assert'; -import { isCallLinkAdmin } from '../../types/CallLink'; -import { CallLinkAddNameModal } from '../../components/CallLinkAddNameModal'; +import { useCallingActions } from '../ducks/calling.js'; +import { getCallLinkSelector } from '../selectors/calling.js'; +import { createLogger } from '../../logging/log.js'; +import { getIntl } from '../selectors/user.js'; +import { useGlobalModalActions } from '../ducks/globalModals.js'; +import { getCallLinkAddNameModalRoomId } from '../selectors/globalModals.js'; +import { strictAssert } from '../../util/assert.js'; +import { isCallLinkAdmin } from '../../types/CallLink.js'; +import { CallLinkAddNameModal } from '../../components/CallLinkAddNameModal.js'; const log = createLogger('CallLinkAddNameModal'); diff --git a/ts/state/smart/CallLinkDetails.tsx b/ts/state/smart/CallLinkDetails.tsx index 4d2b0eb2b9a..be3cdccbaa2 100644 --- a/ts/state/smart/CallLinkDetails.tsx +++ b/ts/state/smart/CallLinkDetails.tsx @@ -2,22 +2,22 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; -import type { CallHistoryGroup } from '../../types/CallDisposition'; -import { getIntl } from '../selectors/user'; -import { CallLinkDetails } from '../../components/CallLinkDetails'; +import type { CallHistoryGroup } from '../../types/CallDisposition.js'; +import { getIntl } from '../selectors/user.js'; +import { CallLinkDetails } from '../../components/CallLinkDetails.js'; import { getActiveCallState, getAdhocCallSelector, getCallLinkSelector, -} from '../selectors/calling'; -import { useGlobalModalActions } from '../ducks/globalModals'; -import { useCallingActions } from '../ducks/calling'; -import { strictAssert } from '../../util/assert'; -import type { CallLinkRestrictions } from '../../types/CallLink'; +} from '../selectors/calling.js'; +import { useGlobalModalActions } from '../ducks/globalModals.js'; +import { useCallingActions } from '../ducks/calling.js'; +import { strictAssert } from '../../util/assert.js'; +import type { CallLinkRestrictions } from '../../types/CallLink.js'; import { isAnybodyInGroupCall, isGroupCallActiveOnServer, -} from '../ducks/callingHelpers'; +} from '../ducks/callingHelpers.js'; export type SmartCallLinkDetailsProps = Readonly<{ roomId: string; diff --git a/ts/state/smart/CallLinkEditModal.tsx b/ts/state/smart/CallLinkEditModal.tsx index 8376b3d1914..e10198cc65d 100644 --- a/ts/state/smart/CallLinkEditModal.tsx +++ b/ts/state/smart/CallLinkEditModal.tsx @@ -2,18 +2,21 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo, useCallback, useMemo } from 'react'; import { useSelector } from 'react-redux'; -import { CallLinkEditModal } from '../../components/CallLinkEditModal'; -import { useCallingActions } from '../ducks/calling'; -import { getActiveCallState, getCallLinkSelector } from '../selectors/calling'; -import { createLogger } from '../../logging/log'; -import { getIntl } from '../selectors/user'; -import { useGlobalModalActions } from '../ducks/globalModals'; -import type { CallLinkRestrictions } from '../../types/CallLink'; -import { getCallLinkEditModalRoomId } from '../selectors/globalModals'; -import { strictAssert } from '../../util/assert'; -import { linkCallRoute } from '../../util/signalRoutes'; -import { copyCallLink } from '../../util/copyLinksWithToast'; -import { drop } from '../../util/drop'; +import { CallLinkEditModal } from '../../components/CallLinkEditModal.js'; +import { useCallingActions } from '../ducks/calling.js'; +import { + getActiveCallState, + getCallLinkSelector, +} from '../selectors/calling.js'; +import { createLogger } from '../../logging/log.js'; +import { getIntl } from '../selectors/user.js'; +import { useGlobalModalActions } from '../ducks/globalModals.js'; +import type { CallLinkRestrictions } from '../../types/CallLink.js'; +import { getCallLinkEditModalRoomId } from '../selectors/globalModals.js'; +import { strictAssert } from '../../util/assert.js'; +import { linkCallRoute } from '../../util/signalRoutes.js'; +import { copyCallLink } from '../../util/copyLinksWithToast.js'; +import { drop } from '../../util/drop.js'; const log = createLogger('CallLinkEditModal'); diff --git a/ts/state/smart/CallLinkPendingParticipantModal.tsx b/ts/state/smart/CallLinkPendingParticipantModal.tsx index 5c1ad11b1da..b79f9b576df 100644 --- a/ts/state/smart/CallLinkPendingParticipantModal.tsx +++ b/ts/state/smart/CallLinkPendingParticipantModal.tsx @@ -2,14 +2,14 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { CallLinkPendingParticipantModal } from '../../components/CallLinkPendingParticipantModal'; -import { useCallingActions } from '../ducks/calling'; -import { getIntl } from '../selectors/user'; -import { useConversationsActions } from '../ducks/conversations'; -import { useGlobalModalActions } from '../ducks/globalModals'; -import { getConversationSelector } from '../selectors/conversations'; -import { getCallLinkPendingParticipantContactId } from '../selectors/globalModals'; -import { strictAssert } from '../../util/assert'; +import { CallLinkPendingParticipantModal } from '../../components/CallLinkPendingParticipantModal.js'; +import { useCallingActions } from '../ducks/calling.js'; +import { getIntl } from '../selectors/user.js'; +import { useConversationsActions } from '../ducks/conversations.js'; +import { useGlobalModalActions } from '../ducks/globalModals.js'; +import { getConversationSelector } from '../selectors/conversations.js'; +import { getCallLinkPendingParticipantContactId } from '../selectors/globalModals.js'; +import { strictAssert } from '../../util/assert.js'; export const SmartCallLinkPendingParticipantModal = memo( function SmartCallLinkPendingParticipantModal(): JSX.Element | null { diff --git a/ts/state/smart/CallManager.tsx b/ts/state/smart/CallManager.tsx index c740e7b4264..ac2adaf803e 100644 --- a/ts/state/smart/CallManager.tsx +++ b/ts/state/smart/CallManager.tsx @@ -7,16 +7,16 @@ import { useSelector } from 'react-redux'; import type { DirectIncomingCall, GroupIncomingCall, -} from '../../components/CallManager'; -import { CallManager } from '../../components/CallManager'; -import { isConversationTooBigToRing as getIsConversationTooBigToRing } from '../../conversations/isConversationTooBigToRing'; -import { createLogger } from '../../logging/log'; -import { calling as callingService } from '../../services/calling'; +} from '../../components/CallManager.js'; +import { CallManager } from '../../components/CallManager.js'; +import { isConversationTooBigToRing as getIsConversationTooBigToRing } from '../../conversations/isConversationTooBigToRing.js'; +import { createLogger } from '../../logging/log.js'; +import { calling as callingService } from '../../services/calling.js'; import { bounceAppIconStart, bounceAppIconStop, -} from '../../shims/bounceAppIcon'; -import type { CallLinkType } from '../../types/CallLink'; +} from '../../shims/bounceAppIcon.js'; +import type { CallLinkType } from '../../types/CallLink.js'; import type { ActiveCallBaseType, ActiveCallType, @@ -25,33 +25,33 @@ import type { CallingConversationType, ConversationsByDemuxIdType, GroupCallRemoteParticipantType, -} from '../../types/Calling'; -import { CallState } from '../../types/Calling'; -import { CallMode } from '../../types/CallDisposition'; -import type { AciString } from '../../types/ServiceId'; -import { callLinkToConversation } from '../../util/callLinks'; -import { callingTones } from '../../util/callingTones'; -import { missingCaseError } from '../../util/missingCaseError'; -import { useAudioPlayerActions } from '../ducks/audioPlayer'; -import { getActiveCall, useCallingActions } from '../ducks/calling'; -import type { ConversationType } from '../ducks/conversations'; -import type { StateType } from '../reducer'; -import { getHasInitialLoadCompleted } from '../selectors/app'; +} from '../../types/Calling.js'; +import { CallState } from '../../types/Calling.js'; +import { CallMode } from '../../types/CallDisposition.js'; +import type { AciString } from '../../types/ServiceId.js'; +import { callLinkToConversation } from '../../util/callLinks.js'; +import { callingTones } from '../../util/callingTones.js'; +import { missingCaseError } from '../../util/missingCaseError.js'; +import { useAudioPlayerActions } from '../ducks/audioPlayer.js'; +import { getActiveCall, useCallingActions } from '../ducks/calling.js'; +import type { ConversationType } from '../ducks/conversations.js'; +import type { StateType } from '../reducer.js'; +import { getHasInitialLoadCompleted } from '../selectors/app.js'; import { getActiveCallState, getAvailableCameras, getCallLinkSelector, getRingingCall, -} from '../selectors/calling'; -import { getConversationSelector, getMe } from '../selectors/conversations'; -import { getIntl, getUserACI } from '../selectors/user'; -import { SmartCallingDeviceSelection } from './CallingDeviceSelection'; -import { renderEmojiPicker } from './renderEmojiPicker'; -import { renderReactionPicker } from './renderReactionPicker'; -import { isSharingPhoneNumberWithEverybody as getIsSharingPhoneNumberWithEverybody } from '../../util/phoneNumberSharingMode'; -import { useGlobalModalActions } from '../ducks/globalModals'; -import { isLonelyGroup } from '../ducks/callingHelpers'; -import { getActiveProfile } from '../selectors/notificationProfiles'; +} from '../selectors/calling.js'; +import { getConversationSelector, getMe } from '../selectors/conversations.js'; +import { getIntl, getUserACI } from '../selectors/user.js'; +import { SmartCallingDeviceSelection } from './CallingDeviceSelection.js'; +import { renderEmojiPicker } from './renderEmojiPicker.js'; +import { renderReactionPicker } from './renderReactionPicker.js'; +import { isSharingPhoneNumberWithEverybody as getIsSharingPhoneNumberWithEverybody } from '../../util/phoneNumberSharingMode.js'; +import { useGlobalModalActions } from '../ducks/globalModals.js'; +import { isLonelyGroup } from '../ducks/callingHelpers.js'; +import { getActiveProfile } from '../selectors/notificationProfiles.js'; const log = createLogger('CallManager'); diff --git a/ts/state/smart/CallingDeviceSelection.tsx b/ts/state/smart/CallingDeviceSelection.tsx index ec90b2eded2..09d5093296f 100644 --- a/ts/state/smart/CallingDeviceSelection.tsx +++ b/ts/state/smart/CallingDeviceSelection.tsx @@ -3,8 +3,8 @@ import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { CallingDeviceSelection } from '../../components/CallingDeviceSelection'; -import { getIntl } from '../selectors/user'; +import { CallingDeviceSelection } from '../../components/CallingDeviceSelection.js'; +import { getIntl } from '../selectors/user.js'; import { getAvailableCameras, getAvailableMicrophones, @@ -12,8 +12,8 @@ import { getSelectedCamera, getSelectedMicrophone, getSelectedSpeaker, -} from '../selectors/calling'; -import { useCallingActions } from '../ducks/calling'; +} from '../selectors/calling.js'; +import { useCallingActions } from '../ducks/calling.js'; export const SmartCallingDeviceSelection = memo( function SmartCallingDeviceSelection() { diff --git a/ts/state/smart/CallsTab.tsx b/ts/state/smart/CallsTab.tsx index 216c8fab908..7c006f752e5 100644 --- a/ts/state/smart/CallsTab.tsx +++ b/ts/state/smart/CallsTab.tsx @@ -2,30 +2,30 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo, useCallback, useEffect } from 'react'; import { useSelector } from 'react-redux'; -import { DataReader } from '../../sql/Client'; -import { useItemsActions } from '../ducks/items'; +import { DataReader } from '../../sql/Client.js'; +import { useItemsActions } from '../ducks/items.js'; import { getNavTabsCollapsed, getPreferredLeftPaneWidth, -} from '../selectors/items'; -import { getIntl, getRegionCode } from '../selectors/user'; -import type { WidthBreakpoint } from '../../components/_util'; -import { CallsTab } from '../../components/CallsTab'; +} from '../selectors/items.js'; +import { getIntl, getRegionCode } from '../selectors/user.js'; +import type { WidthBreakpoint } from '../../components/_util.js'; +import { CallsTab } from '../../components/CallsTab.js'; import { getAllConversations, getConversationSelector, -} from '../selectors/conversations'; -import { filterAndSortConversations } from '../../util/filterAndSortConversations'; +} from '../selectors/conversations.js'; +import { filterAndSortConversations } from '../../util/filterAndSortConversations.js'; import type { CallHistoryFilter, CallHistoryFilterOptions, CallHistoryGroup, CallHistoryPagination, -} from '../../types/CallDisposition'; -import type { ConversationType } from '../ducks/conversations'; -import { SmartConversationDetails } from './ConversationDetails'; -import { SmartToastManager } from './ToastManager'; -import { useCallingActions } from '../ducks/calling'; +} from '../../types/CallDisposition.js'; +import type { ConversationType } from '../ducks/conversations.js'; +import { SmartConversationDetails } from './ConversationDetails.js'; +import { SmartToastManager } from './ToastManager.js'; +import { useCallingActions } from '../ducks/calling.js'; import { getActiveCallState, getAdhocCallSelector, @@ -33,16 +33,16 @@ import { getCallSelector, getCallLinkSelector, getHasAnyAdminCallLinks, -} from '../selectors/calling'; -import { useCallHistoryActions } from '../ducks/callHistory'; -import { getCallHistoryEdition } from '../selectors/callHistory'; -import { getHasPendingUpdate } from '../selectors/updates'; -import { getHasAnyFailedStorySends } from '../selectors/stories'; -import { getOtherTabsUnreadStats } from '../selectors/nav'; -import { SmartCallLinkDetails } from './CallLinkDetails'; -import type { CallLinkType } from '../../types/CallLink'; -import { filterCallLinks } from '../../util/filterCallLinks'; -import { useGlobalModalActions } from '../ducks/globalModals'; +} from '../selectors/calling.js'; +import { useCallHistoryActions } from '../ducks/callHistory.js'; +import { getCallHistoryEdition } from '../selectors/callHistory.js'; +import { getHasPendingUpdate } from '../selectors/updates.js'; +import { getHasAnyFailedStorySends } from '../selectors/stories.js'; +import { getOtherTabsUnreadStats } from '../selectors/nav.js'; +import { SmartCallLinkDetails } from './CallLinkDetails.js'; +import type { CallLinkType } from '../../types/CallLink.js'; +import { filterCallLinks } from '../../util/filterCallLinks.js'; +import { useGlobalModalActions } from '../ducks/globalModals.js'; function getCallHistoryFilter({ allCallLinks, diff --git a/ts/state/smart/CaptchaDialog.tsx b/ts/state/smart/CaptchaDialog.tsx index 9d5a23269db..bc9b8478a3d 100644 --- a/ts/state/smart/CaptchaDialog.tsx +++ b/ts/state/smart/CaptchaDialog.tsx @@ -2,11 +2,11 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; -import { CaptchaDialog } from '../../components/CaptchaDialog'; -import { getIntl } from '../selectors/user'; -import { isChallengePending } from '../selectors/network'; -import { getChallengeURL } from '../../challenge'; -import { createLogger } from '../../logging/log'; +import { CaptchaDialog } from '../../components/CaptchaDialog.js'; +import { getIntl } from '../selectors/user.js'; +import { isChallengePending } from '../selectors/network.js'; +import { getChallengeURL } from '../../challenge.js'; +import { createLogger } from '../../logging/log.js'; const log = createLogger('CaptchaDialog'); diff --git a/ts/state/smart/ChatColorPicker.tsx b/ts/state/smart/ChatColorPicker.tsx index 09ebfad6451..f02f2eee478 100644 --- a/ts/state/smart/ChatColorPicker.tsx +++ b/ts/state/smart/ChatColorPicker.tsx @@ -2,22 +2,22 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; -import { ChatColorPicker } from '../../components/ChatColorPicker'; +import { ChatColorPicker } from '../../components/ChatColorPicker.js'; import { getConversationSelector, getConversationsWithCustomColorSelector, -} from '../selectors/conversations'; -import { getIntl } from '../selectors/user'; +} from '../selectors/conversations.js'; +import { getIntl } from '../selectors/user.js'; import { getCustomColors, getDefaultConversationColor, -} from '../selectors/items'; -import { getConversationColorAttributes } from '../../util/getConversationColorAttributes'; +} from '../selectors/items.js'; +import { getConversationColorAttributes } from '../../util/getConversationColorAttributes.js'; import { useConversationsActions, type ConversationType, -} from '../ducks/conversations'; -import { useItemsActions } from '../ducks/items'; +} from '../ducks/conversations.js'; +import { useItemsActions } from '../ducks/items.js'; export type SmartChatColorPickerProps = Readonly<{ conversationId?: string; diff --git a/ts/state/smart/ChatsTab.tsx b/ts/state/smart/ChatsTab.tsx index ed583e43f53..8aba99332a2 100644 --- a/ts/state/smart/ChatsTab.tsx +++ b/ts/state/smart/ChatsTab.tsx @@ -2,31 +2,31 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo, useEffect, useRef } from 'react'; import { useSelector } from 'react-redux'; -import { ChatsTab } from '../../components/ChatsTab'; -import type { SmartConversationViewProps } from './ConversationView'; -import { SmartConversationView } from './ConversationView'; -import { SmartMiniPlayer } from './MiniPlayer'; -import { SmartLeftPane } from './LeftPane'; -import type { NavTabPanelProps } from '../../components/NavTabs'; -import { useGlobalModalActions } from '../ducks/globalModals'; -import { getIntl } from '../selectors/user'; -import { usePrevious } from '../../hooks/usePrevious'; -import { TargetedMessageSource } from '../ducks/conversationsEnums'; -import { useConversationsActions } from '../ducks/conversations'; -import { useToastActions } from '../ducks/toast'; -import { strictAssert } from '../../util/assert'; -import { isStagingServer } from '../../util/isStagingServer'; -import { ToastType } from '../../types/Toast'; -import { getNavTabsCollapsed } from '../selectors/items'; -import { useItemsActions } from '../ducks/items'; -import { getHasAnyFailedStorySends } from '../selectors/stories'; -import { getHasPendingUpdate } from '../selectors/updates'; -import { getOtherTabsUnreadStats } from '../selectors/nav'; +import { ChatsTab } from '../../components/ChatsTab.js'; +import type { SmartConversationViewProps } from './ConversationView.js'; +import { SmartConversationView } from './ConversationView.js'; +import { SmartMiniPlayer } from './MiniPlayer.js'; +import { SmartLeftPane } from './LeftPane.js'; +import type { NavTabPanelProps } from '../../components/NavTabs.js'; +import { useGlobalModalActions } from '../ducks/globalModals.js'; +import { getIntl } from '../selectors/user.js'; +import { usePrevious } from '../../hooks/usePrevious.js'; +import { TargetedMessageSource } from '../ducks/conversationsEnums.js'; +import { useConversationsActions } from '../ducks/conversations.js'; +import { useToastActions } from '../ducks/toast.js'; +import { strictAssert } from '../../util/assert.js'; +import { isStagingServer } from '../../util/isStagingServer.js'; +import { ToastType } from '../../types/Toast.js'; +import { getNavTabsCollapsed } from '../selectors/items.js'; +import { useItemsActions } from '../ducks/items.js'; +import { getHasAnyFailedStorySends } from '../selectors/stories.js'; +import { getHasPendingUpdate } from '../selectors/updates.js'; +import { getOtherTabsUnreadStats } from '../selectors/nav.js'; import { getSelectedConversationId, getTargetedMessage, getTargetedMessageSource, -} from '../selectors/conversations'; +} from '../selectors/conversations.js'; function renderConversationView(props: SmartConversationViewProps) { return ; diff --git a/ts/state/smart/ChooseGroupMembersModal.tsx b/ts/state/smart/ChooseGroupMembersModal.tsx index e020d5bf450..3f3608d9e4d 100644 --- a/ts/state/smart/ChooseGroupMembersModal.tsx +++ b/ts/state/smart/ChooseGroupMembersModal.tsx @@ -2,17 +2,17 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo, useMemo } from 'react'; import { useSelector } from 'react-redux'; -import { strictAssert } from '../../util/assert'; -import { lookupConversationWithoutServiceId } from '../../util/lookupConversationWithoutServiceId'; -import { getUsernameFromSearch } from '../../util/Username'; -import { ChooseGroupMembersModal } from '../../components/conversation/conversation-details/AddGroupMembersModal/ChooseGroupMembersModal'; -import { getIntl, getTheme, getRegionCode } from '../selectors/user'; +import { strictAssert } from '../../util/assert.js'; +import { lookupConversationWithoutServiceId } from '../../util/lookupConversationWithoutServiceId.js'; +import { getUsernameFromSearch } from '../../util/Username.js'; +import { ChooseGroupMembersModal } from '../../components/conversation/conversation-details/AddGroupMembersModal/ChooseGroupMembersModal.js'; +import { getIntl, getTheme, getRegionCode } from '../selectors/user.js'; import { getCandidateContactsForNewGroup, getConversationByIdSelector, getMe, -} from '../selectors/conversations'; -import { useGlobalModalActions } from '../ducks/globalModals'; +} from '../selectors/conversations.js'; +import { useGlobalModalActions } from '../ducks/globalModals.js'; export type SmartChooseGroupMembersModalPropsType = Readonly<{ conversationIdsAlreadyInGroup: Set; diff --git a/ts/state/smart/CollidingAvatars.tsx b/ts/state/smart/CollidingAvatars.tsx index 60e93ed5794..e2288e5b584 100644 --- a/ts/state/smart/CollidingAvatars.tsx +++ b/ts/state/smart/CollidingAvatars.tsx @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo, useMemo } from 'react'; import { useSelector } from 'react-redux'; -import { CollidingAvatars } from '../../components/CollidingAvatars'; -import { getIntl } from '../selectors/user'; -import { getConversationSelector } from '../selectors/conversations'; +import { CollidingAvatars } from '../../components/CollidingAvatars.js'; +import { getIntl } from '../selectors/user.js'; +import { getConversationSelector } from '../selectors/conversations.js'; export type PropsType = Readonly<{ conversationIds: ReadonlyArray; diff --git a/ts/state/smart/CompositionArea.tsx b/ts/state/smart/CompositionArea.tsx index eece14e1442..27c8d8614cd 100644 --- a/ts/state/smart/CompositionArea.tsx +++ b/ts/state/smart/CompositionArea.tsx @@ -3,24 +3,24 @@ import React, { useCallback, useMemo, memo } from 'react'; import { useSelector } from 'react-redux'; -import { CompositionArea } from '../../components/CompositionArea'; -import { useContactNameData } from '../../components/conversation/ContactName'; +import { CompositionArea } from '../../components/CompositionArea.js'; +import { useContactNameData } from '../../components/conversation/ContactName.js'; import type { DraftBodyRanges, HydratedBodyRangesType, -} from '../../types/BodyRange'; -import { hydrateRanges } from '../../types/BodyRange'; -import { strictAssert } from '../../util/assert'; -import { getAddedByForOurPendingInvitation } from '../../util/getAddedByForOurPendingInvitation'; -import { imageToBlurHash } from '../../util/imageToBlurHash'; -import { isConversationSMSOnly } from '../../util/isConversationSMSOnly'; -import { isSignalConversation } from '../../util/isSignalConversation'; +} from '../../types/BodyRange.js'; +import { hydrateRanges } from '../../types/BodyRange.js'; +import { strictAssert } from '../../util/assert.js'; +import { getAddedByForOurPendingInvitation } from '../../util/getAddedByForOurPendingInvitation.js'; +import { imageToBlurHash } from '../../util/imageToBlurHash.js'; +import { isConversationSMSOnly } from '../../util/isConversationSMSOnly.js'; +import { isSignalConversation } from '../../util/isSignalConversation.js'; import { getErrorDialogAudioRecorderType, getRecordingState, -} from '../selectors/audioRecorder'; -import { getPreferredBadgeSelector } from '../selectors/badges'; -import { getComposerStateForConversationIdSelector } from '../selectors/composer'; +} from '../selectors/audioRecorder.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.js'; +import { getComposerStateForConversationIdSelector } from '../selectors/composer.js'; import { getConversationSelector, getGroupAdminsSelector, @@ -29,16 +29,16 @@ import { getMessages, getSelectedMessageIds, isMissingRequiredProfileSharing, -} from '../selectors/conversations'; -import { selectRecentEmojis } from '../selectors/emojis'; +} from '../selectors/conversations.js'; +import { selectRecentEmojis } from '../selectors/emojis.js'; import { getDefaultConversationColor, getEmojiSkinToneDefault, getShowStickerPickerHint, getShowStickersIntroduction, getTextFormattingEnabled, -} from '../selectors/items'; -import { canForward, getPropsForQuote } from '../selectors/message'; +} from '../selectors/items.js'; +import { canForward, getPropsForQuote } from '../selectors/message.js'; import { getBlessedStickerPacks, getInstalledStickerPacks, @@ -46,30 +46,30 @@ import { getReceivedStickerPacks, getRecentStickers, getRecentlyInstalledStickerPack, -} from '../selectors/stickers'; +} from '../selectors/stickers.js'; import { getIntl, getPlatform, getTheme, getUserConversationId, -} from '../selectors/user'; -import type { SmartCompositionRecordingProps } from './CompositionRecording'; -import { SmartCompositionRecording } from './CompositionRecording'; -import type { SmartCompositionRecordingDraftProps } from './CompositionRecordingDraft'; -import { SmartCompositionRecordingDraft } from './CompositionRecordingDraft'; -import { useItemsActions } from '../ducks/items'; -import { useComposerActions } from '../ducks/composer'; -import { useConversationsActions } from '../ducks/conversations'; -import { useAudioRecorderActions } from '../ducks/audioRecorder'; -import { useEmojisActions } from '../ducks/emojis'; -import { useGlobalModalActions } from '../ducks/globalModals'; -import { useStickersActions } from '../ducks/stickers'; -import { useToastActions } from '../ducks/toast'; -import { isShowingAnyModal } from '../selectors/globalModals'; -import { isConversationEverUnregistered } from '../../util/isConversationUnregistered'; -import { isDirectConversation } from '../../util/whatTypeOfConversation'; -import { isConversationMuted } from '../../util/isConversationMuted'; -import type { EmojiSkinTone } from '../../components/fun/data/emojis'; +} from '../selectors/user.js'; +import type { SmartCompositionRecordingProps } from './CompositionRecording.js'; +import { SmartCompositionRecording } from './CompositionRecording.js'; +import type { SmartCompositionRecordingDraftProps } from './CompositionRecordingDraft.js'; +import { SmartCompositionRecordingDraft } from './CompositionRecordingDraft.js'; +import { useItemsActions } from '../ducks/items.js'; +import { useComposerActions } from '../ducks/composer.js'; +import { useConversationsActions } from '../ducks/conversations.js'; +import { useAudioRecorderActions } from '../ducks/audioRecorder.js'; +import { useEmojisActions } from '../ducks/emojis.js'; +import { useGlobalModalActions } from '../ducks/globalModals.js'; +import { useStickersActions } from '../ducks/stickers.js'; +import { useToastActions } from '../ducks/toast.js'; +import { isShowingAnyModal } from '../selectors/globalModals.js'; +import { isConversationEverUnregistered } from '../../util/isConversationUnregistered.js'; +import { isDirectConversation } from '../../util/whatTypeOfConversation.js'; +import { isConversationMuted } from '../../util/isConversationMuted.js'; +import type { EmojiSkinTone } from '../../components/fun/data/emojis.js'; function renderSmartCompositionRecording( recProps: SmartCompositionRecordingProps diff --git a/ts/state/smart/CompositionRecording.tsx b/ts/state/smart/CompositionRecording.tsx index 4a964a3043d..0c6abb7d054 100644 --- a/ts/state/smart/CompositionRecording.tsx +++ b/ts/state/smart/CompositionRecording.tsx @@ -3,12 +3,12 @@ import React, { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; -import { CompositionRecording } from '../../components/CompositionRecording'; -import { useAudioRecorderActions } from '../ducks/audioRecorder'; -import { useComposerActions } from '../ducks/composer'; -import { useToastActions } from '../ducks/toast'; -import { getSelectedConversationId } from '../selectors/conversations'; -import { getIntl } from '../selectors/user'; +import { CompositionRecording } from '../../components/CompositionRecording.js'; +import { useAudioRecorderActions } from '../ducks/audioRecorder.js'; +import { useComposerActions } from '../ducks/composer.js'; +import { useToastActions } from '../ducks/toast.js'; +import { getSelectedConversationId } from '../selectors/conversations.js'; +import { getIntl } from '../selectors/user.js'; export type SmartCompositionRecordingProps = { onBeforeSend: () => void; diff --git a/ts/state/smart/CompositionRecordingDraft.tsx b/ts/state/smart/CompositionRecordingDraft.tsx index 7de52a791d5..d674ca748f5 100644 --- a/ts/state/smart/CompositionRecordingDraft.tsx +++ b/ts/state/smart/CompositionRecordingDraft.tsx @@ -3,19 +3,19 @@ import React, { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; -import { CompositionRecordingDraft } from '../../components/CompositionRecordingDraft'; -import type { AttachmentDraftType } from '../../types/Attachment'; +import { CompositionRecordingDraft } from '../../components/CompositionRecordingDraft.js'; +import type { AttachmentDraftType } from '../../types/Attachment.js'; import { AudioPlayerContent, useAudioPlayerActions, -} from '../ducks/audioPlayer'; -import { useComposerActions } from '../ducks/composer'; -import { selectAudioPlayerActive } from '../selectors/audioPlayer'; +} from '../ducks/audioPlayer.js'; +import { useComposerActions } from '../ducks/composer.js'; +import { selectAudioPlayerActive } from '../selectors/audioPlayer.js'; import { getConversationByIdSelector, getSelectedConversationId, -} from '../selectors/conversations'; -import { getIntl } from '../selectors/user'; +} from '../selectors/conversations.js'; +import { getIntl } from '../selectors/user.js'; export type SmartCompositionRecordingDraftProps = { voiceNoteAttachment: AttachmentDraftType; diff --git a/ts/state/smart/CompositionTextArea.tsx b/ts/state/smart/CompositionTextArea.tsx index ba50822f3e9..14d2dbabe58 100644 --- a/ts/state/smart/CompositionTextArea.tsx +++ b/ts/state/smart/CompositionTextArea.tsx @@ -2,15 +2,19 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import type { CompositionTextAreaProps } from '../../components/CompositionTextArea'; -import { CompositionTextArea } from '../../components/CompositionTextArea'; -import { getIntl, getPlatform, getUserConversationId } from '../selectors/user'; -import { useEmojisActions as useEmojiActions } from '../ducks/emojis'; -import { useItemsActions } from '../ducks/items'; -import { getPreferredBadgeSelector } from '../selectors/badges'; -import { useComposerActions } from '../ducks/composer'; -import { getTextFormattingEnabled } from '../selectors/items'; -import { getConversationSelector } from '../selectors/conversations'; +import type { CompositionTextAreaProps } from '../../components/CompositionTextArea.js'; +import { CompositionTextArea } from '../../components/CompositionTextArea.js'; +import { + getIntl, + getPlatform, + getUserConversationId, +} from '../selectors/user.js'; +import { useEmojisActions as useEmojiActions } from '../ducks/emojis.js'; +import { useItemsActions } from '../ducks/items.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.js'; +import { useComposerActions } from '../ducks/composer.js'; +import { getTextFormattingEnabled } from '../selectors/items.js'; +import { getConversationSelector } from '../selectors/conversations.js'; export type SmartCompositionTextAreaProps = Pick< CompositionTextAreaProps, diff --git a/ts/state/smart/ConfirmAdditionsModal.tsx b/ts/state/smart/ConfirmAdditionsModal.tsx index 80e662411d7..ffdba437a1f 100644 --- a/ts/state/smart/ConfirmAdditionsModal.tsx +++ b/ts/state/smart/ConfirmAdditionsModal.tsx @@ -2,11 +2,11 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo, useMemo } from 'react'; import { useSelector } from 'react-redux'; -import { strictAssert } from '../../util/assert'; -import { ConfirmAdditionsModal } from '../../components/conversation/conversation-details/AddGroupMembersModal/ConfirmAdditionsModal'; -import type { RequestState } from '../../components/conversation/conversation-details/util'; -import { getIntl } from '../selectors/user'; -import { getConversationByIdSelector } from '../selectors/conversations'; +import { strictAssert } from '../../util/assert.js'; +import { ConfirmAdditionsModal } from '../../components/conversation/conversation-details/AddGroupMembersModal/ConfirmAdditionsModal.js'; +import type { RequestState } from '../../components/conversation/conversation-details/util.js'; +import { getIntl } from '../selectors/user.js'; +import { getConversationByIdSelector } from '../selectors/conversations.js'; export type SmartConfirmAdditionsModalPropsType = { selectedConversationIds: ReadonlyArray; diff --git a/ts/state/smart/ConfirmLeaveCallModal.tsx b/ts/state/smart/ConfirmLeaveCallModal.tsx index 6b239f11b2c..57be1ec8375 100644 --- a/ts/state/smart/ConfirmLeaveCallModal.tsx +++ b/ts/state/smart/ConfirmLeaveCallModal.tsx @@ -3,11 +3,11 @@ import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { useCallingActions } from '../ducks/calling'; -import { getIntl } from '../selectors/user'; -import { useGlobalModalActions } from '../ducks/globalModals'; -import { getConfirmLeaveCallModalState } from '../selectors/globalModals'; -import { ConfirmLeaveCallModal } from '../../components/ConfirmLeaveCallModal'; +import { useCallingActions } from '../ducks/calling.js'; +import { getIntl } from '../selectors/user.js'; +import { useGlobalModalActions } from '../ducks/globalModals.js'; +import { getConfirmLeaveCallModalState } from '../selectors/globalModals.js'; +import { ConfirmLeaveCallModal } from '../../components/ConfirmLeaveCallModal.js'; export const SmartConfirmLeaveCallModal = memo( function SmartConfirmLeaveCallModal(): JSX.Element | null { diff --git a/ts/state/smart/ContactDetail.tsx b/ts/state/smart/ContactDetail.tsx index 6ec915ca2bd..a3e188f4ef0 100644 --- a/ts/state/smart/ContactDetail.tsx +++ b/ts/state/smart/ContactDetail.tsx @@ -4,13 +4,13 @@ import React, { memo, useEffect } from 'react'; import { useSelector } from 'react-redux'; -import type { Props as ContactDetailProps } from '../../components/conversation/ContactDetail'; -import { ContactDetail } from '../../components/conversation/ContactDetail'; -import { useConversationsActions } from '../ducks/conversations'; -import { getMessages } from '../selectors/conversations'; -import { getIntl, getRegionCode } from '../selectors/user'; -import { embeddedContactSelector } from '../../types/EmbeddedContact'; -import { getAccountSelector } from '../selectors/accounts'; +import type { Props as ContactDetailProps } from '../../components/conversation/ContactDetail.js'; +import { ContactDetail } from '../../components/conversation/ContactDetail.js'; +import { useConversationsActions } from '../ducks/conversations.js'; +import { getMessages } from '../selectors/conversations.js'; +import { getIntl, getRegionCode } from '../selectors/user.js'; +import { embeddedContactSelector } from '../../types/EmbeddedContact.js'; +import { getAccountSelector } from '../selectors/accounts.js'; export type OwnProps = Pick; diff --git a/ts/state/smart/ContactModal.tsx b/ts/state/smart/ContactModal.tsx index 37b38a73e25..d98fa5e27fa 100644 --- a/ts/state/smart/ContactModal.tsx +++ b/ts/state/smart/ContactModal.tsx @@ -3,22 +3,22 @@ import React, { memo, useCallback, useMemo } from 'react'; import { useSelector } from 'react-redux'; -import { ContactModal } from '../../components/conversation/ContactModal'; -import { getAreWeASubscriber } from '../selectors/items'; -import { getIntl, getTheme } from '../selectors/user'; -import { getBadgesSelector } from '../selectors/badges'; -import { getConversationSelector } from '../selectors/conversations'; -import { getHasStoriesSelector } from '../selectors/stories2'; +import { ContactModal } from '../../components/conversation/ContactModal.js'; +import { getAreWeASubscriber } from '../selectors/items.js'; +import { getIntl, getTheme } from '../selectors/user.js'; +import { getBadgesSelector } from '../selectors/badges.js'; +import { getConversationSelector } from '../selectors/conversations.js'; +import { getHasStoriesSelector } from '../selectors/stories2.js'; import { getActiveCallState, isInFullScreenCall as getIsInFullScreenCall, -} from '../selectors/calling'; -import { useStoriesActions } from '../ducks/stories'; -import { useConversationsActions } from '../ducks/conversations'; -import { useGlobalModalActions } from '../ducks/globalModals'; -import { useCallingActions } from '../ducks/calling'; -import { getContactModalState } from '../selectors/globalModals'; -import { strictAssert } from '../../util/assert'; +} from '../selectors/calling.js'; +import { useStoriesActions } from '../ducks/stories.js'; +import { useConversationsActions } from '../ducks/conversations.js'; +import { useGlobalModalActions } from '../ducks/globalModals.js'; +import { useCallingActions } from '../ducks/calling.js'; +import { getContactModalState } from '../selectors/globalModals.js'; +import { strictAssert } from '../../util/assert.js'; export const SmartContactModal = memo(function SmartContactModal() { const i18n = useSelector(getIntl); diff --git a/ts/state/smart/ContactName.tsx b/ts/state/smart/ContactName.tsx index f66e43f3db5..0a082129d24 100644 --- a/ts/state/smart/ContactName.tsx +++ b/ts/state/smart/ContactName.tsx @@ -2,13 +2,13 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo, useCallback, useMemo } from 'react'; import { useSelector } from 'react-redux'; -import { ContactName } from '../../components/conversation/ContactName'; -import { getIntl } from '../selectors/user'; +import { ContactName } from '../../components/conversation/ContactName.js'; +import { getIntl } from '../selectors/user.js'; import { getConversationSelector, getSelectedConversationId, -} from '../selectors/conversations'; -import { useGlobalModalActions } from '../ducks/globalModals'; +} from '../selectors/conversations.js'; +import { useGlobalModalActions } from '../ducks/globalModals.js'; type ExternalProps = { contactId: string; diff --git a/ts/state/smart/ContactSpoofingReviewDialog.tsx b/ts/state/smart/ContactSpoofingReviewDialog.tsx index 754d0c68507..1d14609e84e 100644 --- a/ts/state/smart/ContactSpoofingReviewDialog.tsx +++ b/ts/state/smart/ContactSpoofingReviewDialog.tsx @@ -4,26 +4,26 @@ import React, { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; import { mapValues } from 'lodash'; -import type { StateType } from '../reducer'; -import { ContactSpoofingReviewDialog } from '../../components/conversation/ContactSpoofingReviewDialog'; -import { useConversationsActions } from '../ducks/conversations'; +import type { StateType } from '../reducer.js'; +import { ContactSpoofingReviewDialog } from '../../components/conversation/ContactSpoofingReviewDialog.js'; +import { useConversationsActions } from '../ducks/conversations.js'; import { getConversationSelector, getConversationByServiceIdSelector, getSafeConversationWithSameTitle, -} from '../selectors/conversations'; -import { getOwn } from '../../util/getOwn'; -import { assertDev } from '../../util/assert'; -import { ContactSpoofingType } from '../../util/contactSpoofing'; -import { getGroupMemberships } from '../../util/getGroupMemberships'; -import { isSignalConnection } from '../../util/getSignalConnections'; +} from '../selectors/conversations.js'; +import { getOwn } from '../../util/getOwn.js'; +import { assertDev } from '../../util/assert.js'; +import { ContactSpoofingType } from '../../util/contactSpoofing.js'; +import { getGroupMemberships } from '../../util/getGroupMemberships.js'; +import { isSignalConnection } from '../../util/getSignalConnections.js'; import { getCollisionsFromMemberships, invertIdsByTitle, -} from '../../util/groupMemberNameCollisions'; -import { useGlobalModalActions } from '../ducks/globalModals'; -import { getPreferredBadgeSelector } from '../selectors/badges'; -import { getIntl, getTheme } from '../selectors/user'; +} from '../../util/groupMemberNameCollisions.js'; +import { useGlobalModalActions } from '../ducks/globalModals.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.js'; +import { getIntl, getTheme } from '../selectors/user.js'; export type PropsType = Readonly<{ conversationId: string; diff --git a/ts/state/smart/ConversationDetails.tsx b/ts/state/smart/ConversationDetails.tsx index 7f11ec81cb6..595c19e6a68 100644 --- a/ts/state/smart/ConversationDetails.tsx +++ b/ts/state/smart/ConversationDetails.tsx @@ -4,45 +4,45 @@ import { sortBy } from 'lodash'; import React, { memo, useCallback, useState, useEffect } from 'react'; import { useSelector } from 'react-redux'; -import { ConversationDetails } from '../../components/conversation/conversation-details/ConversationDetails'; +import { ConversationDetails } from '../../components/conversation/conversation-details/ConversationDetails.js'; import { getGroupSizeHardLimit, getGroupSizeRecommendedLimit, -} from '../../groups/limits'; -import { SignalService as Proto } from '../../protobuf'; -import type { CallHistoryGroup } from '../../types/CallDisposition'; -import { assertDev } from '../../util/assert'; -import { getConversationColorAttributes } from '../../util/getConversationColorAttributes'; -import { getGroupMemberships } from '../../util/getGroupMemberships'; +} from '../../groups/limits.js'; +import { SignalService as Proto } from '../../protobuf/index.js'; +import type { CallHistoryGroup } from '../../types/CallDisposition.js'; +import { assertDev } from '../../util/assert.js'; +import { getConversationColorAttributes } from '../../util/getConversationColorAttributes.js'; +import { getGroupMemberships } from '../../util/getGroupMemberships.js'; import { getBadgesSelector, getPreferredBadgeSelector, -} from '../selectors/badges'; -import { getActiveCallState } from '../selectors/calling'; +} from '../selectors/badges.js'; +import { getActiveCallState } from '../selectors/calling.js'; import { getAllComposableConversations, getConversationByIdSelector, getConversationByServiceIdSelector, getPendingAvatarDownloadSelector, -} from '../selectors/conversations'; +} from '../selectors/conversations.js'; import { getAreWeASubscriber, getDefaultConversationColor, -} from '../selectors/items'; -import { getSelectedNavTab } from '../selectors/nav'; -import { getIntl, getTheme } from '../selectors/user'; -import type { SmartChooseGroupMembersModalPropsType } from './ChooseGroupMembersModal'; -import { SmartChooseGroupMembersModal } from './ChooseGroupMembersModal'; -import type { SmartConfirmAdditionsModalPropsType } from './ConfirmAdditionsModal'; -import { SmartConfirmAdditionsModal } from './ConfirmAdditionsModal'; -import type { ConversationType } from '../ducks/conversations'; -import { useConversationsActions } from '../ducks/conversations'; -import { useCallingActions } from '../ducks/calling'; -import { useSearchActions } from '../ducks/search'; -import { useGlobalModalActions } from '../ducks/globalModals'; -import { isSignalConversation } from '../../util/isSignalConversation'; -import { drop } from '../../util/drop'; -import { DataReader } from '../../sql/Client'; +} from '../selectors/items.js'; +import { getSelectedNavTab } from '../selectors/nav.js'; +import { getIntl, getTheme } from '../selectors/user.js'; +import type { SmartChooseGroupMembersModalPropsType } from './ChooseGroupMembersModal.js'; +import { SmartChooseGroupMembersModal } from './ChooseGroupMembersModal.js'; +import type { SmartConfirmAdditionsModalPropsType } from './ConfirmAdditionsModal.js'; +import { SmartConfirmAdditionsModal } from './ConfirmAdditionsModal.js'; +import type { ConversationType } from '../ducks/conversations.js'; +import { useConversationsActions } from '../ducks/conversations.js'; +import { useCallingActions } from '../ducks/calling.js'; +import { useSearchActions } from '../ducks/search.js'; +import { useGlobalModalActions } from '../ducks/globalModals.js'; +import { isSignalConversation } from '../../util/isSignalConversation.js'; +import { drop } from '../../util/drop.js'; +import { DataReader } from '../../sql/Client.js'; export type SmartConversationDetailsProps = { conversationId: string; diff --git a/ts/state/smart/ConversationHeader.tsx b/ts/state/smart/ConversationHeader.tsx index 6745cf7433c..94a264ba1fa 100644 --- a/ts/state/smart/ConversationHeader.tsx +++ b/ts/state/smart/ConversationHeader.tsx @@ -3,48 +3,48 @@ import React, { memo, useCallback, useMemo } from 'react'; import { useSelector } from 'react-redux'; -import { useContactNameData } from '../../components/conversation/ContactName'; +import { useContactNameData } from '../../components/conversation/ContactName.js'; import { ConversationHeader, OutgoingCallButtonStyle, -} from '../../components/conversation/ConversationHeader'; -import { getCannotLeaveBecauseYouAreLastAdmin } from '../../components/conversation/conversation-details/ConversationDetails'; -import { useMinimalConversation } from '../../hooks/useMinimalConversation'; -import { CallMode } from '../../types/CallDisposition'; -import { PanelType } from '../../types/Panels'; -import { StoryViewModeType } from '../../types/Stories'; -import { strictAssert } from '../../util/assert'; -import { getAddedByForOurPendingInvitation } from '../../util/getAddedByForOurPendingInvitation'; -import { getGroupMemberships } from '../../util/getGroupMemberships'; -import { isConversationSMSOnly } from '../../util/isConversationSMSOnly'; -import { isGroupOrAdhocCallState } from '../../util/isGroupOrAdhocCall'; -import { isSignalConversation } from '../../util/isSignalConversation'; -import { missingCaseError } from '../../util/missingCaseError'; -import { useCallingActions } from '../ducks/calling'; -import { isAnybodyElseInGroupCall } from '../ducks/callingHelpers'; -import type { ConversationType } from '../ducks/conversations'; +} from '../../components/conversation/ConversationHeader.js'; +import { getCannotLeaveBecauseYouAreLastAdmin } from '../../components/conversation/conversation-details/ConversationDetails.js'; +import { useMinimalConversation } from '../../hooks/useMinimalConversation.js'; +import { CallMode } from '../../types/CallDisposition.js'; +import { PanelType } from '../../types/Panels.js'; +import { StoryViewModeType } from '../../types/Stories.js'; +import { strictAssert } from '../../util/assert.js'; +import { getAddedByForOurPendingInvitation } from '../../util/getAddedByForOurPendingInvitation.js'; +import { getGroupMemberships } from '../../util/getGroupMemberships.js'; +import { isConversationSMSOnly } from '../../util/isConversationSMSOnly.js'; +import { isGroupOrAdhocCallState } from '../../util/isGroupOrAdhocCall.js'; +import { isSignalConversation } from '../../util/isSignalConversation.js'; +import { missingCaseError } from '../../util/missingCaseError.js'; +import { useCallingActions } from '../ducks/calling.js'; +import { isAnybodyElseInGroupCall } from '../ducks/callingHelpers.js'; +import type { ConversationType } from '../ducks/conversations.js'; import { getConversationCallMode, useConversationsActions, -} from '../ducks/conversations'; -import { useSearchActions } from '../ducks/search'; -import { useStoriesActions } from '../ducks/stories'; -import { getPreferredBadgeSelector } from '../selectors/badges'; -import { getActiveCallState, getCallSelector } from '../selectors/calling'; +} from '../ducks/conversations.js'; +import { useSearchActions } from '../ducks/search.js'; +import { useStoriesActions } from '../ducks/stories.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.js'; +import { getActiveCallState, getCallSelector } from '../selectors/calling.js'; import { getConversationByServiceIdSelector, getConversationSelector, getHasPanelOpen, isMissingRequiredProfileSharing as getIsMissingRequiredProfileSharing, getSelectedMessageIds, -} from '../selectors/conversations'; -import { getHasStoriesSelector } from '../selectors/stories2'; -import { getIntl, getTheme, getUserACI } from '../selectors/user'; -import { useItemsActions } from '../ducks/items'; -import { getLocalDeleteWarningShown } from '../selectors/items'; -import { isConversationEverUnregistered } from '../../util/isConversationUnregistered'; -import { isDirectConversation } from '../../util/whatTypeOfConversation'; -import type { DurationInSeconds } from '../../util/durations'; +} from '../selectors/conversations.js'; +import { getHasStoriesSelector } from '../selectors/stories2.js'; +import { getIntl, getTheme, getUserACI } from '../selectors/user.js'; +import { useItemsActions } from '../ducks/items.js'; +import { getLocalDeleteWarningShown } from '../selectors/items.js'; +import { isConversationEverUnregistered } from '../../util/isConversationUnregistered.js'; +import { isDirectConversation } from '../../util/whatTypeOfConversation.js'; +import type { DurationInSeconds } from '../../util/durations/index.js'; export type OwnProps = { id: string; diff --git a/ts/state/smart/ConversationNotificationsSettings.tsx b/ts/state/smart/ConversationNotificationsSettings.tsx index 3cfadbbeea8..e26db336c90 100644 --- a/ts/state/smart/ConversationNotificationsSettings.tsx +++ b/ts/state/smart/ConversationNotificationsSettings.tsx @@ -3,11 +3,11 @@ import { useSelector } from 'react-redux'; import React, { memo } from 'react'; -import { ConversationNotificationsSettings } from '../../components/conversation/conversation-details/ConversationNotificationsSettings'; -import { getIntl } from '../selectors/user'; -import { getConversationByIdSelector } from '../selectors/conversations'; -import { strictAssert } from '../../util/assert'; -import { useConversationsActions } from '../ducks/conversations'; +import { ConversationNotificationsSettings } from '../../components/conversation/conversation-details/ConversationNotificationsSettings.js'; +import { getIntl } from '../selectors/user.js'; +import { getConversationByIdSelector } from '../selectors/conversations.js'; +import { strictAssert } from '../../util/assert.js'; +import { useConversationsActions } from '../ducks/conversations.js'; export type SmartConversationNotificationsSettingsProps = { conversationId: string; diff --git a/ts/state/smart/ConversationPanel.tsx b/ts/state/smart/ConversationPanel.tsx index be337b7e5f4..46bde0adca4 100644 --- a/ts/state/smart/ConversationPanel.tsx +++ b/ts/state/smart/ConversationPanel.tsx @@ -11,31 +11,31 @@ import React, { useState, } from 'react'; import { useSelector } from 'react-redux'; -import type { PanelRenderType } from '../../types/Panels'; -import { createLogger } from '../../logging/log'; -import { PanelType } from '../../types/Panels'; -import { toLogFormat } from '../../types/errors'; -import { SmartAllMedia } from './AllMedia'; -import { SmartChatColorPicker } from './ChatColorPicker'; -import { SmartContactDetail } from './ContactDetail'; -import { SmartConversationDetails } from './ConversationDetails'; -import { SmartConversationNotificationsSettings } from './ConversationNotificationsSettings'; -import { SmartGV1Members } from './GV1Members'; -import { SmartGroupLinkManagement } from './GroupLinkManagement'; -import { SmartGroupV2Permissions } from './GroupV2Permissions'; -import { SmartMessageDetail } from './MessageDetail'; -import { SmartPendingInvites } from './PendingInvites'; -import { SmartStickerManager } from './StickerManager'; -import { getConversationTitleForPanelType } from '../../util/getConversationTitleForPanelType'; -import { getIntl } from '../selectors/user'; +import type { PanelRenderType } from '../../types/Panels.js'; +import { createLogger } from '../../logging/log.js'; +import { PanelType } from '../../types/Panels.js'; +import { toLogFormat } from '../../types/errors.js'; +import { SmartAllMedia } from './AllMedia.js'; +import { SmartChatColorPicker } from './ChatColorPicker.js'; +import { SmartContactDetail } from './ContactDetail.js'; +import { SmartConversationDetails } from './ConversationDetails.js'; +import { SmartConversationNotificationsSettings } from './ConversationNotificationsSettings.js'; +import { SmartGV1Members } from './GV1Members.js'; +import { SmartGroupLinkManagement } from './GroupLinkManagement.js'; +import { SmartGroupV2Permissions } from './GroupV2Permissions.js'; +import { SmartMessageDetail } from './MessageDetail.js'; +import { SmartPendingInvites } from './PendingInvites.js'; +import { SmartStickerManager } from './StickerManager.js'; +import { getConversationTitleForPanelType } from '../../util/getConversationTitleForPanelType.js'; +import { getIntl } from '../selectors/user.js'; import { getPanelInformation, getWasPanelAnimated, -} from '../selectors/conversations'; -import { focusableSelector } from '../../util/focusableSelectors'; -import { missingCaseError } from '../../util/missingCaseError'; -import { useConversationsActions } from '../ducks/conversations'; -import { useReducedMotion } from '../../hooks/useReducedMotion'; +} from '../selectors/conversations.js'; +import { focusableSelector } from '../../util/focusableSelectors.js'; +import { missingCaseError } from '../../util/missingCaseError.js'; +import { useConversationsActions } from '../ducks/conversations.js'; +import { useReducedMotion } from '../../hooks/useReducedMotion.js'; const log = createLogger('ConversationPanel'); diff --git a/ts/state/smart/ConversationView.tsx b/ts/state/smart/ConversationView.tsx index f1a3e31e6f4..9d384e57e39 100644 --- a/ts/state/smart/ConversationView.tsx +++ b/ts/state/smart/ConversationView.tsx @@ -3,19 +3,19 @@ import React, { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; -import { ConversationPanel } from './ConversationPanel'; -import { ConversationView } from '../../components/conversation/ConversationView'; -import { SmartCompositionArea } from './CompositionArea'; -import { SmartConversationHeader } from './ConversationHeader'; -import { SmartTimeline } from './Timeline'; +import { ConversationPanel } from './ConversationPanel.js'; +import { ConversationView } from '../../components/conversation/ConversationView.js'; +import { SmartCompositionArea } from './CompositionArea.js'; +import { SmartConversationHeader } from './ConversationHeader.js'; +import { SmartTimeline } from './Timeline.js'; import { getActivePanel, getIsPanelAnimating, getSelectedMessageIds, -} from '../selectors/conversations'; -import { useComposerActions } from '../ducks/composer'; -import { useConversationsActions } from '../ducks/conversations'; -import { isShowingAnyModal } from '../selectors/globalModals'; +} from '../selectors/conversations.js'; +import { useComposerActions } from '../ducks/composer.js'; +import { useConversationsActions } from '../ducks/conversations.js'; +import { isShowingAnyModal } from '../selectors/globalModals.js'; function renderCompositionArea(conversationId: string) { return ; diff --git a/ts/state/smart/CrashReportDialog.tsx b/ts/state/smart/CrashReportDialog.tsx index 9177143a741..b9f5b243619 100644 --- a/ts/state/smart/CrashReportDialog.tsx +++ b/ts/state/smart/CrashReportDialog.tsx @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import { useSelector } from 'react-redux'; import React, { memo } from 'react'; -import { CrashReportDialog } from '../../components/CrashReportDialog'; -import { getIntl } from '../selectors/user'; -import { useCrashReportsActions } from '../ducks/crashReports'; -import { getCrashReportsIsPending } from '../selectors/crashReports'; +import { CrashReportDialog } from '../../components/CrashReportDialog.js'; +import { getIntl } from '../selectors/user.js'; +import { useCrashReportsActions } from '../ducks/crashReports.js'; +import { getCrashReportsIsPending } from '../selectors/crashReports.js'; export const SmartCrashReportDialog = memo(function SmartCrashReportDialog() { const i18n = useSelector(getIntl); diff --git a/ts/state/smart/CustomizingPreferredReactionsModal.tsx b/ts/state/smart/CustomizingPreferredReactionsModal.tsx index 374ee8f8a62..4bc74e831a0 100644 --- a/ts/state/smart/CustomizingPreferredReactionsModal.tsx +++ b/ts/state/smart/CustomizingPreferredReactionsModal.tsx @@ -2,14 +2,14 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { usePreferredReactionsActions } from '../ducks/preferredReactions'; -import { useItemsActions } from '../ducks/items'; -import { getIntl } from '../selectors/user'; -import { getEmojiSkinToneDefault } from '../selectors/items'; -import { useRecentEmojis } from '../selectors/emojis'; -import { getCustomizeModalState } from '../selectors/preferredReactions'; -import { CustomizingPreferredReactionsModal } from '../../components/CustomizingPreferredReactionsModal'; -import { strictAssert } from '../../util/assert'; +import { usePreferredReactionsActions } from '../ducks/preferredReactions.js'; +import { useItemsActions } from '../ducks/items.js'; +import { getIntl } from '../selectors/user.js'; +import { getEmojiSkinToneDefault } from '../selectors/items.js'; +import { useRecentEmojis } from '../selectors/emojis.js'; +import { getCustomizeModalState } from '../selectors/preferredReactions.js'; +import { CustomizingPreferredReactionsModal } from '../../components/CustomizingPreferredReactionsModal.js'; +import { strictAssert } from '../../util/assert.js'; export const SmartCustomizingPreferredReactionsModal = memo( function SmartCustomizingPreferredReactionsModal(): JSX.Element { diff --git a/ts/state/smart/DeleteMessagesModal.tsx b/ts/state/smart/DeleteMessagesModal.tsx index c7a15882b38..af3524c1ec9 100644 --- a/ts/state/smart/DeleteMessagesModal.tsx +++ b/ts/state/smart/DeleteMessagesModal.tsx @@ -3,22 +3,22 @@ import React, { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; -import type { StateType } from '../reducer'; -import { getIntl } from '../selectors/user'; -import { useGlobalModalActions } from '../ducks/globalModals'; -import DeleteMessagesModal from '../../components/DeleteMessagesModal'; -import { strictAssert } from '../../util/assert'; -import { canDeleteMessagesForEveryone } from '../selectors/message'; -import { useConversationsActions } from '../ducks/conversations'; -import { useToastActions } from '../ducks/toast'; +import type { StateType } from '../reducer.js'; +import { getIntl } from '../selectors/user.js'; +import { useGlobalModalActions } from '../ducks/globalModals.js'; +import DeleteMessagesModal from '../../components/DeleteMessagesModal.js'; +import { strictAssert } from '../../util/assert.js'; +import { canDeleteMessagesForEveryone } from '../selectors/message.js'; +import { useConversationsActions } from '../ducks/conversations.js'; +import { useToastActions } from '../ducks/toast.js'; import { getConversationSelector, getLastSelectedMessage, -} from '../selectors/conversations'; -import { getDeleteMessagesProps } from '../selectors/globalModals'; -import { useItemsActions } from '../ducks/items'; -import { getLocalDeleteWarningShown } from '../selectors/items'; -import { LocalDeleteWarningModal } from '../../components/LocalDeleteWarningModal'; +} from '../selectors/conversations.js'; +import { getDeleteMessagesProps } from '../selectors/globalModals.js'; +import { useItemsActions } from '../ducks/items.js'; +import { getLocalDeleteWarningShown } from '../selectors/items.js'; +import { LocalDeleteWarningModal } from '../../components/LocalDeleteWarningModal.js'; export const SmartDeleteMessagesModal = memo( function SmartDeleteMessagesModal() { diff --git a/ts/state/smart/DraftGifMessageSendModal.tsx b/ts/state/smart/DraftGifMessageSendModal.tsx index 9cf05011d4f..a6a501dc76a 100644 --- a/ts/state/smart/DraftGifMessageSendModal.tsx +++ b/ts/state/smart/DraftGifMessageSendModal.tsx @@ -2,26 +2,26 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo, useCallback, useEffect, useState } from 'react'; import { useSelector } from 'react-redux'; -import { getIntl, getTheme } from '../selectors/user'; -import type { DraftGifMessageSendModalProps } from '../../components/DraftGifMessageSendModal'; -import { DraftGifMessageSendModal } from '../../components/DraftGifMessageSendModal'; -import { strictAssert } from '../../util/assert'; -import type { HydratedBodyRangesType } from '../../types/BodyRange'; -import { SmartCompositionTextArea } from './CompositionTextArea'; -import { getDraftGifMessageSendModalProps } from '../selectors/globalModals'; -import { useGlobalModalActions } from '../ducks/globalModals'; -import { useComposerActions } from '../ducks/composer'; -import type { FunGifSelection } from '../../components/fun/panels/FunPanelGifs'; -import { tenorDownload } from '../../components/fun/data/tenor'; -import { drop } from '../../util/drop'; -import { processAttachment } from '../../util/processAttachment'; -import { SignalService as Proto } from '../../protobuf'; -import { writeDraftAttachment } from '../../util/writeDraftAttachment'; -import type { AttachmentDraftType } from '../../types/Attachment'; -import { createLogger } from '../../logging/log'; -import * as Errors from '../../types/errors'; -import { type Loadable, LoadingState } from '../../util/loadable'; -import { isAbortError } from '../../util/isAbortError'; +import { getIntl, getTheme } from '../selectors/user.js'; +import type { DraftGifMessageSendModalProps } from '../../components/DraftGifMessageSendModal.js'; +import { DraftGifMessageSendModal } from '../../components/DraftGifMessageSendModal.js'; +import { strictAssert } from '../../util/assert.js'; +import type { HydratedBodyRangesType } from '../../types/BodyRange.js'; +import { SmartCompositionTextArea } from './CompositionTextArea.js'; +import { getDraftGifMessageSendModalProps } from '../selectors/globalModals.js'; +import { useGlobalModalActions } from '../ducks/globalModals.js'; +import { useComposerActions } from '../ducks/composer.js'; +import type { FunGifSelection } from '../../components/fun/panels/FunPanelGifs.js'; +import { tenorDownload } from '../../components/fun/data/tenor.js'; +import { drop } from '../../util/drop.js'; +import { processAttachment } from '../../util/processAttachment.js'; +import { SignalService as Proto } from '../../protobuf/index.js'; +import { writeDraftAttachment } from '../../util/writeDraftAttachment.js'; +import type { AttachmentDraftType } from '../../types/Attachment.js'; +import { createLogger } from '../../logging/log.js'; +import * as Errors from '../../types/errors.js'; +import { type Loadable, LoadingState } from '../../util/loadable.js'; +import { isAbortError } from '../../util/isAbortError.js'; const log = createLogger('DraftGifMessageSendModal'); diff --git a/ts/state/smart/EditHistoryMessagesModal.tsx b/ts/state/smart/EditHistoryMessagesModal.tsx index 237842ab152..6ee7acec354 100644 --- a/ts/state/smart/EditHistoryMessagesModal.tsx +++ b/ts/state/smart/EditHistoryMessagesModal.tsx @@ -3,16 +3,16 @@ import React, { memo, useMemo } from 'react'; import { useSelector } from 'react-redux'; -import type { ReadonlyMessageAttributesType } from '../../model-types.d'; -import { EditHistoryMessagesModal } from '../../components/EditHistoryMessagesModal'; -import { getIntl, getPlatform } from '../selectors/user'; -import { getMessagePropsSelector } from '../selectors/message'; -import { getPreferredBadgeSelector } from '../selectors/badges'; -import { useConversationsActions } from '../ducks/conversations'; -import { useGlobalModalActions } from '../ducks/globalModals'; -import { useLightboxActions } from '../ducks/lightbox'; -import { strictAssert } from '../../util/assert'; -import { getEditHistoryMessages } from '../selectors/globalModals'; +import type { ReadonlyMessageAttributesType } from '../../model-types.d.ts'; +import { EditHistoryMessagesModal } from '../../components/EditHistoryMessagesModal.js'; +import { getIntl, getPlatform } from '../selectors/user.js'; +import { getMessagePropsSelector } from '../selectors/message.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.js'; +import { useConversationsActions } from '../ducks/conversations.js'; +import { useGlobalModalActions } from '../ducks/globalModals.js'; +import { useLightboxActions } from '../ducks/lightbox.js'; +import { strictAssert } from '../../util/assert.js'; +import { getEditHistoryMessages } from '../selectors/globalModals.js'; export const SmartEditHistoryMessagesModal = memo( function SmartEditHistoryMessagesModal(): JSX.Element { diff --git a/ts/state/smart/EditNicknameAndNoteModal.tsx b/ts/state/smart/EditNicknameAndNoteModal.tsx index 15e961df70c..53a6f83459c 100644 --- a/ts/state/smart/EditNicknameAndNoteModal.tsx +++ b/ts/state/smart/EditNicknameAndNoteModal.tsx @@ -2,14 +2,14 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; -import { getConversationSelector } from '../selectors/conversations'; -import { getEditNicknameAndNoteModalProps } from '../selectors/globalModals'; -import { strictAssert } from '../../util/assert'; -import { EditNicknameAndNoteModal } from '../../components/EditNicknameAndNoteModal'; -import { getIntl } from '../selectors/user'; -import { useGlobalModalActions } from '../ducks/globalModals'; -import type { NicknameAndNote } from '../ducks/conversations'; -import { useConversationsActions } from '../ducks/conversations'; +import { getConversationSelector } from '../selectors/conversations.js'; +import { getEditNicknameAndNoteModalProps } from '../selectors/globalModals.js'; +import { strictAssert } from '../../util/assert.js'; +import { EditNicknameAndNoteModal } from '../../components/EditNicknameAndNoteModal.js'; +import { getIntl } from '../selectors/user.js'; +import { useGlobalModalActions } from '../ducks/globalModals.js'; +import type { NicknameAndNote } from '../ducks/conversations.js'; +import { useConversationsActions } from '../ducks/conversations.js'; export const SmartEditNicknameAndNoteModal = memo( function SmartEditNicknameAndNoteModal(): JSX.Element { diff --git a/ts/state/smart/EmojiPicker.tsx b/ts/state/smart/EmojiPicker.tsx index 3f346e955ee..ed80245db1c 100644 --- a/ts/state/smart/EmojiPicker.tsx +++ b/ts/state/smart/EmojiPicker.tsx @@ -3,16 +3,16 @@ import React, { useCallback, forwardRef, memo } from 'react'; import { useSelector } from 'react-redux'; -import { useRecentEmojis } from '../selectors/emojis'; -import { useEmojisActions as useEmojiActions } from '../ducks/emojis'; +import { useRecentEmojis } from '../selectors/emojis.js'; +import { useEmojisActions as useEmojiActions } from '../ducks/emojis.js'; import type { EmojiPickDataType, Props as EmojiPickerProps, -} from '../../components/emoji/EmojiPicker'; -import { EmojiPicker } from '../../components/emoji/EmojiPicker'; -import { getIntl } from '../selectors/user'; -import { getEmojiSkinToneDefault } from '../selectors/items'; -import { EmojiSkinTone } from '../../components/fun/data/emojis'; +} from '../../components/emoji/EmojiPicker.js'; +import { EmojiPicker } from '../../components/emoji/EmojiPicker.js'; +import { getIntl } from '../selectors/user.js'; +import { getEmojiSkinToneDefault } from '../selectors/items.js'; +import { EmojiSkinTone } from '../../components/fun/data/emojis.js'; export const SmartEmojiPicker = memo( forwardRef< diff --git a/ts/state/smart/ForwardMessagesModal.tsx b/ts/state/smart/ForwardMessagesModal.tsx index 710ab3f168f..be758b1095b 100644 --- a/ts/state/smart/ForwardMessagesModal.tsx +++ b/ts/state/smart/ForwardMessagesModal.tsx @@ -3,33 +3,33 @@ import React, { useCallback, useState } from 'react'; import { useSelector } from 'react-redux'; -import type { ForwardMessagesPropsType } from '../ducks/globalModals'; -import { createLogger } from '../../logging/log'; -import { ForwardMessagesModal } from '../../components/ForwardMessagesModal'; -import { LinkPreviewSourceType } from '../../types/LinkPreview'; -import * as Errors from '../../types/errors'; -import { getAllComposableConversations } from '../selectors/conversations'; -import { getIntl, getTheme, getRegionCode } from '../selectors/user'; -import { getLinkPreview } from '../selectors/linkPreviews'; -import { isInFullScreenCall as getIsInFullScreenCall } from '../selectors/calling'; -import { getPreferredBadgeSelector } from '../selectors/badges'; -import { maybeForwardMessages } from '../../util/maybeForwardMessages'; +import type { ForwardMessagesPropsType } from '../ducks/globalModals.js'; +import { createLogger } from '../../logging/log.js'; +import { ForwardMessagesModal } from '../../components/ForwardMessagesModal.js'; +import { LinkPreviewSourceType } from '../../types/LinkPreview.js'; +import * as Errors from '../../types/errors.js'; +import { getAllComposableConversations } from '../selectors/conversations.js'; +import { getIntl, getTheme, getRegionCode } from '../selectors/user.js'; +import { getLinkPreview } from '../selectors/linkPreviews.js'; +import { isInFullScreenCall as getIsInFullScreenCall } from '../selectors/calling.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.js'; +import { maybeForwardMessages } from '../../util/maybeForwardMessages.js'; import { maybeGrabLinkPreview, resetLinkPreview, -} from '../../services/LinkPreview'; -import { useGlobalModalActions } from '../ducks/globalModals'; -import { useLinkPreviewActions } from '../ducks/linkPreviews'; -import { SmartCompositionTextArea } from './CompositionTextArea'; -import { useToastActions } from '../ducks/toast'; -import { isDownloaded } from '../../types/Attachment'; -import { getMessageById } from '../../messages/getMessageById'; -import { strictAssert } from '../../util/assert'; +} from '../../services/LinkPreview.js'; +import { useGlobalModalActions } from '../ducks/globalModals.js'; +import { useLinkPreviewActions } from '../ducks/linkPreviews.js'; +import { SmartCompositionTextArea } from './CompositionTextArea.js'; +import { useToastActions } from '../ducks/toast.js'; +import { isDownloaded } from '../../types/Attachment.js'; +import { getMessageById } from '../../messages/getMessageById.js'; +import { strictAssert } from '../../util/assert.js'; import type { ForwardMessageData, MessageForwardDraft, -} from '../../types/ForwardDraft'; -import { getForwardMessagesProps } from '../selectors/globalModals'; +} from '../../types/ForwardDraft.js'; +import { getForwardMessagesProps } from '../selectors/globalModals.js'; const log = createLogger('ForwardMessagesModal'); diff --git a/ts/state/smart/FunProvider.tsx b/ts/state/smart/FunProvider.tsx index 153399940c4..fdd2443dda7 100644 --- a/ts/state/smart/FunProvider.tsx +++ b/ts/state/smart/FunProvider.tsx @@ -4,37 +4,37 @@ import type { ReactNode } from 'react'; import React, { memo, useCallback, useMemo } from 'react'; import { useSelector } from 'react-redux'; -import { FunProvider } from '../../components/fun/FunProvider'; -import { getIntl } from '../selectors/user'; -import { selectRecentEmojis } from '../selectors/emojis'; -import type { FunGifSelection } from '../../components/fun/panels/FunPanelGifs'; +import { FunProvider } from '../../components/fun/FunProvider.js'; +import { getIntl } from '../selectors/user.js'; +import { selectRecentEmojis } from '../selectors/emojis.js'; +import type { FunGifSelection } from '../../components/fun/panels/FunPanelGifs.js'; import { getInstalledStickerPacks, getRecentStickers, -} from '../selectors/stickers'; -import { strictAssert } from '../../util/assert'; -import type { EmojiSkinTone } from '../../components/fun/data/emojis'; +} from '../selectors/stickers.js'; +import { strictAssert } from '../../util/assert.js'; +import type { EmojiSkinTone } from '../../components/fun/data/emojis.js'; import { getEmojiParentKeyByEnglishShortName, isEmojiEnglishShortName, -} from '../../components/fun/data/emojis'; +} from '../../components/fun/data/emojis.js'; import { getEmojiSkinToneDefault, getShowStickerPickerHint, -} from '../selectors/items'; -import { useItemsActions } from '../ducks/items'; -import { useGifsActions } from '../ducks/gifs'; +} from '../selectors/items.js'; +import { useItemsActions } from '../ducks/items.js'; +import { useGifsActions } from '../ducks/gifs.js'; import { fetchGifsFeatured, fetchGifsSearch, -} from '../../components/fun/data/gifs'; -import { tenorDownload } from '../../components/fun/data/tenor'; -import { usePreferredReactionsActions } from '../ducks/preferredReactions'; -import { useEmojisActions } from '../ducks/emojis'; -import { useStickersActions } from '../ducks/stickers'; -import type { FunStickerSelection } from '../../components/fun/panels/FunPanelStickers'; -import type { FunEmojiSelection } from '../../components/fun/panels/FunPanelEmojis'; -import { getRecentGifs } from '../selectors/gifs'; +} from '../../components/fun/data/gifs.js'; +import { tenorDownload } from '../../components/fun/data/tenor.js'; +import { usePreferredReactionsActions } from '../ducks/preferredReactions.js'; +import { useEmojisActions } from '../ducks/emojis.js'; +import { useStickersActions } from '../ducks/stickers.js'; +import type { FunStickerSelection } from '../../components/fun/panels/FunPanelStickers.js'; +import type { FunEmojiSelection } from '../../components/fun/panels/FunPanelEmojis.js'; +import { getRecentGifs } from '../selectors/gifs.js'; export type SmartFunProviderProps = Readonly<{ children: ReactNode; diff --git a/ts/state/smart/GV1Members.tsx b/ts/state/smart/GV1Members.tsx index 115fb8a1126..d3b3f017dc0 100644 --- a/ts/state/smart/GV1Members.tsx +++ b/ts/state/smart/GV1Members.tsx @@ -4,16 +4,16 @@ import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { ConversationDetailsMembershipList } from '../../components/conversation/conversation-details/ConversationDetailsMembershipList'; -import { assertDev } from '../../util/assert'; -import { getGroupMemberships } from '../../util/getGroupMemberships'; +import { ConversationDetailsMembershipList } from '../../components/conversation/conversation-details/ConversationDetailsMembershipList.js'; +import { assertDev } from '../../util/assert.js'; +import { getGroupMemberships } from '../../util/getGroupMemberships.js'; import { getConversationByIdSelector, getConversationByServiceIdSelector, -} from '../selectors/conversations'; -import { getIntl, getTheme } from '../selectors/user'; -import { getPreferredBadgeSelector } from '../selectors/badges'; -import { useGlobalModalActions } from '../ducks/globalModals'; +} from '../selectors/conversations.js'; +import { getIntl, getTheme } from '../selectors/user.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.js'; +import { useGlobalModalActions } from '../ducks/globalModals.js'; export type PropsType = { conversationId: string; diff --git a/ts/state/smart/GlobalModalContainer.tsx b/ts/state/smart/GlobalModalContainer.tsx index 00188e42fb5..089514263da 100644 --- a/ts/state/smart/GlobalModalContainer.tsx +++ b/ts/state/smart/GlobalModalContainer.tsx @@ -3,35 +3,35 @@ import React, { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; -import type { ButtonVariant } from '../../components/Button'; -import { ErrorModal } from '../../components/ErrorModal'; -import { GlobalModalContainer } from '../../components/GlobalModalContainer'; -import { SmartAboutContactModal } from './AboutContactModal'; -import { SmartAddUserToAnotherGroupModal } from './AddUserToAnotherGroupModal'; -import { SmartContactModal } from './ContactModal'; -import { SmartEditHistoryMessagesModal } from './EditHistoryMessagesModal'; -import { SmartForwardMessagesModal } from './ForwardMessagesModal'; -import { SmartUsernameOnboardingModal } from './UsernameOnboardingModal'; -import { SmartSafetyNumberModal } from './SafetyNumberModal'; -import { SmartSendAnywayDialog } from './SendAnywayDialog'; -import { SmartShortcutGuideModal } from './ShortcutGuideModal'; -import { SmartStickerPreviewModal } from './StickerPreviewModal'; -import { SmartStoriesSettingsModal } from './StoriesSettingsModal'; -import { getConversationsStoppingSend } from '../selectors/conversations'; -import { getIntl, getTheme } from '../selectors/user'; -import { useGlobalModalActions } from '../ducks/globalModals'; -import { SmartDeleteMessagesModal } from './DeleteMessagesModal'; -import { SmartMessageRequestActionsConfirmation } from './MessageRequestActionsConfirmation'; -import { getGlobalModalsState } from '../selectors/globalModals'; -import { SmartEditNicknameAndNoteModal } from './EditNicknameAndNoteModal'; -import { SmartNotePreviewModal } from './NotePreviewModal'; -import { SmartCallLinkEditModal } from './CallLinkEditModal'; -import { SmartCallLinkAddNameModal } from './CallLinkAddNameModal'; -import { SmartConfirmLeaveCallModal } from './ConfirmLeaveCallModal'; -import { SmartCallLinkPendingParticipantModal } from './CallLinkPendingParticipantModal'; -import { SmartProfileNameWarningModal } from './ProfileNameWarningModal'; -import { SmartDraftGifMessageSendModal } from './DraftGifMessageSendModal'; -import { DebugLogErrorModal } from '../../components/DebugLogErrorModal'; +import type { ButtonVariant } from '../../components/Button.js'; +import { ErrorModal } from '../../components/ErrorModal.js'; +import { GlobalModalContainer } from '../../components/GlobalModalContainer.js'; +import { SmartAboutContactModal } from './AboutContactModal.js'; +import { SmartAddUserToAnotherGroupModal } from './AddUserToAnotherGroupModal.js'; +import { SmartContactModal } from './ContactModal.js'; +import { SmartEditHistoryMessagesModal } from './EditHistoryMessagesModal.js'; +import { SmartForwardMessagesModal } from './ForwardMessagesModal.js'; +import { SmartUsernameOnboardingModal } from './UsernameOnboardingModal.js'; +import { SmartSafetyNumberModal } from './SafetyNumberModal.js'; +import { SmartSendAnywayDialog } from './SendAnywayDialog.js'; +import { SmartShortcutGuideModal } from './ShortcutGuideModal.js'; +import { SmartStickerPreviewModal } from './StickerPreviewModal.js'; +import { SmartStoriesSettingsModal } from './StoriesSettingsModal.js'; +import { getConversationsStoppingSend } from '../selectors/conversations.js'; +import { getIntl, getTheme } from '../selectors/user.js'; +import { useGlobalModalActions } from '../ducks/globalModals.js'; +import { SmartDeleteMessagesModal } from './DeleteMessagesModal.js'; +import { SmartMessageRequestActionsConfirmation } from './MessageRequestActionsConfirmation.js'; +import { getGlobalModalsState } from '../selectors/globalModals.js'; +import { SmartEditNicknameAndNoteModal } from './EditNicknameAndNoteModal.js'; +import { SmartNotePreviewModal } from './NotePreviewModal.js'; +import { SmartCallLinkEditModal } from './CallLinkEditModal.js'; +import { SmartCallLinkAddNameModal } from './CallLinkAddNameModal.js'; +import { SmartConfirmLeaveCallModal } from './ConfirmLeaveCallModal.js'; +import { SmartCallLinkPendingParticipantModal } from './CallLinkPendingParticipantModal.js'; +import { SmartProfileNameWarningModal } from './ProfileNameWarningModal.js'; +import { SmartDraftGifMessageSendModal } from './DraftGifMessageSendModal.js'; +import { DebugLogErrorModal } from '../../components/DebugLogErrorModal.js'; function renderCallLinkAddNameModal(): JSX.Element { return ; diff --git a/ts/state/smart/GroupLinkManagement.tsx b/ts/state/smart/GroupLinkManagement.tsx index faca0a1f674..d4d725fd9d4 100644 --- a/ts/state/smart/GroupLinkManagement.tsx +++ b/ts/state/smart/GroupLinkManagement.tsx @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { GroupLinkManagement } from '../../components/conversation/conversation-details/GroupLinkManagement'; -import { getConversationSelector } from '../selectors/conversations'; -import { getIntl } from '../selectors/user'; -import { useConversationsActions } from '../ducks/conversations'; +import { GroupLinkManagement } from '../../components/conversation/conversation-details/GroupLinkManagement.js'; +import { getConversationSelector } from '../selectors/conversations.js'; +import { getIntl } from '../selectors/user.js'; +import { useConversationsActions } from '../ducks/conversations.js'; export type SmartGroupLinkManagementProps = Readonly<{ conversationId: string; diff --git a/ts/state/smart/GroupV1MigrationDialog.tsx b/ts/state/smart/GroupV1MigrationDialog.tsx index d4deb753b10..6042eecd086 100644 --- a/ts/state/smart/GroupV1MigrationDialog.tsx +++ b/ts/state/smart/GroupV1MigrationDialog.tsx @@ -2,14 +2,14 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo, useCallback, useMemo } from 'react'; import { useSelector } from 'react-redux'; -import type { DataPropsType as GroupV1MigrationDialogPropsType } from '../../components/GroupV1MigrationDialog'; -import { GroupV1MigrationDialog } from '../../components/GroupV1MigrationDialog'; -import { useConversationsActions } from '../ducks/conversations'; -import { getPreferredBadgeSelector } from '../selectors/badges'; -import { getConversationSelector } from '../selectors/conversations'; -import { getIntl, getTheme } from '../selectors/user'; -import { createLogger } from '../../logging/log'; -import { useGlobalModalActions } from '../ducks/globalModals'; +import type { DataPropsType as GroupV1MigrationDialogPropsType } from '../../components/GroupV1MigrationDialog.js'; +import { GroupV1MigrationDialog } from '../../components/GroupV1MigrationDialog.js'; +import { useConversationsActions } from '../ducks/conversations.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.js'; +import { getConversationSelector } from '../selectors/conversations.js'; +import { getIntl, getTheme } from '../selectors/user.js'; +import { createLogger } from '../../logging/log.js'; +import { useGlobalModalActions } from '../ducks/globalModals.js'; const log = createLogger('GroupV1MigrationDialog'); diff --git a/ts/state/smart/GroupV2JoinDialog.tsx b/ts/state/smart/GroupV2JoinDialog.tsx index 4b5e431a61a..7a51dd4d247 100644 --- a/ts/state/smart/GroupV2JoinDialog.tsx +++ b/ts/state/smart/GroupV2JoinDialog.tsx @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import type { PropsType as GroupV2JoinDialogPropsType } from '../../components/GroupV2JoinDialog'; -import { GroupV2JoinDialog } from '../../components/GroupV2JoinDialog'; -import { getIntl } from '../selectors/user'; -import { getPreJoinConversation } from '../selectors/conversations'; +import type { PropsType as GroupV2JoinDialogPropsType } from '../../components/GroupV2JoinDialog.js'; +import { GroupV2JoinDialog } from '../../components/GroupV2JoinDialog.js'; +import { getIntl } from '../selectors/user.js'; +import { getPreJoinConversation } from '../selectors/conversations.js'; export type SmartGroupV2JoinDialogProps = Pick< GroupV2JoinDialogPropsType, diff --git a/ts/state/smart/GroupV2Permissions.tsx b/ts/state/smart/GroupV2Permissions.tsx index caf878523f2..5f13ed0ac16 100644 --- a/ts/state/smart/GroupV2Permissions.tsx +++ b/ts/state/smart/GroupV2Permissions.tsx @@ -3,10 +3,10 @@ import { useSelector } from 'react-redux'; import React, { memo } from 'react'; -import { GroupV2Permissions } from '../../components/conversation/conversation-details/GroupV2Permissions'; -import { getConversationSelector } from '../selectors/conversations'; -import { getIntl } from '../selectors/user'; -import { useConversationsActions } from '../ducks/conversations'; +import { GroupV2Permissions } from '../../components/conversation/conversation-details/GroupV2Permissions.js'; +import { getConversationSelector } from '../selectors/conversations.js'; +import { getIntl } from '../selectors/user.js'; +import { useConversationsActions } from '../ducks/conversations.js'; export type SmartGroupV2PermissionsProps = { conversationId: string; diff --git a/ts/state/smart/HeroRow.tsx b/ts/state/smart/HeroRow.tsx index 47f852410ad..7e0f7a6bef5 100644 --- a/ts/state/smart/HeroRow.tsx +++ b/ts/state/smart/HeroRow.tsx @@ -2,25 +2,25 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; -import { PanelType } from '../../types/Panels'; -import { ConversationHero } from '../../components/conversation/ConversationHero'; -import { getPreferredBadgeSelector } from '../selectors/badges'; -import { getIntl, getTheme } from '../selectors/user'; -import { getHasStoriesSelector } from '../selectors/stories2'; -import { isSignalConversation } from '../../util/isSignalConversation'; +import { PanelType } from '../../types/Panels.js'; +import { ConversationHero } from '../../components/conversation/ConversationHero.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.js'; +import { getIntl, getTheme } from '../selectors/user.js'; +import { getHasStoriesSelector } from '../selectors/stories2.js'; +import { isSignalConversation } from '../../util/isSignalConversation.js'; import { getConversationByServiceIdSelector, getConversationSelector, getPendingAvatarDownloadSelector, -} from '../selectors/conversations'; +} from '../selectors/conversations.js'; import { type ConversationType, useConversationsActions, -} from '../ducks/conversations'; -import { useGlobalModalActions } from '../ducks/globalModals'; -import { useStoriesActions } from '../ducks/stories'; -import { getAddedByForOurPendingInvitation } from '../../util/getAddedByForOurPendingInvitation'; -import { getGroupMemberships } from '../../util/getGroupMemberships'; +} from '../ducks/conversations.js'; +import { useGlobalModalActions } from '../ducks/globalModals.js'; +import { useStoriesActions } from '../ducks/stories.js'; +import { getAddedByForOurPendingInvitation } from '../../util/getAddedByForOurPendingInvitation.js'; +import { getGroupMemberships } from '../../util/getGroupMemberships.js'; type SmartHeroRowProps = Readonly<{ id: string; diff --git a/ts/state/smart/Inbox.tsx b/ts/state/smart/Inbox.tsx index 073fdf6cc84..26de8ec93a5 100644 --- a/ts/state/smart/Inbox.tsx +++ b/ts/state/smart/Inbox.tsx @@ -3,24 +3,24 @@ import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { Inbox } from '../../components/Inbox'; -import { isNightly } from '../../util/version'; -import { getIntl } from '../selectors/user'; -import { SmartCustomizingPreferredReactionsModal } from './CustomizingPreferredReactionsModal'; -import { getIsCustomizingPreferredReactions } from '../selectors/preferredReactions'; -import type { SmartNavTabsProps } from './NavTabs'; -import { SmartNavTabs } from './NavTabs'; -import { SmartStoriesTab } from './StoriesTab'; -import { SmartCallsTab } from './CallsTab'; -import { useItemsActions } from '../ducks/items'; -import { getNavTabsCollapsed } from '../selectors/items'; -import { SmartChatsTab } from './ChatsTab'; -import { getHasInitialLoadCompleted } from '../selectors/app'; +import { Inbox } from '../../components/Inbox.js'; +import { isNightly } from '../../util/version.js'; +import { getIntl } from '../selectors/user.js'; +import { SmartCustomizingPreferredReactionsModal } from './CustomizingPreferredReactionsModal.js'; +import { getIsCustomizingPreferredReactions } from '../selectors/preferredReactions.js'; +import type { SmartNavTabsProps } from './NavTabs.js'; +import { SmartNavTabs } from './NavTabs.js'; +import { SmartStoriesTab } from './StoriesTab.js'; +import { SmartCallsTab } from './CallsTab.js'; +import { useItemsActions } from '../ducks/items.js'; +import { getNavTabsCollapsed } from '../selectors/items.js'; +import { SmartChatsTab } from './ChatsTab.js'; +import { getHasInitialLoadCompleted } from '../selectors/app.js'; import { getInboxEnvelopeTimestamp, getInboxFirstEnvelopeTimestamp, -} from '../selectors/inbox'; -import { SmartPreferences } from './Preferences'; +} from '../selectors/inbox.js'; +import { SmartPreferences } from './Preferences.js'; function renderChatsTab() { return ; diff --git a/ts/state/smart/InstallScreen.tsx b/ts/state/smart/InstallScreen.tsx index f4a958c4a8a..5c5b0ac4775 100644 --- a/ts/state/smart/InstallScreen.tsx +++ b/ts/state/smart/InstallScreen.tsx @@ -5,21 +5,21 @@ import type { ComponentProps } from 'react'; import React, { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; -import { getIntl } from '../selectors/user'; -import { getUpdatesState } from '../selectors/updates'; -import { getInstallerState } from '../selectors/installer'; -import { useInstallerActions } from '../ducks/installer'; -import { useUpdatesActions } from '../ducks/updates'; -import { hasExpired as hasExpiredSelector } from '../selectors/expiration'; -import { missingCaseError } from '../../util/missingCaseError'; -import { backupsService } from '../../services/backups'; -import { InstallScreen } from '../../components/InstallScreen'; -import { WidthBreakpoint } from '../../components/_util'; -import { InstallScreenStep } from '../../types/InstallScreen'; -import OS from '../../util/os/osMain'; -import { isStagingServer } from '../../util/isStagingServer'; -import { createLogger } from '../../logging/log'; -import { SmartToastManager } from './ToastManager'; +import { getIntl } from '../selectors/user.js'; +import { getUpdatesState } from '../selectors/updates.js'; +import { getInstallerState } from '../selectors/installer.js'; +import { useInstallerActions } from '../ducks/installer.js'; +import { useUpdatesActions } from '../ducks/updates.js'; +import { hasExpired as hasExpiredSelector } from '../selectors/expiration.js'; +import { missingCaseError } from '../../util/missingCaseError.js'; +import { backupsService } from '../../services/backups/index.js'; +import { InstallScreen } from '../../components/InstallScreen.js'; +import { WidthBreakpoint } from '../../components/_util.js'; +import { InstallScreenStep } from '../../types/InstallScreen.js'; +import OS from '../../util/os/osMain.js'; +import { isStagingServer } from '../../util/isStagingServer.js'; +import { createLogger } from '../../logging/log.js'; +import { SmartToastManager } from './ToastManager.js'; const log = createLogger('InstallScreen'); diff --git a/ts/state/smart/LeftPane.tsx b/ts/state/smart/LeftPane.tsx index c6f8dfec158..f983f397383 100644 --- a/ts/state/smart/LeftPane.tsx +++ b/ts/state/smart/LeftPane.tsx @@ -3,33 +3,36 @@ import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import type { PropsType as DialogExpiredBuildPropsType } from '../../components/DialogExpiredBuild'; -import { DialogExpiredBuild } from '../../components/DialogExpiredBuild'; -import type { PropsType as LeftPanePropsType } from '../../components/LeftPane'; -import { LeftPane } from '../../components/LeftPane'; -import type { NavTabPanelProps } from '../../components/NavTabs'; -import type { WidthBreakpoint } from '../../components/_util'; +import type { PropsType as DialogExpiredBuildPropsType } from '../../components/DialogExpiredBuild.js'; +import { DialogExpiredBuild } from '../../components/DialogExpiredBuild.js'; +import type { PropsType as LeftPanePropsType } from '../../components/LeftPane.js'; +import { LeftPane } from '../../components/LeftPane.js'; +import type { NavTabPanelProps } from '../../components/NavTabs.js'; +import type { WidthBreakpoint } from '../../components/_util.js'; import { getGroupSizeHardLimit, getGroupSizeRecommendedLimit, -} from '../../groups/limits'; -import { LeftPaneMode } from '../../types/leftPane'; -import { getUsernameFromSearch } from '../../util/Username'; -import { getCountryDataForLocale } from '../../util/getCountryData'; -import { lookupConversationWithoutServiceId } from '../../util/lookupConversationWithoutServiceId'; -import { missingCaseError } from '../../util/missingCaseError'; -import { isDone as isRegistrationDone } from '../../util/registration'; -import { drop } from '../../util/drop'; -import { useCallingActions } from '../ducks/calling'; -import { useConversationsActions } from '../ducks/conversations'; -import { ComposerStep, OneTimeModalState } from '../ducks/conversationsEnums'; -import { useGlobalModalActions } from '../ducks/globalModals'; -import { useItemsActions } from '../ducks/items'; -import { useNetworkActions } from '../ducks/network'; -import { useSearchActions } from '../ducks/search'; -import { useUsernameActions } from '../ducks/username'; -import type { StateType } from '../reducer'; -import { getPreferredBadgeSelector } from '../selectors/badges'; +} from '../../groups/limits.js'; +import { LeftPaneMode } from '../../types/leftPane.js'; +import { getUsernameFromSearch } from '../../util/Username.js'; +import { getCountryDataForLocale } from '../../util/getCountryData.js'; +import { lookupConversationWithoutServiceId } from '../../util/lookupConversationWithoutServiceId.js'; +import { missingCaseError } from '../../util/missingCaseError.js'; +import { isDone as isRegistrationDone } from '../../util/registration.js'; +import { drop } from '../../util/drop.js'; +import { useCallingActions } from '../ducks/calling.js'; +import { useConversationsActions } from '../ducks/conversations.js'; +import { + ComposerStep, + OneTimeModalState, +} from '../ducks/conversationsEnums.js'; +import { useGlobalModalActions } from '../ducks/globalModals.js'; +import { useItemsActions } from '../ducks/items.js'; +import { useNetworkActions } from '../ducks/network.js'; +import { useSearchActions } from '../ducks/search.js'; +import { useUsernameActions } from '../ducks/username.js'; +import type { StateType } from '../reducer.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.js'; import { getComposeAvatarData, getComposeGroupAvatar, @@ -53,9 +56,9 @@ import { hasGroupCreationError, isCreatingGroup, isEditingAvatar, -} from '../selectors/conversations'; -import { getCrashReportCount } from '../selectors/crashReports'; -import { hasExpired } from '../selectors/expiration'; +} from '../selectors/conversations.js'; +import { getCrashReportCount } from '../selectors/crashReports.js'; +import { hasExpired } from '../selectors/expiration.js'; import { getBackupMediaDownloadProgress, getNavTabsCollapsed, @@ -63,12 +66,12 @@ import { getServerAlerts, getUsernameCorrupted, getUsernameLinkCorrupted, -} from '../selectors/items'; +} from '../selectors/items.js'; import { getChallengeStatus, hasNetworkDialog as getHasNetworkDialog, getNetworkIsOnline, -} from '../selectors/network'; +} from '../selectors/network.js'; import { getFilterByUnread, getHasSearchQuery, @@ -79,34 +82,34 @@ import { getSearchConversation, getSearchResults, getStartSearchCounter, -} from '../selectors/search'; +} from '../selectors/search.js'; import { isUpdateDownloaded as getIsUpdateDownloaded, isOSUnsupported, isUpdateDialogVisible, -} from '../selectors/updates'; +} from '../selectors/updates.js'; import { getIntl, getIsMacOS, getRegionCode, getTheme, -} from '../selectors/user'; -import { SmartCaptchaDialog } from './CaptchaDialog'; -import { SmartCrashReportDialog } from './CrashReportDialog'; -import { SmartMessageSearchResult } from './MessageSearchResult'; -import { SmartNetworkStatus } from './NetworkStatus'; -import { SmartRelinkDialog } from './RelinkDialog'; -import { SmartToastManager } from './ToastManager'; -import type { PropsType as SmartUnsupportedOSDialogPropsType } from './UnsupportedOSDialog'; -import { SmartUnsupportedOSDialog } from './UnsupportedOSDialog'; -import { SmartUpdateDialog } from './UpdateDialog'; +} from '../selectors/user.js'; +import { SmartCaptchaDialog } from './CaptchaDialog.js'; +import { SmartCrashReportDialog } from './CrashReportDialog.js'; +import { SmartMessageSearchResult } from './MessageSearchResult.js'; +import { SmartNetworkStatus } from './NetworkStatus.js'; +import { SmartRelinkDialog } from './RelinkDialog.js'; +import { SmartToastManager } from './ToastManager.js'; +import type { PropsType as SmartUnsupportedOSDialogPropsType } from './UnsupportedOSDialog.js'; +import { SmartUnsupportedOSDialog } from './UnsupportedOSDialog.js'; +import { SmartUpdateDialog } from './UpdateDialog.js'; import { cancelBackupMediaDownload, dismissBackupMediaDownloadBanner, pauseBackupMediaDownload, resumeBackupMediaDownload, -} from '../../util/backupMediaDownload'; -import { useNavActions } from '../ducks/nav'; +} from '../../util/backupMediaDownload.js'; +import { useNavActions } from '../ducks/nav.js'; function renderMessageSearchResult(id: string): JSX.Element { return ; diff --git a/ts/state/smart/Lightbox.tsx b/ts/state/smart/Lightbox.tsx index 6d6e6ccf82e..e8d00a7f66f 100644 --- a/ts/state/smart/Lightbox.tsx +++ b/ts/state/smart/Lightbox.tsx @@ -3,13 +3,13 @@ import React, { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; -import { Lightbox } from '../../components/Lightbox'; -import { getConversationSelector } from '../selectors/conversations'; -import { getIntl } from '../selectors/user'; -import { useConversationsActions } from '../ducks/conversations'; -import { useGlobalModalActions } from '../ducks/globalModals'; -import { useLightboxActions } from '../ducks/lightbox'; -import { useAudioPlayerActions } from '../ducks/audioPlayer'; +import { Lightbox } from '../../components/Lightbox.js'; +import { getConversationSelector } from '../selectors/conversations.js'; +import { getIntl } from '../selectors/user.js'; +import { useConversationsActions } from '../ducks/conversations.js'; +import { useGlobalModalActions } from '../ducks/globalModals.js'; +import { useLightboxActions } from '../ducks/lightbox.js'; +import { useAudioPlayerActions } from '../ducks/audioPlayer.js'; import { getIsViewOnce, getMedia, @@ -18,7 +18,7 @@ import { getPlaybackDisabled, getSelectedIndex, shouldShowLightbox, -} from '../selectors/lightbox'; +} from '../selectors/lightbox.js'; export const SmartLightbox = memo(function SmartLightbox() { const i18n = useSelector(getIntl); diff --git a/ts/state/smart/MessageAudio.tsx b/ts/state/smart/MessageAudio.tsx index 07de4eeecb5..23d900640de 100644 --- a/ts/state/smart/MessageAudio.tsx +++ b/ts/state/smart/MessageAudio.tsx @@ -3,24 +3,24 @@ import React, { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; -import { MessageAudio } from '../../components/conversation/MessageAudio'; -import type { OwnProps as MessageAudioOwnProps } from '../../components/conversation/MessageAudio'; -import type { ActiveAudioPlayerStateType } from '../ducks/audioPlayer'; +import { MessageAudio } from '../../components/conversation/MessageAudio.js'; +import type { OwnProps as MessageAudioOwnProps } from '../../components/conversation/MessageAudio.js'; +import type { ActiveAudioPlayerStateType } from '../ducks/audioPlayer.js'; import { AudioPlayerContent, useAudioPlayerActions, -} from '../ducks/audioPlayer'; +} from '../ducks/audioPlayer.js'; import { selectAudioPlayerActive, selectVoiceNoteAndConsecutive, -} from '../selectors/audioPlayer'; -import { useConversationsActions } from '../ducks/conversations'; -import { getUserConversationId } from '../selectors/user'; -import { createLogger } from '../../logging/log'; +} from '../selectors/audioPlayer.js'; +import { useConversationsActions } from '../ducks/conversations.js'; +import { getUserConversationId } from '../selectors/user.js'; +import { createLogger } from '../../logging/log.js'; import { getConversationByIdSelector, getSelectedConversationId, -} from '../selectors/conversations'; +} from '../selectors/conversations.js'; const log = createLogger('MessageAudio'); diff --git a/ts/state/smart/MessageDetail.tsx b/ts/state/smart/MessageDetail.tsx index 5d13b5add65..62e720ac423 100644 --- a/ts/state/smart/MessageDetail.tsx +++ b/ts/state/smart/MessageDetail.tsx @@ -4,25 +4,25 @@ import React, { memo, useEffect } from 'react'; import { useSelector } from 'react-redux'; -import type { Props as MessageDetailProps } from '../../components/conversation/MessageDetail'; -import { MessageDetail } from '../../components/conversation/MessageDetail'; -import { getContactNameColorSelector } from '../selectors/conversations'; +import type { Props as MessageDetailProps } from '../../components/conversation/MessageDetail.js'; +import { MessageDetail } from '../../components/conversation/MessageDetail.js'; +import { getContactNameColorSelector } from '../selectors/conversations.js'; import { getIntl, getInteractionMode, getTheme, getPlatform, -} from '../selectors/user'; -import { getMessageDetails } from '../selectors/message'; -import { getPreferredBadgeSelector } from '../selectors/badges'; -import { renderAudioAttachment } from './renderAudioAttachment'; -import { useAccountsActions } from '../ducks/accounts'; -import { useConversationsActions } from '../ducks/conversations'; -import { useGlobalModalActions } from '../ducks/globalModals'; -import { useLightboxActions } from '../ducks/lightbox'; -import { useStoriesActions } from '../ducks/stories'; +} from '../selectors/user.js'; +import { getMessageDetails } from '../selectors/message.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.js'; +import { renderAudioAttachment } from './renderAudioAttachment.js'; +import { useAccountsActions } from '../ducks/accounts.js'; +import { useConversationsActions } from '../ducks/conversations.js'; +import { useGlobalModalActions } from '../ducks/globalModals.js'; +import { useLightboxActions } from '../ducks/lightbox.js'; +import { useStoriesActions } from '../ducks/stories.js'; -export type { Contact } from '../../components/conversation/MessageDetail'; +export type { Contact } from '../../components/conversation/MessageDetail.js'; export type OwnProps = Pick< MessageDetailProps, 'contacts' | 'errors' | 'message' | 'receivedAt' diff --git a/ts/state/smart/MessageRequestActionsConfirmation.tsx b/ts/state/smart/MessageRequestActionsConfirmation.tsx index 44ff85f2ae7..d165aa7871e 100644 --- a/ts/state/smart/MessageRequestActionsConfirmation.tsx +++ b/ts/state/smart/MessageRequestActionsConfirmation.tsx @@ -3,18 +3,18 @@ import React, { memo, useCallback, useMemo } from 'react'; import { useSelector } from 'react-redux'; -import { getIntl } from '../selectors/user'; -import { getGlobalModalsState } from '../selectors/globalModals'; -import { getConversationSelector } from '../selectors/conversations'; -import { useConversationsActions } from '../ducks/conversations'; +import { getIntl } from '../selectors/user.js'; +import { getGlobalModalsState } from '../selectors/globalModals.js'; +import { getConversationSelector } from '../selectors/conversations.js'; +import { useConversationsActions } from '../ducks/conversations.js'; import { MessageRequestActionsConfirmation, MessageRequestState, -} from '../../components/conversation/MessageRequestActionsConfirmation'; -import { useContactNameData } from '../../components/conversation/ContactName'; -import { getAddedByForOurPendingInvitation } from '../../util/getAddedByForOurPendingInvitation'; -import { strictAssert } from '../../util/assert'; -import { useGlobalModalActions } from '../ducks/globalModals'; +} from '../../components/conversation/MessageRequestActionsConfirmation.js'; +import { useContactNameData } from '../../components/conversation/ContactName.js'; +import { getAddedByForOurPendingInvitation } from '../../util/getAddedByForOurPendingInvitation.js'; +import { strictAssert } from '../../util/assert.js'; +import { useGlobalModalActions } from '../ducks/globalModals.js'; export const SmartMessageRequestActionsConfirmation = memo( function SmartMessageRequestActionsConfirmation() { diff --git a/ts/state/smart/MessageSearchResult.tsx b/ts/state/smart/MessageSearchResult.tsx index 0e2d8414af2..f378257fc6e 100644 --- a/ts/state/smart/MessageSearchResult.tsx +++ b/ts/state/smart/MessageSearchResult.tsx @@ -2,12 +2,12 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { MessageSearchResult } from '../../components/conversationList/MessageSearchResult'; -import { getPreferredBadgeSelector } from '../selectors/badges'; -import { getIntl, getTheme } from '../selectors/user'; -import { getMessageSearchResultSelector } from '../selectors/search'; -import { createLogger } from '../../logging/log'; -import { useConversationsActions } from '../ducks/conversations'; +import { MessageSearchResult } from '../../components/conversationList/MessageSearchResult.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.js'; +import { getIntl, getTheme } from '../selectors/user.js'; +import { getMessageSearchResultSelector } from '../selectors/search.js'; +import { createLogger } from '../../logging/log.js'; +import { useConversationsActions } from '../ducks/conversations.js'; const log = createLogger('MessageSearchResult'); diff --git a/ts/state/smart/MiniPlayer.tsx b/ts/state/smart/MiniPlayer.tsx index 2d4c3fdde58..1b0050918da 100644 --- a/ts/state/smart/MiniPlayer.tsx +++ b/ts/state/smart/MiniPlayer.tsx @@ -3,17 +3,17 @@ import React, { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; -import { MiniPlayer, PlayerState } from '../../components/MiniPlayer'; -import type { Props as DumbProps } from '../../components/MiniPlayer'; +import { MiniPlayer, PlayerState } from '../../components/MiniPlayer.js'; +import type { Props as DumbProps } from '../../components/MiniPlayer.js'; import { AudioPlayerContent, useAudioPlayerActions, -} from '../ducks/audioPlayer'; +} from '../ducks/audioPlayer.js'; import { selectAudioPlayerActive, selectVoiceNoteTitle, -} from '../selectors/audioPlayer'; -import { getIntl } from '../selectors/user'; +} from '../selectors/audioPlayer.js'; +import { getIntl } from '../selectors/user.js'; type Props = Pick; diff --git a/ts/state/smart/NavTabs.tsx b/ts/state/smart/NavTabs.tsx index 1975c447d6e..d7b19dc6b9c 100644 --- a/ts/state/smart/NavTabs.tsx +++ b/ts/state/smart/NavTabs.tsx @@ -6,29 +6,29 @@ import React, { memo, useCallback } from 'react'; import type { ReactNode } from 'react'; import { useSelector } from 'react-redux'; -import { NavTabs } from '../../components/NavTabs'; -import { getIntl, getTheme, getIsNightly } from '../selectors/user'; +import { NavTabs } from '../../components/NavTabs.js'; +import { getIntl, getTheme, getIsNightly } from '../selectors/user.js'; import { getAllConversationsUnreadStats, getMe, -} from '../selectors/conversations'; -import { getPreferredBadgeSelector } from '../selectors/badges'; +} from '../selectors/conversations.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.js'; import { getHasAnyFailedStorySends, getStoriesNotificationCount, -} from '../selectors/stories'; +} from '../selectors/stories.js'; import { getProfileMovedModalNeeded, getStoriesEnabled, -} from '../selectors/items'; -import { getSelectedNavTab } from '../selectors/nav'; -import { useNavActions } from '../ducks/nav'; -import { getHasPendingUpdate } from '../selectors/updates'; -import { getCallHistoryUnreadCount } from '../selectors/callHistory'; -import { Environment } from '../../environment'; -import { useItemsActions } from '../ducks/items'; +} from '../selectors/items.js'; +import { getSelectedNavTab } from '../selectors/nav.js'; +import { useNavActions } from '../ducks/nav.js'; +import { getHasPendingUpdate } from '../selectors/updates.js'; +import { getCallHistoryUnreadCount } from '../selectors/callHistory.js'; +import { Environment } from '../../environment.js'; +import { useItemsActions } from '../ducks/items.js'; -import type { Location } from '../../types/Nav'; +import type { Location } from '../../types/Nav.js'; export type SmartNavTabsProps = Readonly<{ navTabsCollapsed: boolean; diff --git a/ts/state/smart/NetworkStatus.tsx b/ts/state/smart/NetworkStatus.tsx index dee52570f39..c7945da96d1 100644 --- a/ts/state/smart/NetworkStatus.tsx +++ b/ts/state/smart/NetworkStatus.tsx @@ -2,15 +2,15 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { DialogNetworkStatus } from '../../components/DialogNetworkStatus'; -import { getIntl } from '../selectors/user'; -import type { WidthBreakpoint } from '../../components/_util'; +import { DialogNetworkStatus } from '../../components/DialogNetworkStatus.js'; +import { getIntl } from '../selectors/user.js'; +import type { WidthBreakpoint } from '../../components/_util.js'; import { getNetworkIsOnline, getNetworkIsOutage, getNetworkSocketStatus, -} from '../selectors/network'; -import { useUserActions } from '../ducks/user'; +} from '../selectors/network.js'; +import { useUserActions } from '../ducks/user.js'; type SmartNetworkStatusProps = Readonly<{ containerWidthBreakpoint: WidthBreakpoint; diff --git a/ts/state/smart/NotePreviewModal.tsx b/ts/state/smart/NotePreviewModal.tsx index 86ab50f3487..11a2664b1be 100644 --- a/ts/state/smart/NotePreviewModal.tsx +++ b/ts/state/smart/NotePreviewModal.tsx @@ -3,12 +3,12 @@ import React, { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; -import { NotePreviewModal } from '../../components/NotePreviewModal'; -import { strictAssert } from '../../util/assert'; -import { getConversationSelector } from '../selectors/conversations'; -import { getNotePreviewModalProps } from '../selectors/globalModals'; -import { getIntl } from '../selectors/user'; -import { useGlobalModalActions } from '../ducks/globalModals'; +import { NotePreviewModal } from '../../components/NotePreviewModal.js'; +import { strictAssert } from '../../util/assert.js'; +import { getConversationSelector } from '../selectors/conversations.js'; +import { getNotePreviewModalProps } from '../selectors/globalModals.js'; +import { getIntl } from '../selectors/user.js'; +import { useGlobalModalActions } from '../ducks/globalModals.js'; export const SmartNotePreviewModal = memo(function SmartNotePreviewModal() { const i18n = useSelector(getIntl); diff --git a/ts/state/smart/PendingInvites.tsx b/ts/state/smart/PendingInvites.tsx index e5eb8603e8d..f507e3776b2 100644 --- a/ts/state/smart/PendingInvites.tsx +++ b/ts/state/smart/PendingInvites.tsx @@ -2,17 +2,17 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { PendingInvites } from '../../components/conversation/conversation-details/PendingInvites'; -import { getIntl, getTheme } from '../selectors/user'; -import { getPreferredBadgeSelector } from '../selectors/badges'; +import { PendingInvites } from '../../components/conversation/conversation-details/PendingInvites.js'; +import { getIntl, getTheme } from '../selectors/user.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.js'; import { getConversationByIdSelector, getConversationByServiceIdSelector, -} from '../selectors/conversations'; -import { getGroupMemberships } from '../../util/getGroupMemberships'; -import { assertDev } from '../../util/assert'; -import type { AciString } from '../../types/ServiceId'; -import { useConversationsActions } from '../ducks/conversations'; +} from '../selectors/conversations.js'; +import { getGroupMemberships } from '../../util/getGroupMemberships.js'; +import { assertDev } from '../../util/assert.js'; +import type { AciString } from '../../types/ServiceId.js'; +import { useConversationsActions } from '../ducks/conversations.js'; export type SmartPendingInvitesProps = { conversationId: string; diff --git a/ts/state/smart/Preferences.tsx b/ts/state/smart/Preferences.tsx index 641591c009b..b99afffe502 100644 --- a/ts/state/smart/Preferences.tsx +++ b/ts/state/smart/Preferences.tsx @@ -7,88 +7,91 @@ import { useSelector } from 'react-redux'; import type { AudioDevice } from '@signalapp/ringrtc'; import type { MutableRefObject } from 'react'; -import { useItemsActions } from '../ducks/items'; -import { useConversationsActions } from '../ducks/conversations'; +import { useItemsActions } from '../ducks/items.js'; +import { useConversationsActions } from '../ducks/conversations.js'; import { getConversationsWithCustomColorSelector, getMe, -} from '../selectors/conversations'; +} from '../selectors/conversations.js'; import { getCustomColors, getItems, getNavTabsCollapsed, getPreferredLeftPaneWidth, -} from '../selectors/items'; -import { DEFAULT_AUTO_DOWNLOAD_ATTACHMENT } from '../../textsecure/Storage'; -import { DEFAULT_CONVERSATION_COLOR } from '../../types/Colors'; -import { isBackupFeatureEnabled } from '../../util/isBackupEnabled'; -import { format } from '../../types/PhoneNumber'; +} from '../selectors/items.js'; +import { DEFAULT_AUTO_DOWNLOAD_ATTACHMENT } from '../../textsecure/Storage.js'; +import { DEFAULT_CONVERSATION_COLOR } from '../../types/Colors.js'; +import { isBackupFeatureEnabled } from '../../util/isBackupEnabled.js'; +import { format } from '../../types/PhoneNumber.js'; import { getIntl, getTheme, getUserDeviceId, getUserNumber, -} from '../selectors/user'; -import { EmojiSkinTone } from '../../components/fun/data/emojis'; -import { renderClearingDataView } from '../../shims/renderClearingDataView'; -import OS from '../../util/os/osPreload'; -import { themeChanged } from '../../shims/themeChanged'; -import * as Settings from '../../types/Settings'; -import * as universalExpireTimerUtil from '../../util/universalExpireTimer'; +} from '../selectors/user.js'; +import { EmojiSkinTone } from '../../components/fun/data/emojis.js'; +import { renderClearingDataView } from '../../shims/renderClearingDataView.js'; +import OS from '../../util/os/osPreload.js'; +import { themeChanged } from '../../shims/themeChanged.js'; +import * as Settings from '../../types/Settings.js'; +import * as universalExpireTimerUtil from '../../util/universalExpireTimer.js'; import { parseSystemTraySetting, shouldMinimizeToSystemTray, SystemTraySetting, -} from '../../types/SystemTraySetting'; -import { calling } from '../../services/calling'; -import { drop } from '../../util/drop'; -import { assertDev, strictAssert } from '../../util/assert'; -import { backupsService } from '../../services/backups'; -import { DurationInSeconds } from '../../util/durations/duration-in-seconds'; -import { PhoneNumberDiscoverability } from '../../util/phoneNumberDiscoverability'; -import { PhoneNumberSharingMode } from '../../util/phoneNumberSharingMode'; -import { writeProfile } from '../../services/writeProfile'; -import { getConversation } from '../../util/getConversation'; -import { waitForEvent } from '../../shims/events'; -import { MINUTE } from '../../util/durations'; -import { sendSyncRequests } from '../../textsecure/syncRequests'; -import { SmartUpdateDialog } from './UpdateDialog'; -import { Preferences } from '../../components/Preferences'; -import { useUpdatesActions } from '../ducks/updates'; -import { getUpdateDialogType } from '../selectors/updates'; -import { getHasAnyFailedStorySends } from '../selectors/stories'; -import { getOtherTabsUnreadStats, getSelectedLocation } from '../selectors/nav'; -import { getPreferredBadgeSelector } from '../selectors/badges'; -import { SmartProfileEditor } from './ProfileEditor'; -import { useNavActions } from '../ducks/nav'; -import { NavTab, ProfileEditorPage, SettingsPage } from '../../types/Nav'; -import { SmartToastManager } from './ToastManager'; -import { useToastActions } from '../ducks/toast'; -import { DataReader } from '../../sql/Client'; -import { deleteAllMyStories } from '../../util/deleteAllMyStories'; -import { isLocalBackupsEnabled } from '../../util/isLocalBackupsEnabled'; -import { SmartPreferencesDonations } from './PreferencesDonations'; -import { useDonationsActions } from '../ducks/donations'; -import { generateDonationReceiptBlob } from '../../util/generateDonationReceipt'; +} from '../../types/SystemTraySetting.js'; +import { calling } from '../../services/calling.js'; +import { drop } from '../../util/drop.js'; +import { assertDev, strictAssert } from '../../util/assert.js'; +import { backupsService } from '../../services/backups/index.js'; +import { DurationInSeconds } from '../../util/durations/duration-in-seconds.js'; +import { PhoneNumberDiscoverability } from '../../util/phoneNumberDiscoverability.js'; +import { PhoneNumberSharingMode } from '../../util/phoneNumberSharingMode.js'; +import { writeProfile } from '../../services/writeProfile.js'; +import { getConversation } from '../../util/getConversation.js'; +import { waitForEvent } from '../../shims/events.js'; +import { MINUTE } from '../../util/durations/index.js'; +import { sendSyncRequests } from '../../textsecure/syncRequests.js'; +import { SmartUpdateDialog } from './UpdateDialog.js'; +import { Preferences } from '../../components/Preferences.js'; +import { useUpdatesActions } from '../ducks/updates.js'; +import { getUpdateDialogType } from '../selectors/updates.js'; +import { getHasAnyFailedStorySends } from '../selectors/stories.js'; +import { + getOtherTabsUnreadStats, + getSelectedLocation, +} from '../selectors/nav.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.js'; +import { SmartProfileEditor } from './ProfileEditor.js'; +import { useNavActions } from '../ducks/nav.js'; +import { NavTab, ProfileEditorPage, SettingsPage } from '../../types/Nav.js'; +import { SmartToastManager } from './ToastManager.js'; +import { useToastActions } from '../ducks/toast.js'; +import { DataReader } from '../../sql/Client.js'; +import { deleteAllMyStories } from '../../util/deleteAllMyStories.js'; +import { isLocalBackupsEnabled } from '../../util/isLocalBackupsEnabled.js'; +import { SmartPreferencesDonations } from './PreferencesDonations.js'; +import { useDonationsActions } from '../ducks/donations.js'; +import { generateDonationReceiptBlob } from '../../util/generateDonationReceipt.js'; -import type { StorageAccessType, ZoomFactorType } from '../../types/Storage'; -import type { ThemeType } from '../../util/preload'; -import type { WidthBreakpoint } from '../../components/_util'; -import { DialogType } from '../../types/Dialogs'; -import { promptOSAuth } from '../../util/promptOSAuth'; -import type { StateType } from '../reducer'; +import type { StorageAccessType, ZoomFactorType } from '../../types/Storage.js'; +import type { ThemeType } from '../../util/preload.js'; +import type { WidthBreakpoint } from '../../components/_util.js'; +import { DialogType } from '../../types/Dialogs.js'; +import { promptOSAuth } from '../../util/promptOSAuth.js'; +import type { StateType } from '../reducer.js'; import { pauseBackupMediaDownload, resumeBackupMediaDownload, cancelBackupMediaDownload, -} from '../../util/backupMediaDownload'; -import { DonationsErrorBoundary } from '../../components/DonationsErrorBoundary'; -import type { SmartPreferencesChatFoldersPageProps } from './PreferencesChatFoldersPage'; -import { SmartPreferencesChatFoldersPage } from './PreferencesChatFoldersPage'; -import type { SmartPreferencesEditChatFolderPageProps } from './PreferencesEditChatFolderPage'; -import { SmartPreferencesEditChatFolderPage } from './PreferencesEditChatFolderPage'; -import { isProduction } from '../../util/version'; -import { AxoProvider } from '../../axo/AxoProvider'; +} from '../../util/backupMediaDownload.js'; +import { DonationsErrorBoundary } from '../../components/DonationsErrorBoundary.js'; +import type { SmartPreferencesChatFoldersPageProps } from './PreferencesChatFoldersPage.js'; +import { SmartPreferencesChatFoldersPage } from './PreferencesChatFoldersPage.js'; +import type { SmartPreferencesEditChatFolderPageProps } from './PreferencesEditChatFolderPage.js'; +import { SmartPreferencesEditChatFolderPage } from './PreferencesEditChatFolderPage.js'; +import { isProduction } from '../../util/version.js'; +import { AxoProvider } from '../../axo/AxoProvider.js'; const DEFAULT_NOTIFICATION_SETTING = 'message'; diff --git a/ts/state/smart/PreferencesChatFoldersPage.tsx b/ts/state/smart/PreferencesChatFoldersPage.tsx index 9872b5822e3..94584c9aa50 100644 --- a/ts/state/smart/PreferencesChatFoldersPage.tsx +++ b/ts/state/smart/PreferencesChatFoldersPage.tsx @@ -2,12 +2,12 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; import { useSelector } from 'react-redux'; -import type { PreferencesChatFoldersPageProps } from '../../components/preferences/chatFolders/PreferencesChatFoldersPage'; -import { PreferencesChatFoldersPage } from '../../components/preferences/chatFolders/PreferencesChatFoldersPage'; -import { getIntl } from '../selectors/user'; -import { getCurrentChatFolders } from '../selectors/chatFolders'; -import type { ChatFolderId } from '../../types/ChatFolder'; -import { useChatFolderActions } from '../ducks/chatFolders'; +import type { PreferencesChatFoldersPageProps } from '../../components/preferences/chatFolders/PreferencesChatFoldersPage.js'; +import { PreferencesChatFoldersPage } from '../../components/preferences/chatFolders/PreferencesChatFoldersPage.js'; +import { getIntl } from '../selectors/user.js'; +import { getCurrentChatFolders } from '../selectors/chatFolders.js'; +import type { ChatFolderId } from '../../types/ChatFolder.js'; +import { useChatFolderActions } from '../ducks/chatFolders.js'; export type SmartPreferencesChatFoldersPageProps = Readonly<{ settingsPaneRef: PreferencesChatFoldersPageProps['settingsPaneRef']; diff --git a/ts/state/smart/PreferencesDonations.tsx b/ts/state/smart/PreferencesDonations.tsx index 256b3976d10..489eb04e324 100644 --- a/ts/state/smart/PreferencesDonations.tsx +++ b/ts/state/smart/PreferencesDonations.tsx @@ -6,28 +6,34 @@ import { useSelector } from 'react-redux'; import type { MutableRefObject } from 'react'; -import { getIntl, getTheme, getUserNumber } from '../selectors/user'; -import { getMe } from '../selectors/conversations'; -import { PreferencesDonations } from '../../components/PreferencesDonations'; -import type { SettingsPage } from '../../types/Nav'; -import { useDonationsActions } from '../ducks/donations'; -import type { StateType } from '../reducer'; -import { useConversationsActions } from '../ducks/conversations'; -import { generateDonationReceiptBlob } from '../../util/generateDonationReceipt'; -import { useToastActions } from '../ducks/toast'; +import { getIntl, getTheme, getUserNumber } from '../selectors/user.js'; +import { getMe } from '../selectors/conversations.js'; +import { PreferencesDonations } from '../../components/PreferencesDonations.js'; +import type { SettingsPage } from '../../types/Nav.js'; +import { useDonationsActions } from '../ducks/donations.js'; +import type { StateType } from '../reducer.js'; +import { useConversationsActions } from '../ducks/conversations.js'; +import { generateDonationReceiptBlob } from '../../util/generateDonationReceipt.js'; +import { useToastActions } from '../ducks/toast.js'; import { getDonationHumanAmounts, getCachedSubscriptionConfiguration, -} from '../../util/subscriptionConfiguration'; -import { drop } from '../../util/drop'; -import type { OneTimeDonationHumanAmounts } from '../../types/Donations'; -import { ONE_TIME_DONATION_CONFIG_ID, BOOST_ID } from '../../types/Donations'; -import { phoneNumberToCurrencyCode } from '../../services/donations'; -import { getPreferredBadgeSelector, getBadgesById } from '../selectors/badges'; -import { parseBoostBadgeListFromServer } from '../../badges/parseBadgesFromServer'; -import { createLogger } from '../../logging/log'; -import { useBadgesActions } from '../ducks/badges'; -import { getNetworkIsOnline } from '../selectors/network'; +} from '../../util/subscriptionConfiguration.js'; +import { drop } from '../../util/drop.js'; +import type { OneTimeDonationHumanAmounts } from '../../types/Donations.js'; +import { + ONE_TIME_DONATION_CONFIG_ID, + BOOST_ID, +} from '../../types/Donations.js'; +import { phoneNumberToCurrencyCode } from '../../services/donations.js'; +import { + getPreferredBadgeSelector, + getBadgesById, +} from '../selectors/badges.js'; +import { parseBoostBadgeListFromServer } from '../../badges/parseBadgesFromServer.js'; +import { createLogger } from '../../logging/log.js'; +import { useBadgesActions } from '../ducks/badges.js'; +import { getNetworkIsOnline } from '../selectors/network.js'; const log = createLogger('SmartPreferencesDonations'); diff --git a/ts/state/smart/PreferencesEditChatFolderPage.tsx b/ts/state/smart/PreferencesEditChatFolderPage.tsx index b9ff02f31a1..0139515f15c 100644 --- a/ts/state/smart/PreferencesEditChatFolderPage.tsx +++ b/ts/state/smart/PreferencesEditChatFolderPage.tsx @@ -2,18 +2,18 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { useMemo } from 'react'; import { useSelector } from 'react-redux'; -import type { PreferencesEditChatFolderPageProps } from '../../components/preferences/chatFolders/PreferencesEditChatFoldersPage'; -import { PreferencesEditChatFolderPage } from '../../components/preferences/chatFolders/PreferencesEditChatFoldersPage'; -import { getIntl, getTheme } from '../selectors/user'; -import { CHAT_FOLDER_DEFAULTS } from '../../types/ChatFolder'; +import type { PreferencesEditChatFolderPageProps } from '../../components/preferences/chatFolders/PreferencesEditChatFoldersPage.js'; +import { PreferencesEditChatFolderPage } from '../../components/preferences/chatFolders/PreferencesEditChatFoldersPage.js'; +import { getIntl, getTheme } from '../selectors/user.js'; +import { CHAT_FOLDER_DEFAULTS } from '../../types/ChatFolder.js'; import { getAllComposableConversations, getConversationSelector, -} from '../selectors/conversations'; -import { getPreferredBadgeSelector } from '../selectors/badges'; -import { useChatFolderActions } from '../ducks/chatFolders'; -import { getCurrentChatFolders } from '../selectors/chatFolders'; -import { strictAssert } from '../../util/assert'; +} from '../selectors/conversations.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.js'; +import { useChatFolderActions } from '../ducks/chatFolders.js'; +import { getCurrentChatFolders } from '../selectors/chatFolders.js'; +import { strictAssert } from '../../util/assert.js'; export type SmartPreferencesEditChatFolderPageProps = Readonly<{ onBack: () => void; diff --git a/ts/state/smart/ProfileEditor.tsx b/ts/state/smart/ProfileEditor.tsx index d29c2c05092..78ae1c2bf6c 100644 --- a/ts/state/smart/ProfileEditor.tsx +++ b/ts/state/smart/ProfileEditor.tsx @@ -5,13 +5,13 @@ import { useSelector } from 'react-redux'; import type { MutableRefObject } from 'react'; -import { ProfileEditor } from '../../components/ProfileEditor'; -import { useConversationsActions } from '../ducks/conversations'; -import { useItemsActions } from '../ducks/items'; -import { useToastActions } from '../ducks/toast'; -import { useUsernameActions } from '../ducks/username'; -import { getMe, getProfileUpdateError } from '../selectors/conversations'; -import { selectRecentEmojis } from '../selectors/emojis'; +import { ProfileEditor } from '../../components/ProfileEditor.js'; +import { useConversationsActions } from '../ducks/conversations.js'; +import { useItemsActions } from '../ducks/items.js'; +import { useToastActions } from '../ducks/toast.js'; +import { useUsernameActions } from '../ducks/username.js'; +import { getMe, getProfileUpdateError } from '../selectors/conversations.js'; +import { selectRecentEmojis } from '../selectors/emojis.js'; import { getEmojiSkinToneDefault, getHasCompletedUsernameLinkOnboarding, @@ -19,20 +19,20 @@ import { getUsernameLink, getUsernameLinkColor, getUsernameLinkCorrupted, -} from '../selectors/items'; -import { getIntl } from '../selectors/user'; +} from '../selectors/items.js'; +import { getIntl } from '../selectors/user.js'; import { getUsernameEditState, getUsernameLinkState, -} from '../selectors/username'; -import { SmartUsernameEditor } from './UsernameEditor'; -import { getSelectedLocation } from '../selectors/nav'; -import { useNavActions } from '../ducks/nav'; -import { NavTab, SettingsPage } from '../../types/Nav'; +} from '../selectors/username.js'; +import { SmartUsernameEditor } from './UsernameEditor.js'; +import { getSelectedLocation } from '../selectors/nav.js'; +import { useNavActions } from '../ducks/nav.js'; +import { NavTab, SettingsPage } from '../../types/Nav.js'; -import type { ProfileEditorPage } from '../../types/Nav'; -import type { SmartUsernameEditorProps } from './UsernameEditor'; -import { ConfirmationDialog } from '../../components/ConfirmationDialog'; +import type { ProfileEditorPage } from '../../types/Nav.js'; +import type { SmartUsernameEditorProps } from './UsernameEditor.js'; +import { ConfirmationDialog } from '../../components/ConfirmationDialog.js'; function renderUsernameEditor(props: SmartUsernameEditorProps): JSX.Element { return ; diff --git a/ts/state/smart/ProfileNameWarningModal.tsx b/ts/state/smart/ProfileNameWarningModal.tsx index 5699a63b445..32de04d467f 100644 --- a/ts/state/smart/ProfileNameWarningModal.tsx +++ b/ts/state/smart/ProfileNameWarningModal.tsx @@ -3,10 +3,10 @@ import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { getIntl } from '../selectors/user'; -import { getGlobalModalsState } from '../selectors/globalModals'; -import { useGlobalModalActions } from '../ducks/globalModals'; -import { ProfileNameWarningModal } from '../../components/conversation/ProfileNameWarningModal'; +import { getIntl } from '../selectors/user.js'; +import { getGlobalModalsState } from '../selectors/globalModals.js'; +import { useGlobalModalActions } from '../ducks/globalModals.js'; +import { ProfileNameWarningModal } from '../../components/conversation/ProfileNameWarningModal.js'; export const SmartProfileNameWarningModal = memo( function SmartProfileNameWarningModal() { diff --git a/ts/state/smart/ReactionPicker.tsx b/ts/state/smart/ReactionPicker.tsx index ac4c3df3d74..04d60101dd3 100644 --- a/ts/state/smart/ReactionPicker.tsx +++ b/ts/state/smart/ReactionPicker.tsx @@ -4,12 +4,12 @@ import type { Ref } from 'react'; import React, { forwardRef, memo } from 'react'; import { useSelector } from 'react-redux'; -import { usePreferredReactionsActions } from '../ducks/preferredReactions'; -import { useItemsActions } from '../ducks/items'; -import { getIntl } from '../selectors/user'; -import { getPreferredReactionEmoji } from '../selectors/items'; -import type { Props as InternalProps } from '../../components/conversation/ReactionPicker'; -import { ReactionPicker } from '../../components/conversation/ReactionPicker'; +import { usePreferredReactionsActions } from '../ducks/preferredReactions.js'; +import { useItemsActions } from '../ducks/items.js'; +import { getIntl } from '../selectors/user.js'; +import { getPreferredReactionEmoji } from '../selectors/items.js'; +import type { Props as InternalProps } from '../../components/conversation/ReactionPicker.js'; +import { ReactionPicker } from '../../components/conversation/ReactionPicker.js'; type ExternalProps = Omit< InternalProps, diff --git a/ts/state/smart/RelinkDialog.tsx b/ts/state/smart/RelinkDialog.tsx index ba6a18a7735..0f02669ccda 100644 --- a/ts/state/smart/RelinkDialog.tsx +++ b/ts/state/smart/RelinkDialog.tsx @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { DialogRelink } from '../../components/DialogRelink'; -import { getIntl } from '../selectors/user'; -import type { WidthBreakpoint } from '../../components/_util'; -import { useNetworkActions } from '../ducks/network'; +import { DialogRelink } from '../../components/DialogRelink.js'; +import { getIntl } from '../selectors/user.js'; +import type { WidthBreakpoint } from '../../components/_util.js'; +import { useNetworkActions } from '../ducks/network.js'; type SmartRelinkDialogProps = Readonly<{ containerWidthBreakpoint: WidthBreakpoint; diff --git a/ts/state/smart/SafetyNumberModal.tsx b/ts/state/smart/SafetyNumberModal.tsx index 954bf0ada3e..865c32a94bc 100644 --- a/ts/state/smart/SafetyNumberModal.tsx +++ b/ts/state/smart/SafetyNumberModal.tsx @@ -2,12 +2,12 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { SafetyNumberModal } from '../../components/SafetyNumberModal'; -import { getContactSafetyNumberSelector } from '../selectors/safetyNumber'; -import { getConversationSelector } from '../selectors/conversations'; -import { getIntl } from '../selectors/user'; -import { useSafetyNumberActions } from '../ducks/safetyNumber'; -import { useGlobalModalActions } from '../ducks/globalModals'; +import { SafetyNumberModal } from '../../components/SafetyNumberModal.js'; +import { getContactSafetyNumberSelector } from '../selectors/safetyNumber.js'; +import { getConversationSelector } from '../selectors/conversations.js'; +import { getIntl } from '../selectors/user.js'; +import { useSafetyNumberActions } from '../ducks/safetyNumber.js'; +import { useGlobalModalActions } from '../ducks/globalModals.js'; export type SmartSafetyNumberModalProps = { contactID: string; diff --git a/ts/state/smart/SafetyNumberViewer.tsx b/ts/state/smart/SafetyNumberViewer.tsx index 68709178444..9a2f4738d4e 100644 --- a/ts/state/smart/SafetyNumberViewer.tsx +++ b/ts/state/smart/SafetyNumberViewer.tsx @@ -3,12 +3,12 @@ import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { SafetyNumberViewer } from '../../components/SafetyNumberViewer'; -import type { SafetyNumberProps } from '../../components/SafetyNumberChangeDialog'; -import { getContactSafetyNumberSelector } from '../selectors/safetyNumber'; -import { getConversationSelector } from '../selectors/conversations'; -import { getIntl } from '../selectors/user'; -import { useSafetyNumberActions } from '../ducks/safetyNumber'; +import { SafetyNumberViewer } from '../../components/SafetyNumberViewer.js'; +import type { SafetyNumberProps } from '../../components/SafetyNumberChangeDialog.js'; +import { getContactSafetyNumberSelector } from '../selectors/safetyNumber.js'; +import { getConversationSelector } from '../selectors/conversations.js'; +import { getIntl } from '../selectors/user.js'; +import { useSafetyNumberActions } from '../ducks/safetyNumber.js'; export const SmartSafetyNumberViewer = memo(function SmartSafetyNumberViewer({ contactID, diff --git a/ts/state/smart/SendAnywayDialog.tsx b/ts/state/smart/SendAnywayDialog.tsx index 4ae3f0b0c18..e788757f927 100644 --- a/ts/state/smart/SendAnywayDialog.tsx +++ b/ts/state/smart/SendAnywayDialog.tsx @@ -3,20 +3,20 @@ import React, { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; -import * as SingleServePromise from '../../services/singleServePromise'; -import type { SafetyNumberProps } from '../../components/SafetyNumberChangeDialog'; +import * as SingleServePromise from '../../services/singleServePromise.js'; +import type { SafetyNumberProps } from '../../components/SafetyNumberChangeDialog.js'; import { SafetyNumberChangeDialog, SafetyNumberChangeSource, -} from '../../components/SafetyNumberChangeDialog'; -import { SmartSafetyNumberViewer } from './SafetyNumberViewer'; -import { getByDistributionListConversationsStoppingSend } from '../selectors/conversations-extra'; -import { getIntl, getTheme } from '../selectors/user'; -import { getPreferredBadgeSelector } from '../selectors/badges'; -import { useConversationsActions } from '../ducks/conversations'; -import { useGlobalModalActions } from '../ducks/globalModals'; -import { useStoryDistributionListsActions } from '../ducks/storyDistributionLists'; -import { getSafetyNumberChangedBlockingData } from '../selectors/globalModals'; +} from '../../components/SafetyNumberChangeDialog.js'; +import { SmartSafetyNumberViewer } from './SafetyNumberViewer.js'; +import { getByDistributionListConversationsStoppingSend } from '../selectors/conversations-extra.js'; +import { getIntl, getTheme } from '../selectors/user.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.js'; +import { useConversationsActions } from '../ducks/conversations.js'; +import { useGlobalModalActions } from '../ducks/globalModals.js'; +import { useStoryDistributionListsActions } from '../ducks/storyDistributionLists.js'; +import { getSafetyNumberChangedBlockingData } from '../selectors/globalModals.js'; function renderSafetyNumber({ contactID, onClose }: SafetyNumberProps) { return ; diff --git a/ts/state/smart/ShortcutGuideModal.tsx b/ts/state/smart/ShortcutGuideModal.tsx index c7ee512dc99..095103d7c0f 100644 --- a/ts/state/smart/ShortcutGuideModal.tsx +++ b/ts/state/smart/ShortcutGuideModal.tsx @@ -3,16 +3,16 @@ import React, { memo, useMemo } from 'react'; import { useSelector } from 'react-redux'; -import { ShortcutGuideModal } from '../../components/ShortcutGuideModal'; -import { countStickers } from '../../components/stickers/lib'; -import { getIntl, getPlatform } from '../selectors/user'; +import { ShortcutGuideModal } from '../../components/ShortcutGuideModal.js'; +import { countStickers } from '../../components/stickers/lib.js'; +import { getIntl, getPlatform } from '../selectors/user.js'; import { getBlessedStickerPacks, getInstalledStickerPacks, getKnownStickerPacks, getReceivedStickerPacks, -} from '../selectors/stickers'; -import { useGlobalModalActions } from '../ducks/globalModals'; +} from '../selectors/stickers.js'; +import { useGlobalModalActions } from '../ducks/globalModals.js'; export const SmartShortcutGuideModal = memo(function SmartShortcutGuideModal() { const i18n = useSelector(getIntl); diff --git a/ts/state/smart/StickerManager.tsx b/ts/state/smart/StickerManager.tsx index 7d7f6e14587..e0fb6136f41 100644 --- a/ts/state/smart/StickerManager.tsx +++ b/ts/state/smart/StickerManager.tsx @@ -3,16 +3,16 @@ import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { StickerManager } from '../../components/stickers/StickerManager'; -import { getIntl } from '../selectors/user'; +import { StickerManager } from '../../components/stickers/StickerManager.js'; +import { getIntl } from '../selectors/user.js'; import { getBlessedStickerPacks, getInstalledStickerPacks, getKnownStickerPacks, getReceivedStickerPacks, -} from '../selectors/stickers'; -import { useStickersActions } from '../ducks/stickers'; -import { useGlobalModalActions } from '../ducks/globalModals'; +} from '../selectors/stickers.js'; +import { useStickersActions } from '../ducks/stickers.js'; +import { useGlobalModalActions } from '../ducks/globalModals.js'; export const SmartStickerManager = memo(function SmartStickerManager() { const i18n = useSelector(getIntl); diff --git a/ts/state/smart/StickerPreviewModal.tsx b/ts/state/smart/StickerPreviewModal.tsx index 37d918f6588..540655d6df0 100644 --- a/ts/state/smart/StickerPreviewModal.tsx +++ b/ts/state/smart/StickerPreviewModal.tsx @@ -3,15 +3,15 @@ import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { StickerPreviewModal } from '../../components/stickers/StickerPreviewModal'; -import { getIntl } from '../selectors/user'; +import { StickerPreviewModal } from '../../components/stickers/StickerPreviewModal.js'; +import { getIntl } from '../selectors/user.js'; import { getBlessedPacks, getPacks, translatePackFromDB, -} from '../selectors/stickers'; -import { useStickersActions } from '../ducks/stickers'; -import { useGlobalModalActions } from '../ducks/globalModals'; +} from '../selectors/stickers.js'; +import { useStickersActions } from '../ducks/stickers.js'; +import { useGlobalModalActions } from '../ducks/globalModals.js'; export type ExternalProps = { packId: string; diff --git a/ts/state/smart/StoriesSettingsModal.tsx b/ts/state/smart/StoriesSettingsModal.tsx index 5c6b6c79231..c9e99c428da 100644 --- a/ts/state/smart/StoriesSettingsModal.tsx +++ b/ts/state/smart/StoriesSettingsModal.tsx @@ -3,22 +3,22 @@ import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { StoriesSettingsModal } from '../../components/StoriesSettingsModal'; +import { StoriesSettingsModal } from '../../components/StoriesSettingsModal.js'; import { getAllSignalConnections, getCandidateContactsForNewGroup, getConversationByServiceIdSelector, getGroupStories, getMe, -} from '../selectors/conversations'; -import { getDistributionListsWithMembers } from '../selectors/storyDistributionLists'; -import { getIntl, getTheme } from '../selectors/user'; -import { getPreferredBadgeSelector } from '../selectors/badges'; -import { getHasStoryViewReceiptSetting } from '../selectors/items'; -import { useGlobalModalActions } from '../ducks/globalModals'; -import { useStoryDistributionListsActions } from '../ducks/storyDistributionLists'; -import { useStoriesActions } from '../ducks/stories'; -import { useConversationsActions } from '../ducks/conversations'; +} from '../selectors/conversations.js'; +import { getDistributionListsWithMembers } from '../selectors/storyDistributionLists.js'; +import { getIntl, getTheme } from '../selectors/user.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.js'; +import { getHasStoryViewReceiptSetting } from '../selectors/items.js'; +import { useGlobalModalActions } from '../ducks/globalModals.js'; +import { useStoryDistributionListsActions } from '../ducks/storyDistributionLists.js'; +import { useStoriesActions } from '../ducks/stories.js'; +import { useConversationsActions } from '../ducks/conversations.js'; export const SmartStoriesSettingsModal = memo( function SmartStoriesSettingsModal() { diff --git a/ts/state/smart/StoriesTab.tsx b/ts/state/smart/StoriesTab.tsx index 4af7fd7b0e0..d6fa78af9f4 100644 --- a/ts/state/smart/StoriesTab.tsx +++ b/ts/state/smart/StoriesTab.tsx @@ -3,38 +3,38 @@ import React, { memo, useCallback, useEffect } from 'react'; import { useSelector } from 'react-redux'; -import { SmartStoryCreator } from './StoryCreator'; -import { SmartToastManager } from './ToastManager'; -import type { WidthBreakpoint } from '../../components/_util'; -import { StoriesTab } from '../../components/StoriesTab'; -import { getMaximumOutgoingAttachmentSizeInKb } from '../../types/AttachmentSize'; -import type { ConfigKeyType } from '../../RemoteConfig'; -import { getMe } from '../selectors/conversations'; -import { getIntl, getTheme } from '../selectors/user'; -import { getPreferredBadgeSelector } from '../selectors/badges'; +import { SmartStoryCreator } from './StoryCreator.js'; +import { SmartToastManager } from './ToastManager.js'; +import type { WidthBreakpoint } from '../../components/_util.js'; +import { StoriesTab } from '../../components/StoriesTab.js'; +import { getMaximumOutgoingAttachmentSizeInKb } from '../../types/AttachmentSize.js'; +import type { ConfigKeyType } from '../../RemoteConfig.js'; +import { getMe } from '../selectors/conversations.js'; +import { getIntl, getTheme } from '../selectors/user.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.js'; import { getHasStoryViewReceiptSetting, getNavTabsCollapsed, getPreferredLeftPaneWidth, getRemoteConfig, -} from '../selectors/items'; +} from '../selectors/items.js'; import { getAddStoryData, getHasAnyFailedStorySends, getSelectedStoryData, getStories, -} from '../selectors/stories'; -import { useConversationsActions } from '../ducks/conversations'; -import { useGlobalModalActions } from '../ducks/globalModals'; -import { useStoriesActions } from '../ducks/stories'; -import { useToastActions } from '../ducks/toast'; -import { useAudioPlayerActions } from '../ducks/audioPlayer'; -import { useItemsActions } from '../ducks/items'; -import { getHasPendingUpdate } from '../selectors/updates'; -import { getOtherTabsUnreadStats } from '../selectors/nav'; -import { getIsStoriesSettingsVisible } from '../selectors/globalModals'; -import type { StoryViewType } from '../../types/Stories'; -import { ForwardMessagesModalType } from '../../components/ForwardMessagesModal'; +} from '../selectors/stories.js'; +import { useConversationsActions } from '../ducks/conversations.js'; +import { useGlobalModalActions } from '../ducks/globalModals.js'; +import { useStoriesActions } from '../ducks/stories.js'; +import { useToastActions } from '../ducks/toast.js'; +import { useAudioPlayerActions } from '../ducks/audioPlayer.js'; +import { useItemsActions } from '../ducks/items.js'; +import { getHasPendingUpdate } from '../selectors/updates.js'; +import { getOtherTabsUnreadStats } from '../selectors/nav.js'; +import { getIsStoriesSettingsVisible } from '../selectors/globalModals.js'; +import type { StoryViewType } from '../../types/Stories.js'; +import { ForwardMessagesModalType } from '../../components/ForwardMessagesModal.js'; function renderStoryCreator(): JSX.Element { return ; diff --git a/ts/state/smart/StoryCreator.tsx b/ts/state/smart/StoryCreator.tsx index a9f3deef208..11012547b36 100644 --- a/ts/state/smart/StoryCreator.tsx +++ b/ts/state/smart/StoryCreator.tsx @@ -3,9 +3,9 @@ import React, { memo, useMemo } from 'react'; import { useSelector } from 'react-redux'; -import { ThemeType } from '../../types/Util'; -import { LinkPreviewSourceType } from '../../types/LinkPreview'; -import { StoryCreator } from '../../components/StoryCreator'; +import { ThemeType } from '../../types/Util.js'; +import { LinkPreviewSourceType } from '../../types/LinkPreview.js'; +import { StoryCreator } from '../../components/StoryCreator.js'; import { getAllSignalConnections, getCandidateContactsForNewGroup, @@ -13,33 +13,37 @@ import { getMe, getNonGroupStories, selectMostRecentActiveStoryTimestampByGroupOrDistributionList, -} from '../selectors/conversations'; -import { getDistributionListsWithMembers } from '../selectors/storyDistributionLists'; -import { getIntl, getPlatform, getUserConversationId } from '../selectors/user'; +} from '../selectors/conversations.js'; +import { getDistributionListsWithMembers } from '../selectors/storyDistributionLists.js'; +import { + getIntl, + getPlatform, + getUserConversationId, +} from '../selectors/user.js'; import { getInstalledStickerPacks, getRecentStickers, -} from '../selectors/stickers'; -import { getAddStoryData } from '../selectors/stories'; -import { getLinkPreview } from '../selectors/linkPreviews'; -import { getPreferredBadgeSelector } from '../selectors/badges'; +} from '../selectors/stickers.js'; +import { getAddStoryData } from '../selectors/stories.js'; +import { getLinkPreview } from '../selectors/linkPreviews.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.js'; import { getEmojiSkinToneDefault, getHasSetMyStoriesPrivacy, getTextFormattingEnabled, -} from '../selectors/items'; -import { imageToBlurHash } from '../../util/imageToBlurHash'; -import { processAttachment } from '../../util/processAttachment'; -import { useEmojisActions } from '../ducks/emojis'; -import { useAudioPlayerActions } from '../ducks/audioPlayer'; -import { useComposerActions } from '../ducks/composer'; -import { useConversationsActions } from '../ducks/conversations'; -import { useGlobalModalActions } from '../ducks/globalModals'; -import { useItemsActions } from '../ducks/items'; -import { useLinkPreviewActions } from '../ducks/linkPreviews'; -import { useRecentEmojis } from '../selectors/emojis'; -import { useStoriesActions } from '../ducks/stories'; -import { useStoryDistributionListsActions } from '../ducks/storyDistributionLists'; +} from '../selectors/items.js'; +import { imageToBlurHash } from '../../util/imageToBlurHash.js'; +import { processAttachment } from '../../util/processAttachment.js'; +import { useEmojisActions } from '../ducks/emojis.js'; +import { useAudioPlayerActions } from '../ducks/audioPlayer.js'; +import { useComposerActions } from '../ducks/composer.js'; +import { useConversationsActions } from '../ducks/conversations.js'; +import { useGlobalModalActions } from '../ducks/globalModals.js'; +import { useItemsActions } from '../ducks/items.js'; +import { useLinkPreviewActions } from '../ducks/linkPreviews.js'; +import { useRecentEmojis } from '../selectors/emojis.js'; +import { useStoriesActions } from '../ducks/stories.js'; +import { useStoryDistributionListsActions } from '../ducks/storyDistributionLists.js'; export type PropsType = { file?: File; diff --git a/ts/state/smart/StoryViewer.tsx b/ts/state/smart/StoryViewer.tsx index 02dce18bdf2..cd680003d36 100644 --- a/ts/state/smart/StoryViewer.tsx +++ b/ts/state/smart/StoryViewer.tsx @@ -3,40 +3,44 @@ import React, { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; -import { StoryViewer } from '../../components/StoryViewer'; -import { ToastType } from '../../types/Toast'; -import { useToastActions } from '../ducks/toast'; -import { getConversationSelector } from '../selectors/conversations'; +import { StoryViewer } from '../../components/StoryViewer.js'; +import { ToastType } from '../../types/Toast.js'; +import { useToastActions } from '../ducks/toast.js'; +import { getConversationSelector } from '../selectors/conversations.js'; import { getEmojiSkinToneDefault, getHasStoryViewReceiptSetting, getPreferredReactionEmoji, getTextFormattingEnabled, isInternalUser, -} from '../selectors/items'; -import { getIntl, getPlatform, getUserConversationId } from '../selectors/user'; -import { getPreferredBadgeSelector } from '../selectors/badges'; +} from '../selectors/items.js'; +import { + getIntl, + getPlatform, + getUserConversationId, +} from '../selectors/user.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.js'; import { getSelectedStoryData, getStoryReplies, getStoryByIdSelector, getHasAllStoriesUnmuted, -} from '../selectors/stories'; -import { isInFullScreenCall } from '../selectors/calling'; -import { isSignalConversation as getIsSignalConversation } from '../../util/isSignalConversation'; -import { renderEmojiPicker } from './renderEmojiPicker'; -import { strictAssert } from '../../util/assert'; -import { asyncShouldNeverBeCalled } from '../../util/shouldNeverBeCalled'; -import { useEmojisActions } from '../ducks/emojis'; -import { useConversationsActions } from '../ducks/conversations'; -import { useRecentEmojis } from '../selectors/emojis'; -import { useItemsActions } from '../ducks/items'; -import { useAudioPlayerActions } from '../ducks/audioPlayer'; -import { useGlobalModalActions } from '../ducks/globalModals'; -import { useStoriesActions } from '../ducks/stories'; -import { useIsWindowActive } from '../../hooks/useIsWindowActive'; -import type { DraftBodyRanges } from '../../types/BodyRange'; -import type { StoryViewType } from '../../types/Stories'; +} from '../selectors/stories.js'; +import { isInFullScreenCall } from '../selectors/calling.js'; +import { isSignalConversation as getIsSignalConversation } from '../../util/isSignalConversation.js'; +import { renderEmojiPicker } from './renderEmojiPicker.js'; +import { strictAssert } from '../../util/assert.js'; +import { asyncShouldNeverBeCalled } from '../../util/shouldNeverBeCalled.js'; +import { useEmojisActions } from '../ducks/emojis.js'; +import { useConversationsActions } from '../ducks/conversations.js'; +import { useRecentEmojis } from '../selectors/emojis.js'; +import { useItemsActions } from '../ducks/items.js'; +import { useAudioPlayerActions } from '../ducks/audioPlayer.js'; +import { useGlobalModalActions } from '../ducks/globalModals.js'; +import { useStoriesActions } from '../ducks/stories.js'; +import { useIsWindowActive } from '../../hooks/useIsWindowActive.js'; +import type { DraftBodyRanges } from '../../types/BodyRange.js'; +import type { StoryViewType } from '../../types/Stories.js'; export const SmartStoryViewer = memo(function SmartStoryViewer() { const { diff --git a/ts/state/smart/Timeline.tsx b/ts/state/smart/Timeline.tsx index 5a7f3fa9f36..dec46d2d824 100644 --- a/ts/state/smart/Timeline.tsx +++ b/ts/state/smart/Timeline.tsx @@ -5,23 +5,23 @@ import { isEmpty } from 'lodash'; import React, { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; import type { ReadonlyDeep } from 'type-fest'; -import type { WarningType as TimelineWarningType } from '../../components/conversation/Timeline'; -import { Timeline } from '../../components/conversation/Timeline'; -import { ContactSpoofingType } from '../../util/contactSpoofing'; -import { getGroupMemberships } from '../../util/getGroupMemberships'; +import type { WarningType as TimelineWarningType } from '../../components/conversation/Timeline.js'; +import { Timeline } from '../../components/conversation/Timeline.js'; +import { ContactSpoofingType } from '../../util/contactSpoofing.js'; +import { getGroupMemberships } from '../../util/getGroupMemberships.js'; import { dehydrateCollisionsWithConversations, getCollisionsFromMemberships, -} from '../../util/groupMemberNameCollisions'; -import { missingCaseError } from '../../util/missingCaseError'; -import { useCallingActions } from '../ducks/calling'; +} from '../../util/groupMemberNameCollisions.js'; +import { missingCaseError } from '../../util/missingCaseError.js'; +import { useCallingActions } from '../ducks/calling.js'; import { useConversationsActions, type ConversationType, -} from '../ducks/conversations'; -import type { StateType } from '../reducer'; -import { selectAudioPlayerActive } from '../selectors/audioPlayer'; -import { getPreferredBadgeSelector } from '../selectors/badges'; +} from '../ducks/conversations.js'; +import type { StateType } from '../reducer.js'; +import { selectAudioPlayerActive } from '../selectors/audioPlayer.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.js'; import { getConversationByServiceIdSelector, getConversationMessagesSelector, @@ -32,18 +32,21 @@ import { getSafeConversationWithSameTitle, getSelectedConversationId, getTargetedMessage, -} from '../selectors/conversations'; -import { getIntl, getTheme } from '../selectors/user'; -import type { PropsType as SmartCollidingAvatarsPropsType } from './CollidingAvatars'; -import { SmartCollidingAvatars } from './CollidingAvatars'; -import type { PropsType as SmartContactSpoofingReviewDialogPropsType } from './ContactSpoofingReviewDialog'; -import { SmartContactSpoofingReviewDialog } from './ContactSpoofingReviewDialog'; -import { SmartHeroRow } from './HeroRow'; -import { SmartMiniPlayer } from './MiniPlayer'; -import { SmartTimelineItem, type SmartTimelineItemProps } from './TimelineItem'; -import { SmartTypingBubble } from './TypingBubble'; -import { AttachmentDownloadManager } from '../../jobs/AttachmentDownloadManager'; -import { isInFullScreenCall as getIsInFullScreenCall } from '../selectors/calling'; +} from '../selectors/conversations.js'; +import { getIntl, getTheme } from '../selectors/user.js'; +import type { PropsType as SmartCollidingAvatarsPropsType } from './CollidingAvatars.js'; +import { SmartCollidingAvatars } from './CollidingAvatars.js'; +import type { PropsType as SmartContactSpoofingReviewDialogPropsType } from './ContactSpoofingReviewDialog.js'; +import { SmartContactSpoofingReviewDialog } from './ContactSpoofingReviewDialog.js'; +import { SmartHeroRow } from './HeroRow.js'; +import { SmartMiniPlayer } from './MiniPlayer.js'; +import { + SmartTimelineItem, + type SmartTimelineItemProps, +} from './TimelineItem.js'; +import { SmartTypingBubble } from './TypingBubble.js'; +import { AttachmentDownloadManager } from '../../jobs/AttachmentDownloadManager.js'; +import { isInFullScreenCall as getIsInFullScreenCall } from '../selectors/calling.js'; type ExternalProps = { id: string; diff --git a/ts/state/smart/TimelineItem.tsx b/ts/state/smart/TimelineItem.tsx index 447c2113f9f..6e0414851b1 100644 --- a/ts/state/smart/TimelineItem.tsx +++ b/ts/state/smart/TimelineItem.tsx @@ -5,37 +5,37 @@ import type { RefObject } from 'react'; import React, { useCallback, memo } from 'react'; import { useSelector } from 'react-redux'; -import { TimelineItem } from '../../components/conversation/TimelineItem'; -import type { WidthBreakpoint } from '../../components/_util'; -import { useConversationsActions } from '../ducks/conversations'; -import { useComposerActions } from '../ducks/composer'; -import { useGlobalModalActions } from '../ducks/globalModals'; -import { useAccountsActions } from '../ducks/accounts'; -import { useLightboxActions } from '../ducks/lightbox'; -import { useStoriesActions } from '../ducks/stories'; -import { useCallingActions } from '../ducks/calling'; -import { getPreferredBadgeSelector } from '../selectors/badges'; +import { TimelineItem } from '../../components/conversation/TimelineItem.js'; +import type { WidthBreakpoint } from '../../components/_util.js'; +import { useConversationsActions } from '../ducks/conversations.js'; +import { useComposerActions } from '../ducks/composer.js'; +import { useGlobalModalActions } from '../ducks/globalModals.js'; +import { useAccountsActions } from '../ducks/accounts.js'; +import { useLightboxActions } from '../ducks/lightbox.js'; +import { useStoriesActions } from '../ducks/stories.js'; +import { useCallingActions } from '../ducks/calling.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.js'; import { getIntl, getInteractionMode, getTheme, getPlatform, -} from '../selectors/user'; -import { getTargetedMessage } from '../selectors/conversations'; -import { useTimelineItem } from '../selectors/timeline'; +} from '../selectors/user.js'; +import { getTargetedMessage } from '../selectors/conversations.js'; +import { useTimelineItem } from '../selectors/timeline.js'; import { areMessagesInSameGroup, shouldCurrentMessageHideMetadata, UnreadIndicatorPlacement, -} from '../../util/timelineUtil'; +} from '../../util/timelineUtil.js'; -import { SmartContactName } from './ContactName'; -import { SmartUniversalTimerNotification } from './UniversalTimerNotification'; -import { isSameDay } from '../../util/timestamp'; -import { renderAudioAttachment } from './renderAudioAttachment'; -import { renderEmojiPicker } from './renderEmojiPicker'; -import { renderReactionPicker } from './renderReactionPicker'; -import type { MessageRequestState } from '../../components/conversation/MessageRequestActionsConfirmation'; +import { SmartContactName } from './ContactName.js'; +import { SmartUniversalTimerNotification } from './UniversalTimerNotification.js'; +import { isSameDay } from '../../util/timestamp.js'; +import { renderAudioAttachment } from './renderAudioAttachment.js'; +import { renderEmojiPicker } from './renderEmojiPicker.js'; +import { renderReactionPicker } from './renderReactionPicker.js'; +import type { MessageRequestState } from '../../components/conversation/MessageRequestActionsConfirmation.js'; export type SmartTimelineItemProps = { containerElementRef: RefObject; diff --git a/ts/state/smart/ToastManager.tsx b/ts/state/smart/ToastManager.tsx index ec9f515ec1e..ac22a756db3 100644 --- a/ts/state/smart/ToastManager.tsx +++ b/ts/state/smart/ToastManager.tsx @@ -3,31 +3,34 @@ import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import type { AnyActionableMegaphone } from '../../types/Megaphone'; -import { MegaphoneType } from '../../types/Megaphone'; -import { UsernameOnboardingState } from '../../types/globalModals'; -import OS from '../../util/os/osMain'; -import { drop } from '../../util/drop'; -import { getIntl } from '../selectors/user'; +import type { AnyActionableMegaphone } from '../../types/Megaphone.js'; +import { MegaphoneType } from '../../types/Megaphone.js'; +import { UsernameOnboardingState } from '../../types/globalModals.js'; +import OS from '../../util/os/osMain.js'; +import { drop } from '../../util/drop.js'; +import { getIntl } from '../selectors/user.js'; import { getGlobalModalsState, isShowingAnyModal as getIsShowingAnyModal, -} from '../selectors/globalModals'; -import { hasSelectedStoryData } from '../selectors/stories'; -import { shouldShowLightbox } from '../selectors/lightbox'; -import { isInFullScreenCall as getIsInFullScreenCall } from '../selectors/calling'; -import { getSelectedNavTab } from '../selectors/nav'; -import { getMe, getSelectedConversationId } from '../selectors/conversations'; -import { useConversationsActions } from '../ducks/conversations'; -import { useToastActions } from '../ducks/toast'; -import { useGlobalModalActions } from '../ducks/globalModals'; -import { useNavActions } from '../ducks/nav'; -import { NavTab } from '../../types/Nav'; -import { getHasCompletedUsernameOnboarding } from '../selectors/items'; -import { ToastManager } from '../../components/ToastManager'; -import type { WidthBreakpoint } from '../../components/_util'; -import { getToast } from '../selectors/toast'; -import { useDonationsActions } from '../ducks/donations'; +} from '../selectors/globalModals.js'; +import { hasSelectedStoryData } from '../selectors/stories.js'; +import { shouldShowLightbox } from '../selectors/lightbox.js'; +import { isInFullScreenCall as getIsInFullScreenCall } from '../selectors/calling.js'; +import { getSelectedNavTab } from '../selectors/nav.js'; +import { + getMe, + getSelectedConversationId, +} from '../selectors/conversations.js'; +import { useConversationsActions } from '../ducks/conversations.js'; +import { useToastActions } from '../ducks/toast.js'; +import { useGlobalModalActions } from '../ducks/globalModals.js'; +import { useNavActions } from '../ducks/nav.js'; +import { NavTab } from '../../types/Nav.js'; +import { getHasCompletedUsernameOnboarding } from '../selectors/items.js'; +import { ToastManager } from '../../components/ToastManager.js'; +import type { WidthBreakpoint } from '../../components/_util.js'; +import { getToast } from '../selectors/toast.js'; +import { useDonationsActions } from '../ducks/donations.js'; export type SmartPropsType = Readonly<{ disableMegaphone?: boolean; diff --git a/ts/state/smart/TypingBubble.tsx b/ts/state/smart/TypingBubble.tsx index d1b7359652a..0ab9fd35ada 100644 --- a/ts/state/smart/TypingBubble.tsx +++ b/ts/state/smart/TypingBubble.tsx @@ -4,15 +4,15 @@ import { last } from 'lodash'; import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { TypingBubble } from '../../components/conversation/TypingBubble'; -import { useGlobalModalActions } from '../ducks/globalModals'; -import { getIntl, getTheme } from '../selectors/user'; -import { useTimelineItem } from '../selectors/timeline'; +import { TypingBubble } from '../../components/conversation/TypingBubble.js'; +import { useGlobalModalActions } from '../ducks/globalModals.js'; +import { getIntl, getTheme } from '../selectors/user.js'; +import { useTimelineItem } from '../selectors/timeline.js'; import { getConversationSelector, getConversationMessagesSelector, -} from '../selectors/conversations'; -import { getPreferredBadgeSelector } from '../selectors/badges'; +} from '../selectors/conversations.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.js'; type ExternalProps = { conversationId: string; diff --git a/ts/state/smart/UniversalTimerNotification.tsx b/ts/state/smart/UniversalTimerNotification.tsx index 1fa924362a0..e20edcf7757 100644 --- a/ts/state/smart/UniversalTimerNotification.tsx +++ b/ts/state/smart/UniversalTimerNotification.tsx @@ -3,9 +3,9 @@ import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { UniversalTimerNotification } from '../../components/conversation/UniversalTimerNotification'; -import { getIntl } from '../selectors/user'; -import { getUniversalExpireTimer } from '../selectors/items'; +import { UniversalTimerNotification } from '../../components/conversation/UniversalTimerNotification.js'; +import { getIntl } from '../selectors/user.js'; +import { getUniversalExpireTimer } from '../selectors/items.js'; export const SmartUniversalTimerNotification = memo( function SmartUniversalTimerNotification() { diff --git a/ts/state/smart/UnsupportedOSDialog.tsx b/ts/state/smart/UnsupportedOSDialog.tsx index aed2b3adcbd..40774954ef6 100644 --- a/ts/state/smart/UnsupportedOSDialog.tsx +++ b/ts/state/smart/UnsupportedOSDialog.tsx @@ -3,11 +3,11 @@ import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { UnsupportedOSDialog } from '../../components/UnsupportedOSDialog'; -import { getIntl } from '../selectors/user'; -import { getExpirationTimestamp } from '../selectors/expiration'; -import type { WidthBreakpoint } from '../../components/_util'; -import OS from '../../util/os/osMain'; +import { UnsupportedOSDialog } from '../../components/UnsupportedOSDialog.js'; +import { getIntl } from '../selectors/user.js'; +import { getExpirationTimestamp } from '../selectors/expiration.js'; +import type { WidthBreakpoint } from '../../components/_util.js'; +import OS from '../../util/os/osMain.js'; export type PropsType = Readonly<{ type: 'warning' | 'error'; diff --git a/ts/state/smart/UpdateDialog.tsx b/ts/state/smart/UpdateDialog.tsx index 5b120edcf5a..bda3e0aa198 100644 --- a/ts/state/smart/UpdateDialog.tsx +++ b/ts/state/smart/UpdateDialog.tsx @@ -3,17 +3,17 @@ import { useSelector } from 'react-redux'; import React, { memo } from 'react'; -import { DialogUpdate } from '../../components/DialogUpdate'; -import { getIntl } from '../selectors/user'; -import type { WidthBreakpoint } from '../../components/_util'; -import { useUpdatesActions } from '../ducks/updates'; +import { DialogUpdate } from '../../components/DialogUpdate.js'; +import { getIntl } from '../selectors/user.js'; +import type { WidthBreakpoint } from '../../components/_util.js'; +import { useUpdatesActions } from '../ducks/updates.js'; import { getUpdateDialogType, getUpdateDownloadSize, getUpdateDownloadedSize, getUpdateVersion, -} from '../selectors/updates'; -import { DialogType } from '../../types/Dialogs'; +} from '../selectors/updates.js'; +import { DialogType } from '../../types/Dialogs.js'; type SmartUpdateDialogProps = Readonly<{ containerWidthBreakpoint: WidthBreakpoint; diff --git a/ts/state/smart/UsernameEditor.tsx b/ts/state/smart/UsernameEditor.tsx index e2cbf31ce3f..962a65cdac0 100644 --- a/ts/state/smart/UsernameEditor.tsx +++ b/ts/state/smart/UsernameEditor.tsx @@ -2,19 +2,19 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { UsernameEditor } from '../../components/UsernameEditor'; -import { getMinNickname, getMaxNickname } from '../../util/Username'; -import { getIntl } from '../selectors/user'; +import { UsernameEditor } from '../../components/UsernameEditor.js'; +import { getMinNickname, getMaxNickname } from '../../util/Username.js'; +import { getIntl } from '../selectors/user.js'; import { getUsernameReservationState, getUsernameReservationObject, getUsernameReservationError, getRecoveredUsername, -} from '../selectors/username'; -import { getUsernameCorrupted } from '../selectors/items'; -import { getMe } from '../selectors/conversations'; -import { useUsernameActions } from '../ducks/username'; -import { useToastActions } from '../ducks/toast'; +} from '../selectors/username.js'; +import { getUsernameCorrupted } from '../selectors/items.js'; +import { getMe } from '../selectors/conversations.js'; +import { useUsernameActions } from '../ducks/username.js'; +import { useToastActions } from '../ducks/toast.js'; export type SmartUsernameEditorProps = Readonly<{ onClose(): void; diff --git a/ts/state/smart/UsernameOnboardingModal.tsx b/ts/state/smart/UsernameOnboardingModal.tsx index db8e7b1da44..4d7d2ca3ba7 100644 --- a/ts/state/smart/UsernameOnboardingModal.tsx +++ b/ts/state/smart/UsernameOnboardingModal.tsx @@ -4,12 +4,12 @@ import React, { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; -import { UsernameOnboardingModal } from '../../components/UsernameOnboardingModal'; -import { getIntl } from '../selectors/user'; -import { useGlobalModalActions } from '../ducks/globalModals'; -import { useUsernameActions } from '../ducks/username'; -import { useNavActions } from '../ducks/nav'; -import { NavTab, SettingsPage, ProfileEditorPage } from '../../types/Nav'; +import { UsernameOnboardingModal } from '../../components/UsernameOnboardingModal.js'; +import { getIntl } from '../selectors/user.js'; +import { useGlobalModalActions } from '../ducks/globalModals.js'; +import { useUsernameActions } from '../ducks/username.js'; +import { useNavActions } from '../ducks/nav.js'; +import { NavTab, SettingsPage, ProfileEditorPage } from '../../types/Nav.js'; export const SmartUsernameOnboardingModal = memo( function SmartUsernameOnboardingModal(): JSX.Element { diff --git a/ts/state/smart/VoiceNotesPlaybackProvider.tsx b/ts/state/smart/VoiceNotesPlaybackProvider.tsx index abb18b703cb..d5e74a2a891 100644 --- a/ts/state/smart/VoiceNotesPlaybackProvider.tsx +++ b/ts/state/smart/VoiceNotesPlaybackProvider.tsx @@ -3,23 +3,23 @@ import React, { memo, useEffect } from 'react'; import { useSelector } from 'react-redux'; -import type { VoiceNotesPlaybackProps } from '../../components/VoiceNotesPlaybackContext'; -import { VoiceNotesPlaybackProvider } from '../../components/VoiceNotesPlaybackContext'; -import { selectAudioPlayerActive } from '../selectors/audioPlayer'; +import type { VoiceNotesPlaybackProps } from '../../components/VoiceNotesPlaybackContext.js'; +import { VoiceNotesPlaybackProvider } from '../../components/VoiceNotesPlaybackContext.js'; +import { selectAudioPlayerActive } from '../selectors/audioPlayer.js'; import { AudioPlayerContent, useAudioPlayerActions, -} from '../ducks/audioPlayer'; -import { globalMessageAudio } from '../../services/globalMessageAudio'; -import { strictAssert } from '../../util/assert'; -import { drop } from '../../util/drop'; -import { createLogger } from '../../logging/log'; -import { Sound, SoundType } from '../../util/Sound'; -import { getConversations } from '../selectors/conversations'; -import { SeenStatus } from '../../MessageSeenStatus'; -import { markViewed } from '../ducks/conversations'; -import * as Errors from '../../types/errors'; -import { usePrevious } from '../../hooks/usePrevious'; +} from '../ducks/audioPlayer.js'; +import { globalMessageAudio } from '../../services/globalMessageAudio.js'; +import { strictAssert } from '../../util/assert.js'; +import { drop } from '../../util/drop.js'; +import { createLogger } from '../../logging/log.js'; +import { Sound, SoundType } from '../../util/Sound.js'; +import { getConversations } from '../selectors/conversations.js'; +import { SeenStatus } from '../../MessageSeenStatus.js'; +import { markViewed } from '../ducks/conversations.js'; +import * as Errors from '../../types/errors.js'; +import { usePrevious } from '../../hooks/usePrevious.js'; const log = createLogger('VoiceNotesPlaybackProvider'); diff --git a/ts/state/smart/Waveform.tsx b/ts/state/smart/Waveform.tsx index 23551ae5c3c..09fd9e6ca5e 100644 --- a/ts/state/smart/Waveform.tsx +++ b/ts/state/smart/Waveform.tsx @@ -3,10 +3,10 @@ import { noop } from 'lodash'; import React, { memo, useEffect, useState } from 'react'; -import { Waveform } from '../../components/conversation/Waveform'; -import type { ComputePeaksResult } from '../../components/VoiceNotesPlaybackContext'; -import { VoiceNotesPlaybackContext } from '../../components/VoiceNotesPlaybackContext'; -import { createLogger } from '../../logging/log'; +import { Waveform } from '../../components/conversation/Waveform.js'; +import type { ComputePeaksResult } from '../../components/VoiceNotesPlaybackContext.js'; +import { VoiceNotesPlaybackContext } from '../../components/VoiceNotesPlaybackContext.js'; +import { createLogger } from '../../logging/log.js'; const log = createLogger('Waveform'); diff --git a/ts/state/smart/renderAudioAttachment.tsx b/ts/state/smart/renderAudioAttachment.tsx index 60d2a9dafe0..6c45d028caa 100644 --- a/ts/state/smart/renderAudioAttachment.tsx +++ b/ts/state/smart/renderAudioAttachment.tsx @@ -3,9 +3,9 @@ import type { ReactElement } from 'react'; import React from 'react'; -import { VoiceNotesPlaybackContext } from '../../components/VoiceNotesPlaybackContext'; -import type { Props as MessageAudioProps } from './MessageAudio'; -import { SmartMessageAudio } from './MessageAudio'; +import { VoiceNotesPlaybackContext } from '../../components/VoiceNotesPlaybackContext.js'; +import type { Props as MessageAudioProps } from './MessageAudio.js'; +import { SmartMessageAudio } from './MessageAudio.js'; type AudioAttachmentProps = Omit; diff --git a/ts/state/smart/renderEmojiPicker.tsx b/ts/state/smart/renderEmojiPicker.tsx index 84d29e40398..97512809377 100644 --- a/ts/state/smart/renderEmojiPicker.tsx +++ b/ts/state/smart/renderEmojiPicker.tsx @@ -3,8 +3,8 @@ import React from 'react'; -import type { RenderEmojiPickerProps } from '../../components/conversation/ReactionPicker'; -import { SmartEmojiPicker } from './EmojiPicker'; +import type { RenderEmojiPickerProps } from '../../components/conversation/ReactionPicker.js'; +import { SmartEmojiPicker } from './EmojiPicker.js'; export function renderEmojiPicker({ ref, diff --git a/ts/state/smart/renderReactionPicker.tsx b/ts/state/smart/renderReactionPicker.tsx index 002b51e8e05..c8ae37fad62 100644 --- a/ts/state/smart/renderReactionPicker.tsx +++ b/ts/state/smart/renderReactionPicker.tsx @@ -4,7 +4,7 @@ import type { ComponentProps } from 'react'; import React from 'react'; -import { SmartReactionPicker } from './ReactionPicker'; +import { SmartReactionPicker } from './ReactionPicker.js'; export const renderReactionPicker = ( props: ComponentProps diff --git a/ts/state/types.ts b/ts/state/types.ts index 4bffd2c808c..0ca24765556 100644 --- a/ts/state/types.ts +++ b/ts/state/types.ts @@ -1,40 +1,40 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { actions as accounts } from './ducks/accounts'; -import type { actions as app } from './ducks/app'; -import type { actions as audioPlayer } from './ducks/audioPlayer'; -import type { actions as audioRecorder } from './ducks/audioRecorder'; -import type { actions as badges } from './ducks/badges'; -import type { actions as callHistory } from './ducks/callHistory'; -import type { actions as calling } from './ducks/calling'; -import type { actions as chatFolders } from './ducks/chatFolders'; -import type { actions as composer } from './ducks/composer'; -import type { actions as conversations } from './ducks/conversations'; -import type { actions as crashReports } from './ducks/crashReports'; -import type { actions as donations } from './ducks/donations'; -import type { actions as emojis } from './ducks/emojis'; -import type { actions as expiration } from './ducks/expiration'; -import type { actions as gifs } from './ducks/gifs'; -import type { actions as globalModals } from './ducks/globalModals'; -import type { actions as inbox } from './ducks/inbox'; -import type { actions as installer } from './ducks/installer'; -import type { actions as items } from './ducks/items'; -import type { actions as lightbox } from './ducks/lightbox'; -import type { actions as linkPreviews } from './ducks/linkPreviews'; -import type { actions as mediaGallery } from './ducks/mediaGallery'; -import type { actions as nav } from './ducks/nav'; -import type { actions as network } from './ducks/network'; -import type { actions as notificationProfiles } from './ducks/notificationProfiles'; -import type { actions as safetyNumber } from './ducks/safetyNumber'; -import type { actions as search } from './ducks/search'; -import type { actions as stickers } from './ducks/stickers'; -import type { actions as stories } from './ducks/stories'; -import type { actions as storyDistributionLists } from './ducks/storyDistributionLists'; -import type { actions as toast } from './ducks/toast'; -import type { actions as updates } from './ducks/updates'; -import type { actions as user } from './ducks/user'; -import type { actions as username } from './ducks/username'; +import type { actions as accounts } from './ducks/accounts.js'; +import type { actions as app } from './ducks/app.js'; +import type { actions as audioPlayer } from './ducks/audioPlayer.js'; +import type { actions as audioRecorder } from './ducks/audioRecorder.js'; +import type { actions as badges } from './ducks/badges.js'; +import type { actions as callHistory } from './ducks/callHistory.js'; +import type { actions as calling } from './ducks/calling.js'; +import type { actions as chatFolders } from './ducks/chatFolders.js'; +import type { actions as composer } from './ducks/composer.js'; +import type { actions as conversations } from './ducks/conversations.js'; +import type { actions as crashReports } from './ducks/crashReports.js'; +import type { actions as donations } from './ducks/donations.js'; +import type { actions as emojis } from './ducks/emojis.js'; +import type { actions as expiration } from './ducks/expiration.js'; +import type { actions as gifs } from './ducks/gifs.js'; +import type { actions as globalModals } from './ducks/globalModals.js'; +import type { actions as inbox } from './ducks/inbox.js'; +import type { actions as installer } from './ducks/installer.js'; +import type { actions as items } from './ducks/items.js'; +import type { actions as lightbox } from './ducks/lightbox.js'; +import type { actions as linkPreviews } from './ducks/linkPreviews.js'; +import type { actions as mediaGallery } from './ducks/mediaGallery.js'; +import type { actions as nav } from './ducks/nav.js'; +import type { actions as network } from './ducks/network.js'; +import type { actions as notificationProfiles } from './ducks/notificationProfiles.js'; +import type { actions as safetyNumber } from './ducks/safetyNumber.js'; +import type { actions as search } from './ducks/search.js'; +import type { actions as stickers } from './ducks/stickers.js'; +import type { actions as stories } from './ducks/stories.js'; +import type { actions as storyDistributionLists } from './ducks/storyDistributionLists.js'; +import type { actions as toast } from './ducks/toast.js'; +import type { actions as updates } from './ducks/updates.js'; +import type { actions as user } from './ducks/user.js'; +import type { actions as username } from './ducks/username.js'; export type ReduxActions = { accounts: typeof accounts; diff --git a/ts/test-electron/ContactsParser_test.ts b/ts/test-electron/ContactsParser_test.ts index 3bef8edc934..63ba2eeed4e 100644 --- a/ts/test-electron/ContactsParser_test.ts +++ b/ts/test-electron/ContactsParser_test.ts @@ -2,28 +2,31 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { createReadStream, unlinkSync, writeFileSync } from 'fs'; +import { createReadStream, unlinkSync, writeFileSync } from 'node:fs'; import { v4 as generateGuid } from 'uuid'; -import { join } from 'path'; -import { pipeline } from 'stream/promises'; -import { Transform } from 'stream'; +import { join } from 'node:path'; +import { pipeline } from 'node:stream/promises'; +import { Transform } from 'node:stream'; -import protobuf from '../protobuf/wrap'; -import { createLogger } from '../logging/log'; -import * as Bytes from '../Bytes'; -import * as Errors from '../types/errors'; -import { APPLICATION_OCTET_STREAM } from '../types/MIME'; -import { type AciString, generateAci } from '../types/ServiceId'; -import { SignalService as Proto } from '../protobuf'; +import protobuf from '../protobuf/wrap.js'; +import { createLogger } from '../logging/log.js'; +import * as Bytes from '../Bytes.js'; +import * as Errors from '../types/errors.js'; +import { APPLICATION_OCTET_STREAM } from '../types/MIME.js'; +import { type AciString, generateAci } from '../types/ServiceId.js'; +import { SignalService as Proto } from '../protobuf/index.js'; import { ParseContactsTransform, parseContactsV2, -} from '../textsecure/ContactsParser'; -import type { ContactDetailsWithAvatar } from '../textsecure/ContactsParser'; -import { createTempDir, deleteTempDir } from '../updater/common'; -import { strictAssert } from '../util/assert'; -import { toAciObject } from '../util/ServiceId'; -import { generateKeys, encryptAttachmentV2ToDisk } from '../AttachmentCrypto'; +} from '../textsecure/ContactsParser.js'; +import type { ContactDetailsWithAvatar } from '../textsecure/ContactsParser.js'; +import { createTempDir, deleteTempDir } from '../updater/common.js'; +import { strictAssert } from '../util/assert.js'; +import { toAciObject } from '../util/ServiceId.js'; +import { + generateKeys, + encryptAttachmentV2ToDisk, +} from '../AttachmentCrypto.js'; const log = createLogger('ContactsParser_test'); diff --git a/ts/test-electron/ConversationController_test.ts b/ts/test-electron/ConversationController_test.ts index 78306cb3a7d..97688cd9766 100644 --- a/ts/test-electron/ConversationController_test.ts +++ b/ts/test-electron/ConversationController_test.ts @@ -3,13 +3,17 @@ import { assert } from 'chai'; -import { strictAssert } from '../util/assert'; -import { DataWriter } from '../sql/Client'; +import { strictAssert } from '../util/assert.js'; +import { DataWriter } from '../sql/Client.js'; -import type { ConversationModel } from '../models/conversations'; -import type { AciString, PniString, ServiceIdString } from '../types/ServiceId'; -import { generateAci, generatePni } from '../types/ServiceId'; -import type { SafeCombineConversationsParams } from '../ConversationController'; +import type { ConversationModel } from '../models/conversations.js'; +import type { + AciString, + PniString, + ServiceIdString, +} from '../types/ServiceId.js'; +import { generateAci, generatePni } from '../types/ServiceId.js'; +import type { SafeCombineConversationsParams } from '../ConversationController.js'; const ACI_1 = generateAci(); const ACI_2 = generateAci(); diff --git a/ts/test-electron/Crypto_test.ts b/ts/test-electron/Crypto_test.ts index e6defe96269..ab6b872556d 100644 --- a/ts/test-electron/Crypto_test.ts +++ b/ts/test-electron/Crypto_test.ts @@ -1,17 +1,17 @@ // Copyright 2015 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { readFileSync, unlinkSync, writeFileSync } from 'fs'; -import { join } from 'path'; -import { createCipheriv } from 'crypto'; -import { PassThrough } from 'stream'; +import { readFileSync, unlinkSync, writeFileSync } from 'node:fs'; +import { join } from 'node:path'; +import { createCipheriv } from 'node:crypto'; +import { PassThrough } from 'node:stream'; import { emptyDir } from 'fs-extra'; import { assert } from 'chai'; import { isNumber } from 'lodash'; -import { createLogger } from '../logging/log'; -import * as Bytes from '../Bytes'; -import * as Curve from '../Curve'; +import { createLogger } from '../logging/log.js'; +import * as Bytes from '../Bytes.js'; +import * as Curve from '../Curve.js'; import { PaddedLengths, encryptProfileItemWithPadding, @@ -39,7 +39,7 @@ import { decryptAttachmentV1, padAndEncryptAttachment, CipherType, -} from '../Crypto'; +} from '../Crypto.js'; import { _generateAttachmentIv, decryptAttachmentV2, @@ -50,11 +50,11 @@ import { generateAttachmentKeys, type DecryptedAttachmentV2, decryptAttachmentV2ToSink, -} from '../AttachmentCrypto'; -import type { AciString, PniString } from '../types/ServiceId'; -import { createTempDir, deleteTempDir } from '../updater/common'; -import { uuidToBytes, bytesToUuid } from '../util/uuidToBytes'; -import { getPath } from '../windows/main/attachments'; +} from '../AttachmentCrypto.js'; +import type { AciString, PniString } from '../types/ServiceId.js'; +import { createTempDir, deleteTempDir } from '../updater/common.js'; +import { uuidToBytes, bytesToUuid } from '../util/uuidToBytes.js'; +import { getPath } from '../windows/main/attachments.js'; const log = createLogger('Crypto_test'); diff --git a/ts/test-electron/Curve_test.ts b/ts/test-electron/Curve_test.ts index 8fb475a0481..cfc2b9966d9 100644 --- a/ts/test-electron/Curve_test.ts +++ b/ts/test-electron/Curve_test.ts @@ -3,8 +3,8 @@ import { assert } from 'chai'; -import * as Bytes from '../Bytes'; -import { constantTimeEqual } from '../Crypto'; +import * as Bytes from '../Bytes.js'; +import { constantTimeEqual } from '../Crypto.js'; import { calculateSignature, clampPrivateKey, @@ -15,7 +15,7 @@ import { generateSignedPreKey, isNonNegativeInteger, verifySignature, -} from '../Curve'; +} from '../Curve.js'; describe('Curve', () => { it('verifySignature roundtrip', () => { diff --git a/ts/test-electron/MessageReceipts_test.ts b/ts/test-electron/MessageReceipts_test.ts index 0be56903110..c7434a0c921 100644 --- a/ts/test-electron/MessageReceipts_test.ts +++ b/ts/test-electron/MessageReceipts_test.ts @@ -4,19 +4,19 @@ import { v4 as uuid } from 'uuid'; import { assert } from 'chai'; -import { type AciString, generateAci } from '../types/ServiceId'; -import type { MessageAttributesType } from '../model-types'; -import { DataReader, DataWriter } from '../sql/Client'; -import { SendStatus } from '../messages/MessageSendState'; +import { type AciString, generateAci } from '../types/ServiceId.js'; +import type { MessageAttributesType } from '../model-types.js'; +import { DataReader, DataWriter } from '../sql/Client.js'; +import { SendStatus } from '../messages/MessageSendState.js'; import type { MessageReceiptAttributesType, MessageReceiptType, -} from '../messageModifiers/MessageReceipts'; +} from '../messageModifiers/MessageReceipts.js'; import { onReceipt, messageReceiptTypeSchema, -} from '../messageModifiers/MessageReceipts'; -import { ReadStatus } from '../messages/MessageReadStatus'; +} from '../messageModifiers/MessageReceipts.js'; +import { ReadStatus } from '../messages/MessageReadStatus.js'; describe('MessageReceipts', () => { let ourAci: AciString; diff --git a/ts/test-electron/MessageReceiver_test.ts b/ts/test-electron/MessageReceiver_test.ts index a4f8e3e95e3..61c5d72e5d4 100644 --- a/ts/test-electron/MessageReceiver_test.ts +++ b/ts/test-electron/MessageReceiver_test.ts @@ -6,15 +6,15 @@ import { assert } from 'chai'; import Long from 'long'; -import MessageReceiver from '../textsecure/MessageReceiver'; -import { IncomingWebSocketRequestLegacy } from '../textsecure/WebsocketResources'; -import type { DecryptionErrorEvent } from '../textsecure/messageReceiverEvents'; -import { generateAci } from '../types/ServiceId'; -import type { AciString } from '../types/ServiceId'; -import { toAciObject } from '../util/ServiceId'; -import { SignalService as Proto } from '../protobuf'; -import * as Crypto from '../Crypto'; -import { toBase64 } from '../Bytes'; +import MessageReceiver from '../textsecure/MessageReceiver.js'; +import { IncomingWebSocketRequestLegacy } from '../textsecure/WebsocketResources.js'; +import type { DecryptionErrorEvent } from '../textsecure/messageReceiverEvents.js'; +import { generateAci } from '../types/ServiceId.js'; +import type { AciString } from '../types/ServiceId.js'; +import { toAciObject } from '../util/ServiceId.js'; +import { SignalService as Proto } from '../protobuf/index.js'; +import * as Crypto from '../Crypto.js'; +import { toBase64 } from '../Bytes.js'; describe('MessageReceiver', () => { const someAci = generateAci(); diff --git a/ts/test-electron/SignalProtocolStore_test.ts b/ts/test-electron/SignalProtocolStore_test.ts index 7d4ef4ef512..1218a5b7d85 100644 --- a/ts/test-electron/SignalProtocolStore_test.ts +++ b/ts/test-electron/SignalProtocolStore_test.ts @@ -14,26 +14,26 @@ import { } from '@signalapp/libsignal-client'; import { v4 as generateUuid } from 'uuid'; -import { DataReader, DataWriter } from '../sql/Client'; -import { signal } from '../protobuf/compiled'; -import { sessionStructureToBytes } from '../util/sessionTranslation'; -import * as durations from '../util/durations'; -import { explodePromise } from '../util/explodePromise'; -import { Zone } from '../util/Zone'; +import { DataReader, DataWriter } from '../sql/Client.js'; +import { signal } from '../protobuf/compiled.js'; +import { sessionStructureToBytes } from '../util/sessionTranslation.js'; +import * as durations from '../util/durations/index.js'; +import { explodePromise } from '../util/explodePromise.js'; +import { Zone } from '../util/Zone.js'; -import * as Bytes from '../Bytes'; -import { getRandomBytes, constantTimeEqual } from '../Crypto'; +import * as Bytes from '../Bytes.js'; +import { getRandomBytes, constantTimeEqual } from '../Crypto.js'; import { clampPrivateKey, setPublicKeyTypeByte, generateSignedPreKey, -} from '../Curve'; -import type { SignalProtocolStore } from '../SignalProtocolStore'; -import { GLOBAL_ZONE } from '../SignalProtocolStore'; -import { Address } from '../types/Address'; -import { QualifiedAddress } from '../types/QualifiedAddress'; -import { generateAci, generatePni } from '../types/ServiceId'; -import type { IdentityKeyType, KeyPairType } from '../textsecure/Types.d'; +} from '../Curve.js'; +import type { SignalProtocolStore } from '../SignalProtocolStore.js'; +import { GLOBAL_ZONE } from '../SignalProtocolStore.js'; +import { Address } from '../types/Address.js'; +import { QualifiedAddress } from '../types/QualifiedAddress.js'; +import { generateAci, generatePni } from '../types/ServiceId.js'; +import type { IdentityKeyType, KeyPairType } from '../textsecure/Types.d.ts'; const { RecordStructure, diff --git a/ts/test-electron/WebsocketResources_test.ts b/ts/test-electron/WebsocketResources_test.ts index aee6859efd7..dd5e2f62fb9 100644 --- a/ts/test-electron/WebsocketResources_test.ts +++ b/ts/test-electron/WebsocketResources_test.ts @@ -9,16 +9,16 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; -import EventEmitter from 'events'; +import EventEmitter from 'node:events'; import type { connection as WebSocket } from 'websocket'; import Long from 'long'; -import { dropNull } from '../util/dropNull'; -import { SignalService as Proto } from '../protobuf'; +import { dropNull } from '../util/dropNull.js'; +import { SignalService as Proto } from '../protobuf/index.js'; import WebSocketResource, { ServerRequestType, -} from '../textsecure/WebsocketResources'; +} from '../textsecure/WebsocketResources.js'; describe('WebSocket-Resource', () => { class FakeSocket extends EventEmitter { diff --git a/ts/test-electron/background_test.ts b/ts/test-electron/background_test.ts index 2f25ff2127f..73f358ba5d5 100644 --- a/ts/test-electron/background_test.ts +++ b/ts/test-electron/background_test.ts @@ -4,8 +4,8 @@ import { assert } from 'chai'; import { pick } from 'lodash'; -import { isOverHourIntoPast, cleanupSessionResets } from '../background'; -import { DataWriter } from '../sql/Client'; +import { isOverHourIntoPast, cleanupSessionResets } from '../background.js'; +import { DataWriter } from '../sql/Client.js'; describe('#isOverHourIntoPast', () => { it('returns false for now', () => { diff --git a/ts/test-electron/backup/attachments_test.ts b/ts/test-electron/backup/attachments_test.ts index 13af7b540a9..31d6a16ac7f 100644 --- a/ts/test-electron/backup/attachments_test.ts +++ b/ts/test-electron/backup/attachments_test.ts @@ -5,16 +5,16 @@ import { v4 as generateGuid } from 'uuid'; import { BackupLevel } from '@signalapp/libsignal-client/zkgroup'; import { omit } from 'lodash'; import * as sinon from 'sinon'; -import { join } from 'path'; +import { join } from 'node:path'; import { assert } from 'chai'; -import type { ConversationModel } from '../../models/conversations'; -import * as Bytes from '../../Bytes'; -import { DataWriter } from '../../sql/Client'; -import { type AciString, generateAci } from '../../types/ServiceId'; -import { ReadStatus } from '../../messages/MessageReadStatus'; -import { SeenStatus } from '../../MessageSeenStatus'; -import { setupBasics, asymmetricRoundtripHarness } from './helpers'; +import type { ConversationModel } from '../../models/conversations.js'; +import * as Bytes from '../../Bytes.js'; +import { DataWriter } from '../../sql/Client.js'; +import { type AciString, generateAci } from '../../types/ServiceId.js'; +import { ReadStatus } from '../../messages/MessageReadStatus.js'; +import { SeenStatus } from '../../MessageSeenStatus.js'; +import { setupBasics, asymmetricRoundtripHarness } from './helpers.js'; import { AUDIO_MP3, IMAGE_JPEG, @@ -22,26 +22,26 @@ import { IMAGE_WEBP, LONG_MESSAGE, VIDEO_MP4, -} from '../../types/MIME'; +} from '../../types/MIME.js'; import type { MessageAttributesType, QuotedMessageType, -} from '../../model-types'; +} from '../../model-types.js'; import { hasRequiredInformationForBackup, isVoiceMessage, type AttachmentType, -} from '../../types/Attachment'; -import { strictAssert } from '../../util/assert'; -import { SignalService } from '../../protobuf'; -import { getRandomBytes } from '../../Crypto'; -import { loadAllAndReinitializeRedux } from '../../services/allLoaders'; +} from '../../types/Attachment.js'; +import { strictAssert } from '../../util/assert.js'; +import { SignalService } from '../../protobuf/index.js'; +import { getRandomBytes } from '../../Crypto.js'; +import { loadAllAndReinitializeRedux } from '../../services/allLoaders.js'; import { generateAttachmentKeys, generateKeys, getPlaintextHashForInMemoryAttachment, -} from '../../AttachmentCrypto'; -import { KIBIBYTE } from '../../types/AttachmentSize'; +} from '../../AttachmentCrypto.js'; +import { KIBIBYTE } from '../../types/AttachmentSize.js'; const CONTACT_A = generateAci(); diff --git a/ts/test-electron/backup/backup_groupv2_notifications_test.ts b/ts/test-electron/backup/backup_groupv2_notifications_test.ts index 7fe89acdbb5..e34358362fc 100644 --- a/ts/test-electron/backup/backup_groupv2_notifications_test.ts +++ b/ts/test-electron/backup/backup_groupv2_notifications_test.ts @@ -3,26 +3,26 @@ import { v4 as generateGuid } from 'uuid'; -import { DataWriter } from '../../sql/Client'; -import { SignalService as Proto } from '../../protobuf'; +import { DataWriter } from '../../sql/Client.js'; +import { SignalService as Proto } from '../../protobuf/index.js'; -import { generateAci, generatePni } from '../../types/ServiceId'; -import type { MessageAttributesType } from '../../model-types'; -import type { GroupV2ChangeType } from '../../groups'; -import { getRandomBytes } from '../../Crypto'; -import * as Bytes from '../../Bytes'; -import { strictAssert } from '../../util/assert'; -import { DurationInSeconds } from '../../util/durations'; +import { generateAci, generatePni } from '../../types/ServiceId.js'; +import type { MessageAttributesType } from '../../model-types.js'; +import type { GroupV2ChangeType } from '../../groups.js'; +import { getRandomBytes } from '../../Crypto.js'; +import * as Bytes from '../../Bytes.js'; +import { strictAssert } from '../../util/assert.js'; +import { DurationInSeconds } from '../../util/durations/index.js'; import { OUR_ACI, OUR_PNI, setupBasics, asymmetricRoundtripHarness, symmetricRoundtripHarness, -} from './helpers'; -import { ReadStatus } from '../../messages/MessageReadStatus'; -import { SeenStatus } from '../../MessageSeenStatus'; -import { loadAllAndReinitializeRedux } from '../../services/allLoaders'; +} from './helpers.js'; +import { ReadStatus } from '../../messages/MessageReadStatus.js'; +import { SeenStatus } from '../../MessageSeenStatus.js'; +import { loadAllAndReinitializeRedux } from '../../services/allLoaders.js'; // Note: this should be kept up to date with GroupV2Change.stories.tsx, to // maintain the comprehensive set of GroupV2 notifications we need to handle diff --git a/ts/test-electron/backup/bubble_test.ts b/ts/test-electron/backup/bubble_test.ts index ac512884273..21109e27bbc 100644 --- a/ts/test-electron/backup/bubble_test.ts +++ b/ts/test-electron/backup/bubble_test.ts @@ -3,30 +3,30 @@ import { v4 as generateGuid } from 'uuid'; -import { SendStatus } from '../../messages/MessageSendState'; -import type { ConversationModel } from '../../models/conversations'; -import { GiftBadgeStates } from '../../components/conversation/Message'; +import { SendStatus } from '../../messages/MessageSendState.js'; +import type { ConversationModel } from '../../models/conversations.js'; +import { GiftBadgeStates } from '../../components/conversation/Message.js'; -import { DataWriter } from '../../sql/Client'; -import { getRandomBytes } from '../../Crypto'; -import * as Bytes from '../../Bytes'; -import { generateAci } from '../../types/ServiceId'; -import { ReadStatus } from '../../messages/MessageReadStatus'; -import { SeenStatus } from '../../MessageSeenStatus'; -import { ID_V1_LENGTH } from '../../groups'; -import { DurationInSeconds, WEEK } from '../../util/durations'; +import { DataWriter } from '../../sql/Client.js'; +import { getRandomBytes } from '../../Crypto.js'; +import * as Bytes from '../../Bytes.js'; +import { generateAci } from '../../types/ServiceId.js'; +import { ReadStatus } from '../../messages/MessageReadStatus.js'; +import { SeenStatus } from '../../MessageSeenStatus.js'; +import { ID_V1_LENGTH } from '../../groups.js'; +import { DurationInSeconds, WEEK } from '../../util/durations/index.js'; import { setupBasics, asymmetricRoundtripHarness, symmetricRoundtripHarness, OUR_ACI, -} from './helpers'; -import { loadAllAndReinitializeRedux } from '../../services/allLoaders'; -import { strictAssert } from '../../util/assert'; -import type { MessageAttributesType } from '../../model-types'; -import { IMAGE_PNG, TEXT_ATTACHMENT } from '../../types/MIME'; -import { MY_STORY_ID } from '../../types/Stories'; -import { generateAttachmentKeys } from '../../AttachmentCrypto'; +} from './helpers.js'; +import { loadAllAndReinitializeRedux } from '../../services/allLoaders.js'; +import { strictAssert } from '../../util/assert.js'; +import type { MessageAttributesType } from '../../model-types.js'; +import { IMAGE_PNG, TEXT_ATTACHMENT } from '../../types/MIME.js'; +import { MY_STORY_ID } from '../../types/Stories.js'; +import { generateAttachmentKeys } from '../../AttachmentCrypto.js'; const CONTACT_A = generateAci(); const CONTACT_B = generateAci(); diff --git a/ts/test-electron/backup/calling_test.ts b/ts/test-electron/backup/calling_test.ts index f5b2bbe94aa..1fde0a38b1d 100644 --- a/ts/test-electron/backup/calling_test.ts +++ b/ts/test-electron/backup/calling_test.ts @@ -1,20 +1,20 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import assert from 'assert'; +import assert from 'node:assert'; import { v4 as generateGuid } from 'uuid'; import { CallLinkRootKey } from '@signalapp/ringrtc'; -import type { ConversationModel } from '../../models/conversations'; -import type { MessageAttributesType } from '../../model-types'; -import type { CallHistoryDetails } from '../../types/CallDisposition'; -import type { CallLinkType } from '../../types/CallLink'; +import type { ConversationModel } from '../../models/conversations.js'; +import type { MessageAttributesType } from '../../model-types.js'; +import type { CallHistoryDetails } from '../../types/CallDisposition.js'; +import type { CallLinkType } from '../../types/CallLink.js'; -import * as Bytes from '../../Bytes'; -import { getRandomBytes } from '../../Crypto'; -import { DataReader, DataWriter } from '../../sql/Client'; -import { generateAci } from '../../types/ServiceId'; -import { setupBasics, symmetricRoundtripHarness } from './helpers'; +import * as Bytes from '../../Bytes.js'; +import { getRandomBytes } from '../../Crypto.js'; +import { DataReader, DataWriter } from '../../sql/Client.js'; +import { generateAci } from '../../types/ServiceId.js'; +import { setupBasics, symmetricRoundtripHarness } from './helpers.js'; import { AdhocCallStatus, CallDirection, @@ -22,14 +22,14 @@ import { CallType, DirectCallStatus, GroupCallStatus, -} from '../../types/CallDisposition'; -import { CallLinkRestrictions } from '../../types/CallLink'; -import { getRoomIdFromRootKey } from '../../util/callLinksRingrtc'; -import { fromAdminKeyBytes } from '../../util/callLinks'; -import { ReadStatus } from '../../messages/MessageReadStatus'; -import { SeenStatus } from '../../MessageSeenStatus'; -import { deriveGroupID, deriveGroupSecretParams } from '../../util/zkgroup'; -import { loadAllAndReinitializeRedux } from '../../services/allLoaders'; +} from '../../types/CallDisposition.js'; +import { CallLinkRestrictions } from '../../types/CallLink.js'; +import { getRoomIdFromRootKey } from '../../util/callLinksRingrtc.js'; +import { fromAdminKeyBytes } from '../../util/callLinks.js'; +import { ReadStatus } from '../../messages/MessageReadStatus.js'; +import { SeenStatus } from '../../MessageSeenStatus.js'; +import { deriveGroupID, deriveGroupSecretParams } from '../../util/zkgroup.js'; +import { loadAllAndReinitializeRedux } from '../../services/allLoaders.js'; const CONTACT_A = generateAci(); const GROUP_MASTER_KEY = getRandomBytes(32); diff --git a/ts/test-electron/backup/conversations_test.ts b/ts/test-electron/backup/conversations_test.ts index 151132eb548..543ef744994 100644 --- a/ts/test-electron/backup/conversations_test.ts +++ b/ts/test-electron/backup/conversations_test.ts @@ -2,16 +2,16 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { randomBytes } from 'crypto'; -import { getRandomBytes } from '../../Crypto'; -import * as Bytes from '../../Bytes'; -import { setupBasics, symmetricRoundtripHarness } from './helpers'; -import { loadAllAndReinitializeRedux } from '../../services/allLoaders'; -import { deriveGroupID, deriveGroupSecretParams } from '../../util/zkgroup'; -import { DataWriter } from '../../sql/Client'; -import { generateAci, generatePni } from '../../types/ServiceId'; -import type { ConversationAttributesType } from '../../model-types'; -import { strictAssert } from '../../util/assert'; +import { randomBytes } from 'node:crypto'; +import { getRandomBytes } from '../../Crypto.js'; +import * as Bytes from '../../Bytes.js'; +import { setupBasics, symmetricRoundtripHarness } from './helpers.js'; +import { loadAllAndReinitializeRedux } from '../../services/allLoaders.js'; +import { deriveGroupID, deriveGroupSecretParams } from '../../util/zkgroup.js'; +import { DataWriter } from '../../sql/Client.js'; +import { generateAci, generatePni } from '../../types/ServiceId.js'; +import type { ConversationAttributesType } from '../../model-types.js'; +import { strictAssert } from '../../util/assert.js'; function getGroupTestInfo() { const masterKey = getRandomBytes(32); diff --git a/ts/test-electron/backup/filePointer_test.ts b/ts/test-electron/backup/filePointer_test.ts index d455472a180..26358ef1b83 100644 --- a/ts/test-electron/backup/filePointer_test.ts +++ b/ts/test-electron/backup/filePointer_test.ts @@ -4,23 +4,23 @@ import { assert } from 'chai'; import Long from 'long'; import * as sinon from 'sinon'; import { BackupLevel } from '@signalapp/libsignal-client/zkgroup'; -import { randomBytes } from 'crypto'; -import { join } from 'path'; +import { randomBytes } from 'node:crypto'; +import { join } from 'node:path'; -import { Backups } from '../../protobuf'; +import { Backups } from '../../protobuf/index.js'; import { getFilePointerForAttachment, convertFilePointerToAttachment, -} from '../../services/backups/util/filePointers'; -import { IMAGE_PNG } from '../../types/MIME'; -import * as Bytes from '../../Bytes'; -import { type AttachmentType } from '../../types/Attachment'; -import { MASTER_KEY, MEDIA_ROOT_KEY } from './helpers'; -import { generateKeys } from '../../AttachmentCrypto'; -import type { GetBackupCdnInfoType } from '../../services/backups/util/mediaId'; -import { strictAssert } from '../../util/assert'; -import { isValidAttachmentKey } from '../../types/Crypto'; +} from '../../services/backups/util/filePointers.js'; +import { IMAGE_PNG } from '../../types/MIME.js'; +import * as Bytes from '../../Bytes.js'; +import { type AttachmentType } from '../../types/Attachment.js'; +import { MASTER_KEY, MEDIA_ROOT_KEY } from './helpers.js'; +import { generateKeys } from '../../AttachmentCrypto.js'; +import type { GetBackupCdnInfoType } from '../../services/backups/util/mediaId.js'; +import { strictAssert } from '../../util/assert.js'; +import { isValidAttachmentKey } from '../../types/Crypto.js'; describe('convertFilePointerToAttachment', () => { const commonFilePointerProps = { diff --git a/ts/test-electron/backup/helpers.ts b/ts/test-electron/backup/helpers.ts index e702f36657b..9f0b4740346 100644 --- a/ts/test-electron/backup/helpers.ts +++ b/ts/test-electron/backup/helpers.ts @@ -2,11 +2,11 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import path from 'path'; -import { tmpdir } from 'os'; +import path from 'node:path'; +import { tmpdir } from 'node:os'; import { omit, sortBy } from 'lodash'; -import { createReadStream } from 'fs'; -import { mkdtemp, rm } from 'fs/promises'; +import { createReadStream } from 'node:fs'; +import { mkdtemp, rm } from 'node:fs/promises'; import * as sinon from 'sinon'; import { BackupLevel } from '@signalapp/libsignal-client/zkgroup'; import { AccountEntropyPool } from '@signalapp/libsignal-client/dist/AccountKeys'; @@ -15,19 +15,19 @@ import type { EditHistoryType, MessageAttributesType, MessageReactionType, -} from '../../model-types'; +} from '../../model-types.js'; import type { SendStateByConversationId, SendState, -} from '../../messages/MessageSendState'; +} from '../../messages/MessageSendState.js'; -import { backupsService } from '../../services/backups'; -import { isUnsupportedMessage } from '../../state/selectors/message'; -import { generateAci, generatePni } from '../../types/ServiceId'; -import { DataReader, DataWriter } from '../../sql/Client'; -import { getRandomBytes } from '../../Crypto'; -import * as Bytes from '../../Bytes'; -import { postSaveUpdates } from '../../util/cleanup'; +import { backupsService } from '../../services/backups/index.js'; +import { isUnsupportedMessage } from '../../state/selectors/message.js'; +import { generateAci, generatePni } from '../../types/ServiceId.js'; +import { DataReader, DataWriter } from '../../sql/Client.js'; +import { getRandomBytes } from '../../Crypto.js'; +import * as Bytes from '../../Bytes.js'; +import { postSaveUpdates } from '../../util/cleanup.js'; export const OUR_ACI = generateAci(); export const OUR_PNI = generatePni(); diff --git a/ts/test-electron/backup/integration_test.ts b/ts/test-electron/backup/integration_test.ts index c58681438e2..e77902467d6 100644 --- a/ts/test-electron/backup/integration_test.ts +++ b/ts/test-electron/backup/integration_test.ts @@ -12,11 +12,11 @@ import { } from '@signalapp/libsignal-client/dist/MessageBackup'; import { assert } from 'chai'; -import { clearData } from './helpers'; -import { loadAllAndReinitializeRedux } from '../../services/allLoaders'; -import { backupsService, BackupType } from '../../services/backups'; -import { MemoryStream } from '../../services/backups/util/MemoryStream'; -import { initialize as initializeExpiringMessageService } from '../../services/expiringMessagesDeletion'; +import { clearData } from './helpers.js'; +import { loadAllAndReinitializeRedux } from '../../services/allLoaders.js'; +import { backupsService, BackupType } from '../../services/backups/index.js'; +import { MemoryStream } from '../../services/backups/util/MemoryStream.js'; +import { initialize as initializeExpiringMessageService } from '../../services/expiringMessagesDeletion.js'; const { BACKUP_INTEGRATION_DIR } = process.env; diff --git a/ts/test-electron/backup/non_bubble_test.ts b/ts/test-electron/backup/non_bubble_test.ts index 721b1fdf193..101a40d6cf9 100644 --- a/ts/test-electron/backup/non_bubble_test.ts +++ b/ts/test-electron/backup/non_bubble_test.ts @@ -4,27 +4,27 @@ import { v4 as generateGuid } from 'uuid'; import Long from 'long'; -import type { ConversationModel } from '../../models/conversations'; +import type { ConversationModel } from '../../models/conversations.js'; -import { getRandomBytes } from '../../Crypto'; -import * as Bytes from '../../Bytes'; -import { SignalService as Proto, Backups } from '../../protobuf'; -import { DataWriter } from '../../sql/Client'; -import { APPLICATION_OCTET_STREAM } from '../../types/MIME'; -import { generateAci } from '../../types/ServiceId'; -import { PaymentEventKind } from '../../types/Payment'; -import { ContactFormType } from '../../types/EmbeddedContact'; -import { MessageRequestResponseEvent } from '../../types/MessageRequestResponseEvent'; -import { DurationInSeconds } from '../../util/durations'; -import { ReadStatus } from '../../messages/MessageReadStatus'; -import { SeenStatus } from '../../MessageSeenStatus'; +import { getRandomBytes } from '../../Crypto.js'; +import * as Bytes from '../../Bytes.js'; +import { SignalService as Proto, Backups } from '../../protobuf/index.js'; +import { DataWriter } from '../../sql/Client.js'; +import { APPLICATION_OCTET_STREAM } from '../../types/MIME.js'; +import { generateAci } from '../../types/ServiceId.js'; +import { PaymentEventKind } from '../../types/Payment.js'; +import { ContactFormType } from '../../types/EmbeddedContact.js'; +import { MessageRequestResponseEvent } from '../../types/MessageRequestResponseEvent.js'; +import { DurationInSeconds } from '../../util/durations/index.js'; +import { ReadStatus } from '../../messages/MessageReadStatus.js'; +import { SeenStatus } from '../../MessageSeenStatus.js'; import { setupBasics, asymmetricRoundtripHarness, symmetricRoundtripHarness, OUR_ACI, -} from './helpers'; -import { loadAllAndReinitializeRedux } from '../../services/allLoaders'; +} from './helpers.js'; +import { loadAllAndReinitializeRedux } from '../../services/allLoaders.js'; const CONTACT_A = generateAci(); const GROUP_ID = Bytes.toBase64(getRandomBytes(32)); diff --git a/ts/test-electron/cleanupOrphanedAttachments_test.ts b/ts/test-electron/cleanupOrphanedAttachments_test.ts index 57750493104..cbea215eb0c 100644 --- a/ts/test-electron/cleanupOrphanedAttachments_test.ts +++ b/ts/test-electron/cleanupOrphanedAttachments_test.ts @@ -4,19 +4,19 @@ import { assert } from 'chai'; import { emptyDir, ensureFile } from 'fs-extra'; import { v4 as generateUuid } from 'uuid'; -import { readdirSync } from 'fs'; -import { dirname } from 'path'; +import { readdirSync } from 'node:fs'; +import { dirname } from 'node:path'; -import { DataWriter } from '../sql/Client'; -import { missingCaseError } from '../util/missingCaseError'; +import { DataWriter } from '../sql/Client.js'; +import { missingCaseError } from '../util/missingCaseError.js'; import { getDownloadsPath, getDraftPath, getPath, -} from '../windows/main/attachments'; +} from '../windows/main/attachments.js'; -import { generateAci } from '../types/ServiceId'; -import { IMAGE_JPEG, LONG_MESSAGE } from '../types/MIME'; +import { generateAci } from '../types/ServiceId.js'; +import { IMAGE_JPEG, LONG_MESSAGE } from '../types/MIME.js'; function getAbsolutePath( path: string, diff --git a/ts/test-electron/components/Avatar_test.tsx b/ts/test-electron/components/Avatar_test.tsx index 6b69bd67b9f..3208bfefd76 100644 --- a/ts/test-electron/components/Avatar_test.tsx +++ b/ts/test-electron/components/Avatar_test.tsx @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { _getBadgeSize, _getBadgePlacement } from '../../components/Avatar'; +import { _getBadgeSize, _getBadgePlacement } from '../../components/Avatar.js'; describe('', () => { describe('_getBadgeSize', () => { diff --git a/ts/test-electron/context/Crypto_test.ts b/ts/test-electron/context/Crypto_test.ts index 874335272d6..70aff6450fe 100644 --- a/ts/test-electron/context/Crypto_test.ts +++ b/ts/test-electron/context/Crypto_test.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import crypto from 'crypto'; +import crypto from 'node:crypto'; import { CipherType, @@ -11,7 +11,7 @@ import { sign, encrypt, decrypt, -} from '../../Crypto'; +} from '../../Crypto.js'; describe('SignalContext.Crypto', () => { describe('hash', () => { diff --git a/ts/test-electron/context/createNativeThemeListener_test.ts b/ts/test-electron/context/createNativeThemeListener_test.ts index 126d735f403..cd13f4f2fe7 100644 --- a/ts/test-electron/context/createNativeThemeListener_test.ts +++ b/ts/test-electron/context/createNativeThemeListener_test.ts @@ -2,15 +2,15 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { EventEmitter } from 'events'; +import { EventEmitter } from 'node:events'; import type { MinimalIPC, SystemThemeHolder, -} from '../../context/createNativeThemeListener'; -import { createNativeThemeListener } from '../../context/createNativeThemeListener'; -import type { NativeThemeState } from '../../types/NativeThemeNotifier.d'; -import { SystemThemeType } from '../../types/Util'; +} from '../../context/createNativeThemeListener.js'; +import { createNativeThemeListener } from '../../context/createNativeThemeListener.js'; +import type { NativeThemeState } from '../../types/NativeThemeNotifier.d.ts'; +import { SystemThemeType } from '../../types/Util.js'; class FakeIPC extends EventEmitter implements MinimalIPC { constructor(private readonly state: NativeThemeState) { diff --git a/ts/test-electron/linkPreviews/linkPreviewFetch_test.ts b/ts/test-electron/linkPreviews/linkPreviewFetch_test.ts index 02bfd18fb0c..747a0597ae4 100644 --- a/ts/test-electron/linkPreviews/linkPreviewFetch_test.ts +++ b/ts/test-electron/linkPreviews/linkPreviewFetch_test.ts @@ -4,15 +4,15 @@ import { assert } from 'chai'; import { Response } from 'node-fetch'; import * as sinon from 'sinon'; -import * as fs from 'fs'; -import * as path from 'path'; -import { IMAGE_JPEG, IMAGE_WEBP, stringToMIMEType } from '../../types/MIME'; -import type { LoggerType } from '../../types/Logging'; +import * as fs from 'node:fs'; +import * as path from 'node:path'; +import { IMAGE_JPEG, IMAGE_WEBP, stringToMIMEType } from '../../types/MIME.js'; +import type { LoggerType } from '../../types/Logging.js'; import { fetchLinkPreviewImage, fetchLinkPreviewMetadata, -} from '../../linkPreviews/linkPreviewFetch'; +} from '../../linkPreviews/linkPreviewFetch.js'; async function readFixtureImage(filename: string): Promise { const result = await fs.promises.readFile( diff --git a/ts/test-electron/models/conversations_test.ts b/ts/test-electron/models/conversations_test.ts index 118a9e53451..3f3f62525d5 100644 --- a/ts/test-electron/models/conversations_test.ts +++ b/ts/test-electron/models/conversations_test.ts @@ -4,13 +4,13 @@ import { assert } from 'chai'; import { v7 as generateUuid } from 'uuid'; -import { DataWriter } from '../../sql/Client'; -import { SendStatus } from '../../messages/MessageSendState'; -import { IMAGE_PNG } from '../../types/MIME'; -import { generateAci, generatePni } from '../../types/ServiceId'; -import { MessageModel } from '../../models/messages'; -import { DurationInSeconds } from '../../util/durations'; -import { ConversationModel } from '../../models/conversations'; +import { DataWriter } from '../../sql/Client.js'; +import { SendStatus } from '../../messages/MessageSendState.js'; +import { IMAGE_PNG } from '../../types/MIME.js'; +import { generateAci, generatePni } from '../../types/ServiceId.js'; +import { MessageModel } from '../../models/messages.js'; +import { DurationInSeconds } from '../../util/durations/index.js'; +import { ConversationModel } from '../../models/conversations.js'; describe('Conversations', () => { async function resetConversationController(): Promise { diff --git a/ts/test-electron/models/messages_test.ts b/ts/test-electron/models/messages_test.ts index d4a394623ed..d35fbca46f8 100644 --- a/ts/test-electron/models/messages_test.ts +++ b/ts/test-electron/models/messages_test.ts @@ -5,21 +5,21 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; import { v4 as generateUuid } from 'uuid'; -import type { AttachmentType } from '../../types/Attachment'; -import type { CallbackResultType } from '../../textsecure/Types.d'; -import type { ConversationModel } from '../../models/conversations'; -import type { MessageAttributesType } from '../../model-types.d'; -import { MessageModel } from '../../models/messages'; -import type { RawBodyRange } from '../../types/BodyRange'; -import type { WebAPIType } from '../../textsecure/WebAPI'; -import { DataWriter } from '../../sql/Client'; -import MessageSender from '../../textsecure/SendMessage'; +import type { AttachmentType } from '../../types/Attachment.js'; +import type { CallbackResultType } from '../../textsecure/Types.d.ts'; +import type { ConversationModel } from '../../models/conversations.js'; +import type { MessageAttributesType } from '../../model-types.d.ts'; +import { MessageModel } from '../../models/messages.js'; +import type { RawBodyRange } from '../../types/BodyRange.js'; +import type { WebAPIType } from '../../textsecure/WebAPI.js'; +import { DataWriter } from '../../sql/Client.js'; +import MessageSender from '../../textsecure/SendMessage.js'; import enMessages from '../../../_locales/en/messages.json'; -import { SendStatus } from '../../messages/MessageSendState'; -import { SignalService as Proto } from '../../protobuf'; -import { generateAci } from '../../types/ServiceId'; -import { getAuthor } from '../../messages/helpers'; -import { setupI18n } from '../../util/setupI18n'; +import { SendStatus } from '../../messages/MessageSendState.js'; +import { SignalService as Proto } from '../../protobuf/index.js'; +import { generateAci } from '../../types/ServiceId.js'; +import { getAuthor } from '../../messages/helpers.js'; +import { setupI18n } from '../../util/setupI18n.js'; import { APPLICATION_JSON, AUDIO_MP3, @@ -28,10 +28,10 @@ import { LONG_MESSAGE, TEXT_ATTACHMENT, VIDEO_MP4, -} from '../../types/MIME'; -import { getNotificationDataForMessage } from '../../util/getNotificationDataForMessage'; -import { getNotificationTextForMessage } from '../../util/getNotificationTextForMessage'; -import { send } from '../../messages/send'; +} from '../../types/MIME.js'; +import { getNotificationDataForMessage } from '../../util/getNotificationDataForMessage.js'; +import { getNotificationTextForMessage } from '../../util/getNotificationTextForMessage.js'; +import { send } from '../../messages/send.js'; describe('Message', () => { const i18n = setupI18n('en', enMessages); diff --git a/ts/test-electron/normalizedAttachments_test.ts b/ts/test-electron/normalizedAttachments_test.ts index 961751bffea..9ec7c28a5e7 100644 --- a/ts/test-electron/normalizedAttachments_test.ts +++ b/ts/test-electron/normalizedAttachments_test.ts @@ -4,27 +4,27 @@ import { assert } from 'chai'; import { v4 as generateGuid } from 'uuid'; -import * as Bytes from '../Bytes'; +import * as Bytes from '../Bytes.js'; import type { EphemeralAttachmentFields, ScreenshotType, AttachmentType, ThumbnailType, BackupThumbnailType, -} from '../types/Attachment'; +} from '../types/Attachment.js'; import { APPLICATION_OCTET_STREAM, IMAGE_JPEG, IMAGE_PNG, LONG_MESSAGE, -} from '../types/MIME'; -import type { MessageAttributesType } from '../model-types'; -import { generateAci } from '../types/ServiceId'; -import { ReadStatus } from '../messages/MessageReadStatus'; -import { SeenStatus } from '../MessageSeenStatus'; -import { DataWriter, DataReader } from '../sql/Client'; -import { strictAssert } from '../util/assert'; -import { HOUR, MINUTE } from '../util/durations'; +} from '../types/MIME.js'; +import type { MessageAttributesType } from '../model-types.js'; +import { generateAci } from '../types/ServiceId.js'; +import { ReadStatus } from '../messages/MessageReadStatus.js'; +import { SeenStatus } from '../MessageSeenStatus.js'; +import { DataWriter, DataReader } from '../sql/Client.js'; +import { strictAssert } from '../util/assert.js'; +import { HOUR, MINUTE } from '../util/durations/index.js'; const CONTACT_A = generateAci(); const contactAConversationId = generateGuid(); diff --git a/ts/test-electron/quill/emoji/completion_test.tsx b/ts/test-electron/quill/emoji/completion_test.tsx index 30b09016465..d68e8bcf4a4 100644 --- a/ts/test-electron/quill/emoji/completion_test.tsx +++ b/ts/test-electron/quill/emoji/completion_test.tsx @@ -4,25 +4,25 @@ import { assert } from 'chai'; import sinon from 'sinon'; -import { EmojiCompletion } from '../../../quill/emoji/completion'; +import { EmojiCompletion } from '../../../quill/emoji/completion.js'; import type { EmojiCompletionOptions, InsertEmojiOptionsType, -} from '../../../quill/emoji/completion'; +} from '../../../quill/emoji/completion.js'; import { EmojiSkinTone, emojiVariantConstant, getEmojiParentKeyByVariantKey, -} from '../../../components/fun/data/emojis'; +} from '../../../components/fun/data/emojis.js'; import { _createFunEmojiSearch, createFunEmojiSearchIndex, -} from '../../../components/fun/useFunEmojiSearch'; +} from '../../../components/fun/useFunEmojiSearch.js'; import { _createFunEmojiLocalizer, createFunEmojiLocalizerIndex, -} from '../../../components/fun/useFunEmojiLocalizer'; -import type { LocaleEmojiListType } from '../../../types/emoji'; +} from '../../../components/fun/useFunEmojiLocalizer.js'; +import type { LocaleEmojiListType } from '../../../types/emoji.js'; const EMOJI_VARIANTS = { SMILE: emojiVariantConstant('\u{1F604}'), diff --git a/ts/test-electron/quill/memberRepository_test.ts b/ts/test-electron/quill/memberRepository_test.ts index 5ea77f0e6d4..1f4a321f086 100644 --- a/ts/test-electron/quill/memberRepository_test.ts +++ b/ts/test-electron/quill/memberRepository_test.ts @@ -3,11 +3,11 @@ import { assert } from 'chai'; -import { generateAci } from '../../types/ServiceId'; -import { isAciString } from '../../util/isAciString'; -import type { ConversationType } from '../../state/ducks/conversations'; -import { MemberRepository, _toMembers } from '../../quill/memberRepository'; -import { getDefaultConversationWithServiceId } from '../../test-helpers/getDefaultConversation'; +import { generateAci } from '../../types/ServiceId.js'; +import { isAciString } from '../../util/isAciString.js'; +import type { ConversationType } from '../../state/ducks/conversations.js'; +import { MemberRepository, _toMembers } from '../../quill/memberRepository.js'; +import { getDefaultConversationWithServiceId } from '../../test-helpers/getDefaultConversation.js'; const UNKNOWN_SERVICE_ID = generateAci(); diff --git a/ts/test-electron/quill/mentions/completion_test.tsx b/ts/test-electron/quill/mentions/completion_test.tsx index 9e2f1fa1d0f..5a4cfb7658e 100644 --- a/ts/test-electron/quill/mentions/completion_test.tsx +++ b/ts/test-electron/quill/mentions/completion_test.tsx @@ -9,14 +9,17 @@ import type Quill from '@signalapp/quill-cjs'; import type Keyboard from '@signalapp/quill-cjs/modules/keyboard'; import type { MutableRefObject } from 'react'; -import type { MentionCompletionOptions } from '../../../quill/mentions/completion'; -import { MentionCompletion } from '../../../quill/mentions/completion'; -import type { ConversationType } from '../../../state/ducks/conversations'; -import { MemberRepository, _toMembers } from '../../../quill/memberRepository'; -import type { MemberType } from '../../../quill/memberRepository'; -import { ThemeType } from '../../../types/Util'; -import { getDefaultConversationWithServiceId } from '../../../test-helpers/getDefaultConversation'; -import { setupI18n } from '../../../util/setupI18n'; +import type { MentionCompletionOptions } from '../../../quill/mentions/completion.js'; +import { MentionCompletion } from '../../../quill/mentions/completion.js'; +import type { ConversationType } from '../../../state/ducks/conversations.js'; +import { + MemberRepository, + _toMembers, +} from '../../../quill/memberRepository.js'; +import type { MemberType } from '../../../quill/memberRepository.js'; +import { ThemeType } from '../../../types/Util.js'; +import { getDefaultConversationWithServiceId } from '../../../test-helpers/getDefaultConversation.js'; +import { setupI18n } from '../../../util/setupI18n.js'; type MiniLeafBlot = { value: () => string; diff --git a/ts/test-electron/quill/mentions/matchers_test.ts b/ts/test-electron/quill/mentions/matchers_test.ts index e9c97563268..6788dd72ffe 100644 --- a/ts/test-electron/quill/mentions/matchers_test.ts +++ b/ts/test-electron/quill/mentions/matchers_test.ts @@ -5,12 +5,12 @@ import { assert } from 'chai'; import type { RefObject } from 'react'; import { Delta } from '@signalapp/quill-cjs'; -import type { AciString } from '../../../types/ServiceId'; -import { generateAci } from '../../../types/ServiceId'; -import { matchMention } from '../../../quill/mentions/matchers'; -import { MemberRepository } from '../../../quill/memberRepository'; -import type { ConversationType } from '../../../state/ducks/conversations'; -import { getDefaultConversationWithServiceId } from '../../../test-helpers/getDefaultConversation'; +import type { AciString } from '../../../types/ServiceId.js'; +import { generateAci } from '../../../types/ServiceId.js'; +import { matchMention } from '../../../quill/mentions/matchers.js'; +import { MemberRepository } from '../../../quill/memberRepository.js'; +import type { ConversationType } from '../../../state/ducks/conversations.js'; +import { getDefaultConversationWithServiceId } from '../../../test-helpers/getDefaultConversation.js'; const ACI_1 = generateAci(); diff --git a/ts/test-electron/quill/util_test.ts b/ts/test-electron/quill/util_test.ts index d4cec93f3c3..cf40bc7e75f 100644 --- a/ts/test-electron/quill/util_test.ts +++ b/ts/test-electron/quill/util_test.ts @@ -7,9 +7,9 @@ import { getDeltaToRemoveStaleMentions, getTextAndRangesFromOps, getDeltaToRestartMention, -} from '../../quill/util'; -import { BodyRange } from '../../types/BodyRange'; -import { generateAci } from '../../types/ServiceId'; +} from '../../quill/util.js'; +import { BodyRange } from '../../types/BodyRange.js'; +import { generateAci } from '../../types/ServiceId.js'; const SERVICE_ID_1 = generateAci(); const SERVICE_ID_2 = generateAci(); diff --git a/ts/test-electron/routineProfileRefresh_test.ts b/ts/test-electron/routineProfileRefresh_test.ts index 6173e72e6fc..e2a93070433 100644 --- a/ts/test-electron/routineProfileRefresh_test.ts +++ b/ts/test-electron/routineProfileRefresh_test.ts @@ -5,13 +5,13 @@ import * as sinon from 'sinon'; import { v4 as generateUuid } from 'uuid'; import { times } from 'lodash'; -import { ConversationModel } from '../models/conversations'; -import type { ConversationAttributesType } from '../model-types.d'; -import { generateAci } from '../types/ServiceId'; -import { DAY, HOUR, MINUTE, MONTH } from '../util/durations'; +import { ConversationModel } from '../models/conversations.js'; +import type { ConversationAttributesType } from '../model-types.d.ts'; +import { generateAci } from '../types/ServiceId.js'; +import { DAY, HOUR, MINUTE, MONTH } from '../util/durations/index.js'; -import { routineProfileRefresh } from '../routineProfileRefresh'; -import type { getProfile } from '../util/getProfile'; +import { routineProfileRefresh } from '../routineProfileRefresh.js'; +import type { getProfile } from '../util/getProfile.js'; describe('routineProfileRefresh', () => { let sinonSandbox: sinon.SinonSandbox; diff --git a/ts/test-electron/scrollUtil_test.ts b/ts/test-electron/scrollUtil_test.ts index 6664c76ddde..dd7b8c138df 100644 --- a/ts/test-electron/scrollUtil_test.ts +++ b/ts/test-electron/scrollUtil_test.ts @@ -7,7 +7,7 @@ import { getScrollBottom, scrollToBottom, setScrollBottom, -} from '../util/scrollUtil'; +} from '../util/scrollUtil.js'; describe('scroll utilities', () => { let sandbox: HTMLDivElement; diff --git a/ts/test-electron/services/ActiveWindowService_test.ts b/ts/test-electron/services/ActiveWindowService_test.ts index 15187f81885..751c70fdd91 100644 --- a/ts/test-electron/services/ActiveWindowService_test.ts +++ b/ts/test-electron/services/ActiveWindowService_test.ts @@ -3,9 +3,9 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; -import { EventEmitter } from 'events'; +import { EventEmitter } from 'node:events'; -import { getActiveWindowService } from '../../services/ActiveWindowService'; +import { getActiveWindowService } from '../../services/ActiveWindowService.js'; describe('ActiveWindowService', () => { const fakeIpcEvent = {}; diff --git a/ts/test-electron/services/AttachmentBackupManager_test.ts b/ts/test-electron/services/AttachmentBackupManager_test.ts index c90daa0616f..d5594a0a034 100644 --- a/ts/test-electron/services/AttachmentBackupManager_test.ts +++ b/ts/test-electron/services/AttachmentBackupManager_test.ts @@ -3,29 +3,29 @@ import * as sinon from 'sinon'; import { assert } from 'chai'; -import { join } from 'path'; -import { createWriteStream } from 'fs'; +import { join } from 'node:path'; +import { createWriteStream } from 'node:fs'; import { ensureFile } from 'fs-extra'; -import * as Bytes from '../../Bytes'; +import * as Bytes from '../../Bytes.js'; import { AttachmentBackupManager, FILE_NOT_FOUND_ON_TRANSIT_TIER_STATUS, runAttachmentBackupJob, -} from '../../jobs/AttachmentBackupManager'; +} from '../../jobs/AttachmentBackupManager.js'; import type { AttachmentBackupJobType, CoreAttachmentBackupJobType, StandardAttachmentBackupJobType, ThumbnailAttachmentBackupJobType, -} from '../../types/AttachmentBackup'; -import { DataWriter } from '../../sql/Client'; -import { getRandomBytes } from '../../Crypto'; -import { APPLICATION_OCTET_STREAM, VIDEO_MP4 } from '../../types/MIME'; -import { createName, getRelativePath } from '../../util/attachmentPath'; -import { encryptAttachmentV2, generateKeys } from '../../AttachmentCrypto'; -import { SECOND } from '../../util/durations'; -import { HTTPError } from '../../textsecure/Errors'; +} from '../../types/AttachmentBackup.js'; +import { DataWriter } from '../../sql/Client.js'; +import { getRandomBytes } from '../../Crypto.js'; +import { APPLICATION_OCTET_STREAM, VIDEO_MP4 } from '../../types/MIME.js'; +import { createName, getRelativePath } from '../../util/attachmentPath.js'; +import { encryptAttachmentV2, generateKeys } from '../../AttachmentCrypto.js'; +import { SECOND } from '../../util/durations/index.js'; +import { HTTPError } from '../../textsecure/Errors.js'; const TRANSIT_CDN = 2; const TRANSIT_CDN_FOR_NEW_UPLOAD = 42; diff --git a/ts/test-electron/services/AttachmentDownloadManager_test.ts b/ts/test-electron/services/AttachmentDownloadManager_test.ts index 593623a22d9..8ce54f46b54 100644 --- a/ts/test-electron/services/AttachmentDownloadManager_test.ts +++ b/ts/test-electron/services/AttachmentDownloadManager_test.ts @@ -6,32 +6,35 @@ import * as sinon from 'sinon'; import { assert } from 'chai'; import { omit } from 'lodash'; -import type { StatsFs } from 'fs'; +import type { StatsFs } from 'node:fs'; -import * as MIME from '../../types/MIME'; +import * as MIME from '../../types/MIME.js'; import { AttachmentDownloadManager, runDownloadAttachmentJobInner, type NewAttachmentDownloadJobType, -} from '../../jobs/AttachmentDownloadManager'; +} from '../../jobs/AttachmentDownloadManager.js'; import { type AttachmentDownloadJobType, AttachmentDownloadUrgency, -} from '../../types/AttachmentDownload'; -import { DataReader, DataWriter } from '../../sql/Client'; -import { DAY, MINUTE, MONTH } from '../../util/durations'; -import { type AttachmentType, AttachmentVariant } from '../../types/Attachment'; -import { strictAssert } from '../../util/assert'; -import type { downloadAttachment as downloadAttachmentUtil } from '../../util/downloadAttachment'; -import { AttachmentDownloadSource } from '../../sql/Interface'; +} from '../../types/AttachmentDownload.js'; +import { DataReader, DataWriter } from '../../sql/Client.js'; +import { DAY, MINUTE, MONTH } from '../../util/durations/index.js'; +import { + type AttachmentType, + AttachmentVariant, +} from '../../types/Attachment.js'; +import { strictAssert } from '../../util/assert.js'; +import type { downloadAttachment as downloadAttachmentUtil } from '../../util/downloadAttachment.js'; +import { AttachmentDownloadSource } from '../../sql/Interface.js'; import { generateAttachmentKeys, getAttachmentCiphertextLength, -} from '../../AttachmentCrypto'; -import { MEBIBYTE } from '../../types/AttachmentSize'; -import { generateAci } from '../../types/ServiceId'; -import { toBase64, toHex } from '../../Bytes'; -import { getRandomBytes } from '../../Crypto'; +} from '../../AttachmentCrypto.js'; +import { MEBIBYTE } from '../../types/AttachmentSize.js'; +import { generateAci } from '../../types/ServiceId.js'; +import { toBase64, toHex } from '../../Bytes.js'; +import { getRandomBytes } from '../../Crypto.js'; function composeJob({ messageId, diff --git a/ts/test-electron/services/MessageCache_test.ts b/ts/test-electron/services/MessageCache_test.ts index 960ab6385ee..454298af5f7 100644 --- a/ts/test-electron/services/MessageCache_test.ts +++ b/ts/test-electron/services/MessageCache_test.ts @@ -3,12 +3,12 @@ import { assert } from 'chai'; import { v4 as uuid } from 'uuid'; -import { MessageModel } from '../../models/messages'; -import { strictAssert } from '../../util/assert'; +import { MessageModel } from '../../models/messages.js'; +import { strictAssert } from '../../util/assert.js'; -import { MessageCache } from '../../services/MessageCache'; -import { generateAci } from '../../types/ServiceId'; -import { DataWriter } from '../../sql/Client'; +import { MessageCache } from '../../services/MessageCache.js'; +import { generateAci } from '../../types/ServiceId.js'; +import { DataWriter } from '../../sql/Client.js'; describe('MessageCache', () => { beforeEach(async () => { diff --git a/ts/test-electron/services/ReleaseNotesFetcher_test.ts b/ts/test-electron/services/ReleaseNotesFetcher_test.ts index aa6d7c2393f..e74c1b21579 100644 --- a/ts/test-electron/services/ReleaseNotesFetcher_test.ts +++ b/ts/test-electron/services/ReleaseNotesFetcher_test.ts @@ -3,16 +3,16 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; -import { EventEmitter } from 'events'; +import { EventEmitter } from 'node:events'; import { v4 as uuid } from 'uuid'; -import { ReleaseNotesFetcher } from '../../services/releaseNotesFetcher'; -import * as durations from '../../util/durations'; -import { generateAci } from '../../types/ServiceId'; -import { saveNewMessageBatcher } from '../../util/messageBatcher'; -import type { WebAPIType } from '../../textsecure/WebAPI'; -import type { CIType } from '../../CI'; -import type { ConversationModel } from '../../models/conversations'; +import { ReleaseNotesFetcher } from '../../services/releaseNotesFetcher.js'; +import * as durations from '../../util/durations/index.js'; +import { generateAci } from '../../types/ServiceId.js'; +import { saveNewMessageBatcher } from '../../util/messageBatcher.js'; +import type { WebAPIType } from '../../textsecure/WebAPI.js'; +import type { CIType } from '../../CI.js'; +import type { ConversationModel } from '../../models/conversations.js'; const waitUntil = ( condition: () => boolean, diff --git a/ts/test-electron/services/areWeASubscriber_test.ts b/ts/test-electron/services/areWeASubscriber_test.ts index fcbb260f4e6..d2c9489ec06 100644 --- a/ts/test-electron/services/areWeASubscriber_test.ts +++ b/ts/test-electron/services/areWeASubscriber_test.ts @@ -3,8 +3,8 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; -import { AreWeASubscriberService } from '../../services/areWeASubscriber'; -import { explodePromise } from '../../util/explodePromise'; +import { AreWeASubscriberService } from '../../services/areWeASubscriber.js'; +import { explodePromise } from '../../util/explodePromise.js'; describe('"are we a subscriber?" service', () => { const subscriberId = new Uint8Array([1, 2, 3]); diff --git a/ts/test-electron/services/profiles_test.ts b/ts/test-electron/services/profiles_test.ts index 4f2ab242937..89350e71b0b 100644 --- a/ts/test-electron/services/profiles_test.ts +++ b/ts/test-electron/services/profiles_test.ts @@ -2,13 +2,13 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { sleep } from '../../util/sleep'; -import { MINUTE } from '../../util/durations'; -import { drop } from '../../util/drop'; +import { sleep } from '../../util/sleep.js'; +import { MINUTE } from '../../util/durations/index.js'; +import { drop } from '../../util/drop.js'; -import { ProfileService } from '../../services/profiles'; -import { generateAci } from '../../types/ServiceId'; -import { HTTPError } from '../../textsecure/Errors'; +import { ProfileService } from '../../services/profiles.js'; +import { generateAci } from '../../types/ServiceId.js'; +import { HTTPError } from '../../textsecure/Errors.js'; describe('util/profiles', () => { const SERVICE_ID_1 = generateAci(); diff --git a/ts/test-electron/services/senderCertificate_test.ts b/ts/test-electron/services/senderCertificate_test.ts index 996fee4d67f..52d8ef8129f 100644 --- a/ts/test-electron/services/senderCertificate_test.ts +++ b/ts/test-electron/services/senderCertificate_test.ts @@ -13,12 +13,12 @@ import { ServerCertificate, } from '@signalapp/libsignal-client'; -import * as durations from '../../util/durations'; -import { drop } from '../../util/drop'; -import * as Bytes from '../../Bytes'; -import { SenderCertificateMode } from '../../textsecure/OutgoingMessage'; +import * as durations from '../../util/durations/index.js'; +import { drop } from '../../util/drop.js'; +import * as Bytes from '../../Bytes.js'; +import { SenderCertificateMode } from '../../textsecure/OutgoingMessage.js'; -import { SenderCertificateService } from '../../services/senderCertificate'; +import { SenderCertificateService } from '../../services/senderCertificate.js'; describe('SenderCertificateService', () => { const FIFTEEN_MINUTES = 15 * durations.MINUTE; diff --git a/ts/test-electron/sql/attachment_download_backup_stats_test.ts b/ts/test-electron/sql/attachment_download_backup_stats_test.ts index 435f1570ba1..f52d7ea21f7 100644 --- a/ts/test-electron/sql/attachment_download_backup_stats_test.ts +++ b/ts/test-electron/sql/attachment_download_backup_stats_test.ts @@ -2,13 +2,13 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { DataReader, DataWriter } from '../../sql/Client'; +import { DataReader, DataWriter } from '../../sql/Client.js'; -import { createAttachmentDownloadJob } from '../../test-helpers/attachmentDownloads'; -import type { MessageAttributesType } from '../../model-types'; -import { generateAci } from '../../types/ServiceId'; -import { AttachmentDownloadSource } from '../../sql/Interface'; -import { cleanupMessages } from '../../util/cleanup'; +import { createAttachmentDownloadJob } from '../../test-helpers/attachmentDownloads.js'; +import type { MessageAttributesType } from '../../model-types.js'; +import { generateAci } from '../../types/ServiceId.js'; +import { AttachmentDownloadSource } from '../../sql/Interface.js'; +import { cleanupMessages } from '../../util/cleanup.js'; describe('sql/AttachmentDownloadBackupStats', () => { beforeEach(async () => { diff --git a/ts/test-electron/sql/callLinks_test.ts b/ts/test-electron/sql/callLinks_test.ts index 573ba172142..e3244ba89ce 100644 --- a/ts/test-electron/sql/callLinks_test.ts +++ b/ts/test-electron/sql/callLinks_test.ts @@ -3,12 +3,12 @@ import { assert } from 'chai'; -import { DataReader, DataWriter } from '../../sql/Client'; +import { DataReader, DataWriter } from '../../sql/Client.js'; import { FAKE_CALL_LINK, FAKE_CALL_LINK_WITH_ADMIN_KEY, -} from '../../test-helpers/fakeCallLink'; +} from '../../test-helpers/fakeCallLink.js'; const { getCallLinkByRoomId } = DataReader; const { removeAll, insertCallLink, insertOrUpdateCallLinkFromSync } = diff --git a/ts/test-electron/sql/conversationSummary_test.ts b/ts/test-electron/sql/conversationSummary_test.ts index acc36b4dfe5..7533e9ee8e7 100644 --- a/ts/test-electron/sql/conversationSummary_test.ts +++ b/ts/test-electron/sql/conversationSummary_test.ts @@ -4,12 +4,12 @@ import { assert } from 'chai'; import { v4 as generateUuid } from 'uuid'; -import { DataReader, DataWriter } from '../../sql/Client'; -import { generateAci } from '../../types/ServiceId'; -import { DurationInSeconds } from '../../util/durations'; +import { DataReader, DataWriter } from '../../sql/Client.js'; +import { generateAci } from '../../types/ServiceId.js'; +import { DurationInSeconds } from '../../util/durations/index.js'; -import type { MessageAttributesType } from '../../model-types.d'; -import { postSaveUpdates } from '../../util/cleanup'; +import type { MessageAttributesType } from '../../model-types.d.ts'; +import { postSaveUpdates } from '../../util/cleanup.js'; const { _getAllMessages, getConversationMessageStats } = DataReader; const { removeAll, saveMessages } = DataWriter; diff --git a/ts/test-electron/sql/donationReceipts_test.ts b/ts/test-electron/sql/donationReceipts_test.ts index 886c13685e8..d785d8c2b33 100644 --- a/ts/test-electron/sql/donationReceipts_test.ts +++ b/ts/test-electron/sql/donationReceipts_test.ts @@ -4,9 +4,9 @@ import { assert } from 'chai'; import { v1 as getGuid } from 'uuid'; -import { DataReader, DataWriter } from '../../sql/Client'; +import { DataReader, DataWriter } from '../../sql/Client.js'; -import type { DonationReceipt } from '../../types/Donations'; +import type { DonationReceipt } from '../../types/Donations.js'; const { getAllDonationReceipts, getDonationReceiptById } = DataReader; const { diff --git a/ts/test-electron/sql/fullTextSearch_test.ts b/ts/test-electron/sql/fullTextSearch_test.ts index 79e99fa9c33..4a32ed832d6 100644 --- a/ts/test-electron/sql/fullTextSearch_test.ts +++ b/ts/test-electron/sql/fullTextSearch_test.ts @@ -4,11 +4,11 @@ import { assert } from 'chai'; import { v4 as generateUuid } from 'uuid'; -import { DataReader, DataWriter } from '../../sql/Client'; -import { generateAci } from '../../types/ServiceId'; +import { DataReader, DataWriter } from '../../sql/Client.js'; +import { generateAci } from '../../types/ServiceId.js'; -import type { MessageAttributesType } from '../../model-types.d'; -import { postSaveUpdates } from '../../util/cleanup'; +import type { MessageAttributesType } from '../../model-types.d.ts'; +import { postSaveUpdates } from '../../util/cleanup.js'; const { _getAllMessages, searchMessages } = DataReader; const { removeAll, saveMessages, saveMessage } = DataWriter; diff --git a/ts/test-electron/sql/getCallHistoryGroups_test.ts b/ts/test-electron/sql/getCallHistoryGroups_test.ts index 4168a620beb..7e1289a0bcc 100644 --- a/ts/test-electron/sql/getCallHistoryGroups_test.ts +++ b/ts/test-electron/sql/getCallHistoryGroups_test.ts @@ -4,7 +4,7 @@ import { assert } from 'chai'; import { v4 as generateUuid } from 'uuid'; -import { DataReader, DataWriter } from '../../sql/Client'; +import { DataReader, DataWriter } from '../../sql/Client.js'; import { CallMode, @@ -13,20 +13,20 @@ import { CallHistoryFilterStatus, CallType, DirectCallStatus, -} from '../../types/CallDisposition'; -import { generateAci } from '../../types/ServiceId'; -import type { ServiceIdString } from '../../types/ServiceId'; +} from '../../types/CallDisposition.js'; +import { generateAci } from '../../types/ServiceId.js'; +import type { ServiceIdString } from '../../types/ServiceId.js'; import type { CallHistoryDetails, CallHistoryGroup, CallStatus, -} from '../../types/CallDisposition'; -import { strictAssert } from '../../util/assert'; -import type { ConversationAttributesType } from '../../model-types'; +} from '../../types/CallDisposition.js'; +import { strictAssert } from '../../util/assert.js'; +import type { ConversationAttributesType } from '../../model-types.js'; import { FAKE_CALL_LINK, FAKE_CALL_LINK_WITH_ADMIN_KEY, -} from '../../test-helpers/fakeCallLink'; +} from '../../test-helpers/fakeCallLink.js'; const { getCallHistoryGroups, getCallHistoryGroupsCount } = DataReader; const { removeAll, insertCallLink, saveCallHistory, saveConversation } = diff --git a/ts/test-electron/sql/getCallHistoryMessageByCallId_test.ts b/ts/test-electron/sql/getCallHistoryMessageByCallId_test.ts index 9518a5ea1fa..402eeb1b4ac 100644 --- a/ts/test-electron/sql/getCallHistoryMessageByCallId_test.ts +++ b/ts/test-electron/sql/getCallHistoryMessageByCallId_test.ts @@ -4,11 +4,11 @@ import { assert } from 'chai'; import { v4 as generateUuid } from 'uuid'; -import { DataReader, DataWriter } from '../../sql/Client'; -import { generateAci } from '../../types/ServiceId'; +import { DataReader, DataWriter } from '../../sql/Client.js'; +import { generateAci } from '../../types/ServiceId.js'; -import type { MessageAttributesType } from '../../model-types.d'; -import { postSaveUpdates } from '../../util/cleanup'; +import type { MessageAttributesType } from '../../model-types.d.ts'; +import { postSaveUpdates } from '../../util/cleanup.js'; const { _getAllMessages, getCallHistoryMessageByCallId } = DataReader; const { removeAll, saveMessages } = DataWriter; diff --git a/ts/test-electron/sql/getMessagesBetween_test.ts b/ts/test-electron/sql/getMessagesBetween_test.ts index a9a88cbdd45..e1bdd5a8c0d 100644 --- a/ts/test-electron/sql/getMessagesBetween_test.ts +++ b/ts/test-electron/sql/getMessagesBetween_test.ts @@ -4,11 +4,11 @@ import { assert } from 'chai'; import { v4 as generateUuid } from 'uuid'; -import { generateAci } from '../../types/ServiceId'; -import { DataReader, DataWriter } from '../../sql/Client'; +import { generateAci } from '../../types/ServiceId.js'; +import { DataReader, DataWriter } from '../../sql/Client.js'; -import type { MessageAttributesType } from '../../model-types'; -import { postSaveUpdates } from '../../util/cleanup'; +import type { MessageAttributesType } from '../../model-types.js'; +import { postSaveUpdates } from '../../util/cleanup.js'; const { _getAllMessages, getMessagesBetween } = DataReader; const { saveMessages, _removeAllMessages } = DataWriter; diff --git a/ts/test-electron/sql/getNearbyMessageFromDeletedSet_test.ts b/ts/test-electron/sql/getNearbyMessageFromDeletedSet_test.ts index 4750fff3086..d4bdbbe2f2b 100644 --- a/ts/test-electron/sql/getNearbyMessageFromDeletedSet_test.ts +++ b/ts/test-electron/sql/getNearbyMessageFromDeletedSet_test.ts @@ -4,11 +4,11 @@ import { assert } from 'chai'; import { v4 as generateUuid } from 'uuid'; -import { DataReader, DataWriter } from '../../sql/Client'; -import { generateAci } from '../../types/ServiceId'; +import { DataReader, DataWriter } from '../../sql/Client.js'; +import { generateAci } from '../../types/ServiceId.js'; -import type { MessageAttributesType } from '../../model-types'; -import { postSaveUpdates } from '../../util/cleanup'; +import type { MessageAttributesType } from '../../model-types.js'; +import { postSaveUpdates } from '../../util/cleanup.js'; const { _getAllMessages, getNearbyMessageFromDeletedSet } = DataReader; const { saveMessages, _removeAllMessages } = DataWriter; diff --git a/ts/test-electron/sql/getRecentStaleRingsAndMarkOlderMissed_test.ts b/ts/test-electron/sql/getRecentStaleRingsAndMarkOlderMissed_test.ts index 9d66b5a5a7e..864fe875725 100644 --- a/ts/test-electron/sql/getRecentStaleRingsAndMarkOlderMissed_test.ts +++ b/ts/test-electron/sql/getRecentStaleRingsAndMarkOlderMissed_test.ts @@ -5,17 +5,17 @@ import { assert } from 'chai'; import { v4 as generateUuid } from 'uuid'; import { times } from 'lodash'; -import { DataReader, DataWriter } from '../../sql/Client'; +import { DataReader, DataWriter } from '../../sql/Client.js'; import { CallMode, CallDirection, CallType, GroupCallStatus, -} from '../../types/CallDisposition'; -import { generateAci } from '../../types/ServiceId'; -import type { CallHistoryDetails } from '../../types/CallDisposition'; -import type { MaybeStaleCallHistory } from '../../sql/Server'; +} from '../../types/CallDisposition.js'; +import { generateAci } from '../../types/ServiceId.js'; +import type { CallHistoryDetails } from '../../types/CallDisposition.js'; +import type { MaybeStaleCallHistory } from '../../sql/Server.js'; const { getAllCallHistory } = DataReader; const { getRecentStaleRingsAndMarkOlderMissed, removeAll, saveCallHistory } = diff --git a/ts/test-electron/sql/getRecentStoryReplies_test.ts b/ts/test-electron/sql/getRecentStoryReplies_test.ts index d0e9588b36a..772b7847ac0 100644 --- a/ts/test-electron/sql/getRecentStoryReplies_test.ts +++ b/ts/test-electron/sql/getRecentStoryReplies_test.ts @@ -4,11 +4,11 @@ import { assert } from 'chai'; import { v4 as generateUuid } from 'uuid'; -import { DataReader, DataWriter } from '../../sql/Client'; -import { generateAci } from '../../types/ServiceId'; +import { DataReader, DataWriter } from '../../sql/Client.js'; +import { generateAci } from '../../types/ServiceId.js'; -import type { MessageAttributesType } from '../../model-types.d'; -import { postSaveUpdates } from '../../util/cleanup'; +import type { MessageAttributesType } from '../../model-types.d.ts'; +import { postSaveUpdates } from '../../util/cleanup.js'; const { _getAllMessages, getRecentStoryReplies } = DataReader; const { removeAll, saveMessages } = DataWriter; diff --git a/ts/test-electron/sql/markRead_test.ts b/ts/test-electron/sql/markRead_test.ts index 0de9c7a8a76..1f58726246b 100644 --- a/ts/test-electron/sql/markRead_test.ts +++ b/ts/test-electron/sql/markRead_test.ts @@ -4,15 +4,15 @@ import { assert } from 'chai'; import { v4 as generateUuid } from 'uuid'; -import { DataReader, DataWriter } from '../../sql/Client'; -import { generateAci } from '../../types/ServiceId'; +import { DataReader, DataWriter } from '../../sql/Client.js'; +import { generateAci } from '../../types/ServiceId.js'; -import type { ReactionType } from '../../types/Reactions'; -import { ReactionReadStatus } from '../../types/Reactions'; -import { DurationInSeconds } from '../../util/durations'; -import type { MessageAttributesType } from '../../model-types.d'; -import { ReadStatus } from '../../messages/MessageReadStatus'; -import { postSaveUpdates } from '../../util/cleanup'; +import type { ReactionType } from '../../types/Reactions.js'; +import { ReactionReadStatus } from '../../types/Reactions.js'; +import { DurationInSeconds } from '../../util/durations/index.js'; +import type { MessageAttributesType } from '../../model-types.d.ts'; +import { ReadStatus } from '../../messages/MessageReadStatus.js'; +import { postSaveUpdates } from '../../util/cleanup.js'; const { _getAllReactions, _getAllMessages, getTotalUnreadForConversation } = DataReader; diff --git a/ts/test-electron/sql/notificationProfiles_test.ts b/ts/test-electron/sql/notificationProfiles_test.ts index e4c802e225c..d98a4124fe7 100644 --- a/ts/test-electron/sql/notificationProfiles_test.ts +++ b/ts/test-electron/sql/notificationProfiles_test.ts @@ -3,12 +3,12 @@ import { assert } from 'chai'; -import { DataReader, DataWriter } from '../../sql/Client'; +import { DataReader, DataWriter } from '../../sql/Client.js'; -import { DayOfWeek } from '../../types/NotificationProfile'; -import { generateNotificationProfileId } from '../../types/NotificationProfile-node'; +import { DayOfWeek } from '../../types/NotificationProfile.js'; +import { generateNotificationProfileId } from '../../types/NotificationProfile-node.js'; -import type { NotificationProfileType } from '../../types/NotificationProfile'; +import type { NotificationProfileType } from '../../types/NotificationProfile.js'; const { getAllNotificationProfiles } = DataReader; const { diff --git a/ts/test-electron/sql/removeAllConfiguration_test.ts b/ts/test-electron/sql/removeAllConfiguration_test.ts index 37823e040fc..54b5031a8a2 100644 --- a/ts/test-electron/sql/removeAllConfiguration_test.ts +++ b/ts/test-electron/sql/removeAllConfiguration_test.ts @@ -4,7 +4,7 @@ import { assert } from 'chai'; import { v4 as generateGuid } from 'uuid'; -import { DataWriter, DataReader } from '../../sql/Client'; +import { DataWriter, DataReader } from '../../sql/Client.js'; describe('Remove all configuration test', () => { beforeEach(async () => { diff --git a/ts/test-electron/sql/sendLog_test.ts b/ts/test-electron/sql/sendLog_test.ts index d820f7a00b9..7cc1149f09c 100644 --- a/ts/test-electron/sql/sendLog_test.ts +++ b/ts/test-electron/sql/sendLog_test.ts @@ -4,10 +4,10 @@ import { assert } from 'chai'; import { v4 as generateUuid } from 'uuid'; -import { DataReader, DataWriter } from '../../sql/Client'; -import { generateAci } from '../../types/ServiceId'; -import { constantTimeEqual, getRandomBytes } from '../../Crypto'; -import { cleanupMessages, postSaveUpdates } from '../../util/cleanup'; +import { DataReader, DataWriter } from '../../sql/Client.js'; +import { generateAci } from '../../types/ServiceId.js'; +import { constantTimeEqual, getRandomBytes } from '../../Crypto.js'; +import { cleanupMessages, postSaveUpdates } from '../../util/cleanup.js'; const { _getAllSentProtoMessageIds, diff --git a/ts/test-electron/sql/stories_test.ts b/ts/test-electron/sql/stories_test.ts index 999ee854dd3..002ed1211ac 100644 --- a/ts/test-electron/sql/stories_test.ts +++ b/ts/test-electron/sql/stories_test.ts @@ -4,11 +4,11 @@ import { assert } from 'chai'; import { v4 as generateUuid } from 'uuid'; -import { DataReader, DataWriter } from '../../sql/Client'; -import { generateAci } from '../../types/ServiceId'; +import { DataReader, DataWriter } from '../../sql/Client.js'; +import { generateAci } from '../../types/ServiceId.js'; -import type { MessageAttributesType } from '../../model-types.d'; -import { postSaveUpdates } from '../../util/cleanup'; +import type { MessageAttributesType } from '../../model-types.d.ts'; +import { postSaveUpdates } from '../../util/cleanup.js'; const { _getAllMessages, getAllStories } = DataReader; const { removeAll, saveMessages } = DataWriter; diff --git a/ts/test-electron/sql/storyDistribution_test.ts b/ts/test-electron/sql/storyDistribution_test.ts index c482852f907..873ec9ede29 100644 --- a/ts/test-electron/sql/storyDistribution_test.ts +++ b/ts/test-electron/sql/storyDistribution_test.ts @@ -4,11 +4,11 @@ import { assert } from 'chai'; import { v4 as generateUuid } from 'uuid'; -import { DataReader, DataWriter } from '../../sql/Client'; -import { generateAci } from '../../types/ServiceId'; -import { generateStoryDistributionId } from '../../types/StoryDistributionId'; +import { DataReader, DataWriter } from '../../sql/Client.js'; +import { generateAci } from '../../types/ServiceId.js'; +import { generateStoryDistributionId } from '../../types/StoryDistributionId.js'; -import type { StoryDistributionWithMembersType } from '../../sql/Interface'; +import type { StoryDistributionWithMembersType } from '../../sql/Interface.js'; const { _getAllStoryDistributionMembers, diff --git a/ts/test-electron/sql/storyReads_test.ts b/ts/test-electron/sql/storyReads_test.ts index 11a8683c38d..2020b33759d 100644 --- a/ts/test-electron/sql/storyReads_test.ts +++ b/ts/test-electron/sql/storyReads_test.ts @@ -4,10 +4,10 @@ import { assert } from 'chai'; import { v4 as generateUuid } from 'uuid'; -import { DataReader, DataWriter } from '../../sql/Client'; -import { generateAci } from '../../types/ServiceId'; +import { DataReader, DataWriter } from '../../sql/Client.js'; +import { generateAci } from '../../types/ServiceId.js'; -import type { StoryReadType } from '../../sql/Interface'; +import type { StoryReadType } from '../../sql/Interface.js'; const { _getAllStoryReads, getLastStoryReadsForAuthor } = DataReader; diff --git a/ts/test-electron/sql/timelineFetches_test.ts b/ts/test-electron/sql/timelineFetches_test.ts index 84434916f1c..524f705b834 100644 --- a/ts/test-electron/sql/timelineFetches_test.ts +++ b/ts/test-electron/sql/timelineFetches_test.ts @@ -4,12 +4,12 @@ import { assert } from 'chai'; import { v4 as generateUuid } from 'uuid'; -import { DataReader, DataWriter } from '../../sql/Client'; -import { generateAci } from '../../types/ServiceId'; +import { DataReader, DataWriter } from '../../sql/Client.js'; +import { generateAci } from '../../types/ServiceId.js'; -import type { MessageAttributesType } from '../../model-types.d'; -import { ReadStatus } from '../../messages/MessageReadStatus'; -import { postSaveUpdates } from '../../util/cleanup'; +import type { MessageAttributesType } from '../../model-types.d.ts'; +import { ReadStatus } from '../../messages/MessageReadStatus.js'; +import { postSaveUpdates } from '../../util/cleanup.js'; const { _getAllMessages, diff --git a/ts/test-electron/sql/utils_test.ts b/ts/test-electron/sql/utils_test.ts index 5f010f33ebf..39f02dbb227 100644 --- a/ts/test-electron/sql/utils_test.ts +++ b/ts/test-electron/sql/utils_test.ts @@ -4,7 +4,7 @@ import { assert } from 'chai'; import type { Database } from '@signalapp/sqlcipher'; import SQL from '@signalapp/sqlcipher'; -import { sql, sqlFragment, sqlJoin } from '../../sql/util'; +import { sql, sqlFragment, sqlJoin } from '../../sql/util.js'; describe('sql/utils/sql', () => { let db: Database; diff --git a/ts/test-electron/state/ducks/calling_test.ts b/ts/test-electron/state/ducks/calling_test.ts index 9dc5206eb82..f2d8e9463cb 100644 --- a/ts/test-electron/state/ducks/calling_test.ts +++ b/ts/test-electron/state/ducks/calling_test.ts @@ -8,9 +8,9 @@ import type { PeekInfo } from '@signalapp/ringrtc'; import type { StateType as RootStateType, StateType, -} from '../../../state/reducer'; -import { reducer as rootReducer } from '../../../state/reducer'; -import { noopAction } from '../../../state/ducks/noop'; +} from '../../../state/reducer.js'; +import { reducer as rootReducer } from '../../../state/reducer.js'; +import { noopAction } from '../../../state/ducks/noop.js'; import type { ActiveCallStateType, CallingActionType, @@ -22,35 +22,35 @@ import type { HandleCallLinkUpdateType, SendGroupCallReactionActionType, StartCallLinkLobbyType, -} from '../../../state/ducks/calling'; +} from '../../../state/ducks/calling.js'; import { actions, getActiveCall, getEmptyState, reducer, -} from '../../../state/ducks/calling'; -import { isAnybodyElseInGroupCall } from '../../../state/ducks/callingHelpers'; -import { truncateAudioLevel } from '../../../calling/truncateAudioLevel'; -import { calling as callingService } from '../../../services/calling'; +} from '../../../state/ducks/calling.js'; +import { isAnybodyElseInGroupCall } from '../../../state/ducks/callingHelpers.js'; +import { truncateAudioLevel } from '../../../calling/truncateAudioLevel.js'; +import { calling as callingService } from '../../../services/calling.js'; import { CallState, CallViewMode, GroupCallConnectionState, GroupCallJoinState, -} from '../../../types/Calling'; -import { CallMode } from '../../../types/CallDisposition'; -import { generateAci } from '../../../types/ServiceId'; -import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation'; -import type { UnwrapPromise } from '../../../types/Util'; +} from '../../../types/Calling.js'; +import { CallMode } from '../../../types/CallDisposition.js'; +import { generateAci } from '../../../types/ServiceId.js'; +import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.js'; +import type { UnwrapPromise } from '../../../types/Util.js'; import { FAKE_CALL_LINK, FAKE_CALL_LINK_WITH_ADMIN_KEY, getCallLinkState, -} from '../../../test-helpers/fakeCallLink'; -import { strictAssert } from '../../../util/assert'; -import { callLinkRefreshJobQueue } from '../../../jobs/callLinkRefreshJobQueue'; -import { CALL_LINK_DEFAULT_STATE } from '../../../util/callLinks'; -import { DataWriter } from '../../../sql/Client'; +} from '../../../test-helpers/fakeCallLink.js'; +import { strictAssert } from '../../../util/assert.js'; +import { callLinkRefreshJobQueue } from '../../../jobs/callLinkRefreshJobQueue.js'; +import { CALL_LINK_DEFAULT_STATE } from '../../../util/callLinks.js'; +import { DataWriter } from '../../../sql/Client.js'; const ACI_1 = generateAci(); const NOW = new Date('2020-01-23T04:56:00.000'); diff --git a/ts/test-electron/state/ducks/conversations_test.ts b/ts/test-electron/state/ducks/conversations_test.ts index 8ffb3e7b7f3..7bf25e0bc6c 100644 --- a/ts/test-electron/state/ducks/conversations_test.ts +++ b/ts/test-electron/state/ducks/conversations_test.ts @@ -7,13 +7,13 @@ import { v4 as generateUuid } from 'uuid'; import { times } from 'lodash'; import type { ReadonlyDeep } from 'type-fest'; -import { reducer as rootReducer } from '../../../state/reducer'; -import { noopAction } from '../../../state/ducks/noop'; +import { reducer as rootReducer } from '../../../state/reducer.js'; +import { noopAction } from '../../../state/ducks/noop.js'; import { ComposerStep, ConversationVerificationState, OneTimeModalState, -} from '../../../state/ducks/conversationsEnums'; +} from '../../../state/ducks/conversationsEnums.js'; import type { CancelVerificationDataByConversationActionType, ConversationMessageType, @@ -24,7 +24,7 @@ import type { ToggleConversationInChooseMembersActionType, MessageChangedActionType, ConversationsUpdatedActionType, -} from '../../../state/ducks/conversations'; +} from '../../../state/ducks/conversations.js'; import { TARGETED_CONVERSATION_CHANGED, actions, @@ -34,41 +34,41 @@ import { getEmptyState, reducer, updateConversationLookups, -} from '../../../state/ducks/conversations'; -import { ReadStatus } from '../../../messages/MessageReadStatus'; -import type { SingleServePromiseIdString } from '../../../services/singleServePromise'; -import { CallMode } from '../../../types/CallDisposition'; +} from '../../../state/ducks/conversations.js'; +import { ReadStatus } from '../../../messages/MessageReadStatus.js'; +import type { SingleServePromiseIdString } from '../../../services/singleServePromise.js'; +import { CallMode } from '../../../types/CallDisposition.js'; import { type AciString, type PniString, generateAci, getAciFromPrefix, -} from '../../../types/ServiceId'; -import { generateStoryDistributionId } from '../../../types/StoryDistributionId'; +} from '../../../types/ServiceId.js'; +import { generateStoryDistributionId } from '../../../types/StoryDistributionId.js'; import { getDefaultConversation, getDefaultConversationWithServiceId, getDefaultGroup, -} from '../../../test-helpers/getDefaultConversation'; -import { getDefaultAvatars } from '../../../types/Avatar'; +} from '../../../test-helpers/getDefaultConversation.js'; +import { getDefaultAvatars } from '../../../types/Avatar.js'; import { defaultStartDirectConversationComposerState, defaultChooseGroupMembersComposerState, defaultSetGroupMetadataComposerState, -} from '../../../test-helpers/defaultComposerStates'; -import { updateRemoteConfig } from '../../../test-helpers/RemoteConfigStub'; -import type { ShowSendAnywayDialogActionType } from '../../../state/ducks/globalModals'; -import { SHOW_SEND_ANYWAY_DIALOG } from '../../../state/ducks/globalModals'; -import type { StoryDistributionListsActionType } from '../../../state/ducks/storyDistributionLists'; +} from '../../../test-helpers/defaultComposerStates.js'; +import { updateRemoteConfig } from '../../../test-helpers/RemoteConfigStub.js'; +import type { ShowSendAnywayDialogActionType } from '../../../state/ducks/globalModals.js'; +import { SHOW_SEND_ANYWAY_DIALOG } from '../../../state/ducks/globalModals.js'; +import type { StoryDistributionListsActionType } from '../../../state/ducks/storyDistributionLists.js'; import { DELETE_LIST, HIDE_MY_STORIES_FROM, MODIFY_LIST, VIEWERS_CHANGED, -} from '../../../state/ducks/storyDistributionLists'; -import { MY_STORY_ID } from '../../../types/Stories'; -import type { ReadonlyMessageAttributesType } from '../../../model-types.d'; -import { strictAssert } from '../../../util/assert'; +} from '../../../state/ducks/storyDistributionLists.js'; +import { MY_STORY_ID } from '../../../types/Stories.js'; +import type { ReadonlyMessageAttributesType } from '../../../model-types.d.ts'; +import { strictAssert } from '../../../util/assert.js'; const { clearGroupCreationError, diff --git a/ts/test-electron/state/ducks/stories_test.ts b/ts/test-electron/state/ducks/stories_test.ts index 95d31460bc5..300b5db5a98 100644 --- a/ts/test-electron/state/ducks/stories_test.ts +++ b/ts/test-electron/state/ducks/stories_test.ts @@ -8,26 +8,26 @@ import { v4 as generateUuid } from 'uuid'; import type { DispatchableViewStoryType, StoryDataType, -} from '../../../state/ducks/stories'; -import type { ConversationType } from '../../../state/ducks/conversations'; -import type { MessageAttributesType } from '../../../model-types.d'; -import type { StateType as RootStateType } from '../../../state/reducer'; -import { DurationInSeconds } from '../../../util/durations'; -import { TEXT_ATTACHMENT, IMAGE_JPEG } from '../../../types/MIME'; -import { ReadStatus } from '../../../messages/MessageReadStatus'; +} from '../../../state/ducks/stories.js'; +import type { ConversationType } from '../../../state/ducks/conversations.js'; +import type { MessageAttributesType } from '../../../model-types.d.ts'; +import type { StateType as RootStateType } from '../../../state/reducer.js'; +import { DurationInSeconds } from '../../../util/durations/index.js'; +import { TEXT_ATTACHMENT, IMAGE_JPEG } from '../../../types/MIME.js'; +import { ReadStatus } from '../../../messages/MessageReadStatus.js'; import { StoryViewDirectionType, StoryViewModeType, -} from '../../../types/Stories'; -import type { StoryDistributionIdString } from '../../../types/StoryDistributionId'; -import { generateAci, generatePni } from '../../../types/ServiceId'; -import { generateStoryDistributionId } from '../../../types/StoryDistributionId'; -import { actions, getEmptyState } from '../../../state/ducks/stories'; -import { noopAction } from '../../../state/ducks/noop'; -import { reducer as rootReducer } from '../../../state/reducer'; -import { dropNull } from '../../../util/dropNull'; -import { MessageModel } from '../../../models/messages'; -import { DataWriter } from '../../../sql/Client'; +} from '../../../types/Stories.js'; +import type { StoryDistributionIdString } from '../../../types/StoryDistributionId.js'; +import { generateAci, generatePni } from '../../../types/ServiceId.js'; +import { generateStoryDistributionId } from '../../../types/StoryDistributionId.js'; +import { actions, getEmptyState } from '../../../state/ducks/stories.js'; +import { noopAction } from '../../../state/ducks/noop.js'; +import { reducer as rootReducer } from '../../../state/reducer.js'; +import { dropNull } from '../../../util/dropNull.js'; +import { MessageModel } from '../../../models/messages.js'; +import { DataWriter } from '../../../sql/Client.js'; describe('both/state/ducks/stories', () => { const ourAci = generateAci(); diff --git a/ts/test-electron/state/ducks/username_test.ts b/ts/test-electron/state/ducks/username_test.ts index 44304800f0f..fe7d1e09c62 100644 --- a/ts/test-electron/state/ducks/username_test.ts +++ b/ts/test-electron/state/ducks/username_test.ts @@ -4,26 +4,26 @@ import * as sinon from 'sinon'; import { assert } from 'chai'; -import type { UsernameStateType } from '../../../state/ducks/username'; +import type { UsernameStateType } from '../../../state/ducks/username.js'; import { getUsernameEditState, getUsernameReservationState, getUsernameReservationError, getUsernameReservationObject, -} from '../../../state/selectors/username'; +} from '../../../state/selectors/username.js'; import { UsernameEditState, UsernameReservationState, UsernameReservationError, -} from '../../../state/ducks/usernameEnums'; -import { actions } from '../../../state/ducks/username'; -import { ToastType } from '../../../types/Toast'; -import { noopAction } from '../../../state/ducks/noop'; -import { reducer } from '../../../state/reducer'; +} from '../../../state/ducks/usernameEnums.js'; +import { actions } from '../../../state/ducks/username.js'; +import { ToastType } from '../../../types/Toast.js'; +import { noopAction } from '../../../state/ducks/noop.js'; +import { reducer } from '../../../state/reducer.js'; import { ReserveUsernameError, ConfirmUsernameResult, -} from '../../../types/Username'; +} from '../../../types/Username.js'; const DEFAULT_RESERVATION = { username: 'abc.12', diff --git a/ts/test-electron/state/selectors/audioPlayer_test.ts b/ts/test-electron/state/selectors/audioPlayer_test.ts index 87464b1affa..658be76231a 100644 --- a/ts/test-electron/state/selectors/audioPlayer_test.ts +++ b/ts/test-electron/state/selectors/audioPlayer_test.ts @@ -2,12 +2,12 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { noopAction } from '../../../state/ducks/noop'; -import type { VoiceNoteAndConsecutiveForPlayback } from '../../../state/selectors/audioPlayer'; -import { isPaused } from '../../../state/selectors/audioPlayer'; -import { actions } from '../../../state/ducks/audioPlayer'; -import type { StateType } from '../../../state/reducer'; -import { reducer as rootReducer } from '../../../state/reducer'; +import { noopAction } from '../../../state/ducks/noop.js'; +import type { VoiceNoteAndConsecutiveForPlayback } from '../../../state/selectors/audioPlayer.js'; +import { isPaused } from '../../../state/selectors/audioPlayer.js'; +import { actions } from '../../../state/ducks/audioPlayer.js'; +import type { StateType } from '../../../state/reducer.js'; +import { reducer as rootReducer } from '../../../state/reducer.js'; function voiceNoteDataForMessage( messageId: string diff --git a/ts/test-electron/state/selectors/calling_test.ts b/ts/test-electron/state/selectors/calling_test.ts index b167e776996..e50f81bd5f9 100644 --- a/ts/test-electron/state/selectors/calling_test.ts +++ b/ts/test-electron/state/selectors/calling_test.ts @@ -2,34 +2,34 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { reducer as rootReducer } from '../../../state/reducer'; -import { noopAction } from '../../../state/ducks/noop'; -import { actions as userActions } from '../../../state/ducks/user'; +import { reducer as rootReducer } from '../../../state/reducer.js'; +import { noopAction } from '../../../state/ducks/noop.js'; +import { actions as userActions } from '../../../state/ducks/user.js'; import { CallState, CallViewMode, GroupCallConnectionState, GroupCallJoinState, -} from '../../../types/Calling'; -import { CallMode } from '../../../types/CallDisposition'; -import { generateAci } from '../../../types/ServiceId'; +} from '../../../types/Calling.js'; +import { CallMode } from '../../../types/CallDisposition.js'; +import { generateAci } from '../../../types/ServiceId.js'; import { getCallsByConversation, getCallSelector, getHasAnyAdminCallLinks, getRingingCall, isInCall, -} from '../../../state/selectors/calling'; +} from '../../../state/selectors/calling.js'; import type { CallingStateType, DirectCallStateType, GroupCallStateType, -} from '../../../state/ducks/calling'; -import { getEmptyState } from '../../../state/ducks/calling'; +} from '../../../state/ducks/calling.js'; +import { getEmptyState } from '../../../state/ducks/calling.js'; import { FAKE_CALL_LINK, FAKE_CALL_LINK_WITH_ADMIN_KEY, -} from '../../../test-helpers/fakeCallLink'; +} from '../../../test-helpers/fakeCallLink.js'; const OUR_ACI = generateAci(); const ACI_1 = generateAci(); diff --git a/ts/test-electron/state/selectors/conversations-extra_test.ts b/ts/test-electron/state/selectors/conversations-extra_test.ts index 51ad4957e63..906d4ebb409 100644 --- a/ts/test-electron/state/selectors/conversations-extra_test.ts +++ b/ts/test-electron/state/selectors/conversations-extra_test.ts @@ -3,23 +3,23 @@ import { assert } from 'chai'; -import type { StateType } from '../../../state/reducer'; -import type { ConversationType } from '../../../state/ducks/conversations'; -import type { StoryDistributionListDataType } from '../../../state/ducks/storyDistributionLists'; -import type { StoryDistributionIdString } from '../../../types/StoryDistributionId'; -import type { ServiceIdString } from '../../../types/ServiceId'; -import type { ContactsByStory } from '../../../components/SafetyNumberChangeDialog'; +import type { StateType } from '../../../state/reducer.js'; +import type { ConversationType } from '../../../state/ducks/conversations.js'; +import type { StoryDistributionListDataType } from '../../../state/ducks/storyDistributionLists.js'; +import type { StoryDistributionIdString } from '../../../types/StoryDistributionId.js'; +import type { ServiceIdString } from '../../../types/ServiceId.js'; +import type { ContactsByStory } from '../../../components/SafetyNumberChangeDialog.js'; -import * as Bytes from '../../../Bytes'; -import { reducer as rootReducer } from '../../../state/reducer'; -import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation'; -import { getEmptyState } from '../../../state/ducks/conversations'; -import { getByDistributionListConversationsStoppingSend } from '../../../state/selectors/conversations-extra'; -import { generateAci } from '../../../types/ServiceId'; -import { generateStoryDistributionId } from '../../../types/StoryDistributionId'; -import { noopAction } from '../../../state/ducks/noop'; -import { ID_LENGTH } from '../../../groups'; -import { ConversationVerificationState } from '../../../state/ducks/conversationsEnums'; +import * as Bytes from '../../../Bytes.js'; +import { reducer as rootReducer } from '../../../state/reducer.js'; +import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.js'; +import { getEmptyState } from '../../../state/ducks/conversations.js'; +import { getByDistributionListConversationsStoppingSend } from '../../../state/selectors/conversations-extra.js'; +import { generateAci } from '../../../types/ServiceId.js'; +import { generateStoryDistributionId } from '../../../types/StoryDistributionId.js'; +import { noopAction } from '../../../state/ducks/noop.js'; +import { ID_LENGTH } from '../../../groups.js'; +import { ConversationVerificationState } from '../../../state/ducks/conversationsEnums.js'; describe('both/state/selectors/conversations-extra', () => { const SERVICE_ID_1 = generateAci(); diff --git a/ts/test-electron/state/selectors/messages_test.ts b/ts/test-electron/state/selectors/messages_test.ts index 97cb88ea418..003b8ef1ef8 100644 --- a/ts/test-electron/state/selectors/messages_test.ts +++ b/ts/test-electron/state/selectors/messages_test.ts @@ -4,16 +4,16 @@ import { assert } from 'chai'; import * as moment from 'moment'; import { v4 as uuid } from 'uuid'; -import { SendStatus } from '../../../messages/MessageSendState'; +import { SendStatus } from '../../../messages/MessageSendState.js'; import type { MessageAttributesType, ShallowChallengeError, -} from '../../../model-types.d'; -import type { ConversationType } from '../../../state/ducks/conversations'; +} from '../../../model-types.d.ts'; +import type { ConversationType } from '../../../state/ducks/conversations.js'; import { getDefaultConversation, getDefaultGroup, -} from '../../../test-helpers/getDefaultConversation'; +} from '../../../test-helpers/getDefaultConversation.js'; import { canDeleteForEveryone, @@ -25,7 +25,7 @@ import { isGroupUpdate, isIncoming, isOutgoing, -} from '../../../state/selectors/message'; +} from '../../../state/selectors/message.js'; describe('state/selectors/messages', () => { let ourConversationId: string; diff --git a/ts/test-electron/textsecure/AccountManager_test.ts b/ts/test-electron/textsecure/AccountManager_test.ts index 787b586fa58..f99f9ee6c1f 100644 --- a/ts/test-electron/textsecure/AccountManager_test.ts +++ b/ts/test-electron/textsecure/AccountManager_test.ts @@ -5,15 +5,19 @@ import { assert } from 'chai'; import { range } from 'lodash'; import * as sinon from 'sinon'; -import { getRandomBytes } from '../../Crypto'; -import AccountManager from '../../textsecure/AccountManager'; +import { getRandomBytes } from '../../Crypto.js'; +import AccountManager from '../../textsecure/AccountManager.js'; import type { KyberPreKeyType, OuterSignedPrekeyType, PreKeyType, -} from '../../textsecure/Types.d'; -import { ServiceIdKind, generateAci, generatePni } from '../../types/ServiceId'; -import { DAY } from '../../util/durations'; +} from '../../textsecure/Types.d.ts'; +import { + ServiceIdKind, + generateAci, + generatePni, +} from '../../types/ServiceId.js'; +import { DAY } from '../../util/durations/index.js'; /* eslint-disable @typescript-eslint/no-explicit-any */ diff --git a/ts/test-electron/textsecure/KeyChangeListener_test.ts b/ts/test-electron/textsecure/KeyChangeListener_test.ts index 3ea16b3ab3e..17d2444d925 100644 --- a/ts/test-electron/textsecure/KeyChangeListener_test.ts +++ b/ts/test-electron/textsecure/KeyChangeListener_test.ts @@ -3,16 +3,16 @@ import { assert } from 'chai'; -import { DataWriter } from '../../sql/Client'; -import { getRandomBytes } from '../../Crypto'; -import { Address } from '../../types/Address'; -import { generateAci } from '../../types/ServiceId'; -import { explodePromise } from '../../util/explodePromise'; -import { SignalProtocolStore } from '../../SignalProtocolStore'; -import type { ConversationModel } from '../../models/conversations'; -import * as KeyChangeListener from '../../textsecure/KeyChangeListener'; -import * as Bytes from '../../Bytes'; -import { cleanupMessages } from '../../util/cleanup'; +import { DataWriter } from '../../sql/Client.js'; +import { getRandomBytes } from '../../Crypto.js'; +import { Address } from '../../types/Address.js'; +import { generateAci } from '../../types/ServiceId.js'; +import { explodePromise } from '../../util/explodePromise.js'; +import { SignalProtocolStore } from '../../SignalProtocolStore.js'; +import type { ConversationModel } from '../../models/conversations.js'; +import * as KeyChangeListener from '../../textsecure/KeyChangeListener.js'; +import * as Bytes from '../../Bytes.js'; +import { cleanupMessages } from '../../util/cleanup.js'; describe('KeyChangeListener', () => { let oldNumberId: string | undefined; diff --git a/ts/test-electron/textsecure/WebAPI_test.ts b/ts/test-electron/textsecure/WebAPI_test.ts index 83f00b48f22..ac5169fd1f2 100644 --- a/ts/test-electron/textsecure/WebAPI_test.ts +++ b/ts/test-electron/textsecure/WebAPI_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { makeKeysLowercase } from '../../textsecure/WebAPI'; +import { makeKeysLowercase } from '../../textsecure/WebAPI.js'; describe('WebAPI', () => { describe('makeKeysLowercase', () => { diff --git a/ts/test-electron/textsecure/generate_keys_test.ts b/ts/test-electron/textsecure/generate_keys_test.ts index 5e5ca33155d..474aa106e76 100644 --- a/ts/test-electron/textsecure/generate_keys_test.ts +++ b/ts/test-electron/textsecure/generate_keys_test.ts @@ -3,13 +3,16 @@ import { assert } from 'chai'; -import { constantTimeEqual } from '../../Crypto'; -import { generateKeyPair } from '../../Curve'; -import type { UploadKeysType, UploadPreKeyType } from '../../textsecure/WebAPI'; -import AccountManager from '../../textsecure/AccountManager'; -import { ServiceIdKind } from '../../types/ServiceId'; -import { normalizeAci } from '../../util/normalizeAci'; -import { DataWriter } from '../../sql/Client'; +import { constantTimeEqual } from '../../Crypto.js'; +import { generateKeyPair } from '../../Curve.js'; +import type { + UploadKeysType, + UploadPreKeyType, +} from '../../textsecure/WebAPI.js'; +import AccountManager from '../../textsecure/AccountManager.js'; +import { ServiceIdKind } from '../../types/ServiceId.js'; +import { normalizeAci } from '../../util/normalizeAci.js'; +import { DataWriter } from '../../sql/Client.js'; const { textsecure } = window; diff --git a/ts/test-electron/updateConversationsWithUuidLookup_test.ts b/ts/test-electron/updateConversationsWithUuidLookup_test.ts index 88179db6d11..211ddf23e3e 100644 --- a/ts/test-electron/updateConversationsWithUuidLookup_test.ts +++ b/ts/test-electron/updateConversationsWithUuidLookup_test.ts @@ -6,14 +6,14 @@ import { assert } from 'chai'; import { v4 as generateUuid } from 'uuid'; import sinon from 'sinon'; -import { DataWriter } from '../sql/Client'; -import { ConversationModel } from '../models/conversations'; -import type { ConversationAttributesType } from '../model-types.d'; -import type { WebAPIType } from '../textsecure/WebAPI'; -import { generateAci, normalizeServiceId } from '../types/ServiceId'; -import { normalizeAci } from '../util/normalizeAci'; +import { DataWriter } from '../sql/Client.js'; +import { ConversationModel } from '../models/conversations.js'; +import type { ConversationAttributesType } from '../model-types.d.ts'; +import type { WebAPIType } from '../textsecure/WebAPI.js'; +import { generateAci, normalizeServiceId } from '../types/ServiceId.js'; +import { normalizeAci } from '../util/normalizeAci.js'; -import { updateConversationsWithUuidLookup } from '../updateConversationsWithUuidLookup'; +import { updateConversationsWithUuidLookup } from '../updateConversationsWithUuidLookup.js'; describe('updateConversationsWithUuidLookup', () => { class FakeConversationController { diff --git a/ts/test-electron/util/Username_test.ts b/ts/test-electron/util/Username_test.ts index 989ed97e3d8..a02aba970d6 100644 --- a/ts/test-electron/util/Username_test.ts +++ b/ts/test-electron/util/Username_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import * as Username from '../../util/Username'; +import * as Username from '../../util/Username.js'; describe('Username', () => { describe('getUsernameFromSearch', () => { diff --git a/ts/test-electron/util/canvasToBlob_test.ts b/ts/test-electron/util/canvasToBlob_test.ts index 744da6ee9e9..134bdbf480f 100644 --- a/ts/test-electron/util/canvasToBlob_test.ts +++ b/ts/test-electron/util/canvasToBlob_test.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { IMAGE_JPEG, IMAGE_PNG } from '../../types/MIME'; -import { sniffImageMimeType } from '../../util/sniffImageMimeType'; +import { IMAGE_JPEG, IMAGE_PNG } from '../../types/MIME.js'; +import { sniffImageMimeType } from '../../util/sniffImageMimeType.js'; -import { canvasToBlob } from '../../util/canvasToBlob'; +import { canvasToBlob } from '../../util/canvasToBlob.js'; describe('canvasToBlob', () => { let canvas: HTMLCanvasElement; diff --git a/ts/test-electron/util/canvasToBytes_test.ts b/ts/test-electron/util/canvasToBytes_test.ts index 27720000d51..17a629522e5 100644 --- a/ts/test-electron/util/canvasToBytes_test.ts +++ b/ts/test-electron/util/canvasToBytes_test.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { IMAGE_JPEG, IMAGE_PNG } from '../../types/MIME'; -import { sniffImageMimeType } from '../../util/sniffImageMimeType'; +import { IMAGE_JPEG, IMAGE_PNG } from '../../types/MIME.js'; +import { sniffImageMimeType } from '../../util/sniffImageMimeType.js'; -import { canvasToBytes } from '../../util/canvasToBytes'; +import { canvasToBytes } from '../../util/canvasToBytes.js'; describe('canvasToBytes', () => { let canvas: HTMLCanvasElement; diff --git a/ts/test-electron/util/downloadAttachment_test.ts b/ts/test-electron/util/downloadAttachment_test.ts index 8a6da6abe1b..f29916d57ab 100644 --- a/ts/test-electron/util/downloadAttachment_test.ts +++ b/ts/test-electron/util/downloadAttachment_test.ts @@ -5,26 +5,26 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; import { noop } from 'lodash'; -import { DataWriter } from '../../sql/Client'; -import { IMAGE_PNG } from '../../types/MIME'; -import { downloadAttachment } from '../../util/downloadAttachment'; -import { MediaTier } from '../../types/AttachmentDownload'; -import { HTTPError } from '../../textsecure/Errors'; +import { DataWriter } from '../../sql/Client.js'; +import { IMAGE_PNG } from '../../types/MIME.js'; +import { downloadAttachment } from '../../util/downloadAttachment.js'; +import { MediaTier } from '../../types/AttachmentDownload.js'; +import { HTTPError } from '../../textsecure/Errors.js'; import { getCdnNumberForBackupTier, type downloadAttachment as downloadAttachmentFromServer, -} from '../../textsecure/downloadAttachment'; -import { MASTER_KEY, MEDIA_ROOT_KEY } from '../backup/helpers'; -import { getMediaIdFromMediaName } from '../../services/backups/util/mediaId'; +} from '../../textsecure/downloadAttachment.js'; +import { MASTER_KEY, MEDIA_ROOT_KEY } from '../backup/helpers.js'; +import { getMediaIdFromMediaName } from '../../services/backups/util/mediaId.js'; import { AttachmentVariant, AttachmentPermanentlyUndownloadableError, -} from '../../types/Attachment'; -import { updateRemoteConfig } from '../../test-helpers/RemoteConfigStub'; -import type { WebAPIType } from '../../textsecure/WebAPI'; -import { toHex, toBase64 } from '../../Bytes'; -import { generateAttachmentKeys } from '../../AttachmentCrypto'; -import { getRandomBytes } from '../../Crypto'; +} from '../../types/Attachment.js'; +import { updateRemoteConfig } from '../../test-helpers/RemoteConfigStub.js'; +import type { WebAPIType } from '../../textsecure/WebAPI.js'; +import { toHex, toBase64 } from '../../Bytes.js'; +import { generateAttachmentKeys } from '../../AttachmentCrypto.js'; +import { getRandomBytes } from '../../Crypto.js'; describe('utils/downloadAttachment', () => { const baseAttachment = { diff --git a/ts/test-electron/util/encryptProfileData_test.ts b/ts/test-electron/util/encryptProfileData_test.ts index 967acacd3b5..b05ac0eedfc 100644 --- a/ts/test-electron/util/encryptProfileData_test.ts +++ b/ts/test-electron/util/encryptProfileData_test.ts @@ -3,16 +3,16 @@ import { assert } from 'chai'; -import * as Bytes from '../../Bytes'; +import * as Bytes from '../../Bytes.js'; import { trimForDisplay, getRandomBytes, decryptProfileName, decryptProfile, -} from '../../Crypto'; -import type { ConversationType } from '../../state/ducks/conversations'; -import { generateAci } from '../../types/ServiceId'; -import { encryptProfileData } from '../../util/encryptProfileData'; +} from '../../Crypto.js'; +import type { ConversationType } from '../../state/ducks/conversations.js'; +import { generateAci } from '../../types/ServiceId.js'; +import { encryptProfileData } from '../../util/encryptProfileData.js'; describe('encryptProfileData', () => { let keyBuffer: Uint8Array; diff --git a/ts/test-electron/util/imagePathToBytes_test.ts b/ts/test-electron/util/imagePathToBytes_test.ts index d00c098aff5..28caa32a8bf 100644 --- a/ts/test-electron/util/imagePathToBytes_test.ts +++ b/ts/test-electron/util/imagePathToBytes_test.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only // import { assert } from 'chai'; -import path from 'path'; +import path from 'node:path'; -import { imagePathToBytes } from '../../util/imagePathToBytes'; +import { imagePathToBytes } from '../../util/imagePathToBytes.js'; describe('imagePathToBytes', () => { it('converts an image to an Bytes', async () => { diff --git a/ts/test-electron/util/isWindowDragElement_test.ts b/ts/test-electron/util/isWindowDragElement_test.ts index 5ff5fd69e2e..91265f9533f 100644 --- a/ts/test-electron/util/isWindowDragElement_test.ts +++ b/ts/test-electron/util/isWindowDragElement_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { isWindowDragElement } from '../../util/isWindowDragElement'; +import { isWindowDragElement } from '../../util/isWindowDragElement.js'; describe('isWindowDragElement', () => { const crel = (tagName: string, appRegion?: string): Element => { diff --git a/ts/test-electron/util/migrateMessageData_test.ts b/ts/test-electron/util/migrateMessageData_test.ts index 2b3e9cc47e2..51e6f21c88c 100644 --- a/ts/test-electron/util/migrateMessageData_test.ts +++ b/ts/test-electron/util/migrateMessageData_test.ts @@ -1,13 +1,13 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import assert from 'assert'; +import assert from 'node:assert'; import { v7 as uuid } from 'uuid'; -import { _migrateMessageData as migrateMessageData } from '../../messages/migrateMessageData'; -import type { MessageAttributesType } from '../../model-types'; -import { DataReader, DataWriter } from '../../sql/Client'; -import { generateAci } from '../../types/ServiceId'; -import { postSaveUpdates } from '../../util/cleanup'; +import { _migrateMessageData as migrateMessageData } from '../../messages/migrateMessageData.js'; +import type { MessageAttributesType } from '../../model-types.js'; +import { DataReader, DataWriter } from '../../sql/Client.js'; +import { generateAci } from '../../types/ServiceId.js'; +import { postSaveUpdates } from '../../util/cleanup.js'; function composeMessage(timestamp: number): MessageAttributesType { return { diff --git a/ts/test-electron/util/reactions_test.ts b/ts/test-electron/util/reactions_test.ts index 4bfb5ee43f3..81f06ef36ae 100644 --- a/ts/test-electron/util/reactions_test.ts +++ b/ts/test-electron/util/reactions_test.ts @@ -3,14 +3,14 @@ import { assert } from 'chai'; import { v4 as generateGuid } from 'uuid'; -import { DataWriter } from '../../sql/Client'; -import { generateAci, generatePni } from '../../types/ServiceId'; -import { isMessageAMatchForReaction } from '../../messageModifiers/Reactions'; -import { generateMessageId } from '../../util/generateMessageId'; -import { incrementMessageCounter } from '../../util/incrementMessageCounter'; -import type { ConversationModel } from '../../models/conversations'; -import type { MessageAttributesType } from '../../model-types'; -import { SendStatus } from '../../messages/MessageSendState'; +import { DataWriter } from '../../sql/Client.js'; +import { generateAci, generatePni } from '../../types/ServiceId.js'; +import { isMessageAMatchForReaction } from '../../messageModifiers/Reactions.js'; +import { generateMessageId } from '../../util/generateMessageId.js'; +import { incrementMessageCounter } from '../../util/incrementMessageCounter.js'; +import type { ConversationModel } from '../../models/conversations.js'; +import type { MessageAttributesType } from '../../model-types.js'; +import { SendStatus } from '../../messages/MessageSendState.js'; describe('isMessageAMatchForReaction', () => { let contactA: ConversationModel; diff --git a/ts/test-electron/util/scaleImageToLevel_test.ts b/ts/test-electron/util/scaleImageToLevel_test.ts index 31229844899..ed425c00a67 100644 --- a/ts/test-electron/util/scaleImageToLevel_test.ts +++ b/ts/test-electron/util/scaleImageToLevel_test.ts @@ -3,9 +3,9 @@ import { assert } from 'chai'; import loadImage from 'blueimp-load-image'; -import { IMAGE_JPEG, IMAGE_PNG } from '../../types/MIME'; +import { IMAGE_JPEG, IMAGE_PNG } from '../../types/MIME.js'; -import { scaleImageToLevel } from '../../util/scaleImageToLevel'; +import { scaleImageToLevel } from '../../util/scaleImageToLevel.js'; describe('scaleImageToLevel', () => { // NOTE: These tests are incomplete. diff --git a/ts/test-electron/util/sendToGroup_test.ts b/ts/test-electron/util/sendToGroup_test.ts index 340150055aa..8cf83946d50 100644 --- a/ts/test-electron/util/sendToGroup_test.ts +++ b/ts/test-electron/util/sendToGroup_test.ts @@ -7,10 +7,10 @@ import { LibSignalErrorBase } from '@signalapp/libsignal-client'; import { _analyzeSenderKeyDevices, _shouldFailSend, -} from '../../util/sendToGroup'; -import { generateAci } from '../../types/ServiceId'; +} from '../../util/sendToGroup.js'; +import { generateAci } from '../../types/ServiceId.js'; -import type { DeviceType } from '../../textsecure/Types.d'; +import type { DeviceType } from '../../textsecure/Types.d.ts'; import { ConnectTimeoutError, HTTPError, @@ -23,7 +23,7 @@ import { SendMessageProtoError, UnknownRecipientError, UnregisteredUserError, -} from '../../textsecure/Errors'; +} from '../../textsecure/Errors.js'; describe('sendToGroup', () => { const serviceIdOne = generateAci(); diff --git a/ts/test-electron/util/waitForOnline_test.ts b/ts/test-electron/util/waitForOnline_test.ts index 7b141264090..5e79d2cf5ee 100644 --- a/ts/test-electron/util/waitForOnline_test.ts +++ b/ts/test-electron/util/waitForOnline_test.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { EventEmitter } from 'events'; +import { EventEmitter } from 'node:events'; import * as sinon from 'sinon'; -import { waitForOnline } from '../../util/waitForOnline'; +import { waitForOnline } from '../../util/waitForOnline.js'; describe('waitForOnline', () => { let sandbox: sinon.SinonSandbox; diff --git a/ts/test-electron/windows/attachments_test.ts b/ts/test-electron/windows/attachments_test.ts index a3175ecf605..cbe1478ac9c 100644 --- a/ts/test-electron/windows/attachments_test.ts +++ b/ts/test-electron/windows/attachments_test.ts @@ -2,13 +2,13 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import path from 'path'; -import fs from 'fs'; -import os from 'os'; +import path from 'node:path'; +import fs from 'node:fs'; +import os from 'node:os'; import fse from 'fs-extra'; -import * as Attachments from '../../windows/main/attachments'; -import * as Bytes from '../../Bytes'; -import { createName, getRelativePath } from '../../util/attachmentPath'; +import * as Attachments from '../../windows/main/attachments.js'; +import * as Bytes from '../../Bytes.js'; +import { createName, getRelativePath } from '../../util/attachmentPath.js'; const PREFIX_LENGTH = 2; const NUM_SEPARATORS = 1; diff --git a/ts/test-helpers/FakeLeftPaneContainer.tsx b/ts/test-helpers/FakeLeftPaneContainer.tsx index 787dfee8abf..fea2b47025e 100644 --- a/ts/test-helpers/FakeLeftPaneContainer.tsx +++ b/ts/test-helpers/FakeLeftPaneContainer.tsx @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import { WidthBreakpoint } from '../components/_util'; +import { WidthBreakpoint } from '../components/_util.js'; type PropsType = { children?: React.ReactNode; diff --git a/ts/test-helpers/RemoteConfigStub.ts b/ts/test-helpers/RemoteConfigStub.ts index 97df6400ba8..d1183ae9bc8 100644 --- a/ts/test-helpers/RemoteConfigStub.ts +++ b/ts/test-helpers/RemoteConfigStub.ts @@ -1,11 +1,11 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { _refreshRemoteConfig } from '../RemoteConfig'; +import { _refreshRemoteConfig } from '../RemoteConfig.js'; import type { WebAPIType, RemoteConfigResponseType, -} from '../textsecure/WebAPI'; +} from '../textsecure/WebAPI.js'; export async function updateRemoteConfig( newConfig: Array<{ name: string; value: string }> diff --git a/ts/test-helpers/attachmentDownloads.ts b/ts/test-helpers/attachmentDownloads.ts index cf97f95267c..c996b468b7b 100644 --- a/ts/test-helpers/attachmentDownloads.ts +++ b/ts/test-helpers/attachmentDownloads.ts @@ -1,9 +1,9 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { AttachmentDownloadSource } from '../sql/Interface'; -import { IMAGE_JPEG, IMAGE_PNG } from '../types/MIME'; -import type { AttachmentDownloadJobType } from '../types/AttachmentDownload'; +import { AttachmentDownloadSource } from '../sql/Interface.js'; +import { IMAGE_JPEG, IMAGE_PNG } from '../types/MIME.js'; +import type { AttachmentDownloadJobType } from '../types/AttachmentDownload.js'; export function createAttachmentDownloadJob( index: number, diff --git a/ts/test-helpers/createCallParticipant.ts b/ts/test-helpers/createCallParticipant.ts index 70a59814abb..af803f8b387 100644 --- a/ts/test-helpers/createCallParticipant.ts +++ b/ts/test-helpers/createCallParticipant.ts @@ -3,11 +3,11 @@ import { sample } from 'lodash'; -import { AvatarColors } from '../types/Colors'; -import type { GroupCallRemoteParticipantType } from '../types/Calling'; -import { generateAci } from '../types/ServiceId'; +import { AvatarColors } from '../types/Colors.js'; +import type { GroupCallRemoteParticipantType } from '../types/Calling.js'; +import { generateAci } from '../types/ServiceId.js'; -import { getDefaultConversationWithServiceId } from './getDefaultConversation'; +import { getDefaultConversationWithServiceId } from './getDefaultConversation.js'; export function createCallParticipant( participantProps: Partial diff --git a/ts/test-helpers/defaultComposerStates.ts b/ts/test-helpers/defaultComposerStates.ts index 9871ee4da4a..9c13d8d1661 100644 --- a/ts/test-helpers/defaultComposerStates.ts +++ b/ts/test-helpers/defaultComposerStates.ts @@ -1,9 +1,9 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { ComposerStep } from '../state/ducks/conversationsEnums'; -import { OneTimeModalState } from '../groups/toggleSelectedContactForGroupAddition'; -import { DurationInSeconds } from '../util/durations'; +import { ComposerStep } from '../state/ducks/conversationsEnums.js'; +import { OneTimeModalState } from '../groups/toggleSelectedContactForGroupAddition.js'; +import { DurationInSeconds } from '../util/durations/index.js'; export const defaultStartDirectConversationComposerState = { step: ComposerStep.StartDirectConversation as const, diff --git a/ts/test-helpers/expireTimers.ts b/ts/test-helpers/expireTimers.ts index b97953e2f90..dfca459ebac 100644 --- a/ts/test-helpers/expireTimers.ts +++ b/ts/test-helpers/expireTimers.ts @@ -1,8 +1,8 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import * as durations from '../util/durations'; -import { DurationInSeconds } from '../util/durations'; +import * as durations from '../util/durations/index.js'; +import { DurationInSeconds } from '../util/durations/index.js'; export type TestExpireTimer = Readonly<{ value: DurationInSeconds; diff --git a/ts/test-helpers/fakeAttachment.ts b/ts/test-helpers/fakeAttachment.ts index e17e7ba529b..41729ee9d95 100644 --- a/ts/test-helpers/fakeAttachment.ts +++ b/ts/test-helpers/fakeAttachment.ts @@ -7,8 +7,8 @@ import type { AttachmentDraftType, ThumbnailType, AttachmentForUIType, -} from '../types/Attachment'; -import { IMAGE_JPEG } from '../types/MIME'; +} from '../types/Attachment.js'; +import { IMAGE_JPEG } from '../types/MIME.js'; export const fakeAttachment = ( overrides: Partial = {} diff --git a/ts/test-helpers/fakeCallLink.ts b/ts/test-helpers/fakeCallLink.ts index 62282128fb6..e66a0386218 100644 --- a/ts/test-helpers/fakeCallLink.ts +++ b/ts/test-helpers/fakeCallLink.ts @@ -1,9 +1,9 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { CallLinkStateType, CallLinkType } from '../types/CallLink'; -import type { CallingConversationType } from '../types/Calling'; -import { CallLinkRestrictions } from '../types/CallLink'; -import { MONTH } from '../util/durations/constants'; +import type { CallLinkStateType, CallLinkType } from '../types/CallLink.js'; +import type { CallingConversationType } from '../types/Calling.js'; +import { CallLinkRestrictions } from '../types/CallLink.js'; +import { MONTH } from '../util/durations/constants.js'; export const FAKE_CALL_LINK: CallLinkType = { adminKey: null, diff --git a/ts/test-helpers/fakeLookupConversationWithoutServiceId.ts b/ts/test-helpers/fakeLookupConversationWithoutServiceId.ts index e7c4432fb48..dc7a8e1d7f6 100644 --- a/ts/test-helpers/fakeLookupConversationWithoutServiceId.ts +++ b/ts/test-helpers/fakeLookupConversationWithoutServiceId.ts @@ -6,12 +6,12 @@ import { useState } from 'react'; import type { UUIDFetchStateType, UUIDFetchStateKeyType, -} from '../util/uuidFetchState'; -import type { lookupConversationWithoutServiceId } from '../util/lookupConversationWithoutServiceId'; -import { sleep } from '../util/sleep'; -import * as durations from '../util/durations'; -import type { ConversationType } from '../state/ducks/conversations'; -import { getDefaultConversation } from './getDefaultConversation'; +} from '../util/uuidFetchState.js'; +import type { lookupConversationWithoutServiceId } from '../util/lookupConversationWithoutServiceId.js'; +import { sleep } from '../util/sleep.js'; +import * as durations from '../util/durations/index.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import { getDefaultConversation } from './getDefaultConversation.js'; const VALID_IDENTIFIERS = new Set([ 'e164:+12125551234', diff --git a/ts/test-helpers/generateBackup.ts b/ts/test-helpers/generateBackup.ts index 78ec2246c4c..71a887307aa 100644 --- a/ts/test-helpers/generateBackup.ts +++ b/ts/test-helpers/generateBackup.ts @@ -12,15 +12,15 @@ import { } from '@signalapp/libsignal-client/dist/AccountKeys'; import { MessageBackupKey } from '@signalapp/libsignal-client/dist/MessageBackup'; -import type { AciString } from '../types/ServiceId'; -import { generateAci } from '../types/ServiceId'; -import { CipherType } from '../types/Crypto'; -import { appendPaddingStream } from '../util/logPadding'; -import { prependStream } from '../util/prependStream'; -import { appendMacStream } from '../util/appendMacStream'; -import { toAciObject } from '../util/ServiceId'; -import { BACKUP_VERSION } from '../services/backups/constants'; -import { Backups } from '../protobuf'; +import type { AciString } from '../types/ServiceId.js'; +import { generateAci } from '../types/ServiceId.js'; +import { CipherType } from '../types/Crypto.js'; +import { appendPaddingStream } from '../util/logPadding.js'; +import { prependStream } from '../util/prependStream.js'; +import { appendMacStream } from '../util/appendMacStream.js'; +import { toAciObject } from '../util/ServiceId.js'; +import { BACKUP_VERSION } from '../services/backups/constants.js'; +import { Backups } from '../protobuf/index.js'; export type BackupGeneratorConfigType = Readonly< { diff --git a/ts/test-helpers/getDefaultConversation.ts b/ts/test-helpers/getDefaultConversation.ts index ffd88dd9bd4..f4419da1d1f 100644 --- a/ts/test-helpers/getDefaultConversation.ts +++ b/ts/test-helpers/getDefaultConversation.ts @@ -5,14 +5,14 @@ import casual from 'casual'; import { sample } from 'lodash'; import { v4 as generateUuid } from 'uuid'; -import type { ConversationType } from '../state/ducks/conversations'; -import type { ServiceIdString } from '../types/ServiceId'; -import { generateAci } from '../types/ServiceId'; -import type { GroupListItemConversationType } from '../components/conversationList/GroupListItem'; -import { getRandomColor } from './getRandomColor'; -import { ConversationColors } from '../types/Colors'; -import { StorySendMode } from '../types/Stories'; -import { getAvatarPlaceholderGradient } from '../utils/getAvatarPlaceholderGradient'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import type { ServiceIdString } from '../types/ServiceId.js'; +import { generateAci } from '../types/ServiceId.js'; +import type { GroupListItemConversationType } from '../components/conversationList/GroupListItem.js'; +import { getRandomColor } from './getRandomColor.js'; +import { ConversationColors } from '../types/Colors.js'; +import { StorySendMode } from '../types/Stories.js'; +import { getAvatarPlaceholderGradient } from '../utils/getAvatarPlaceholderGradient.js'; export const getAvatarPath = (): string => sample([ diff --git a/ts/test-helpers/getFakeBadge.ts b/ts/test-helpers/getFakeBadge.ts index d5f48e4606f..29312c504c9 100644 --- a/ts/test-helpers/getFakeBadge.ts +++ b/ts/test-helpers/getFakeBadge.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import { times } from 'lodash'; -import type { BadgeType } from '../badges/types'; -import { BadgeCategory } from '../badges/BadgeCategory'; -import { BadgeImageTheme } from '../badges/BadgeImageTheme'; -import { repeat, zipObject } from '../util/iterables'; +import type { BadgeType } from '../badges/types.js'; +import { BadgeCategory } from '../badges/BadgeCategory.js'; +import { BadgeImageTheme } from '../badges/BadgeImageTheme.js'; +import { repeat, zipObject } from '../util/iterables.js'; export function getFakeBadge({ alternate = false, diff --git a/ts/test-helpers/getFakeCallHistoryGroup.ts b/ts/test-helpers/getFakeCallHistoryGroup.ts index a356c221639..fdbdc8e7659 100644 --- a/ts/test-helpers/getFakeCallHistoryGroup.ts +++ b/ts/test-helpers/getFakeCallHistoryGroup.ts @@ -1,15 +1,15 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { CallHistoryGroup } from '../types/CallDisposition'; +import type { CallHistoryGroup } from '../types/CallDisposition.js'; import { AdhocCallStatus, CallDirection, CallType, DirectCallStatus, CallMode, -} from '../types/CallDisposition'; -import { DurationInSeconds } from '../util/durations'; +} from '../types/CallDisposition.js'; +import { DurationInSeconds } from '../util/durations/index.js'; function mins(n: number) { return DurationInSeconds.toMillis(DurationInSeconds.fromMinutes(n)); diff --git a/ts/test-helpers/getFakeDistributionLists.ts b/ts/test-helpers/getFakeDistributionLists.ts index 8d64c1fca96..f72757d7e4e 100644 --- a/ts/test-helpers/getFakeDistributionLists.ts +++ b/ts/test-helpers/getFakeDistributionLists.ts @@ -3,12 +3,12 @@ import casual from 'casual'; -import type { StoryDistributionListDataType } from '../state/ducks/storyDistributionLists'; -import type { StoryDistributionListWithMembersDataType } from '../types/Stories'; -import { MY_STORY_ID } from '../types/Stories'; -import { generateStoryDistributionId } from '../types/StoryDistributionId'; -import { generateAci } from '../types/ServiceId'; -import { getDefaultConversation } from './getDefaultConversation'; +import type { StoryDistributionListDataType } from '../state/ducks/storyDistributionLists.js'; +import type { StoryDistributionListWithMembersDataType } from '../types/Stories.js'; +import { MY_STORY_ID } from '../types/Stories.js'; +import { generateStoryDistributionId } from '../types/StoryDistributionId.js'; +import { generateAci } from '../types/ServiceId.js'; +import { getDefaultConversation } from './getDefaultConversation.js'; export function getFakeDistributionListsWithMembers(): Array { return [ diff --git a/ts/test-helpers/getFakeStory.tsx b/ts/test-helpers/getFakeStory.tsx index a58a0c537b5..defbfbfca46 100644 --- a/ts/test-helpers/getFakeStory.tsx +++ b/ts/test-helpers/getFakeStory.tsx @@ -4,17 +4,17 @@ import casual from 'casual'; import { v4 as generateUuid } from 'uuid'; -import type { AttachmentType } from '../types/Attachment'; -import type { ConversationType } from '../state/ducks/conversations'; +import type { AttachmentType } from '../types/Attachment.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; import type { ConversationStoryType, MyStoryType, StoryViewType, -} from '../types/Stories'; -import * as durations from '../util/durations'; -import { getDefaultConversation } from './getDefaultConversation'; -import { fakeAttachment, fakeThumbnail } from './fakeAttachment'; -import { MY_STORY_ID, ResolvedSendStatus } from '../types/Stories'; +} from '../types/Stories.js'; +import * as durations from '../util/durations/index.js'; +import { getDefaultConversation } from './getDefaultConversation.js'; +import { fakeAttachment, fakeThumbnail } from './fakeAttachment.js'; +import { MY_STORY_ID, ResolvedSendStatus } from '../types/Stories.js'; function getAttachmentWithThumbnail(url: string): AttachmentType { return fakeAttachment({ diff --git a/ts/test-helpers/getRandomColor.ts b/ts/test-helpers/getRandomColor.ts index eea99b2b377..47ddaa4b794 100644 --- a/ts/test-helpers/getRandomColor.ts +++ b/ts/test-helpers/getRandomColor.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import { sample } from 'lodash'; -import type { AvatarColorType } from '../types/Colors'; -import { AvatarColors } from '../types/Colors'; +import type { AvatarColorType } from '../types/Colors.js'; +import { AvatarColors } from '../types/Colors.js'; export function getRandomColor(): AvatarColorType { return sample(AvatarColors) || AvatarColors[0]; diff --git a/ts/test-helpers/getStickerPacks.ts b/ts/test-helpers/getStickerPacks.ts index 8753415e0d6..b599e77ed06 100644 --- a/ts/test-helpers/getStickerPacks.ts +++ b/ts/test-helpers/getStickerPacks.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { StickerPackType, StickerType } from '../state/ducks/stickers'; +import type { StickerPackType, StickerType } from '../state/ducks/stickers.js'; export const createPack = ( props: Partial, diff --git a/ts/test-mock/backups/backups_test.ts b/ts/test-mock/backups/backups_test.ts index defc11c54ec..dcd19c4a854 100644 --- a/ts/test-mock/backups/backups_test.ts +++ b/ts/test-mock/backups/backups_test.ts @@ -1,34 +1,33 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import fs from 'fs/promises'; +import fs, { readFile } from 'node:fs/promises'; import { randomBytes } from 'node:crypto'; import { join } from 'node:path'; -import os from 'os'; -import { readFile } from 'node:fs/promises'; +import os from 'node:os'; import createDebug from 'debug'; import { Proto, StorageState } from '@signalapp/mock-server'; import { assert } from 'chai'; import { expect } from 'playwright/test'; import Long from 'long'; -import { generateStoryDistributionId } from '../../types/StoryDistributionId'; -import { MY_STORY_ID } from '../../types/Stories'; -import { generateAci } from '../../types/ServiceId'; -import { generateBackup } from '../../test-helpers/generateBackup'; -import { IMAGE_JPEG } from '../../types/MIME'; -import { uuidToBytes } from '../../util/uuidToBytes'; -import * as durations from '../../util/durations'; -import type { App } from '../playwright'; -import { Bootstrap, type LinkOptionsType } from '../bootstrap'; +import { generateStoryDistributionId } from '../../types/StoryDistributionId.js'; +import { MY_STORY_ID } from '../../types/Stories.js'; +import { generateAci } from '../../types/ServiceId.js'; +import { generateBackup } from '../../test-helpers/generateBackup.js'; +import { IMAGE_JPEG } from '../../types/MIME.js'; +import { uuidToBytes } from '../../util/uuidToBytes.js'; +import * as durations from '../../util/durations/index.js'; +import type { App } from '../playwright.js'; +import { Bootstrap, type LinkOptionsType } from '../bootstrap.js'; import { getMessageInTimelineByTimestamp, sendTextMessage, sendReaction, -} from '../helpers'; -import { toBase64 } from '../../Bytes'; -import { strictAssert } from '../../util/assert'; -import { BackupLevel } from '../../services/backups/types'; +} from '../helpers.js'; +import { toBase64 } from '../../Bytes.js'; +import { strictAssert } from '../../util/assert.js'; +import { BackupLevel } from '../../services/backups/types.js'; export const debug = createDebug('mock:test:backups'); diff --git a/ts/test-mock/benchmarks/backup_bench.ts b/ts/test-mock/benchmarks/backup_bench.ts index 2a093f8a2f7..f9292071f77 100644 --- a/ts/test-mock/benchmarks/backup_bench.ts +++ b/ts/test-mock/benchmarks/backup_bench.ts @@ -1,9 +1,9 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { Bootstrap, MAX_CYCLES } from './fixtures'; -import { type RegressionSample } from '../bootstrap'; -import { generateBackup } from '../../test-helpers/generateBackup'; +import { Bootstrap, MAX_CYCLES } from './fixtures.js'; +import { type RegressionSample } from '../bootstrap.js'; +import { generateBackup } from '../../test-helpers/generateBackup.js'; const INITIAL_MESSAGE_COUNT = 10000; const FINAL_MESSAGE_COUNT = 30000; diff --git a/ts/test-mock/benchmarks/call_history_search_bench.ts b/ts/test-mock/benchmarks/call_history_search_bench.ts index 25737fdffc0..76c2f0b1149 100644 --- a/ts/test-mock/benchmarks/call_history_search_bench.ts +++ b/ts/test-mock/benchmarks/call_history_search_bench.ts @@ -7,11 +7,11 @@ import { Proto, StorageState } from '@signalapp/mock-server'; import Long from 'long'; import { sample } from 'lodash'; import { expect } from 'playwright/test'; -import { Bootstrap, debug, RUN_COUNT, DISCARD_COUNT } from './fixtures'; -import { stats } from '../../util/benchmark/stats'; -import { uuidToBytes } from '../../util/uuidToBytes'; -import { strictAssert } from '../../util/assert'; -import { typeIntoInput } from '../helpers'; +import { Bootstrap, debug, RUN_COUNT, DISCARD_COUNT } from './fixtures.js'; +import { stats } from '../../util/benchmark/stats.js'; +import { uuidToBytes } from '../../util/uuidToBytes.js'; +import { strictAssert } from '../../util/assert.js'; +import { typeIntoInput } from '../helpers.js'; const CALL_HISTORY_COUNT = 1000; diff --git a/ts/test-mock/benchmarks/convo_open_bench.ts b/ts/test-mock/benchmarks/convo_open_bench.ts index d500bd47f8b..f956beeeb5e 100644 --- a/ts/test-mock/benchmarks/convo_open_bench.ts +++ b/ts/test-mock/benchmarks/convo_open_bench.ts @@ -2,12 +2,12 @@ // SPDX-License-Identifier: AGPL-3.0-only /* eslint-disable no-await-in-loop, no-console */ -import assert from 'assert'; +import assert from 'node:assert'; import type { PrimaryDevice } from '@signalapp/mock-server'; -import { Bootstrap, debug, RUN_COUNT, DISCARD_COUNT } from './fixtures'; -import { stats } from '../../util/benchmark/stats'; -import { sleep } from '../../util/sleep'; +import { Bootstrap, debug, RUN_COUNT, DISCARD_COUNT } from './fixtures.js'; +import { stats } from '../../util/benchmark/stats.js'; +import { sleep } from '../../util/sleep.js'; const CONVERSATION_SIZE = 1000; // messages const DELAY = 50; // milliseconds diff --git a/ts/test-mock/benchmarks/fixtures.ts b/ts/test-mock/benchmarks/fixtures.ts index dd98b299703..234aff162a7 100644 --- a/ts/test-mock/benchmarks/fixtures.ts +++ b/ts/test-mock/benchmarks/fixtures.ts @@ -4,12 +4,12 @@ import createDebug from 'debug'; -import { Bootstrap } from '../bootstrap'; +import { Bootstrap } from '../bootstrap.js'; export const debug = createDebug('mock:benchmarks'); export { Bootstrap }; -export { App } from '../playwright'; +export { App } from '../playwright.js'; export const RUN_COUNT = process.env.RUN_COUNT ? parseInt(process.env.RUN_COUNT, 10) diff --git a/ts/test-mock/benchmarks/group_send_bench.ts b/ts/test-mock/benchmarks/group_send_bench.ts index 75aa31a66ea..36212b40e22 100644 --- a/ts/test-mock/benchmarks/group_send_bench.ts +++ b/ts/test-mock/benchmarks/group_send_bench.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only /* eslint-disable no-await-in-loop, no-console */ -import assert from 'assert'; +import assert from 'node:assert'; import { StorageState, @@ -18,11 +18,11 @@ import { DISCARD_COUNT, GROUP_DELIVERY_RECEIPTS, BLOCKED_COUNT, -} from './fixtures'; -import { stats } from '../../util/benchmark/stats'; -import { sleep } from '../../util/sleep'; -import { typeIntoInput, waitForEnabledComposer } from '../helpers'; -import { MINUTE } from '../../util/durations'; +} from './fixtures.js'; +import { stats } from '../../util/benchmark/stats.js'; +import { sleep } from '../../util/sleep.js'; +import { typeIntoInput, waitForEnabledComposer } from '../helpers.js'; +import { MINUTE } from '../../util/durations/index.js'; const LAST_MESSAGE = 'start sending messages now'; diff --git a/ts/test-mock/benchmarks/send_bench.ts b/ts/test-mock/benchmarks/send_bench.ts index 861d8e8b7bd..ffa9f8565f9 100644 --- a/ts/test-mock/benchmarks/send_bench.ts +++ b/ts/test-mock/benchmarks/send_bench.ts @@ -2,13 +2,13 @@ // SPDX-License-Identifier: AGPL-3.0-only /* eslint-disable no-await-in-loop, no-console */ -import assert from 'assert'; +import assert from 'node:assert'; import { ReceiptType } from '@signalapp/mock-server'; -import { Bootstrap, debug, RUN_COUNT, DISCARD_COUNT } from './fixtures'; -import { stats } from '../../util/benchmark/stats'; -import { typeIntoInput, waitForEnabledComposer } from '../helpers'; +import { Bootstrap, debug, RUN_COUNT, DISCARD_COUNT } from './fixtures.js'; +import { stats } from '../../util/benchmark/stats.js'; +import { typeIntoInput, waitForEnabledComposer } from '../helpers.js'; const CONVERSATION_SIZE = 500; // messages diff --git a/ts/test-mock/benchmarks/startup_bench.ts b/ts/test-mock/benchmarks/startup_bench.ts index 4675881e9ef..6f67af501d1 100644 --- a/ts/test-mock/benchmarks/startup_bench.ts +++ b/ts/test-mock/benchmarks/startup_bench.ts @@ -4,8 +4,8 @@ import { ReceiptType } from '@signalapp/mock-server'; import { omit } from 'lodash'; -import { debug, Bootstrap, MAX_CYCLES } from './fixtures'; -import { type RegressionSample } from '../bootstrap'; +import { debug, Bootstrap, MAX_CYCLES } from './fixtures.js'; +import { type RegressionSample } from '../bootstrap.js'; const INITIAL_MESSAGE_COUNT = 1000; const FINAL_MESSAGE_COUNT = 5000; diff --git a/ts/test-mock/benchmarks/storage_sync_bench.ts b/ts/test-mock/benchmarks/storage_sync_bench.ts index 8df1e4ceb79..ca18baa5014 100644 --- a/ts/test-mock/benchmarks/storage_sync_bench.ts +++ b/ts/test-mock/benchmarks/storage_sync_bench.ts @@ -5,7 +5,7 @@ import type { PrimaryDevice } from '@signalapp/mock-server'; import { StorageState } from '@signalapp/mock-server'; -import { Bootstrap } from './fixtures'; +import { Bootstrap } from './fixtures.js'; const CONTACT_COUNT = 1000; diff --git a/ts/test-mock/bootstrap.ts b/ts/test-mock/bootstrap.ts index 434879f3da9..35252a25b4b 100644 --- a/ts/test-mock/bootstrap.ts +++ b/ts/test-mock/bootstrap.ts @@ -1,11 +1,11 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import assert from 'assert'; -import fs from 'fs/promises'; -import crypto from 'crypto'; -import path, { join } from 'path'; -import os from 'os'; +import assert from 'node:assert'; +import fs from 'node:fs/promises'; +import crypto from 'node:crypto'; +import path, { join } from 'node:path'; +import os from 'node:os'; import { PassThrough } from 'node:stream'; import createDebug from 'debug'; import pTimeout from 'p-timeout'; @@ -21,19 +21,19 @@ import { ServiceIdKind, loadCertificates, } from '@signalapp/mock-server'; -import { MAX_READ_KEYS as MAX_STORAGE_READ_KEYS } from '../services/storageConstants'; -import { SECOND, MINUTE, WEEK, MONTH } from '../util/durations'; -import { drop } from '../util/drop'; -import { regress } from '../util/benchmark/stats'; -import type { RendererConfigType } from '../types/RendererConfig'; -import type { MIMEType } from '../types/MIME'; -import { App } from './playwright'; -import { CONTACT_COUNT } from './benchmarks/fixtures'; -import { strictAssert } from '../util/assert'; +import { MAX_READ_KEYS as MAX_STORAGE_READ_KEYS } from '../services/storageConstants.js'; +import { SECOND, MINUTE, WEEK, MONTH } from '../util/durations/index.js'; +import { drop } from '../util/drop.js'; +import { regress } from '../util/benchmark/stats.js'; +import type { RendererConfigType } from '../types/RendererConfig.js'; +import type { MIMEType } from '../types/MIME.js'; +import { App } from './playwright.js'; +import { CONTACT_COUNT } from './benchmarks/fixtures.js'; +import { strictAssert } from '../util/assert.js'; import { encryptAttachmentV2, generateAttachmentKeys, -} from '../AttachmentCrypto'; +} from '../AttachmentCrypto.js'; export { App }; diff --git a/ts/test-mock/calling/callLinkAdmin_test.ts b/ts/test-mock/calling/callLinkAdmin_test.ts index 23942236adf..436d760ed41 100644 --- a/ts/test-mock/calling/callLinkAdmin_test.ts +++ b/ts/test-mock/calling/callLinkAdmin_test.ts @@ -1,10 +1,10 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import { expect } from 'playwright/test'; -import * as durations from '../../util/durations'; -import type { App } from '../playwright'; -import { Bootstrap } from '../bootstrap'; -import { createCallLink } from '../helpers'; +import * as durations from '../../util/durations/index.js'; +import type { App } from '../playwright.js'; +import { Bootstrap } from '../bootstrap.js'; +import { createCallLink } from '../helpers.js'; describe('calling/callLinkAdmin', function (this: Mocha.Suite) { this.timeout(durations.MINUTE); diff --git a/ts/test-mock/calling/callMessages_test.docker.ts b/ts/test-mock/calling/callMessages_test.docker.ts index b81132f3519..c264e49cb65 100644 --- a/ts/test-mock/calling/callMessages_test.docker.ts +++ b/ts/test-mock/calling/callMessages_test.docker.ts @@ -3,10 +3,10 @@ import { StorageState } from '@signalapp/mock-server'; import { expect } from 'playwright/test'; -import * as durations from '../../util/durations'; -import type { App } from '../playwright'; -import { Bootstrap } from '../bootstrap'; -import { runTurnInContainer, tearDownTurnContainer } from './helpers'; +import * as durations from '../../util/durations/index.js'; +import type { App } from '../playwright.js'; +import { Bootstrap } from '../bootstrap.js'; +import { runTurnInContainer, tearDownTurnContainer } from './helpers.js'; describe('callMessages', function callMessages(this: Mocha.Suite) { this.timeout(durations.MINUTE); diff --git a/ts/test-mock/calling/helpers.ts b/ts/test-mock/calling/helpers.ts index 9672b0c74f9..ea2937fe5c8 100644 --- a/ts/test-mock/calling/helpers.ts +++ b/ts/test-mock/calling/helpers.ts @@ -1,7 +1,7 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import * as child from 'child_process'; +import * as child from 'node:child_process'; import createDebug from 'debug'; const debug = createDebug('mock:test:calling:helpers'); diff --git a/ts/test-mock/helpers.ts b/ts/test-mock/helpers.ts index 113d335ee7f..529bb68d4ed 100644 --- a/ts/test-mock/helpers.ts +++ b/ts/test-mock/helpers.ts @@ -13,8 +13,8 @@ import { assert } from 'chai'; import Long from 'long'; import type { Locator, Page } from 'playwright'; import { expect } from 'playwright/test'; -import type { SignalService } from '../protobuf'; -import { strictAssert } from '../util/assert'; +import type { SignalService } from '../protobuf/index.js'; +import { strictAssert } from '../util/assert.js'; const debug = createDebug('mock:test:helpers'); diff --git a/ts/test-mock/messaging/attachments_test.ts b/ts/test-mock/messaging/attachments_test.ts index 35c2563823b..75bc847e686 100644 --- a/ts/test-mock/messaging/attachments_test.ts +++ b/ts/test-mock/messaging/attachments_test.ts @@ -5,21 +5,21 @@ import createDebug from 'debug'; import { assert } from 'chai'; import { expect } from 'playwright/test'; import { type PrimaryDevice, StorageState } from '@signalapp/mock-server'; -import * as path from 'path'; -import { readFile } from 'fs/promises'; +import * as path from 'node:path'; +import { readFile } from 'node:fs/promises'; -import type { App } from '../playwright'; -import { Bootstrap } from '../bootstrap'; +import type { App } from '../playwright.js'; +import { Bootstrap } from '../bootstrap.js'; import { getMessageInTimelineByTimestamp, getTimelineMessageWithText, sendMessageWithAttachments, sendTextMessage, -} from '../helpers'; -import * as durations from '../../util/durations'; -import { strictAssert } from '../../util/assert'; -import { VIDEO_MP4 } from '../../types/MIME'; -import { toBase64 } from '../../Bytes'; +} from '../helpers.js'; +import * as durations from '../../util/durations/index.js'; +import { strictAssert } from '../../util/assert.js'; +import { VIDEO_MP4 } from '../../types/MIME.js'; +import { toBase64 } from '../../Bytes.js'; export const debug = createDebug('mock:test:attachments'); diff --git a/ts/test-mock/messaging/backfill_test.ts b/ts/test-mock/messaging/backfill_test.ts index 00f6d516fdf..eb7c83bcb7d 100644 --- a/ts/test-mock/messaging/backfill_test.ts +++ b/ts/test-mock/messaging/backfill_test.ts @@ -7,14 +7,14 @@ import { readFile } from 'node:fs/promises'; import { join } from 'node:path'; import createDebug from 'debug'; import type { Page } from 'playwright'; -import assert from 'assert'; +import assert from 'node:assert'; import Long from 'long'; -import { LONG_MESSAGE, IMAGE_JPEG } from '../../types/MIME'; -import * as durations from '../../util/durations'; -import type { App } from '../playwright'; -import { Bootstrap } from '../bootstrap'; -import { sendTextMessage, getTimelineMessageWithText } from '../helpers'; +import { LONG_MESSAGE, IMAGE_JPEG } from '../../types/MIME.js'; +import * as durations from '../../util/durations/index.js'; +import type { App } from '../playwright.js'; +import { Bootstrap } from '../bootstrap.js'; +import { sendTextMessage, getTimelineMessageWithText } from '../helpers.js'; export const debug = createDebug('mock:test:backfill'); diff --git a/ts/test-mock/messaging/edit_test.ts b/ts/test-mock/messaging/edit_test.ts index bb28ebac43f..0f057b11612 100644 --- a/ts/test-mock/messaging/edit_test.ts +++ b/ts/test-mock/messaging/edit_test.ts @@ -8,18 +8,18 @@ import createDebug from 'debug'; import Long from 'long'; import type { Page } from 'playwright'; -import type { App } from '../playwright'; -import * as durations from '../../util/durations'; -import { Bootstrap } from '../bootstrap'; -import { RECEIPT_BATCHER_WAIT_MS, ReceiptType } from '../../types/Receipt'; -import { SendStatus } from '../../messages/MessageSendState'; -import { drop } from '../../util/drop'; -import { strictAssert } from '../../util/assert'; -import { generateAci } from '../../types/ServiceId'; -import { IMAGE_GIF } from '../../types/MIME'; -import { typeIntoInput, waitForEnabledComposer } from '../helpers'; -import type { MessageAttributesType } from '../../model-types'; -import { sleep } from '../../util/sleep'; +import type { App } from '../playwright.js'; +import * as durations from '../../util/durations/index.js'; +import { Bootstrap } from '../bootstrap.js'; +import { RECEIPT_BATCHER_WAIT_MS, ReceiptType } from '../../types/Receipt.js'; +import { SendStatus } from '../../messages/MessageSendState.js'; +import { drop } from '../../util/drop.js'; +import { strictAssert } from '../../util/assert.js'; +import { generateAci } from '../../types/ServiceId.js'; +import { IMAGE_GIF } from '../../types/MIME.js'; +import { typeIntoInput, waitForEnabledComposer } from '../helpers.js'; +import type { MessageAttributesType } from '../../model-types.js'; +import { sleep } from '../../util/sleep.js'; export const debug = createDebug('mock:test:edit'); diff --git a/ts/test-mock/messaging/expire_timer_version_test.ts b/ts/test-mock/messaging/expire_timer_version_test.ts index 1552a377fbb..9e98cd64621 100644 --- a/ts/test-mock/messaging/expire_timer_version_test.ts +++ b/ts/test-mock/messaging/expire_timer_version_test.ts @@ -10,16 +10,16 @@ import { import createDebug from 'debug'; import Long from 'long'; -import * as durations from '../../util/durations'; -import { uuidToBytes } from '../../util/uuidToBytes'; -import { MY_STORY_ID } from '../../types/Stories'; -import { Bootstrap } from '../bootstrap'; -import type { App } from '../bootstrap'; +import * as durations from '../../util/durations/index.js'; +import { uuidToBytes } from '../../util/uuidToBytes.js'; +import { MY_STORY_ID } from '../../types/Stories.js'; +import { Bootstrap } from '../bootstrap.js'; +import type { App } from '../bootstrap.js'; import { expectSystemMessages, typeIntoInput, waitForEnabledComposer, -} from '../helpers'; +} from '../helpers.js'; export const debug = createDebug('mock:test:messaging'); diff --git a/ts/test-mock/messaging/lightbox_test.ts b/ts/test-mock/messaging/lightbox_test.ts index db61791bbf8..5f7504c2baf 100644 --- a/ts/test-mock/messaging/lightbox_test.ts +++ b/ts/test-mock/messaging/lightbox_test.ts @@ -4,18 +4,18 @@ import createDebug from 'debug'; import { expect } from 'playwright/test'; import { type PrimaryDevice, StorageState } from '@signalapp/mock-server'; -import * as path from 'path'; -import type { App } from '../playwright'; -import { Bootstrap } from '../bootstrap'; +import * as path from 'node:path'; +import type { App } from '../playwright.js'; +import { Bootstrap } from '../bootstrap.js'; import { getMessageInTimelineByTimestamp, getTimelineMessageWithText, sendMessageWithAttachments, sendTextMessage, -} from '../helpers'; -import * as durations from '../../util/durations'; -import { strictAssert } from '../../util/assert'; -import type { SignalService } from '../../protobuf'; +} from '../helpers.js'; +import * as durations from '../../util/durations/index.js'; +import { strictAssert } from '../../util/assert.js'; +import type { SignalService } from '../../protobuf/index.js'; const debug = createDebug('mock:test:lightbox'); diff --git a/ts/test-mock/messaging/reaction_test.ts b/ts/test-mock/messaging/reaction_test.ts index 80339a04fd1..15a870c7714 100644 --- a/ts/test-mock/messaging/reaction_test.ts +++ b/ts/test-mock/messaging/reaction_test.ts @@ -7,17 +7,17 @@ import { type Page } from 'playwright'; import { expect } from 'playwright/test'; import { assert } from 'chai'; -import type { App } from '../playwright'; -import { Bootstrap } from '../bootstrap'; -import { MINUTE } from '../../util/durations'; -import { strictAssert } from '../../util/assert'; +import type { App } from '../playwright.js'; +import { Bootstrap } from '../bootstrap.js'; +import { MINUTE } from '../../util/durations/index.js'; +import { strictAssert } from '../../util/assert.js'; import { clickOnConversation, getMessageInTimelineByTimestamp, sendTextMessage, sendReaction, createGroup, -} from '../helpers'; +} from '../helpers.js'; export const debug = createDebug('mock:test:reactions'); diff --git a/ts/test-mock/messaging/readSync_test.ts b/ts/test-mock/messaging/readSync_test.ts index 20ed985abfc..9f83ae8d991 100644 --- a/ts/test-mock/messaging/readSync_test.ts +++ b/ts/test-mock/messaging/readSync_test.ts @@ -5,9 +5,9 @@ import { assert } from 'chai'; import createDebug from 'debug'; import Long from 'long'; -import type { App } from '../playwright'; -import * as durations from '../../util/durations'; -import { Bootstrap } from '../bootstrap'; +import type { App } from '../playwright.js'; +import * as durations from '../../util/durations/index.js'; +import { Bootstrap } from '../bootstrap.js'; export const debug = createDebug('mock:test:readSync'); diff --git a/ts/test-mock/messaging/relink_test.ts b/ts/test-mock/messaging/relink_test.ts index 211b78ec76d..dcb63300d2b 100644 --- a/ts/test-mock/messaging/relink_test.ts +++ b/ts/test-mock/messaging/relink_test.ts @@ -4,10 +4,10 @@ import createDebug from 'debug'; import { Proto, StorageState } from '@signalapp/mock-server'; -import * as durations from '../../util/durations'; -import type { App } from '../playwright'; -import { Bootstrap } from '../bootstrap'; -import { expectSystemMessages } from '../helpers'; +import * as durations from '../../util/durations/index.js'; +import type { App } from '../playwright.js'; +import { Bootstrap } from '../bootstrap.js'; +import { expectSystemMessages } from '../helpers.js'; export const debug = createDebug('mock:test:relink'); diff --git a/ts/test-mock/messaging/retries_test.ts b/ts/test-mock/messaging/retries_test.ts index 9139b375fce..d9fe4697205 100644 --- a/ts/test-mock/messaging/retries_test.ts +++ b/ts/test-mock/messaging/retries_test.ts @@ -5,10 +5,10 @@ import { assert } from 'chai'; import createDebug from 'debug'; import { EnvelopeType, StorageState } from '@signalapp/mock-server'; -import type { App } from '../playwright'; -import * as durations from '../../util/durations'; -import { Bootstrap } from '../bootstrap'; -import { sleep } from '../../util/sleep'; +import type { App } from '../playwright.js'; +import * as durations from '../../util/durations/index.js'; +import { Bootstrap } from '../bootstrap.js'; +import { sleep } from '../../util/sleep.js'; export const debug = createDebug('mock:test:retries'); diff --git a/ts/test-mock/messaging/safety_number_test.ts b/ts/test-mock/messaging/safety_number_test.ts index b61719398d8..1616cc864f8 100644 --- a/ts/test-mock/messaging/safety_number_test.ts +++ b/ts/test-mock/messaging/safety_number_test.ts @@ -5,17 +5,17 @@ import createDebug from 'debug'; import { StorageState, Proto } from '@signalapp/mock-server'; import { assert } from 'chai'; -import type { App } from '../playwright'; -import { Bootstrap } from '../bootstrap'; -import { MINUTE } from '../../util/durations'; -import { uuidToBytes } from '../../util/uuidToBytes'; -import { MY_STORY_ID } from '../../types/Stories'; +import type { App } from '../playwright.js'; +import { Bootstrap } from '../bootstrap.js'; +import { MINUTE } from '../../util/durations/index.js'; +import { uuidToBytes } from '../../util/uuidToBytes.js'; +import { MY_STORY_ID } from '../../types/Stories.js'; import { clickOnConversation, typeIntoInput, expectSystemMessages, waitForEnabledComposer, -} from '../helpers'; +} from '../helpers.js'; export const debug = createDebug('mock:test:safetyNumber'); diff --git a/ts/test-mock/messaging/sendSync_test.ts b/ts/test-mock/messaging/sendSync_test.ts index 0d79e219028..8465996bfcc 100644 --- a/ts/test-mock/messaging/sendSync_test.ts +++ b/ts/test-mock/messaging/sendSync_test.ts @@ -5,9 +5,9 @@ import createDebug from 'debug'; import Long from 'long'; import { StorageState } from '@signalapp/mock-server'; -import type { App } from '../playwright'; -import * as durations from '../../util/durations'; -import { Bootstrap } from '../bootstrap'; +import type { App } from '../playwright.js'; +import * as durations from '../../util/durations/index.js'; +import { Bootstrap } from '../bootstrap.js'; export const debug = createDebug('mock:test:sendSync'); diff --git a/ts/test-mock/messaging/sender_key_test.ts b/ts/test-mock/messaging/sender_key_test.ts index 9b4cacdde03..e6c8f170a55 100644 --- a/ts/test-mock/messaging/sender_key_test.ts +++ b/ts/test-mock/messaging/sender_key_test.ts @@ -5,9 +5,9 @@ import createDebug from 'debug'; import { StorageState } from '@signalapp/mock-server'; import type { Group } from '@signalapp/mock-server'; -import * as durations from '../../util/durations'; -import type { App } from '../playwright'; -import { Bootstrap } from '../bootstrap'; +import * as durations from '../../util/durations/index.js'; +import type { App } from '../playwright.js'; +import { Bootstrap } from '../bootstrap.js'; export const debug = createDebug('mock:test:senderKey'); diff --git a/ts/test-mock/messaging/stories_test.ts b/ts/test-mock/messaging/stories_test.ts index ef81dfd3dfb..72fa813d7ab 100644 --- a/ts/test-mock/messaging/stories_test.ts +++ b/ts/test-mock/messaging/stories_test.ts @@ -6,12 +6,12 @@ import Long from 'long'; import { Proto, StorageState } from '@signalapp/mock-server'; import type { Group } from '@signalapp/mock-server'; -import * as durations from '../../util/durations'; -import { uuidToBytes } from '../../util/uuidToBytes'; -import { MY_STORY_ID } from '../../types/Stories'; -import { generateStoryDistributionId } from '../../types/StoryDistributionId'; -import type { App } from '../playwright'; -import { Bootstrap } from '../bootstrap'; +import * as durations from '../../util/durations/index.js'; +import { uuidToBytes } from '../../util/uuidToBytes.js'; +import { MY_STORY_ID } from '../../types/Stories.js'; +import { generateStoryDistributionId } from '../../types/StoryDistributionId.js'; +import type { App } from '../playwright.js'; +import { Bootstrap } from '../bootstrap.js'; export const debug = createDebug('mock:test:stories'); diff --git a/ts/test-mock/messaging/twoClients_test.ts b/ts/test-mock/messaging/twoClients_test.ts index 1bdc4f4bc90..47fff4aba1c 100644 --- a/ts/test-mock/messaging/twoClients_test.ts +++ b/ts/test-mock/messaging/twoClients_test.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import { StorageState } from '@signalapp/mock-server'; -import * as durations from '../../util/durations'; -import type { App } from '../playwright'; -import { Bootstrap } from '../bootstrap'; -import { typeIntoInput, waitForEnabledComposer } from '../helpers'; +import * as durations from '../../util/durations/index.js'; +import type { App } from '../playwright.js'; +import { Bootstrap } from '../bootstrap.js'; +import { typeIntoInput, waitForEnabledComposer } from '../helpers.js'; describe('twoClients', function twoClients(this: Mocha.Suite) { this.timeout(durations.MINUTE); diff --git a/ts/test-mock/messaging/unknown_contact_test.ts b/ts/test-mock/messaging/unknown_contact_test.ts index d4e4b346780..46f2e62688c 100644 --- a/ts/test-mock/messaging/unknown_contact_test.ts +++ b/ts/test-mock/messaging/unknown_contact_test.ts @@ -6,11 +6,11 @@ import { Proto } from '@signalapp/mock-server'; import createDebug from 'debug'; import Long from 'long'; import type { Page } from 'playwright'; -import assert from 'assert'; -import * as durations from '../../util/durations'; -import type { App } from '../playwright'; -import { Bootstrap } from '../bootstrap'; -import { acceptConversation } from '../helpers'; +import assert from 'node:assert'; +import * as durations from '../../util/durations/index.js'; +import type { App } from '../playwright.js'; +import { Bootstrap } from '../bootstrap.js'; +import { acceptConversation } from '../helpers.js'; export const debug = createDebug('mock:test:edit'); diff --git a/ts/test-mock/messaging/unprocessed_test.ts b/ts/test-mock/messaging/unprocessed_test.ts index 7a6efda4c50..f120eb4f85a 100644 --- a/ts/test-mock/messaging/unprocessed_test.ts +++ b/ts/test-mock/messaging/unprocessed_test.ts @@ -4,9 +4,9 @@ import createDebug from 'debug'; import { StorageState } from '@signalapp/mock-server'; -import * as durations from '../../util/durations'; -import type { App } from '../playwright'; -import { Bootstrap } from '../bootstrap'; +import * as durations from '../../util/durations/index.js'; +import type { App } from '../playwright.js'; +import { Bootstrap } from '../bootstrap.js'; export const debug = createDebug('mock:test:unprocessed'); diff --git a/ts/test-mock/network/serverAlerts_test.ts b/ts/test-mock/network/serverAlerts_test.ts index f4cb73f33cd..10ddd9287fb 100644 --- a/ts/test-mock/network/serverAlerts_test.ts +++ b/ts/test-mock/network/serverAlerts_test.ts @@ -4,10 +4,10 @@ import createDebug from 'debug'; import type { Page } from 'playwright'; import { StorageState, type PrimaryDevice } from '@signalapp/mock-server'; -import type { App } from '../playwright'; -import { Bootstrap } from '../bootstrap'; -import { getLeftPane } from '../helpers'; -import { MINUTE } from '../../util/durations'; +import type { App } from '../playwright.js'; +import { Bootstrap } from '../bootstrap.js'; +import { getLeftPane } from '../helpers.js'; +import { MINUTE } from '../../util/durations/index.js'; export const debug = createDebug('mock:test:serverAlerts'); diff --git a/ts/test-mock/playwright.ts b/ts/test-mock/playwright.ts index d81ad47bb75..e5ae07c8ed0 100644 --- a/ts/test-mock/playwright.ts +++ b/ts/test-mock/playwright.ts @@ -3,18 +3,18 @@ import type { ElectronApplication, Page } from 'playwright'; import { _electron as electron } from 'playwright'; -import { EventEmitter, once } from 'events'; +import { EventEmitter, once } from 'node:events'; import pTimeout from 'p-timeout'; import type { IPCRequest as ChallengeRequestType, IPCResponse as ChallengeResponseType, -} from '../challenge'; -import type { ReceiptType } from '../types/Receipt'; -import { SECOND } from '../util/durations'; -import { drop } from '../util/drop'; -import type { MessageAttributesType } from '../model-types'; -import type { SocketStatuses } from '../textsecure/SocketManager'; +} from '../challenge.js'; +import type { ReceiptType } from '../types/Receipt.js'; +import { SECOND } from '../util/durations/index.js'; +import { drop } from '../util/drop.js'; +import type { MessageAttributesType } from '../model-types.js'; +import type { SocketStatuses } from '../textsecure/SocketManager.js'; export type AppLoadedInfoType = Readonly<{ loadTime: number; diff --git a/ts/test-mock/pnp/accept_gv2_invite_test.ts b/ts/test-mock/pnp/accept_gv2_invite_test.ts index d70706f0761..719a9dcfa7f 100644 --- a/ts/test-mock/pnp/accept_gv2_invite_test.ts +++ b/ts/test-mock/pnp/accept_gv2_invite_test.ts @@ -6,14 +6,14 @@ import type { Group, PrimaryDevice } from '@signalapp/mock-server'; import { Proto, ServiceIdKind, StorageState } from '@signalapp/mock-server'; import createDebug from 'debug'; -import * as durations from '../../util/durations'; +import * as durations from '../../util/durations/index.js'; import { parseAndFormatPhoneNumber, PhoneNumberFormat, -} from '../../util/libphonenumberInstance'; -import { Bootstrap } from '../bootstrap'; -import type { App } from '../bootstrap'; -import { acceptConversation, expectSystemMessages } from '../helpers'; +} from '../../util/libphonenumberInstance.js'; +import { Bootstrap } from '../bootstrap.js'; +import type { App } from '../bootstrap.js'; +import { acceptConversation, expectSystemMessages } from '../helpers.js'; export const debug = createDebug('mock:test:gv2'); diff --git a/ts/test-mock/pnp/calling_test.ts b/ts/test-mock/pnp/calling_test.ts index ab09c464fef..9413d5f9b35 100644 --- a/ts/test-mock/pnp/calling_test.ts +++ b/ts/test-mock/pnp/calling_test.ts @@ -6,10 +6,10 @@ import chaiAsPromised from 'chai-as-promised'; import { type PrimaryDevice, ServiceIdKind } from '@signalapp/mock-server'; import createDebug from 'debug'; -import * as durations from '../../util/durations'; -import { Bootstrap } from '../bootstrap'; -import type { App } from '../bootstrap'; -import { acceptConversation } from '../helpers'; +import * as durations from '../../util/durations/index.js'; +import { Bootstrap } from '../bootstrap.js'; +import type { App } from '../bootstrap.js'; +import { acceptConversation } from '../helpers.js'; chai.use(chaiAsPromised); diff --git a/ts/test-mock/pnp/change_number_test.ts b/ts/test-mock/pnp/change_number_test.ts index e30df0788a2..48831d9f826 100644 --- a/ts/test-mock/pnp/change_number_test.ts +++ b/ts/test-mock/pnp/change_number_test.ts @@ -4,9 +4,9 @@ import { ServiceIdKind } from '@signalapp/mock-server'; import createDebug from 'debug'; -import * as durations from '../../util/durations'; -import { Bootstrap } from '../bootstrap'; -import type { App } from '../bootstrap'; +import * as durations from '../../util/durations/index.js'; +import { Bootstrap } from '../bootstrap.js'; +import type { App } from '../bootstrap.js'; export const debug = createDebug('mock:test:change-number'); diff --git a/ts/test-mock/pnp/merge_test.ts b/ts/test-mock/pnp/merge_test.ts index 11435b89907..8c971236059 100644 --- a/ts/test-mock/pnp/merge_test.ts +++ b/ts/test-mock/pnp/merge_test.ts @@ -8,17 +8,17 @@ import type { PrimaryDevice } from '@signalapp/mock-server'; import createDebug from 'debug'; import Long from 'long'; -import * as durations from '../../util/durations'; -import { uuidToBytes } from '../../util/uuidToBytes'; -import { generateConfigMatrix } from '../../util/generateConfigMatrix'; -import { MY_STORY_ID } from '../../types/Stories'; -import { Bootstrap } from '../bootstrap'; -import type { App } from '../bootstrap'; +import * as durations from '../../util/durations/index.js'; +import { uuidToBytes } from '../../util/uuidToBytes.js'; +import { generateConfigMatrix } from '../../util/generateConfigMatrix.js'; +import { MY_STORY_ID } from '../../types/Stories.js'; +import { Bootstrap } from '../bootstrap.js'; +import type { App } from '../bootstrap.js'; import { expectSystemMessages, typeIntoInput, waitForEnabledComposer, -} from '../helpers'; +} from '../helpers.js'; export const debug = createDebug('mock:test:merge'); diff --git a/ts/test-mock/pnp/phone_discovery_test.ts b/ts/test-mock/pnp/phone_discovery_test.ts index 0f0747e3456..1b46ef49055 100644 --- a/ts/test-mock/pnp/phone_discovery_test.ts +++ b/ts/test-mock/pnp/phone_discovery_test.ts @@ -6,16 +6,16 @@ import { ServiceIdKind, Proto, StorageState } from '@signalapp/mock-server'; import type { PrimaryDevice } from '@signalapp/mock-server'; import createDebug from 'debug'; -import * as durations from '../../util/durations'; -import { uuidToBytes } from '../../util/uuidToBytes'; -import { MY_STORY_ID } from '../../types/Stories'; -import { Bootstrap } from '../bootstrap'; -import type { App } from '../bootstrap'; +import * as durations from '../../util/durations/index.js'; +import { uuidToBytes } from '../../util/uuidToBytes.js'; +import { MY_STORY_ID } from '../../types/Stories.js'; +import { Bootstrap } from '../bootstrap.js'; +import type { App } from '../bootstrap.js'; import { expectSystemMessages, typeIntoInput, waitForEnabledComposer, -} from '../helpers'; +} from '../helpers.js'; export const debug = createDebug('mock:test:merge'); diff --git a/ts/test-mock/pnp/pni_change_test.ts b/ts/test-mock/pnp/pni_change_test.ts index 3bc3f7801b0..c922947581b 100644 --- a/ts/test-mock/pnp/pni_change_test.ts +++ b/ts/test-mock/pnp/pni_change_test.ts @@ -7,16 +7,16 @@ import { ServiceIdKind, StorageState, Proto } from '@signalapp/mock-server'; import type { PrimaryDevice } from '@signalapp/mock-server'; import createDebug from 'debug'; -import * as durations from '../../util/durations'; -import { generatePni } from '../../types/ServiceId'; -import { toPniObject } from '../../util/ServiceId'; -import { Bootstrap } from '../bootstrap'; -import type { App } from '../bootstrap'; +import * as durations from '../../util/durations/index.js'; +import { generatePni } from '../../types/ServiceId.js'; +import { toPniObject } from '../../util/ServiceId.js'; +import { Bootstrap } from '../bootstrap.js'; +import type { App } from '../bootstrap.js'; import { expectSystemMessages, typeIntoInput, waitForEnabledComposer, -} from '../helpers'; +} from '../helpers.js'; export const debug = createDebug('mock:test:pni-change'); diff --git a/ts/test-mock/pnp/pni_signature_test.ts b/ts/test-mock/pnp/pni_signature_test.ts index 82b94ef1e4d..7ac2e700970 100644 --- a/ts/test-mock/pnp/pni_signature_test.ts +++ b/ts/test-mock/pnp/pni_signature_test.ts @@ -12,22 +12,22 @@ import { } from '@signalapp/mock-server'; import createDebug from 'debug'; -import * as durations from '../../util/durations'; -import { uuidToBytes } from '../../util/uuidToBytes'; -import { MY_STORY_ID } from '../../types/Stories'; -import { Bootstrap } from '../bootstrap'; -import type { App } from '../bootstrap'; +import * as durations from '../../util/durations/index.js'; +import { uuidToBytes } from '../../util/uuidToBytes.js'; +import { MY_STORY_ID } from '../../types/Stories.js'; +import { Bootstrap } from '../bootstrap.js'; +import type { App } from '../bootstrap.js'; import { DELETE_SENT_PROTO_BATCHER_WAIT_MS, RECEIPT_BATCHER_WAIT_MS, -} from '../../types/Receipt'; -import { sleep } from '../../util/sleep'; +} from '../../types/Receipt.js'; +import { sleep } from '../../util/sleep.js'; import { acceptConversation, expectSystemMessages, typeIntoInput, waitForEnabledComposer, -} from '../helpers'; +} from '../helpers.js'; export const debug = createDebug('mock:test:pni-signature'); diff --git a/ts/test-mock/pnp/pni_unlink_test.ts b/ts/test-mock/pnp/pni_unlink_test.ts index 6855815a6b6..8a373dc18a9 100644 --- a/ts/test-mock/pnp/pni_unlink_test.ts +++ b/ts/test-mock/pnp/pni_unlink_test.ts @@ -11,10 +11,10 @@ import { } from '@signalapp/libsignal-client'; import createDebug from 'debug'; -import * as durations from '../../util/durations'; -import { generatePni } from '../../types/ServiceId'; -import { Bootstrap } from '../bootstrap'; -import type { App } from '../bootstrap'; +import * as durations from '../../util/durations/index.js'; +import { generatePni } from '../../types/ServiceId.js'; +import { Bootstrap } from '../bootstrap.js'; +import type { App } from '../bootstrap.js'; export const debug = createDebug('mock:test:pni-unlink'); diff --git a/ts/test-mock/pnp/send_gv2_invite_test.ts b/ts/test-mock/pnp/send_gv2_invite_test.ts index b7602ed34d9..8d7e1ec602f 100644 --- a/ts/test-mock/pnp/send_gv2_invite_test.ts +++ b/ts/test-mock/pnp/send_gv2_invite_test.ts @@ -6,11 +6,11 @@ import type { PrimaryDevice, Group } from '@signalapp/mock-server'; import { StorageState, Proto, ServiceIdKind } from '@signalapp/mock-server'; import createDebug from 'debug'; -import * as durations from '../../util/durations'; -import { Bootstrap } from '../bootstrap'; -import type { App } from '../bootstrap'; -import { MY_STORY_ID } from '../../types/Stories'; -import { uuidToBytes } from '../../util/uuidToBytes'; +import * as durations from '../../util/durations/index.js'; +import { Bootstrap } from '../bootstrap.js'; +import type { App } from '../bootstrap.js'; +import { MY_STORY_ID } from '../../types/Stories.js'; +import { uuidToBytes } from '../../util/uuidToBytes.js'; const IdentifierType = Proto.ManifestRecord.Identifier.Type; diff --git a/ts/test-mock/pnp/username_test.ts b/ts/test-mock/pnp/username_test.ts index a2094e295c7..139904ce1a0 100644 --- a/ts/test-mock/pnp/username_test.ts +++ b/ts/test-mock/pnp/username_test.ts @@ -7,17 +7,17 @@ import type { PrimaryDevice } from '@signalapp/mock-server'; import { usernames } from '@signalapp/libsignal-client'; import createDebug from 'debug'; -import * as durations from '../../util/durations'; -import { uuidToBytes } from '../../util/uuidToBytes'; -import { MY_STORY_ID } from '../../types/Stories'; -import { Bootstrap } from '../bootstrap'; -import type { App } from '../bootstrap'; +import * as durations from '../../util/durations/index.js'; +import { uuidToBytes } from '../../util/uuidToBytes.js'; +import { MY_STORY_ID } from '../../types/Stories.js'; +import { Bootstrap } from '../bootstrap.js'; +import type { App } from '../bootstrap.js'; import { bufferToUuid, typeIntoInput, waitForEnabledComposer, -} from '../helpers'; -import { contactByEncryptedUsernameRoute } from '../../util/signalRoutes'; +} from '../helpers.js'; +import { contactByEncryptedUsernameRoute } from '../../util/signalRoutes.js'; export const debug = createDebug('mock:test:username'); diff --git a/ts/test-mock/rate-limit/story_test.ts b/ts/test-mock/rate-limit/story_test.ts index 5c19618f9fe..7dda3bab113 100644 --- a/ts/test-mock/rate-limit/story_test.ts +++ b/ts/test-mock/rate-limit/story_test.ts @@ -5,11 +5,11 @@ import { assert } from 'chai'; import createDebug from 'debug'; import { Proto, StorageState } from '@signalapp/mock-server'; -import * as durations from '../../util/durations'; -import { uuidToBytes } from '../../util/uuidToBytes'; -import { MY_STORY_ID } from '../../types/Stories'; -import { Bootstrap } from '../bootstrap'; -import type { App } from '../bootstrap'; +import * as durations from '../../util/durations/index.js'; +import { uuidToBytes } from '../../util/uuidToBytes.js'; +import { MY_STORY_ID } from '../../types/Stories.js'; +import { Bootstrap } from '../bootstrap.js'; +import type { App } from '../bootstrap.js'; export const debug = createDebug('mock:test:rate-limit'); diff --git a/ts/test-mock/rate-limit/viewed_test.ts b/ts/test-mock/rate-limit/viewed_test.ts index 19223974937..6e53c0616a5 100644 --- a/ts/test-mock/rate-limit/viewed_test.ts +++ b/ts/test-mock/rate-limit/viewed_test.ts @@ -5,15 +5,15 @@ import { assert } from 'chai'; import type { PrimaryDevice } from '@signalapp/mock-server'; import { StorageState, ServiceIdKind } from '@signalapp/mock-server'; import createDebug from 'debug'; -import * as durations from '../../util/durations'; -import { Bootstrap } from '../bootstrap'; -import type { App } from '../bootstrap'; -import { ReceiptType } from '../../types/Receipt'; +import * as durations from '../../util/durations/index.js'; +import { Bootstrap } from '../bootstrap.js'; +import type { App } from '../bootstrap.js'; +import { ReceiptType } from '../../types/Receipt.js'; import { acceptConversation, typeIntoInput, waitForEnabledComposer, -} from '../helpers'; +} from '../helpers.js'; export const debug = createDebug('mock:test:challenge:receipts'); diff --git a/ts/test-mock/release-notes/release_notes_test.ts b/ts/test-mock/release-notes/release_notes_test.ts index e7fd0020eed..518f991c81e 100644 --- a/ts/test-mock/release-notes/release_notes_test.ts +++ b/ts/test-mock/release-notes/release_notes_test.ts @@ -5,15 +5,15 @@ import createDebug from 'debug'; import { expect } from 'playwright/test'; import { assert } from 'chai'; -import type { App } from '../playwright'; -import { Bootstrap } from '../bootstrap'; -import { MINUTE } from '../../util/durations'; +import type { App } from '../playwright.js'; +import { Bootstrap } from '../bootstrap.js'; +import { MINUTE } from '../../util/durations/index.js'; -import { SIGNAL_ACI } from '../../types/SignalConversation'; +import { SIGNAL_ACI } from '../../types/SignalConversation.js'; import { clickOnConversationWithAci, getTimelineMessageWithText, -} from '../helpers'; +} from '../helpers.js'; export const debug = createDebug('mock:test:releaseNotes'); diff --git a/ts/test-mock/routing/routing_test.ts b/ts/test-mock/routing/routing_test.ts index 2ccff69b9c0..1d3c6d67fe9 100644 --- a/ts/test-mock/routing/routing_test.ts +++ b/ts/test-mock/routing/routing_test.ts @@ -3,18 +3,18 @@ import { assert } from 'chai'; -import * as durations from '../../util/durations'; -import type { Bootstrap, App } from '../bootstrap'; +import * as durations from '../../util/durations/index.js'; +import type { Bootstrap, App } from '../bootstrap.js'; import { artAddStickersRoute, showConversationRoute, -} from '../../util/signalRoutes'; +} from '../../util/signalRoutes.js'; import { initStorage, STICKER_PACKS, storeStickerPacks, -} from '../storage/fixtures'; -import { strictAssert } from '../../util/assert'; +} from '../storage/fixtures.js'; +import { strictAssert } from '../../util/assert.js'; describe('routing', function (this: Mocha.Suite) { this.timeout(durations.MINUTE); diff --git a/ts/test-mock/settings/language_test.ts b/ts/test-mock/settings/language_test.ts index 81d33ead866..fb8b67d5b4f 100644 --- a/ts/test-mock/settings/language_test.ts +++ b/ts/test-mock/settings/language_test.ts @@ -5,10 +5,10 @@ import createDebug from 'debug'; import type { Locator } from 'playwright/test'; import { expect } from 'playwright/test'; -import { writeFile } from 'fs/promises'; -import * as durations from '../../util/durations'; -import type { App } from '../playwright'; -import { Bootstrap } from '../bootstrap'; +import { writeFile } from 'node:fs/promises'; +import * as durations from '../../util/durations/index.js'; +import type { App } from '../playwright.js'; +import { Bootstrap } from '../bootstrap.js'; export const debug = createDebug('mock:test:language'); diff --git a/ts/test-mock/settings/settings_test.ts b/ts/test-mock/settings/settings_test.ts index 361d04b1ce4..6e379fe56fb 100644 --- a/ts/test-mock/settings/settings_test.ts +++ b/ts/test-mock/settings/settings_test.ts @@ -3,9 +3,9 @@ import createDebug from 'debug'; -import * as durations from '../../util/durations'; -import type { App } from '../playwright'; -import { Bootstrap } from '../bootstrap'; +import * as durations from '../../util/durations/index.js'; +import type { App } from '../playwright.js'; +import { Bootstrap } from '../bootstrap.js'; export const debug = createDebug('mock:test:settings'); diff --git a/ts/test-mock/setup-ci.ts b/ts/test-mock/setup-ci.ts index 5de27a1aaa7..34bee0ec528 100644 --- a/ts/test-mock/setup-ci.ts +++ b/ts/test-mock/setup-ci.ts @@ -3,7 +3,7 @@ import createDebug from 'debug'; -import { Bootstrap } from './bootstrap'; +import { Bootstrap } from './bootstrap.js'; const debug = createDebug('mock:test:setup-ci'); diff --git a/ts/test-mock/storage/archive_test.ts b/ts/test-mock/storage/archive_test.ts index f71d87a8ef0..c50e46bfd9c 100644 --- a/ts/test-mock/storage/archive_test.ts +++ b/ts/test-mock/storage/archive_test.ts @@ -3,9 +3,9 @@ import { assert } from 'chai'; -import * as durations from '../../util/durations'; -import type { App, Bootstrap } from './fixtures'; -import { initStorage, debug } from './fixtures'; +import * as durations from '../../util/durations/index.js'; +import type { App, Bootstrap } from './fixtures.js'; +import { initStorage, debug } from './fixtures.js'; describe('storage service', function (this: Mocha.Suite) { this.timeout(durations.MINUTE); diff --git a/ts/test-mock/storage/call_links_test.ts b/ts/test-mock/storage/call_links_test.ts index a222349a157..a5ec3f5feb9 100644 --- a/ts/test-mock/storage/call_links_test.ts +++ b/ts/test-mock/storage/call_links_test.ts @@ -4,12 +4,12 @@ import { assert } from 'chai'; import Long from 'long'; import { Proto, StorageState } from '@signalapp/mock-server'; -import * as durations from '../../util/durations'; -import type { App } from './fixtures'; -import { Bootstrap, debug, getCallLinkRecordPredicate } from './fixtures'; -import { createCallLink } from '../helpers'; -import { uuidToBytes } from '../../util/uuidToBytes'; -import { MY_STORY_ID } from '../../types/Stories'; +import * as durations from '../../util/durations/index.js'; +import type { App } from './fixtures.js'; +import { Bootstrap, debug, getCallLinkRecordPredicate } from './fixtures.js'; +import { createCallLink } from '../helpers.js'; +import { uuidToBytes } from '../../util/uuidToBytes.js'; +import { MY_STORY_ID } from '../../types/Stories.js'; const IdentifierType = Proto.ManifestRecord.Identifier.Type; diff --git a/ts/test-mock/storage/chat_folder_test.ts b/ts/test-mock/storage/chat_folder_test.ts index b0d7c6d820e..35aae3de8e6 100644 --- a/ts/test-mock/storage/chat_folder_test.ts +++ b/ts/test-mock/storage/chat_folder_test.ts @@ -4,11 +4,11 @@ import Long from 'long'; import { v4 as generateUuid } from 'uuid'; import { Proto, StorageState } from '@signalapp/mock-server'; import { expect } from 'playwright/test'; -import * as durations from '../../util/durations'; -import type { App } from './fixtures'; -import { Bootstrap, debug } from './fixtures'; -import { uuidToBytes } from '../../util/uuidToBytes'; -import { CHAT_FOLDER_DELETED_POSITION } from '../../types/ChatFolder'; +import * as durations from '../../util/durations/index.js'; +import type { App } from './fixtures.js'; +import { Bootstrap, debug } from './fixtures.js'; +import { uuidToBytes } from '../../util/uuidToBytes.js'; +import { CHAT_FOLDER_DELETED_POSITION } from '../../types/ChatFolder.js'; const IdentifierType = Proto.ManifestRecord.Identifier.Type; diff --git a/ts/test-mock/storage/conflict_test.ts b/ts/test-mock/storage/conflict_test.ts index d0d886cb5e8..1370c523fd3 100644 --- a/ts/test-mock/storage/conflict_test.ts +++ b/ts/test-mock/storage/conflict_test.ts @@ -7,10 +7,10 @@ import { expect } from 'playwright/test'; import type { Group, StorageState } from '@signalapp/mock-server'; import { Proto } from '@signalapp/mock-server'; -import * as durations from '../../util/durations'; -import { createCallLink } from '../helpers'; -import type { App, Bootstrap } from './fixtures'; -import { initStorage, debug, getCallLinkRecordPredicate } from './fixtures'; +import * as durations from '../../util/durations/index.js'; +import { createCallLink } from '../helpers.js'; +import type { App, Bootstrap } from './fixtures.js'; +import { initStorage, debug, getCallLinkRecordPredicate } from './fixtures.js'; const IdentifierType = Proto.ManifestRecord.Identifier.Type; diff --git a/ts/test-mock/storage/drop_test.ts b/ts/test-mock/storage/drop_test.ts index 64162e2347b..ed70f641e3b 100644 --- a/ts/test-mock/storage/drop_test.ts +++ b/ts/test-mock/storage/drop_test.ts @@ -4,9 +4,9 @@ import { assert } from 'chai'; import { Proto } from '@signalapp/mock-server'; -import * as durations from '../../util/durations'; -import type { App, Bootstrap } from './fixtures'; -import { initStorage, debug } from './fixtures'; +import * as durations from '../../util/durations/index.js'; +import type { App, Bootstrap } from './fixtures.js'; +import { initStorage, debug } from './fixtures.js'; const IdentifierType = Proto.ManifestRecord.Identifier.Type; diff --git a/ts/test-mock/storage/fixtures.ts b/ts/test-mock/storage/fixtures.ts index 972507026e2..294ad7ffe0a 100644 --- a/ts/test-mock/storage/fixtures.ts +++ b/ts/test-mock/storage/fixtures.ts @@ -9,17 +9,17 @@ import type { StorageStateRecord, } from '@signalapp/mock-server'; import { StorageState, Proto } from '@signalapp/mock-server'; -import path from 'path'; -import fs from 'fs/promises'; +import path from 'node:path'; +import fs from 'node:fs/promises'; import { range } from 'lodash'; import { CallLinkRootKey } from '@signalapp/ringrtc'; -import { App } from '../playwright'; -import { Bootstrap } from '../bootstrap'; -import type { BootstrapOptions } from '../bootstrap'; -import { MY_STORY_ID } from '../../types/Stories'; -import { uuidToBytes } from '../../util/uuidToBytes'; -import { artAddStickersRoute } from '../../util/signalRoutes'; -import { getRoomIdFromRootKey } from '../../util/callLinksRingrtc'; +import { App } from '../playwright.js'; +import { Bootstrap } from '../bootstrap.js'; +import type { BootstrapOptions } from '../bootstrap.js'; +import { MY_STORY_ID } from '../../types/Stories.js'; +import { uuidToBytes } from '../../util/uuidToBytes.js'; +import { artAddStickersRoute } from '../../util/signalRoutes.js'; +import { getRoomIdFromRootKey } from '../../util/callLinksRingrtc.js'; export const debug = createDebug('mock:test:storage'); diff --git a/ts/test-mock/storage/max_read_keys_test.ts b/ts/test-mock/storage/max_read_keys_test.ts index 73098c9d407..933bda97f51 100644 --- a/ts/test-mock/storage/max_read_keys_test.ts +++ b/ts/test-mock/storage/max_read_keys_test.ts @@ -4,12 +4,12 @@ import { assert } from 'chai'; import { Proto } from '@signalapp/mock-server'; -import * as durations from '../../util/durations'; -import { generateAci } from '../../types/ServiceId'; -import { toAciObject } from '../../util/ServiceId'; -import { MAX_READ_KEYS } from '../../services/storageConstants'; -import type { App, Bootstrap } from './fixtures'; -import { initStorage, debug } from './fixtures'; +import * as durations from '../../util/durations/index.js'; +import { generateAci } from '../../types/ServiceId.js'; +import { toAciObject } from '../../util/ServiceId.js'; +import { MAX_READ_KEYS } from '../../services/storageConstants.js'; +import type { App, Bootstrap } from './fixtures.js'; +import { initStorage, debug } from './fixtures.js'; const IdentifierType = Proto.ManifestRecord.Identifier.Type; diff --git a/ts/test-mock/storage/message_request_test.ts b/ts/test-mock/storage/message_request_test.ts index f265a4b826a..5cfb79d50cb 100644 --- a/ts/test-mock/storage/message_request_test.ts +++ b/ts/test-mock/storage/message_request_test.ts @@ -3,14 +3,14 @@ import { assert } from 'chai'; -import * as durations from '../../util/durations'; -import type { App, Bootstrap } from './fixtures'; -import { initStorage, debug } from './fixtures'; +import * as durations from '../../util/durations/index.js'; +import type { App, Bootstrap } from './fixtures.js'; +import { initStorage, debug } from './fixtures.js'; import { acceptConversation, typeIntoInput, waitForEnabledComposer, -} from '../helpers'; +} from '../helpers.js'; describe('storage service', function (this: Mocha.Suite) { this.timeout(durations.MINUTE); diff --git a/ts/test-mock/storage/pin_unpin_test.ts b/ts/test-mock/storage/pin_unpin_test.ts index 0c222feed8e..7194c789de8 100644 --- a/ts/test-mock/storage/pin_unpin_test.ts +++ b/ts/test-mock/storage/pin_unpin_test.ts @@ -6,9 +6,9 @@ import { assert } from 'chai'; import type { Group } from '@signalapp/mock-server'; -import * as durations from '../../util/durations'; -import type { App, Bootstrap } from './fixtures'; -import { initStorage, debug } from './fixtures'; +import * as durations from '../../util/durations/index.js'; +import type { App, Bootstrap } from './fixtures.js'; +import { initStorage, debug } from './fixtures.js'; describe('storage service', function (this: Mocha.Suite) { this.timeout(durations.MINUTE); diff --git a/ts/test-mock/storage/sticker_test.ts b/ts/test-mock/storage/sticker_test.ts index d793df50fb7..5936ca6d066 100644 --- a/ts/test-mock/storage/sticker_test.ts +++ b/ts/test-mock/storage/sticker_test.ts @@ -3,8 +3,8 @@ import { assert } from 'chai'; import { Proto } from '@signalapp/mock-server'; -import * as durations from '../../util/durations'; -import type { App, Bootstrap } from './fixtures'; +import * as durations from '../../util/durations/index.js'; +import type { App, Bootstrap } from './fixtures.js'; import { initStorage, debug, @@ -13,7 +13,7 @@ import { storeStickerPacks, getStickerPackRecordPredicate, getStickerPackLink, -} from './fixtures'; +} from './fixtures.js'; const { StickerPackOperation } = Proto.SyncMessage; diff --git a/ts/test-node/AsyncQueue_test.ts b/ts/test-node/AsyncQueue_test.ts index 2d1d159be9b..d5d6f83722e 100644 --- a/ts/test-node/AsyncQueue_test.ts +++ b/ts/test-node/AsyncQueue_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { AsyncQueue } from '../util/AsyncQueue'; +import { AsyncQueue } from '../util/AsyncQueue.js'; describe('AsyncQueue', () => { it('yields values as they are added, even if they were added before consuming', async () => { diff --git a/ts/test-node/RemoteConfig_test.ts b/ts/test-node/RemoteConfig_test.ts index 96fec568960..eb1e04d18de 100644 --- a/ts/test-node/RemoteConfig_test.ts +++ b/ts/test-node/RemoteConfig_test.ts @@ -5,8 +5,8 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; import { omit } from 'lodash'; -import { normalizeAci } from '../util/normalizeAci'; -import type { ConfigKeyType, ConfigListenerType } from '../RemoteConfig'; +import { normalizeAci } from '../util/normalizeAci.js'; +import type { ConfigKeyType, ConfigListenerType } from '../RemoteConfig.js'; import { getCountryCodeValue, getBucketValue, @@ -14,8 +14,8 @@ import { onChange, getValue, isEnabled, -} from '../RemoteConfig'; -import { updateRemoteConfig } from '../test-helpers/RemoteConfigStub'; +} from '../RemoteConfig.js'; +import { updateRemoteConfig } from '../test-helpers/RemoteConfigStub.js'; describe('RemoteConfig', () => { const aci = normalizeAci('95b9729c-51ea-4ddb-b516-652befe78062', 'test'); diff --git a/ts/test-node/TaskWithTimeout_test.ts b/ts/test-node/TaskWithTimeout_test.ts index e82b1f6a6e7..a4326e4f5d1 100644 --- a/ts/test-node/TaskWithTimeout_test.ts +++ b/ts/test-node/TaskWithTimeout_test.ts @@ -4,12 +4,12 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; -import { sleep } from '../util/sleep'; -import { explodePromise } from '../util/explodePromise'; +import { sleep } from '../util/sleep.js'; +import { explodePromise } from '../util/explodePromise.js'; import createTaskWithTimeout, { suspendTasksWithTimeout, resumeTasksWithTimeout, -} from '../textsecure/TaskWithTimeout'; +} from '../textsecure/TaskWithTimeout.js'; describe('createTaskWithTimeout', () => { let sandbox: sinon.SinonSandbox; diff --git a/ts/test-node/app/PreventDisplaySleepService_test.ts b/ts/test-node/app/PreventDisplaySleepService_test.ts index 4b80da3c897..a504806440b 100644 --- a/ts/test-node/app/PreventDisplaySleepService_test.ts +++ b/ts/test-node/app/PreventDisplaySleepService_test.ts @@ -5,7 +5,7 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; import type { PowerSaveBlocker } from 'electron'; -import { PreventDisplaySleepService } from '../../../app/PreventDisplaySleepService'; +import { PreventDisplaySleepService } from '../../../app/PreventDisplaySleepService.js'; describe('PreventDisplaySleepService', () => { class FakePowerSaveBlocker implements PowerSaveBlocker { diff --git a/ts/test-node/app/SystemTrayService_test.ts b/ts/test-node/app/SystemTrayService_test.ts index 86e1ebe93ce..0d4b1bb880a 100644 --- a/ts/test-node/app/SystemTrayService_test.ts +++ b/ts/test-node/app/SystemTrayService_test.ts @@ -5,11 +5,11 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; import type { MenuItem } from 'electron'; import { BrowserWindow, Tray, nativeImage } from 'electron'; -import { MINUTE } from '../../util/durations'; +import { MINUTE } from '../../util/durations/index.js'; -import type { SystemTrayServiceOptionsType } from '../../../app/SystemTrayService'; -import { SystemTrayService } from '../../../app/SystemTrayService'; -import { setupI18n } from '../../util/setupI18n'; +import type { SystemTrayServiceOptionsType } from '../../../app/SystemTrayService.js'; +import { SystemTrayService } from '../../../app/SystemTrayService.js'; +import { setupI18n } from '../../util/setupI18n.js'; import enMessages from '../../../_locales/en/messages.json'; diff --git a/ts/test-node/app/SystemTraySettingCache_test.ts b/ts/test-node/app/SystemTraySettingCache_test.ts index dda1906dd7d..74b0b9d0f33 100644 --- a/ts/test-node/app/SystemTraySettingCache_test.ts +++ b/ts/test-node/app/SystemTraySettingCache_test.ts @@ -3,10 +3,10 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; -import { SystemTraySetting } from '../../types/SystemTraySetting'; +import { SystemTraySetting } from '../../types/SystemTraySetting.js'; -import type { ConfigType } from '../../../app/base_config'; -import { SystemTraySettingCache } from '../../../app/SystemTraySettingCache'; +import type { ConfigType } from '../../../app/base_config.js'; +import { SystemTraySettingCache } from '../../../app/SystemTraySettingCache.js'; describe('SystemTraySettingCache', () => { let sandbox: sinon.SinonSandbox; diff --git a/ts/test-node/app/base_config_test.ts b/ts/test-node/app/base_config_test.ts index 9dfd5335792..691150e0349 100644 --- a/ts/test-node/app/base_config_test.ts +++ b/ts/test-node/app/base_config_test.ts @@ -1,16 +1,16 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import * as path from 'path'; -import { tmpdir } from 'os'; -import { chmodSync, rmSync, writeFileSync, mkdtempSync } from 'fs'; +import * as path from 'node:path'; +import { tmpdir } from 'node:os'; +import { chmodSync, rmSync, writeFileSync, mkdtempSync } from 'node:fs'; import { pathExists, readJsonSync } from 'fs-extra'; import { v4 as generateGuid } from 'uuid'; import { assert } from 'chai'; -import type { ConfigType } from '../../../app/base_config'; -import { start } from '../../../app/base_config'; +import type { ConfigType } from '../../../app/base_config.js'; +import { start } from '../../../app/base_config.js'; describe('base_config', () => { let targetDir: string; diff --git a/ts/test-node/app/locale_test.ts b/ts/test-node/app/locale_test.ts index 630eb20a220..02a579384be 100644 --- a/ts/test-node/app/locale_test.ts +++ b/ts/test-node/app/locale_test.ts @@ -4,9 +4,9 @@ import { assert } from 'chai'; import { stub } from 'sinon'; import * as LocaleMatcher from '@formatjs/intl-localematcher'; -import { load, _getAvailableLocales } from '../../../app/locale'; -import { FAKE_DEFAULT_LOCALE } from '../../../app/spell_check'; -import { HourCyclePreference } from '../../types/I18N'; +import { load, _getAvailableLocales } from '../../../app/locale.js'; +import { FAKE_DEFAULT_LOCALE } from '../../../app/spell_check.js'; +import { HourCyclePreference } from '../../types/I18N.js'; describe('locale', async () => { describe('load', () => { diff --git a/ts/test-node/app/menu_test.ts b/ts/test-node/app/menu_test.ts index 09702c0861f..fc96eb8d6ce 100644 --- a/ts/test-node/app/menu_test.ts +++ b/ts/test-node/app/menu_test.ts @@ -6,12 +6,12 @@ import { stub } from 'sinon'; import type { MenuItemConstructorOptions } from 'electron'; import type pino from 'pino'; -import type { CreateTemplateOptionsType } from '../../../app/menu'; -import { createTemplate } from '../../../app/menu'; -import { load as loadLocale } from '../../../app/locale'; -import type { MenuListType } from '../../types/menu'; -import type { LoggerType } from '../../types/Logging'; -import { HourCyclePreference } from '../../types/I18N'; +import type { CreateTemplateOptionsType } from '../../../app/menu.js'; +import { createTemplate } from '../../../app/menu.js'; +import { load as loadLocale } from '../../../app/locale.js'; +import type { MenuListType } from '../../types/menu.js'; +import type { LoggerType } from '../../types/Logging.js'; +import { HourCyclePreference } from '../../types/I18N.js'; const forceUpdate = stub(); const openArtCreator = stub(); diff --git a/ts/test-node/app/protocol_filter_test.ts b/ts/test-node/app/protocol_filter_test.ts index f5e4ba1264a..556d1633282 100644 --- a/ts/test-node/app/protocol_filter_test.ts +++ b/ts/test-node/app/protocol_filter_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { _urlToPath } from '../../../app/protocol_filter'; +import { _urlToPath } from '../../../app/protocol_filter.js'; describe('Protocol Filter', () => { describe('_urlToPath', () => { diff --git a/ts/test-node/app/renderWindowsToast_test.tsx b/ts/test-node/app/renderWindowsToast_test.tsx index b11e3e68596..028ea259864 100644 --- a/ts/test-node/app/renderWindowsToast_test.tsx +++ b/ts/test-node/app/renderWindowsToast_test.tsx @@ -3,8 +3,8 @@ import { assert } from 'chai'; -import { renderWindowsToast } from '../../../app/renderWindowsToast'; -import { NotificationType } from '../../services/notifications'; +import { renderWindowsToast } from '../../../app/renderWindowsToast.js'; +import { NotificationType } from '../../services/notifications.js'; describe('renderWindowsToast', () => { it('handles toast with image', () => { diff --git a/ts/test-node/app/spell_check_test.ts b/ts/test-node/app/spell_check_test.ts index d474aa86f1f..755a8b7b103 100644 --- a/ts/test-node/app/spell_check_test.ts +++ b/ts/test-node/app/spell_check_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { getLanguages } from '../../../app/spell_check'; +import { getLanguages } from '../../../app/spell_check.js'; describe('SpellCheck', () => { describe('getLanguages', () => { diff --git a/ts/test-node/app/updateDefaultSession_test.ts b/ts/test-node/app/updateDefaultSession_test.ts index 1853e024405..e025017f460 100644 --- a/ts/test-node/app/updateDefaultSession_test.ts +++ b/ts/test-node/app/updateDefaultSession_test.ts @@ -5,7 +5,7 @@ import * as sinon from 'sinon'; import { session } from 'electron'; import { v4 as uuid } from 'uuid'; -import { updateDefaultSession } from '../../../app/updateDefaultSession'; +import { updateDefaultSession } from '../../../app/updateDefaultSession.js'; describe('updateDefaultSession', () => { let sandbox: sinon.SinonSandbox; diff --git a/ts/test-node/badges/getBadgeImageFileLocalPath_test.ts b/ts/test-node/badges/getBadgeImageFileLocalPath_test.ts index b4beadb53f7..3796b793ab4 100644 --- a/ts/test-node/badges/getBadgeImageFileLocalPath_test.ts +++ b/ts/test-node/badges/getBadgeImageFileLocalPath_test.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { BadgeCategory } from '../../badges/BadgeCategory'; -import { BadgeImageTheme } from '../../badges/BadgeImageTheme'; +import { BadgeCategory } from '../../badges/BadgeCategory.js'; +import { BadgeImageTheme } from '../../badges/BadgeImageTheme.js'; -import { getBadgeImageFileLocalPath } from '../../badges/getBadgeImageFileLocalPath'; +import { getBadgeImageFileLocalPath } from '../../badges/getBadgeImageFileLocalPath.js'; describe('getBadgeImageFileLocalPath', () => { const image = (localPath?: string) => ({ diff --git a/ts/test-node/badges/isBadgeImageFileUrlValid_test.ts b/ts/test-node/badges/isBadgeImageFileUrlValid_test.ts index e09e97240aa..743d7901195 100644 --- a/ts/test-node/badges/isBadgeImageFileUrlValid_test.ts +++ b/ts/test-node/badges/isBadgeImageFileUrlValid_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { isBadgeImageFileUrlValid } from '../../badges/isBadgeImageFileUrlValid'; +import { isBadgeImageFileUrlValid } from '../../badges/isBadgeImageFileUrlValid.js'; describe('isBadgeImageFileUrlValid', () => { const UPDATES_URL = 'https://updates2.signal.org/desktop'; diff --git a/ts/test-node/badges/isBadgeVisible_test.ts b/ts/test-node/badges/isBadgeVisible_test.ts index 869f6725e50..b4ee86dccaf 100644 --- a/ts/test-node/badges/isBadgeVisible_test.ts +++ b/ts/test-node/badges/isBadgeVisible_test.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import type { BadgeType } from '../../badges/types'; +import type { BadgeType } from '../../badges/types.js'; -import { isBadgeVisible } from '../../badges/isBadgeVisible'; -import { BadgeCategory } from '../../badges/BadgeCategory'; +import { isBadgeVisible } from '../../badges/isBadgeVisible.js'; +import { BadgeCategory } from '../../badges/BadgeCategory.js'; describe('isBadgeVisible', () => { const fakeBadge = (isVisible?: boolean): BadgeType => ({ diff --git a/ts/test-node/badges/parseBadgesFromServer_test.ts b/ts/test-node/badges/parseBadgesFromServer_test.ts index ce940962331..e80305d4cc9 100644 --- a/ts/test-node/badges/parseBadgesFromServer_test.ts +++ b/ts/test-node/badges/parseBadgesFromServer_test.ts @@ -3,10 +3,10 @@ import { assert } from 'chai'; import { omit } from 'lodash'; -import { BadgeCategory } from '../../badges/BadgeCategory'; -import { BadgeImageTheme } from '../../badges/BadgeImageTheme'; +import { BadgeCategory } from '../../badges/BadgeCategory.js'; +import { BadgeImageTheme } from '../../badges/BadgeImageTheme.js'; -import { parseBadgesFromServer } from '../../badges/parseBadgesFromServer'; +import { parseBadgesFromServer } from '../../badges/parseBadgesFromServer.js'; describe('parseBadgesFromServer', () => { const UPDATES_URL = 'https://updates2.signal.org/desktop'; diff --git a/ts/test-node/calling/findBestMatchingDevice_test.ts b/ts/test-node/calling/findBestMatchingDevice_test.ts index a2fed2f9899..2e654fcae01 100644 --- a/ts/test-node/calling/findBestMatchingDevice_test.ts +++ b/ts/test-node/calling/findBestMatchingDevice_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { findBestMatchingAudioDeviceIndex } from '../../calling/findBestMatchingDevice'; +import { findBestMatchingAudioDeviceIndex } from '../../calling/findBestMatchingDevice.js'; describe('"find best matching device" helpers', () => { describe('findBestMatchingAudioDeviceIndex', () => { diff --git a/ts/test-node/challenge_test.ts b/ts/test-node/challenge_test.ts index 4338e6de275..e42dd043404 100644 --- a/ts/test-node/challenge_test.ts +++ b/ts/test-node/challenge_test.ts @@ -7,9 +7,9 @@ import { assert } from 'chai'; import { noop } from 'lodash'; import * as sinon from 'sinon'; -import { STORAGE_KEY, ChallengeHandler } from '../challenge'; -import type { RegisteredChallengeType } from '../challenge'; -import { DAY, SECOND } from '../util/durations'; +import { STORAGE_KEY, ChallengeHandler } from '../challenge.js'; +import type { RegisteredChallengeType } from '../challenge.js'; +import { DAY, SECOND } from '../util/durations/index.js'; type CreateHandlerOptions = { readonly autoSolve?: boolean; diff --git a/ts/test-node/components/fun/emojis_test.ts b/ts/test-node/components/fun/emojis_test.ts index 8b380b57862..ac6f926b309 100644 --- a/ts/test-node/components/fun/emojis_test.ts +++ b/ts/test-node/components/fun/emojis_test.ts @@ -1,7 +1,7 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import assert from 'node:assert/strict'; -import { getEmojifyData } from '../../../components/fun/data/emojis'; +import { getEmojifyData } from '../../../components/fun/data/emojis.js'; describe('getEmojifyData', () => { function check(text: string, emojiCount: number, isEmojiOnlyText: boolean) { diff --git a/ts/test-node/components/fun/segments_test.ts b/ts/test-node/components/fun/segments_test.ts index 6b532bcca3d..e4e853ae89d 100644 --- a/ts/test-node/components/fun/segments_test.ts +++ b/ts/test-node/components/fun/segments_test.ts @@ -6,7 +6,7 @@ import { _getSegmentSize, _SEGMENT_SIZE_BUCKETS, type _SegmentRange, -} from '../../../components/fun/data/segments'; +} from '../../../components/fun/data/segments.js'; const SMALLEST_BUCKET = Math.min(..._SEGMENT_SIZE_BUCKETS); diff --git a/ts/test-node/components/leftPane/LeftPaneArchiveHelper_test.ts b/ts/test-node/components/leftPane/LeftPaneArchiveHelper_test.ts index dbcde58a253..a3e2aa1c89b 100644 --- a/ts/test-node/components/leftPane/LeftPaneArchiveHelper_test.ts +++ b/ts/test-node/components/leftPane/LeftPaneArchiveHelper_test.ts @@ -4,12 +4,12 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; import { v4 as uuid } from 'uuid'; -import { RowType } from '../../../components/ConversationList'; -import { FindDirection } from '../../../components/leftPane/LeftPaneHelper'; -import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation'; -import { LeftPaneSearchHelper } from '../../../components/leftPane/LeftPaneSearchHelper'; +import { RowType } from '../../../components/ConversationList.js'; +import { FindDirection } from '../../../components/leftPane/LeftPaneHelper.js'; +import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.js'; +import { LeftPaneSearchHelper } from '../../../components/leftPane/LeftPaneSearchHelper.js'; -import { LeftPaneArchiveHelper } from '../../../components/leftPane/LeftPaneArchiveHelper'; +import { LeftPaneArchiveHelper } from '../../../components/leftPane/LeftPaneArchiveHelper.js'; describe('LeftPaneArchiveHelper', () => { let sandbox: sinon.SinonSandbox; diff --git a/ts/test-node/components/leftPane/LeftPaneChooseGroupMembersHelper_test.ts b/ts/test-node/components/leftPane/LeftPaneChooseGroupMembersHelper_test.ts index 7c8bf9429b9..6d36675ad46 100644 --- a/ts/test-node/components/leftPane/LeftPaneChooseGroupMembersHelper_test.ts +++ b/ts/test-node/components/leftPane/LeftPaneChooseGroupMembersHelper_test.ts @@ -4,11 +4,14 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; import { times } from 'lodash'; -import { RowType, _testHeaderText } from '../../../components/ConversationList'; -import { ContactCheckboxDisabledReason } from '../../../components/conversationList/ContactCheckbox'; -import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation'; +import { + RowType, + _testHeaderText, +} from '../../../components/ConversationList.js'; +import { ContactCheckboxDisabledReason } from '../../../components/conversationList/ContactCheckbox.js'; +import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.js'; -import { LeftPaneChooseGroupMembersHelper } from '../../../components/leftPane/LeftPaneChooseGroupMembersHelper'; +import { LeftPaneChooseGroupMembersHelper } from '../../../components/leftPane/LeftPaneChooseGroupMembersHelper.js'; describe('LeftPaneChooseGroupMembersHelper', () => { const defaults = { diff --git a/ts/test-node/components/leftPane/LeftPaneComposeHelper_test.ts b/ts/test-node/components/leftPane/LeftPaneComposeHelper_test.ts index 32992d1f924..c732c7fdd43 100644 --- a/ts/test-node/components/leftPane/LeftPaneComposeHelper_test.ts +++ b/ts/test-node/components/leftPane/LeftPaneComposeHelper_test.ts @@ -3,14 +3,17 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; -import { RowType, _testHeaderText } from '../../../components/ConversationList'; -import { FindDirection } from '../../../components/leftPane/LeftPaneHelper'; +import { + RowType, + _testHeaderText, +} from '../../../components/ConversationList.js'; +import { FindDirection } from '../../../components/leftPane/LeftPaneHelper.js'; import { getDefaultConversation, getDefaultGroupListItem, -} from '../../../test-helpers/getDefaultConversation'; +} from '../../../test-helpers/getDefaultConversation.js'; -import { LeftPaneComposeHelper } from '../../../components/leftPane/LeftPaneComposeHelper'; +import { LeftPaneComposeHelper } from '../../../components/leftPane/LeftPaneComposeHelper.js'; describe('LeftPaneComposeHelper', () => { let sinonSandbox: sinon.SinonSandbox; diff --git a/ts/test-node/components/leftPane/LeftPaneInboxHelper_test.tsx b/ts/test-node/components/leftPane/LeftPaneInboxHelper_test.tsx index a98a1262018..ae7193eaaae 100644 --- a/ts/test-node/components/leftPane/LeftPaneInboxHelper_test.tsx +++ b/ts/test-node/components/leftPane/LeftPaneInboxHelper_test.tsx @@ -3,12 +3,15 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; -import { RowType, _testHeaderText } from '../../../components/ConversationList'; -import { FindDirection } from '../../../components/leftPane/LeftPaneHelper'; -import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation'; +import { + RowType, + _testHeaderText, +} from '../../../components/ConversationList.js'; +import { FindDirection } from '../../../components/leftPane/LeftPaneHelper.js'; +import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.js'; -import type { LeftPaneInboxPropsType } from '../../../components/leftPane/LeftPaneInboxHelper'; -import { LeftPaneInboxHelper } from '../../../components/leftPane/LeftPaneInboxHelper'; +import type { LeftPaneInboxPropsType } from '../../../components/leftPane/LeftPaneInboxHelper.js'; +import { LeftPaneInboxHelper } from '../../../components/leftPane/LeftPaneInboxHelper.js'; describe('LeftPaneInboxHelper', () => { const defaultProps: LeftPaneInboxPropsType = { diff --git a/ts/test-node/components/leftPane/LeftPaneSearchHelper_test.ts b/ts/test-node/components/leftPane/LeftPaneSearchHelper_test.ts index d2eb881de17..4371c0800a4 100644 --- a/ts/test-node/components/leftPane/LeftPaneSearchHelper_test.ts +++ b/ts/test-node/components/leftPane/LeftPaneSearchHelper_test.ts @@ -4,10 +4,13 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; import { v4 as uuid } from 'uuid'; -import { RowType, _testHeaderText } from '../../../components/ConversationList'; -import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation'; +import { + RowType, + _testHeaderText, +} from '../../../components/ConversationList.js'; +import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.js'; -import { LeftPaneSearchHelper } from '../../../components/leftPane/LeftPaneSearchHelper'; +import { LeftPaneSearchHelper } from '../../../components/leftPane/LeftPaneSearchHelper.js'; const baseSearchHelperArgs = { conversationResults: { isLoading: false, results: [] }, diff --git a/ts/test-node/components/leftPane/LeftPaneSetGroupMetadataHelper_test.ts b/ts/test-node/components/leftPane/LeftPaneSetGroupMetadataHelper_test.ts index 345d993af75..d86a0f943be 100644 --- a/ts/test-node/components/leftPane/LeftPaneSetGroupMetadataHelper_test.ts +++ b/ts/test-node/components/leftPane/LeftPaneSetGroupMetadataHelper_test.ts @@ -3,11 +3,14 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; -import { RowType, _testHeaderText } from '../../../components/ConversationList'; -import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation'; -import { DurationInSeconds } from '../../../util/durations'; +import { + RowType, + _testHeaderText, +} from '../../../components/ConversationList.js'; +import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.js'; +import { DurationInSeconds } from '../../../util/durations/index.js'; -import { LeftPaneSetGroupMetadataHelper } from '../../../components/leftPane/LeftPaneSetGroupMetadataHelper'; +import { LeftPaneSetGroupMetadataHelper } from '../../../components/leftPane/LeftPaneSetGroupMetadataHelper.js'; function getComposeState() { return { diff --git a/ts/test-node/components/leftPane/getConversationInDirection_test.ts b/ts/test-node/components/leftPane/getConversationInDirection_test.ts index 61974d992ea..158d4592b77 100644 --- a/ts/test-node/components/leftPane/getConversationInDirection_test.ts +++ b/ts/test-node/components/leftPane/getConversationInDirection_test.ts @@ -2,11 +2,11 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import type { ToFindType } from '../../../components/leftPane/LeftPaneHelper'; -import { FindDirection } from '../../../components/leftPane/LeftPaneHelper'; -import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation'; +import type { ToFindType } from '../../../components/leftPane/LeftPaneHelper.js'; +import { FindDirection } from '../../../components/leftPane/LeftPaneHelper.js'; +import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.js'; -import { getConversationInDirection } from '../../../components/leftPane/getConversationInDirection'; +import { getConversationInDirection } from '../../../components/leftPane/getConversationInDirection.js'; describe('getConversationInDirection', () => { const fakeConversation = (markedUnread = false) => diff --git a/ts/test-node/components/media-gallery/groupMediaItemsByDate.ts b/ts/test-node/components/media-gallery/groupMediaItemsByDate.ts index 877591b3b1e..0ebf8f69b89 100644 --- a/ts/test-node/components/media-gallery/groupMediaItemsByDate.ts +++ b/ts/test-node/components/media-gallery/groupMediaItemsByDate.ts @@ -4,10 +4,10 @@ import { assert } from 'chai'; import { shuffle } from 'lodash'; -import { IMAGE_JPEG } from '../../../types/MIME'; -import { groupMediaItemsByDate } from '../../../components/conversation/media-gallery/groupMediaItemsByDate'; -import type { MediaItemType } from '../../../types/MediaItem'; -import { fakeAttachment } from '../../../test-helpers/fakeAttachment'; +import { IMAGE_JPEG } from '../../../types/MIME.js'; +import { groupMediaItemsByDate } from '../../../components/conversation/media-gallery/groupMediaItemsByDate.js'; +import type { MediaItemType } from '../../../types/MediaItem.js'; +import { fakeAttachment } from '../../../test-helpers/fakeAttachment.js'; const testDate = ( year: number, diff --git a/ts/test-node/conversations/isConversationTooBigToRing_test.ts b/ts/test-node/conversations/isConversationTooBigToRing_test.ts index 65522bc5ef2..7b463a0683c 100644 --- a/ts/test-node/conversations/isConversationTooBigToRing_test.ts +++ b/ts/test-node/conversations/isConversationTooBigToRing_test.ts @@ -3,10 +3,10 @@ import { assert } from 'chai'; import { times } from 'lodash'; -import { updateRemoteConfig } from '../../test-helpers/RemoteConfigStub'; -import { generateAci } from '../../types/ServiceId'; +import { updateRemoteConfig } from '../../test-helpers/RemoteConfigStub.js'; +import { generateAci } from '../../types/ServiceId.js'; -import { isConversationTooBigToRing } from '../../conversations/isConversationTooBigToRing'; +import { isConversationTooBigToRing } from '../../conversations/isConversationTooBigToRing.js'; const CONFIG_KEY = 'global.calling.maxGroupCallRingSize'; diff --git a/ts/test-node/environment_test.ts b/ts/test-node/environment_test.ts index 98e6d4e386d..783cded304f 100644 --- a/ts/test-node/environment_test.ts +++ b/ts/test-node/environment_test.ts @@ -7,7 +7,7 @@ import { Environment, isTestEnvironment, parseEnvironment, -} from '../environment'; +} from '../environment.js'; describe('environment utilities', () => { describe('parseEnvironment', () => { diff --git a/ts/test-node/groups/add_banned_member_test.ts b/ts/test-node/groups/add_banned_member_test.ts index 9389ea0bbf4..c024996c170 100644 --- a/ts/test-node/groups/add_banned_member_test.ts +++ b/ts/test-node/groups/add_banned_member_test.ts @@ -3,10 +3,13 @@ import { assert } from 'chai'; -import { generateAci } from '../../types/ServiceId'; -import { _maybeBuildAddBannedMemberActions } from '../../groups'; -import { getClientZkGroupCipher, decryptServiceId } from '../../util/zkgroup'; -import { updateRemoteConfig } from '../../test-helpers/RemoteConfigStub'; +import { generateAci } from '../../types/ServiceId.js'; +import { _maybeBuildAddBannedMemberActions } from '../../groups.js'; +import { + getClientZkGroupCipher, + decryptServiceId, +} from '../../util/zkgroup.js'; +import { updateRemoteConfig } from '../../test-helpers/RemoteConfigStub.js'; const HARD_LIMIT_KEY = 'global.groupsv2.groupSizeHardLimit'; diff --git a/ts/test-node/groups/limits_test.ts b/ts/test-node/groups/limits_test.ts index a3a6242114e..0b244e07c53 100644 --- a/ts/test-node/groups/limits_test.ts +++ b/ts/test-node/groups/limits_test.ts @@ -2,12 +2,12 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { updateRemoteConfig } from '../../test-helpers/RemoteConfigStub'; +import { updateRemoteConfig } from '../../test-helpers/RemoteConfigStub.js'; import { getGroupSizeRecommendedLimit, getGroupSizeHardLimit, -} from '../../groups/limits'; +} from '../../groups/limits.js'; const RECOMMENDED_SIZE_KEY = 'global.groupsv2.maxGroupSize'; const HARD_LIMIT_KEY = 'global.groupsv2.groupSizeHardLimit'; diff --git a/ts/test-node/groups/message_merge_test.ts b/ts/test-node/groups/message_merge_test.ts index 7f33c81aefa..bb4dc186ecb 100644 --- a/ts/test-node/groups/message_merge_test.ts +++ b/ts/test-node/groups/message_merge_test.ts @@ -4,11 +4,11 @@ import { assert } from 'chai'; import { v4 as generateUuid } from 'uuid'; -import { generateAci } from '../../types/ServiceId'; +import { generateAci } from '../../types/ServiceId.js'; import { _isGroupChangeMessageBounceable, _mergeGroupChangeMessages, -} from '../../groups'; +} from '../../groups.js'; describe('group message merging', () => { const defaultMessage = { diff --git a/ts/test-node/jobs/JobError_test.ts b/ts/test-node/jobs/JobError_test.ts index dcb7c81ea05..4570c724b44 100644 --- a/ts/test-node/jobs/JobError_test.ts +++ b/ts/test-node/jobs/JobError_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { JobError } from '../../jobs/JobError'; +import { JobError } from '../../jobs/JobError.js'; describe('JobError', () => { it('stores the provided argument as a property', () => { diff --git a/ts/test-node/jobs/JobLogger_test.ts b/ts/test-node/jobs/JobLogger_test.ts index b3762aea88d..a2b6b5f6b39 100644 --- a/ts/test-node/jobs/JobLogger_test.ts +++ b/ts/test-node/jobs/JobLogger_test.ts @@ -3,7 +3,7 @@ import * as sinon from 'sinon'; -import { JobLogger } from '../../jobs/JobLogger'; +import { JobLogger } from '../../jobs/JobLogger.js'; describe('JobLogger', () => { const LEVELS = ['fatal', 'error', 'warn', 'info', 'debug', 'trace'] as const; diff --git a/ts/test-node/jobs/JobQueueDatabaseStore_test.ts b/ts/test-node/jobs/JobQueueDatabaseStore_test.ts index f79cc1d3888..3e34241e478 100644 --- a/ts/test-node/jobs/JobQueueDatabaseStore_test.ts +++ b/ts/test-node/jobs/JobQueueDatabaseStore_test.ts @@ -5,9 +5,9 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; import { noop } from 'lodash'; -import type { StoredJob } from '../../jobs/types'; +import type { StoredJob } from '../../jobs/types.js'; -import { JobQueueDatabaseStore } from '../../jobs/JobQueueDatabaseStore'; +import { JobQueueDatabaseStore } from '../../jobs/JobQueueDatabaseStore.js'; describe('JobQueueDatabaseStore', () => { let fakeDatabase: { diff --git a/ts/test-node/jobs/JobQueue_test.ts b/ts/test-node/jobs/JobQueue_test.ts index 3d8b5ce398a..89533cab4b4 100644 --- a/ts/test-node/jobs/JobQueue_test.ts +++ b/ts/test-node/jobs/JobQueue_test.ts @@ -5,22 +5,22 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; -import EventEmitter, { once } from 'events'; +import EventEmitter, { once } from 'node:events'; import { z } from 'zod'; import { noop, groupBy } from 'lodash'; import { v4 as uuid } from 'uuid'; import PQueue from 'p-queue'; -import { JobError } from '../../jobs/JobError'; -import { TestJobQueueStore } from './TestJobQueueStore'; -import { missingCaseError } from '../../util/missingCaseError'; -import { drop } from '../../util/drop'; -import type { LoggerType } from '../../types/Logging'; +import { JobError } from '../../jobs/JobError.js'; +import { TestJobQueueStore } from './TestJobQueueStore.js'; +import { missingCaseError } from '../../util/missingCaseError.js'; +import { drop } from '../../util/drop.js'; +import type { LoggerType } from '../../types/Logging.js'; -import type { JOB_STATUS } from '../../jobs/JobQueue'; -import { JobQueue } from '../../jobs/JobQueue'; -import type { ParsedJob, StoredJob, JobQueueStore } from '../../jobs/types'; -import { sleep } from '../../util/sleep'; -import { parseUnknown } from '../../util/schemas'; +import type { JOB_STATUS } from '../../jobs/JobQueue.js'; +import { JobQueue } from '../../jobs/JobQueue.js'; +import type { ParsedJob, StoredJob, JobQueueStore } from '../../jobs/types.js'; +import { sleep } from '../../util/sleep.js'; +import { parseUnknown } from '../../util/schemas.js'; describe('JobQueue', () => { describe('end-to-end tests', () => { diff --git a/ts/test-node/jobs/Job_test.ts b/ts/test-node/jobs/Job_test.ts index 805eaba75b3..0186605dbab 100644 --- a/ts/test-node/jobs/Job_test.ts +++ b/ts/test-node/jobs/Job_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { Job } from '../../jobs/Job'; +import { Job } from '../../jobs/Job.js'; describe('Job', () => { it('stores its arguments', () => { diff --git a/ts/test-node/jobs/TestJobQueueStore.ts b/ts/test-node/jobs/TestJobQueueStore.ts index 535ffd6444c..cfc5fc7e697 100644 --- a/ts/test-node/jobs/TestJobQueueStore.ts +++ b/ts/test-node/jobs/TestJobQueueStore.ts @@ -4,11 +4,11 @@ /* eslint-disable max-classes-per-file */ /* eslint-disable no-await-in-loop */ -import EventEmitter, { once } from 'events'; +import EventEmitter, { once } from 'node:events'; -import type { JobQueueStore, StoredJob } from '../../jobs/types'; -import { sleep } from '../../util/sleep'; -import { drop } from '../../util/drop'; +import type { JobQueueStore, StoredJob } from '../../jobs/types.js'; +import { sleep } from '../../util/sleep.js'; +import { drop } from '../../util/drop.js'; export class TestJobQueueStore implements JobQueueStore { events = new EventEmitter(); diff --git a/ts/test-node/jobs/formatJobForInsert_test.ts b/ts/test-node/jobs/formatJobForInsert_test.ts index 7c23c88de43..e8255eec935 100644 --- a/ts/test-node/jobs/formatJobForInsert_test.ts +++ b/ts/test-node/jobs/formatJobForInsert_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { formatJobForInsert } from '../../jobs/formatJobForInsert'; +import { formatJobForInsert } from '../../jobs/formatJobForInsert.js'; describe('formatJobForInsert', () => { it('removes non-essential properties', () => { diff --git a/ts/test-node/jobs/helpers/InMemoryQueues_test.ts b/ts/test-node/jobs/helpers/InMemoryQueues_test.ts index c29cd4a9ef1..1484f1767e8 100644 --- a/ts/test-node/jobs/helpers/InMemoryQueues_test.ts +++ b/ts/test-node/jobs/helpers/InMemoryQueues_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { InMemoryQueues } from '../../../jobs/helpers/InMemoryQueues'; +import { InMemoryQueues } from '../../../jobs/helpers/InMemoryQueues.js'; describe('InMemoryQueues', () => { describe('get', () => { diff --git a/ts/test-node/jobs/helpers/addReportSpamJob_test.ts b/ts/test-node/jobs/helpers/addReportSpamJob_test.ts index 4c675ff5de0..a4ef178cd7e 100644 --- a/ts/test-node/jobs/helpers/addReportSpamJob_test.ts +++ b/ts/test-node/jobs/helpers/addReportSpamJob_test.ts @@ -1,10 +1,10 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import * as sinon from 'sinon'; -import { Job } from '../../../jobs/Job'; -import { addReportSpamJob } from '../../../jobs/helpers/addReportSpamJob'; -import type { ConversationType } from '../../../state/ducks/conversations'; -import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation'; +import { Job } from '../../../jobs/Job.js'; +import { addReportSpamJob } from '../../../jobs/helpers/addReportSpamJob.js'; +import type { ConversationType } from '../../../state/ducks/conversations.js'; +import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.js'; describe('addReportSpamJob', () => { let getMessageServerGuidsForSpam: sinon.SinonStub; diff --git a/ts/test-node/jobs/helpers/findRetryAfterTimeFromError_test.ts b/ts/test-node/jobs/helpers/findRetryAfterTimeFromError_test.ts index 1a59546c4e6..3625c17ebe4 100644 --- a/ts/test-node/jobs/helpers/findRetryAfterTimeFromError_test.ts +++ b/ts/test-node/jobs/helpers/findRetryAfterTimeFromError_test.ts @@ -3,9 +3,9 @@ import { assert } from 'chai'; -import { findRetryAfterTimeFromError } from '../../../jobs/helpers/findRetryAfterTimeFromError'; -import { HTTPError } from '../../../textsecure/Errors'; -import { MINUTE } from '../../../util/durations'; +import { findRetryAfterTimeFromError } from '../../../jobs/helpers/findRetryAfterTimeFromError.js'; +import { HTTPError } from '../../../textsecure/Errors.js'; +import { MINUTE } from '../../../util/durations/index.js'; describe('findRetryAfterTimeFromError', () => { it('returns 1 minute or provided default if no Retry-After time is found', () => { diff --git a/ts/test-node/jobs/helpers/getHttpErrorCode_test.ts b/ts/test-node/jobs/helpers/getHttpErrorCode_test.ts index ec6c9104db2..e0245206db8 100644 --- a/ts/test-node/jobs/helpers/getHttpErrorCode_test.ts +++ b/ts/test-node/jobs/helpers/getHttpErrorCode_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { getHttpErrorCode } from '../../../jobs/helpers/getHttpErrorCode'; +import { getHttpErrorCode } from '../../../jobs/helpers/getHttpErrorCode.js'; describe('getHttpErrorCode', () => { it('returns -1 if not passed an object', () => { diff --git a/ts/test-node/jobs/helpers/handleMultipleSendErrors_test.ts b/ts/test-node/jobs/helpers/handleMultipleSendErrors_test.ts index a3e3f79e48c..31438d8f4ba 100644 --- a/ts/test-node/jobs/helpers/handleMultipleSendErrors_test.ts +++ b/ts/test-node/jobs/helpers/handleMultipleSendErrors_test.ts @@ -4,13 +4,16 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; import { noop, omit } from 'lodash'; -import { HTTPError, SendMessageProtoError } from '../../../textsecure/Errors'; -import { SECOND } from '../../../util/durations'; +import { + HTTPError, + SendMessageProtoError, +} from '../../../textsecure/Errors.js'; +import { SECOND } from '../../../util/durations/index.js'; import { handleMultipleSendErrors, maybeExpandErrors, -} from '../../../jobs/helpers/handleMultipleSendErrors'; +} from '../../../jobs/helpers/handleMultipleSendErrors.js'; describe('maybeExpandErrors', () => { // This returns a readonly array, but Chai wants a mutable one. diff --git a/ts/test-node/jobs/helpers/sleepForRateLimitRetryAfterTime_test.ts b/ts/test-node/jobs/helpers/sleepForRateLimitRetryAfterTime_test.ts index 6724b0a4d3f..d48a633f850 100644 --- a/ts/test-node/jobs/helpers/sleepForRateLimitRetryAfterTime_test.ts +++ b/ts/test-node/jobs/helpers/sleepForRateLimitRetryAfterTime_test.ts @@ -3,11 +3,11 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; -import { HTTPError } from '../../../textsecure/Errors'; -import * as durations from '../../../util/durations'; -import { drop } from '../../../util/drop'; +import { HTTPError } from '../../../textsecure/Errors.js'; +import * as durations from '../../../util/durations/index.js'; +import { drop } from '../../../util/drop.js'; -import { sleepForRateLimitRetryAfterTime } from '../../../jobs/helpers/sleepForRateLimitRetryAfterTime'; +import { sleepForRateLimitRetryAfterTime } from '../../../jobs/helpers/sleepForRateLimitRetryAfterTime.js'; describe('sleepFor413RetryAfterTimeIfApplicable', () => { const createLogger = () => ({ info: sinon.spy() }); diff --git a/ts/test-node/jobs/helpers/syncHelpers_test.ts b/ts/test-node/jobs/helpers/syncHelpers_test.ts index 0f7fbdc0206..19787f9fcc1 100644 --- a/ts/test-node/jobs/helpers/syncHelpers_test.ts +++ b/ts/test-node/jobs/helpers/syncHelpers_test.ts @@ -3,8 +3,8 @@ import { assert } from 'chai'; -import { parseRawSyncDataArray } from '../../../jobs/helpers/syncHelpers'; -import { generateAci } from '../../../types/ServiceId'; +import { parseRawSyncDataArray } from '../../../jobs/helpers/syncHelpers.js'; +import { generateAci } from '../../../types/ServiceId.js'; const SERVICE_ID_1 = generateAci(); const SERVICE_ID_2 = generateAci(); diff --git a/ts/test-node/linkPreviews/isLinkPreviewDateValid_test.ts b/ts/test-node/linkPreviews/isLinkPreviewDateValid_test.ts index b51b9f4e5bf..88b548ba1e0 100644 --- a/ts/test-node/linkPreviews/isLinkPreviewDateValid_test.ts +++ b/ts/test-node/linkPreviews/isLinkPreviewDateValid_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { isLinkPreviewDateValid } from '../../linkPreviews/isLinkPreviewDateValid'; +import { isLinkPreviewDateValid } from '../../linkPreviews/isLinkPreviewDateValid.js'; describe('isLinkPreviewDateValid', () => { it('returns false for non-numbers', () => { diff --git a/ts/test-node/linkPreviews/shouldUseFullSizeLinkPreviewImage_test.ts b/ts/test-node/linkPreviews/shouldUseFullSizeLinkPreviewImage_test.ts index 402df7eebf6..dcde53cd362 100644 --- a/ts/test-node/linkPreviews/shouldUseFullSizeLinkPreviewImage_test.ts +++ b/ts/test-node/linkPreviews/shouldUseFullSizeLinkPreviewImage_test.ts @@ -2,11 +2,11 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { VIDEO_MP4 } from '../../types/MIME'; +import { VIDEO_MP4 } from '../../types/MIME.js'; -import { fakeAttachment } from '../../test-helpers/fakeAttachment'; +import { fakeAttachment } from '../../test-helpers/fakeAttachment.js'; -import { shouldUseFullSizeLinkPreviewImage } from '../../linkPreviews/shouldUseFullSizeLinkPreviewImage'; +import { shouldUseFullSizeLinkPreviewImage } from '../../linkPreviews/shouldUseFullSizeLinkPreviewImage.js'; describe('shouldUseFullSizeLinkPreviewImage', () => { const baseLinkPreview = { diff --git a/ts/test-node/logging/formatCountForLogging_test.ts b/ts/test-node/logging/formatCountForLogging_test.ts index 2782797b799..2e56238b004 100644 --- a/ts/test-node/logging/formatCountForLogging_test.ts +++ b/ts/test-node/logging/formatCountForLogging_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { formatCountForLogging } from '../../logging/formatCountForLogging'; +import { formatCountForLogging } from '../../logging/formatCountForLogging.js'; describe('formatCountForLogging', () => { it('returns "0" if passed zero', () => { diff --git a/ts/test-node/logging/uploadDebugLogs_test.ts b/ts/test-node/logging/uploadDebugLogs_test.ts index 6dc8d5bc1b2..d71c2246823 100644 --- a/ts/test-node/logging/uploadDebugLogs_test.ts +++ b/ts/test-node/logging/uploadDebugLogs_test.ts @@ -5,12 +5,12 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; import got from 'got'; import FormData from 'form-data'; -import * as util from 'util'; -import * as zlib from 'zlib'; +import * as util from 'node:util'; +import * as zlib from 'node:zlib'; -import * as durations from '../../util/durations'; -import { upload } from '../../logging/uploadDebugLog'; -import { createLogger } from '../../logging/log'; +import * as durations from '../../util/durations/index.js'; +import { upload } from '../../logging/uploadDebugLog.js'; +import { createLogger } from '../../logging/log.js'; const logger = createLogger('uploadDebugLogs_test'); diff --git a/ts/test-node/logging_test.ts b/ts/test-node/logging_test.ts index 5f4547922c7..c360b77d015 100644 --- a/ts/test-node/logging_test.ts +++ b/ts/test-node/logging_test.ts @@ -4,10 +4,10 @@ // NOTE: Temporarily allow `then` until we convert the entire file to `async` / `await`: /* eslint-disable more/no-then */ -import * as fs from 'fs'; +import * as fs from 'node:fs'; import * as fse from 'fs-extra'; -import * as os from 'os'; -import * as path from 'path'; +import * as os from 'node:os'; +import * as path from 'node:path'; import { assert } from 'chai'; import { @@ -16,7 +16,7 @@ import { isLineAfterDate, fetchLog, fetchLogs, -} from '../logging/main_process_logging'; +} from '../logging/main_process_logging.js'; describe('logging', () => { const fakeLogEntry = ({ diff --git a/ts/test-node/messages/MessageReadStatus_test.ts b/ts/test-node/messages/MessageReadStatus_test.ts index c33967ab93c..7ed22dbbf83 100644 --- a/ts/test-node/messages/MessageReadStatus_test.ts +++ b/ts/test-node/messages/MessageReadStatus_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { ReadStatus, maxReadStatus } from '../../messages/MessageReadStatus'; +import { ReadStatus, maxReadStatus } from '../../messages/MessageReadStatus.js'; describe('message read status utilities', () => { describe('maxReadStatus', () => { diff --git a/ts/test-node/messages/MessageSendState_test.ts b/ts/test-node/messages/MessageSendState_test.ts index e0d8eeca113..cf74a9af047 100644 --- a/ts/test-node/messages/MessageSendState_test.ts +++ b/ts/test-node/messages/MessageSendState_test.ts @@ -9,7 +9,7 @@ import type { SendAction, SendState, SendStateByConversationId, -} from '../../messages/MessageSendState'; +} from '../../messages/MessageSendState.js'; import { SendActionType, SendStatus, @@ -24,7 +24,7 @@ import { sendStateReducer, someRecipientSendStatus, someSendStatus, -} from '../../messages/MessageSendState'; +} from '../../messages/MessageSendState.js'; describe('message send state utilities', () => { describe('maxStatus', () => { diff --git a/ts/test-node/messages/migrateLegacyReadStatus_test.ts b/ts/test-node/messages/migrateLegacyReadStatus_test.ts index fac57fe77f2..aa7f2803a89 100644 --- a/ts/test-node/messages/migrateLegacyReadStatus_test.ts +++ b/ts/test-node/messages/migrateLegacyReadStatus_test.ts @@ -5,9 +5,9 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ import { assert } from 'chai'; -import { ReadStatus } from '../../messages/MessageReadStatus'; +import { ReadStatus } from '../../messages/MessageReadStatus.js'; -import { migrateLegacyReadStatus } from '../../messages/migrateLegacyReadStatus'; +import { migrateLegacyReadStatus } from '../../messages/migrateLegacyReadStatus.js'; describe('migrateLegacyReadStatus', () => { it("doesn't migrate messages that already have the modern read state", () => { diff --git a/ts/test-node/messages/migrateLegacySendAttributes_test.ts b/ts/test-node/messages/migrateLegacySendAttributes_test.ts index a07b1d2d01e..b697e9ef90e 100644 --- a/ts/test-node/messages/migrateLegacySendAttributes_test.ts +++ b/ts/test-node/messages/migrateLegacySendAttributes_test.ts @@ -3,11 +3,11 @@ import { assert } from 'chai'; import { v4 as uuid } from 'uuid'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation'; -import type { ConversationType } from '../../state/ducks/conversations'; -import { SendStatus } from '../../messages/MessageSendState'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; +import type { ConversationType } from '../../state/ducks/conversations.js'; +import { SendStatus } from '../../messages/MessageSendState.js'; -import { migrateLegacySendAttributes } from '../../messages/migrateLegacySendAttributes'; +import { migrateLegacySendAttributes } from '../../messages/migrateLegacySendAttributes.js'; describe('migrateLegacySendAttributes', () => { const defaultMessage = { diff --git a/ts/test-node/processDataMessage_test.ts b/ts/test-node/processDataMessage_test.ts index a6d917500ee..aa0ec5d49c1 100644 --- a/ts/test-node/processDataMessage_test.ts +++ b/ts/test-node/processDataMessage_test.ts @@ -8,13 +8,13 @@ import { v4 as generateUuid } from 'uuid'; import { processDataMessage, ATTACHMENT_MAX, -} from '../textsecure/processDataMessage'; -import type { ProcessedAttachment } from '../textsecure/Types.d'; -import { SignalService as Proto } from '../protobuf'; -import { IMAGE_GIF, IMAGE_JPEG, LONG_MESSAGE } from '../types/MIME'; -import { generateAci } from '../types/ServiceId'; -import { toAciObject } from '../util/ServiceId'; -import { uuidToBytes } from '../util/uuidToBytes'; +} from '../textsecure/processDataMessage.js'; +import type { ProcessedAttachment } from '../textsecure/Types.d.ts'; +import { SignalService as Proto } from '../protobuf/index.js'; +import { IMAGE_GIF, IMAGE_JPEG, LONG_MESSAGE } from '../types/MIME.js'; +import { generateAci } from '../types/ServiceId.js'; +import { toAciObject } from '../util/ServiceId.js'; +import { uuidToBytes } from '../util/uuidToBytes.js'; const ACI_1 = generateAci(); const ACI_BINARY_1 = toAciObject(ACI_1).getRawUuidBytes(); diff --git a/ts/test-node/processSyncMessage_test.ts b/ts/test-node/processSyncMessage_test.ts index 3c0196d37d8..13610a1a5f1 100644 --- a/ts/test-node/processSyncMessage_test.ts +++ b/ts/test-node/processSyncMessage_test.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { generateAci } from '../types/ServiceId'; +import { generateAci } from '../types/ServiceId.js'; -import { processSyncMessage } from '../textsecure/processSyncMessage'; +import { processSyncMessage } from '../textsecure/processSyncMessage.js'; describe('processSyncMessage', () => { const destinationServiceId = generateAci(); diff --git a/ts/test-node/reactions/isValidReactionEmoji_test.ts b/ts/test-node/reactions/isValidReactionEmoji_test.ts index c9d1070ac97..2df7f2a181d 100644 --- a/ts/test-node/reactions/isValidReactionEmoji_test.ts +++ b/ts/test-node/reactions/isValidReactionEmoji_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { isValidReactionEmoji } from '../../reactions/isValidReactionEmoji'; +import { isValidReactionEmoji } from '../../reactions/isValidReactionEmoji.js'; describe('isValidReactionEmoji', () => { it('returns false for non-strings', () => { diff --git a/ts/test-node/reactions/preferredReactionEmoji_test.ts b/ts/test-node/reactions/preferredReactionEmoji_test.ts index 1e7bfd98427..62e18a08ab9 100644 --- a/ts/test-node/reactions/preferredReactionEmoji_test.ts +++ b/ts/test-node/reactions/preferredReactionEmoji_test.ts @@ -6,8 +6,8 @@ import { assert } from 'chai'; import { canBeSynced, getPreferredReactionEmoji, -} from '../../reactions/preferredReactionEmoji'; -import { EmojiSkinTone } from '../../components/fun/data/emojis'; +} from '../../reactions/preferredReactionEmoji.js'; +import { EmojiSkinTone } from '../../components/fun/data/emojis.js'; describe('preferred reaction emoji utilities', () => { describe('getPreferredReactionEmoji', () => { diff --git a/ts/test-node/reactions/util_test.ts b/ts/test-node/reactions/util_test.ts index 1ef470a1df0..d8246313fd2 100644 --- a/ts/test-node/reactions/util_test.ts +++ b/ts/test-node/reactions/util_test.ts @@ -4,8 +4,8 @@ import { assert } from 'chai'; import { v4 as uuid } from 'uuid'; import { omit } from 'lodash'; -import type { MessageReactionType } from '../../model-types.d'; -import { isEmpty } from '../../util/iterables'; +import type { MessageReactionType } from '../../model-types.d.ts'; +import { isEmpty } from '../../util/iterables.js'; import { addOutgoingReaction, @@ -13,7 +13,7 @@ import { getUnsentConversationIds, markOutgoingReactionFailed, markOutgoingReactionSent, -} from '../../reactions/util'; +} from '../../reactions/util.js'; describe('reaction utilities', () => { const OUR_CONVO_ID = uuid(); diff --git a/ts/test-node/services/donations_test.ts b/ts/test-node/services/donations_test.ts index 62f92c07844..f179a339906 100644 --- a/ts/test-node/services/donations_test.ts +++ b/ts/test-node/services/donations_test.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { phoneNumberToCurrencyCode } from '../../services/donations'; +import { phoneNumberToCurrencyCode } from '../../services/donations.js'; describe('donations', () => { describe('phoneNumberToCurrency', () => { diff --git a/ts/test-node/services/expiring/createExpiringEntityCleanupService_test.ts b/ts/test-node/services/expiring/createExpiringEntityCleanupService_test.ts index 952f56857ae..20d2f09ce56 100644 --- a/ts/test-node/services/expiring/createExpiringEntityCleanupService_test.ts +++ b/ts/test-node/services/expiring/createExpiringEntityCleanupService_test.ts @@ -4,8 +4,8 @@ import assert from 'node:assert/strict'; import type { ExpiringEntity, ExpiringEntityCleanupService, -} from '../../../services/expiring/createExpiringEntityCleanupService'; -import { createExpiringEntityCleanupService } from '../../../services/expiring/createExpiringEntityCleanupService'; +} from '../../../services/expiring/createExpiringEntityCleanupService.js'; +import { createExpiringEntityCleanupService } from '../../../services/expiring/createExpiringEntityCleanupService.js'; function waitForMicrotasks() { return new Promise(resolve => { diff --git a/ts/test-node/services/ourProfileKey_test.ts b/ts/test-node/services/ourProfileKey_test.ts index 6252106bc66..fb99b5199e1 100644 --- a/ts/test-node/services/ourProfileKey_test.ts +++ b/ts/test-node/services/ourProfileKey_test.ts @@ -4,10 +4,10 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; import { noop } from 'lodash'; -import { sleep } from '../../util/sleep'; +import { sleep } from '../../util/sleep.js'; -import { constantTimeEqual } from '../../Crypto'; -import { OurProfileKeyService } from '../../services/ourProfileKey'; +import { constantTimeEqual } from '../../Crypto.js'; +import { OurProfileKeyService } from '../../services/ourProfileKey.js'; describe('"our profile key" service', () => { const createFakeStorage = () => ({ diff --git a/ts/test-node/sql/cleanDataForIpc_test.ts b/ts/test-node/sql/cleanDataForIpc_test.ts index a76016c31c2..a618a16c2f7 100644 --- a/ts/test-node/sql/cleanDataForIpc_test.ts +++ b/ts/test-node/sql/cleanDataForIpc_test.ts @@ -4,7 +4,7 @@ import { assert } from 'chai'; import { noop } from 'lodash'; -import { cleanDataForIpc } from '../../sql/cleanDataForIpc'; +import { cleanDataForIpc } from '../../sql/cleanDataForIpc.js'; describe('cleanDataForIpc', () => { it('does nothing to JSON primitives', () => { diff --git a/ts/test-node/sql/cleanMessageData_test.ts b/ts/test-node/sql/cleanMessageData_test.ts index 04b282822c4..6efce60d2ec 100644 --- a/ts/test-node/sql/cleanMessageData_test.ts +++ b/ts/test-node/sql/cleanMessageData_test.ts @@ -3,8 +3,8 @@ import { assert } from 'chai'; -import { _cleanMessageData } from '../../sql/Client'; -import { IMAGE_GIF } from '../../types/MIME'; +import { _cleanMessageData } from '../../sql/Client.js'; +import { IMAGE_GIF } from '../../types/MIME.js'; describe('_cleanMessageData', () => { it('throws if message is missing received_at', () => { diff --git a/ts/test-node/sql/helpers.ts b/ts/test-node/sql/helpers.ts index 1315a120663..64bf36d564a 100644 --- a/ts/test-node/sql/helpers.ts +++ b/ts/test-node/sql/helpers.ts @@ -4,10 +4,10 @@ import { noop } from 'lodash'; import SQL from '@signalapp/sqlcipher'; -import type { ReadableDB, WritableDB } from '../../sql/Interface'; -import type { QueryTemplate } from '../../sql/util'; -import { SCHEMA_VERSIONS } from '../../sql/migrations'; -import { consoleLogger } from '../../util/consoleLogger'; +import type { ReadableDB, WritableDB } from '../../sql/Interface.js'; +import type { QueryTemplate } from '../../sql/util.js'; +import { SCHEMA_VERSIONS } from '../../sql/migrations/index.js'; +import { consoleLogger } from '../../util/consoleLogger.js'; export function createDB(): WritableDB { const db = new SQL(':memory:') as WritableDB; diff --git a/ts/test-node/sql/incrementMessagesMigrationAttempts_test.ts b/ts/test-node/sql/incrementMessagesMigrationAttempts_test.ts index 70a3b93ef9c..d6e39292292 100644 --- a/ts/test-node/sql/incrementMessagesMigrationAttempts_test.ts +++ b/ts/test-node/sql/incrementMessagesMigrationAttempts_test.ts @@ -3,12 +3,12 @@ import { assert } from 'chai'; -import type { WritableDB } from '../../sql/Interface'; +import type { WritableDB } from '../../sql/Interface.js'; import { incrementMessagesMigrationAttempts, setupTests, -} from '../../sql/Server'; -import { createDB, insertData, getTableData } from './helpers'; +} from '../../sql/Server.js'; +import { createDB, insertData, getTableData } from './helpers.js'; describe('SQL/incrementMessagesMigrationAttempts', () => { let db: WritableDB; diff --git a/ts/test-node/sql/migrateConversationMessages_test.ts b/ts/test-node/sql/migrateConversationMessages_test.ts index 22ade6e6202..ecffe775244 100644 --- a/ts/test-node/sql/migrateConversationMessages_test.ts +++ b/ts/test-node/sql/migrateConversationMessages_test.ts @@ -3,9 +3,9 @@ import { assert } from 'chai'; -import type { WritableDB } from '../../sql/Interface'; -import { migrateConversationMessages, setupTests } from '../../sql/Server'; -import { createDB, insertData, getTableData } from './helpers'; +import type { WritableDB } from '../../sql/Interface.js'; +import { migrateConversationMessages, setupTests } from '../../sql/Server.js'; +import { createDB, insertData, getTableData } from './helpers.js'; describe('SQL/migrateConversationMessages', () => { let db: WritableDB; diff --git a/ts/test-node/sql/migration_1000_test.ts b/ts/test-node/sql/migration_1000_test.ts index bf694807681..700d01ec65a 100644 --- a/ts/test-node/sql/migration_1000_test.ts +++ b/ts/test-node/sql/migration_1000_test.ts @@ -4,11 +4,11 @@ import { assert } from 'chai'; import { v4 as generateGuid } from 'uuid'; -import { jsonToObject, sql } from '../../sql/util'; -import { createDB, updateToVersion } from './helpers'; -import type { WritableDB, MessageType } from '../../sql/Interface'; -import { ReadStatus } from '../../messages/MessageReadStatus'; -import { SeenStatus } from '../../MessageSeenStatus'; +import { jsonToObject, sql } from '../../sql/util.js'; +import { createDB, updateToVersion } from './helpers.js'; +import type { WritableDB, MessageType } from '../../sql/Interface.js'; +import { ReadStatus } from '../../messages/MessageReadStatus.js'; +import { SeenStatus } from '../../MessageSeenStatus.js'; describe('SQL/updateToSchemaVersion1000', () => { let db: WritableDB; diff --git a/ts/test-node/sql/migration_1020_test.ts b/ts/test-node/sql/migration_1020_test.ts index 65aeb4da245..945ef420d06 100644 --- a/ts/test-node/sql/migration_1020_test.ts +++ b/ts/test-node/sql/migration_1020_test.ts @@ -4,9 +4,14 @@ import { assert } from 'chai'; import { v4 as generateGuid } from 'uuid'; -import { normalizeAci } from '../../util/normalizeAci'; -import type { WritableDB } from '../../sql/Interface'; -import { createDB, insertData, getTableData, updateToVersion } from './helpers'; +import { normalizeAci } from '../../util/normalizeAci.js'; +import type { WritableDB } from '../../sql/Interface.js'; +import { + createDB, + insertData, + getTableData, + updateToVersion, +} from './helpers.js'; describe('SQL/updateToSchemaVersion1020', () => { let db: WritableDB; diff --git a/ts/test-node/sql/migration_1030_test.ts b/ts/test-node/sql/migration_1030_test.ts index 89ace7363d5..63990c63d5d 100644 --- a/ts/test-node/sql/migration_1030_test.ts +++ b/ts/test-node/sql/migration_1030_test.ts @@ -3,10 +3,10 @@ import { assert } from 'chai'; import { v4 as generateGuid } from 'uuid'; -import { sql } from '../../sql/util'; -import { createDB, updateToVersion } from './helpers'; -import type { WritableDB, MessageType } from '../../sql/Interface'; -import { MessageRequestResponseEvent } from '../../types/MessageRequestResponseEvent'; +import { sql } from '../../sql/util.js'; +import { createDB, updateToVersion } from './helpers.js'; +import type { WritableDB, MessageType } from '../../sql/Interface.js'; +import { MessageRequestResponseEvent } from '../../types/MessageRequestResponseEvent.js'; describe('SQL/updateToSchemaVersion1030', () => { let db: WritableDB; diff --git a/ts/test-node/sql/migration_1040_test.ts b/ts/test-node/sql/migration_1040_test.ts index c8125160616..e0be6ea5e6f 100644 --- a/ts/test-node/sql/migration_1040_test.ts +++ b/ts/test-node/sql/migration_1040_test.ts @@ -3,15 +3,15 @@ import { omit } from 'lodash'; import { assert } from 'chai'; -import type { ReadableDB, WritableDB } from '../../sql/Interface'; -import { jsonToObject, objectToJSON, sql, sqlJoin } from '../../sql/util'; -import { createDB, updateToVersion, explain } from './helpers'; +import type { ReadableDB, WritableDB } from '../../sql/Interface.js'; +import { jsonToObject, objectToJSON, sql, sqlJoin } from '../../sql/util.js'; +import { createDB, updateToVersion, explain } from './helpers.js'; import type { _AttachmentDownloadJobTypeV1030, _AttachmentDownloadJobTypeV1040, -} from '../../sql/migrations/1040-undownloaded-backed-up-media'; -import type { AttachmentType } from '../../types/Attachment'; -import { IMAGE_JPEG } from '../../types/MIME'; +} from '../../sql/migrations/1040-undownloaded-backed-up-media.js'; +import type { AttachmentType } from '../../types/Attachment.js'; +import { IMAGE_JPEG } from '../../types/MIME.js'; function getAttachmentDownloadJobs( db: ReadableDB diff --git a/ts/test-node/sql/migration_1060_test.ts b/ts/test-node/sql/migration_1060_test.ts index 297f2597409..89e3299f1cc 100644 --- a/ts/test-node/sql/migration_1060_test.ts +++ b/ts/test-node/sql/migration_1060_test.ts @@ -8,15 +8,19 @@ import { dequeueOldestSyncTasks, removeSyncTaskById, saveSyncTasks, -} from '../../sql/Server'; -import type { WritableDB, ReadableDB, MessageType } from '../../sql/Interface'; -import { sql, jsonToObject } from '../../sql/util'; -import { insertData, updateToVersion, createDB, explain } from './helpers'; -import { MAX_SYNC_TASK_ATTEMPTS } from '../../util/syncTasks.types'; -import { WEEK } from '../../util/durations'; +} from '../../sql/Server.js'; +import type { + WritableDB, + ReadableDB, + MessageType, +} from '../../sql/Interface.js'; +import { sql, jsonToObject } from '../../sql/util.js'; +import { insertData, updateToVersion, createDB, explain } from './helpers.js'; +import { MAX_SYNC_TASK_ATTEMPTS } from '../../util/syncTasks.types.js'; +import { WEEK } from '../../util/durations/index.js'; -import type { MessageAttributesType } from '../../model-types'; -import type { SyncTaskType } from '../../util/syncTasks'; +import type { MessageAttributesType } from '../../model-types.js'; +import type { SyncTaskType } from '../../util/syncTasks.js'; /* eslint-disable camelcase */ diff --git a/ts/test-node/sql/migration_1080_test.ts b/ts/test-node/sql/migration_1080_test.ts index 450b8ef1e72..d32a8fd1abc 100644 --- a/ts/test-node/sql/migration_1080_test.ts +++ b/ts/test-node/sql/migration_1080_test.ts @@ -4,12 +4,16 @@ import { assert } from 'chai'; import { v4 as generateGuid } from 'uuid'; -import type { WritableDB, ReadableDB, MessageType } from '../../sql/Interface'; -import { sql, jsonToObject } from '../../sql/util'; -import { createDB, insertData, updateToVersion, explain } from './helpers'; +import type { + WritableDB, + ReadableDB, + MessageType, +} from '../../sql/Interface.js'; +import { sql, jsonToObject } from '../../sql/util.js'; +import { createDB, insertData, updateToVersion, explain } from './helpers.js'; -import type { MessageAttributesType } from '../../model-types'; -import { DurationInSeconds } from '../../util/durations/duration-in-seconds'; +import type { MessageAttributesType } from '../../model-types.js'; +import { DurationInSeconds } from '../../util/durations/duration-in-seconds.js'; /* eslint-disable camelcase */ diff --git a/ts/test-node/sql/migration_1090_test.ts b/ts/test-node/sql/migration_1090_test.ts index 86864daa6bf..1f7458b7688 100644 --- a/ts/test-node/sql/migration_1090_test.ts +++ b/ts/test-node/sql/migration_1090_test.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import type { WritableDB } from '../../sql/Interface'; -import { sql } from '../../sql/util'; -import { createDB, updateToVersion, explain } from './helpers'; +import type { WritableDB } from '../../sql/Interface.js'; +import { sql } from '../../sql/util.js'; +import { createDB, updateToVersion, explain } from './helpers.js'; describe('SQL/updateToSchemaVersion1090', () => { let db: WritableDB; diff --git a/ts/test-node/sql/migration_1100_test.ts b/ts/test-node/sql/migration_1100_test.ts index 3f0cb7e0148..00781ff09dd 100644 --- a/ts/test-node/sql/migration_1100_test.ts +++ b/ts/test-node/sql/migration_1100_test.ts @@ -3,17 +3,17 @@ import { assert } from 'chai'; import { findLast } from 'lodash'; -import type { WritableDB } from '../../sql/Interface'; -import { markAllCallHistoryRead } from '../../sql/Server'; -import { SeenStatus } from '../../MessageSeenStatus'; +import type { WritableDB } from '../../sql/Interface.js'; +import { markAllCallHistoryRead } from '../../sql/Server.js'; +import { SeenStatus } from '../../MessageSeenStatus.js'; import { CallMode, CallDirection, CallType, DirectCallStatus, -} from '../../types/CallDisposition'; -import { strictAssert } from '../../util/assert'; -import { createDB, insertData, updateToVersion } from './helpers'; +} from '../../types/CallDisposition.js'; +import { strictAssert } from '../../util/assert.js'; +import { createDB, insertData, updateToVersion } from './helpers.js'; describe('SQL/updateToSchemaVersion1100', () => { let db: WritableDB; diff --git a/ts/test-node/sql/migration_1120_test.ts b/ts/test-node/sql/migration_1120_test.ts index a2d1afed6cf..c2d915ade9b 100644 --- a/ts/test-node/sql/migration_1120_test.ts +++ b/ts/test-node/sql/migration_1120_test.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import type { WritableDB } from '../../sql/Interface'; -import { sql } from '../../sql/util'; -import { createDB, updateToVersion, explain } from './helpers'; +import type { WritableDB } from '../../sql/Interface.js'; +import { sql } from '../../sql/util.js'; +import { createDB, updateToVersion, explain } from './helpers.js'; describe('SQL/updateToSchemaVersion1120', () => { let db: WritableDB; diff --git a/ts/test-node/sql/migration_1130_test.ts b/ts/test-node/sql/migration_1130_test.ts index 6e95f1748a5..747f340ba90 100644 --- a/ts/test-node/sql/migration_1130_test.ts +++ b/ts/test-node/sql/migration_1130_test.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import type { WritableDB } from '../../sql/Interface'; -import { sql } from '../../sql/util'; -import { createDB, updateToVersion, explain } from './helpers'; +import type { WritableDB } from '../../sql/Interface.js'; +import { sql } from '../../sql/util.js'; +import { createDB, updateToVersion, explain } from './helpers.js'; describe('SQL/updateToSchemaVersion1130', () => { let db: WritableDB; diff --git a/ts/test-node/sql/migration_1180_test.ts b/ts/test-node/sql/migration_1180_test.ts index a6042c1e1f1..adec264fe9e 100644 --- a/ts/test-node/sql/migration_1180_test.ts +++ b/ts/test-node/sql/migration_1180_test.ts @@ -3,11 +3,11 @@ import { assert } from 'chai'; import { omit } from 'lodash'; -import type { WritableDB } from '../../sql/Interface'; -import { createDB, updateToVersion, explain } from './helpers'; -import { jsonToObject, objectToJSON, sql } from '../../sql/util'; -import { IMAGE_BMP } from '../../types/MIME'; -import type { _AttachmentDownloadJobTypeV1040 } from '../../sql/migrations/1040-undownloaded-backed-up-media'; +import type { WritableDB } from '../../sql/Interface.js'; +import { createDB, updateToVersion, explain } from './helpers.js'; +import { jsonToObject, objectToJSON, sql } from '../../sql/util.js'; +import { IMAGE_BMP } from '../../types/MIME.js'; +import type { _AttachmentDownloadJobTypeV1040 } from '../../sql/migrations/1040-undownloaded-backed-up-media.js'; function insertOldJob( db: WritableDB, diff --git a/ts/test-node/sql/migration_1200_test.ts b/ts/test-node/sql/migration_1200_test.ts index 90f9d1476c2..0fae1bdc765 100644 --- a/ts/test-node/sql/migration_1200_test.ts +++ b/ts/test-node/sql/migration_1200_test.ts @@ -3,11 +3,14 @@ import { assert } from 'chai'; -import { AttachmentDownloadSource, type WritableDB } from '../../sql/Interface'; -import { objectToJSON, sql } from '../../sql/util'; -import { createDB, updateToVersion, explain } from './helpers'; -import { IMAGE_JPEG } from '../../types/MIME'; -import type { _AttachmentDownloadJobTypeV1040 } from '../../sql/migrations/1040-undownloaded-backed-up-media'; +import { + AttachmentDownloadSource, + type WritableDB, +} from '../../sql/Interface.js'; +import { objectToJSON, sql } from '../../sql/util.js'; +import { createDB, updateToVersion, explain } from './helpers.js'; +import { IMAGE_JPEG } from '../../types/MIME.js'; +import type { _AttachmentDownloadJobTypeV1040 } from '../../sql/migrations/1040-undownloaded-backed-up-media.js'; type UnflattenedAttachmentDownloadJobType = Omit< _AttachmentDownloadJobTypeV1040, diff --git a/ts/test-node/sql/migration_1220_test.ts b/ts/test-node/sql/migration_1220_test.ts index 659564b3d5f..c03f0f31358 100644 --- a/ts/test-node/sql/migration_1220_test.ts +++ b/ts/test-node/sql/migration_1220_test.ts @@ -3,13 +3,18 @@ import { assert } from 'chai'; -import { type WritableDB } from '../../sql/Interface'; +import { type WritableDB } from '../../sql/Interface.js'; import { sessionRecordToProtobuf, sessionStructureToBytes, -} from '../../util/sessionTranslation'; -import { createDB, updateToVersion, insertData, getTableData } from './helpers'; -import { SESSION_V1_RECORD } from '../util/sessionTranslation_test'; +} from '../../util/sessionTranslation.js'; +import { + createDB, + updateToVersion, + insertData, + getTableData, +} from './helpers.js'; +import { SESSION_V1_RECORD } from '../util/sessionTranslation_test.js'; const MAPS = [ { diff --git a/ts/test-node/sql/migration_1280_test.ts b/ts/test-node/sql/migration_1280_test.ts index b8a2f230f0f..f6f75ace0ed 100644 --- a/ts/test-node/sql/migration_1280_test.ts +++ b/ts/test-node/sql/migration_1280_test.ts @@ -3,10 +3,15 @@ import { assert } from 'chai'; -import { type WritableDB } from '../../sql/Interface'; -import { Migrations as Proto } from '../../protobuf'; -import { generateAci } from '../../types/ServiceId'; -import { createDB, updateToVersion, insertData, getTableData } from './helpers'; +import { type WritableDB } from '../../sql/Interface.js'; +import { Migrations as Proto } from '../../protobuf/index.js'; +import { generateAci } from '../../types/ServiceId.js'; +import { + createDB, + updateToVersion, + insertData, + getTableData, +} from './helpers.js'; describe('SQL/updateToSchemaVersion1280', () => { let db: WritableDB; diff --git a/ts/test-node/sql/migration_1290_test.ts b/ts/test-node/sql/migration_1290_test.ts index f0f9b5c2c66..91c51fb2f02 100644 --- a/ts/test-node/sql/migration_1290_test.ts +++ b/ts/test-node/sql/migration_1290_test.ts @@ -3,8 +3,13 @@ import { assert } from 'chai'; -import { type WritableDB } from '../../sql/Interface'; -import { createDB, updateToVersion, insertData, getTableData } from './helpers'; +import { type WritableDB } from '../../sql/Interface.js'; +import { + createDB, + updateToVersion, + insertData, + getTableData, +} from './helpers.js'; const DEFAULTS = { id: 'id', diff --git a/ts/test-node/sql/migration_1310_test.ts b/ts/test-node/sql/migration_1310_test.ts index ed6529ae5ed..e3209418f56 100644 --- a/ts/test-node/sql/migration_1310_test.ts +++ b/ts/test-node/sql/migration_1310_test.ts @@ -3,8 +3,13 @@ import { assert } from 'chai'; -import { type WritableDB } from '../../sql/Interface'; -import { createDB, updateToVersion, insertData, getTableData } from './helpers'; +import { type WritableDB } from '../../sql/Interface.js'; +import { + createDB, + updateToVersion, + insertData, + getTableData, +} from './helpers.js'; describe('SQL/updateToSchemaVersion1310', () => { let db: WritableDB; diff --git a/ts/test-node/sql/migration_1330_test.ts b/ts/test-node/sql/migration_1330_test.ts index 133a6fe1907..e48f6aa9348 100644 --- a/ts/test-node/sql/migration_1330_test.ts +++ b/ts/test-node/sql/migration_1330_test.ts @@ -8,12 +8,12 @@ import { dequeueOldestSyncTasks, saveSyncTasks, incrementAllSyncTaskAttempts, -} from '../../sql/Server'; -import { sql } from '../../sql/util'; -import type { WritableDB } from '../../sql/Interface'; -import { updateToVersion, createDB, explain } from './helpers'; +} from '../../sql/Server.js'; +import { sql } from '../../sql/util.js'; +import type { WritableDB } from '../../sql/Interface.js'; +import { updateToVersion, createDB, explain } from './helpers.js'; -import type { SyncTaskType } from '../../util/syncTasks'; +import type { SyncTaskType } from '../../util/syncTasks.js'; describe('SQL/updateToSchemaVersion1330', () => { let db: WritableDB; diff --git a/ts/test-node/sql/migration_1350_test.ts b/ts/test-node/sql/migration_1350_test.ts index f1f6d83f583..c518d0fafa9 100644 --- a/ts/test-node/sql/migration_1350_test.ts +++ b/ts/test-node/sql/migration_1350_test.ts @@ -1,9 +1,9 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { sql } from '../../sql/util'; -import type { WritableDB } from '../../sql/Interface'; -import { updateToVersion, createDB } from './helpers'; +import { sql } from '../../sql/util.js'; +import type { WritableDB } from '../../sql/Interface.js'; +import { updateToVersion, createDB } from './helpers.js'; describe('SQL/updateToSchemaVersion1350', () => { let db: WritableDB; diff --git a/ts/test-node/sql/migration_1360_test.ts b/ts/test-node/sql/migration_1360_test.ts index 2b900307e28..74654df7f5c 100644 --- a/ts/test-node/sql/migration_1360_test.ts +++ b/ts/test-node/sql/migration_1360_test.ts @@ -3,9 +3,9 @@ import { assert } from 'chai'; -import { sql } from '../../sql/util'; -import { createDB, explain, updateToVersion } from './helpers'; -import type { WritableDB } from '../../sql/Interface'; +import { sql } from '../../sql/util.js'; +import { createDB, explain, updateToVersion } from './helpers.js'; +import type { WritableDB } from '../../sql/Interface.js'; describe('SQL/updateToSchemaVersion1360', () => { let db: WritableDB; diff --git a/ts/test-node/sql/migration_1380_test.ts b/ts/test-node/sql/migration_1380_test.ts index 1b568e673a9..e60a421ad7f 100644 --- a/ts/test-node/sql/migration_1380_test.ts +++ b/ts/test-node/sql/migration_1380_test.ts @@ -4,16 +4,16 @@ import { assert } from 'chai'; import { v1 as getGuid } from 'uuid'; -import { sql } from '../../sql/util'; +import { sql } from '../../sql/util.js'; import { updateToVersion, createDB, explain, insertData, getTableData, -} from './helpers'; +} from './helpers.js'; -import type { WritableDB } from '../../sql/Interface'; +import type { WritableDB } from '../../sql/Interface.js'; describe('SQL/updateToSchemaVersion1380', () => { let db: WritableDB; diff --git a/ts/test-node/sql/migration_1410_test.ts b/ts/test-node/sql/migration_1410_test.ts index 3c6ae276025..164f40a44ca 100644 --- a/ts/test-node/sql/migration_1410_test.ts +++ b/ts/test-node/sql/migration_1410_test.ts @@ -3,9 +3,14 @@ import { assert } from 'chai'; -import { type WritableDB } from '../../sql/Interface'; -import { createDB, updateToVersion, insertData, getTableData } from './helpers'; -import { createOrUpdate, getById } from '../../sql/util'; +import { type WritableDB } from '../../sql/Interface.js'; +import { + createDB, + updateToVersion, + insertData, + getTableData, +} from './helpers.js'; +import { createOrUpdate, getById } from '../../sql/util.js'; describe('SQL/updateToSchemaVersion1410', () => { let db: WritableDB; diff --git a/ts/test-node/sql/migration_1420_test.ts b/ts/test-node/sql/migration_1420_test.ts index 2baad46bff0..13836837c5a 100644 --- a/ts/test-node/sql/migration_1420_test.ts +++ b/ts/test-node/sql/migration_1420_test.ts @@ -3,11 +3,14 @@ import { assert } from 'chai'; -import { AttachmentDownloadSource, type WritableDB } from '../../sql/Interface'; -import { objectToJSON, sql } from '../../sql/util'; -import { createDB, updateToVersion } from './helpers'; -import type { AttachmentDownloadJobType } from '../../types/AttachmentDownload'; -import { createAttachmentDownloadJob } from '../../test-helpers/attachmentDownloads'; +import { + AttachmentDownloadSource, + type WritableDB, +} from '../../sql/Interface.js'; +import { objectToJSON, sql } from '../../sql/util.js'; +import { createDB, updateToVersion } from './helpers.js'; +import type { AttachmentDownloadJobType } from '../../types/AttachmentDownload.js'; +import { createAttachmentDownloadJob } from '../../test-helpers/attachmentDownloads.js'; function createJobAndEnsureMessage( db: WritableDB, diff --git a/ts/test-node/sql/migration_87_test.ts b/ts/test-node/sql/migration_87_test.ts index 1907deb4b06..cabf922be9e 100644 --- a/ts/test-node/sql/migration_87_test.ts +++ b/ts/test-node/sql/migration_87_test.ts @@ -5,20 +5,20 @@ import { assert } from 'chai'; import { v4 as generateGuid } from 'uuid'; import { range } from 'lodash'; -import { createDB, insertData, updateToVersion } from './helpers'; +import { createDB, insertData, updateToVersion } from './helpers.js'; import type { AciString, PniString, ServiceIdString, -} from '../../types/ServiceId'; -import { normalizePni } from '../../types/ServiceId'; -import { normalizeAci } from '../../util/normalizeAci'; +} from '../../types/ServiceId.js'; +import { normalizePni } from '../../types/ServiceId.js'; +import { normalizeAci } from '../../util/normalizeAci.js'; import type { WritableDB, KyberPreKeyType, PreKeyType, SignedPreKeyType, -} from '../../sql/Interface'; +} from '../../sql/Interface.js'; type TestingKyberKey = Omit< KyberPreKeyType, diff --git a/ts/test-node/sql/migration_88_test.ts b/ts/test-node/sql/migration_88_test.ts index a882cc3b298..1b7d2813455 100644 --- a/ts/test-node/sql/migration_88_test.ts +++ b/ts/test-node/sql/migration_88_test.ts @@ -4,8 +4,13 @@ import { assert } from 'chai'; import { v4 as generateGuid } from 'uuid'; -import type { WritableDB } from '../../sql/Interface'; -import { createDB, updateToVersion, insertData, getTableData } from './helpers'; +import type { WritableDB } from '../../sql/Interface.js'; +import { + createDB, + updateToVersion, + insertData, + getTableData, +} from './helpers.js'; const CONVO_ID = generateGuid(); const GROUP_ID = generateGuid(); diff --git a/ts/test-node/sql/migration_89_test.ts b/ts/test-node/sql/migration_89_test.ts index 71613e6f431..46c843739db 100644 --- a/ts/test-node/sql/migration_89_test.ts +++ b/ts/test-node/sql/migration_89_test.ts @@ -4,7 +4,7 @@ import { assert } from 'chai'; import { v4 as generateGuid } from 'uuid'; -import { jsonToObject, sql } from '../../sql/util'; +import { jsonToObject, sql } from '../../sql/util.js'; import { CallMode, CallDirection, @@ -12,17 +12,17 @@ import { DirectCallStatus, GroupCallStatus, callHistoryDetailsSchema, -} from '../../types/CallDisposition'; -import type { CallHistoryDetails } from '../../types/CallDisposition'; +} from '../../types/CallDisposition.js'; +import type { CallHistoryDetails } from '../../types/CallDisposition.js'; import type { CallHistoryDetailsFromDiskType, MessageWithCallHistoryDetails, -} from '../../sql/migrations/89-call-history'; -import { getCallIdFromEra } from '../../util/callDisposition'; -import { isValidUuid } from '../../util/isValidUuid'; -import { createDB, updateToVersion } from './helpers'; -import type { WritableDB, MessageType } from '../../sql/Interface'; -import { parsePartial } from '../../util/schemas'; +} from '../../sql/migrations/89-call-history.js'; +import { getCallIdFromEra } from '../../util/callDisposition.js'; +import { isValidUuid } from '../../util/isValidUuid.js'; +import { createDB, updateToVersion } from './helpers.js'; +import type { WritableDB, MessageType } from '../../sql/Interface.js'; +import { parsePartial } from '../../util/schemas.js'; describe('SQL/updateToSchemaVersion89', () => { let db: WritableDB; diff --git a/ts/test-node/sql/migration_90_test.ts b/ts/test-node/sql/migration_90_test.ts index 5acfd5d1255..052f1d06c54 100644 --- a/ts/test-node/sql/migration_90_test.ts +++ b/ts/test-node/sql/migration_90_test.ts @@ -3,15 +3,15 @@ import { assert } from 'chai'; -import type { WritableDB } from '../../sql/Interface'; -import { sql } from '../../sql/util'; +import type { WritableDB } from '../../sql/Interface.js'; +import { sql } from '../../sql/util.js'; import { createDB, updateToVersion, insertData, getTableData, explain, -} from './helpers'; +} from './helpers.js'; describe('SQL/updateToSchemaVersion90', () => { let db: WritableDB; diff --git a/ts/test-node/sql/migration_91_test.ts b/ts/test-node/sql/migration_91_test.ts index c61215d019c..a4c1302756d 100644 --- a/ts/test-node/sql/migration_91_test.ts +++ b/ts/test-node/sql/migration_91_test.ts @@ -5,11 +5,16 @@ import { assert } from 'chai'; import { v4 as generateGuid } from 'uuid'; import { range } from 'lodash'; -import { createDB, getTableData, insertData, updateToVersion } from './helpers'; -import type { ServiceIdString } from '../../types/ServiceId'; -import { normalizePni } from '../../types/ServiceId'; -import { normalizeAci } from '../../util/normalizeAci'; -import type { WritableDB, PreKeyType } from '../../sql/Interface'; +import { + createDB, + getTableData, + insertData, + updateToVersion, +} from './helpers.js'; +import type { ServiceIdString } from '../../types/ServiceId.js'; +import { normalizePni } from '../../types/ServiceId.js'; +import { normalizeAci } from '../../util/normalizeAci.js'; +import type { WritableDB, PreKeyType } from '../../sql/Interface.js'; type TestingPreKey = Omit< PreKeyType, diff --git a/ts/test-node/sql/migration_920_test.ts b/ts/test-node/sql/migration_920_test.ts index d35d68a3d49..32288f40803 100644 --- a/ts/test-node/sql/migration_920_test.ts +++ b/ts/test-node/sql/migration_920_test.ts @@ -5,15 +5,15 @@ import { assert } from 'chai'; import { v4 as generateGuid } from 'uuid'; import { range } from 'lodash'; -import { createDB, insertData, updateToVersion } from './helpers'; -import type { ServiceIdString } from '../../types/ServiceId'; -import { normalizePni } from '../../types/ServiceId'; -import { normalizeAci } from '../../util/normalizeAci'; +import { createDB, insertData, updateToVersion } from './helpers.js'; +import type { ServiceIdString } from '../../types/ServiceId.js'; +import { normalizePni } from '../../types/ServiceId.js'; +import { normalizeAci } from '../../util/normalizeAci.js'; import type { WritableDB, KyberPreKeyType, SignedPreKeyType, -} from '../../sql/Interface'; +} from '../../sql/Interface.js'; type TestingKyberKey = Omit< KyberPreKeyType, diff --git a/ts/test-node/sql/migration_960_test.ts b/ts/test-node/sql/migration_960_test.ts index 17ced3a9252..7e4c84dbdb2 100644 --- a/ts/test-node/sql/migration_960_test.ts +++ b/ts/test-node/sql/migration_960_test.ts @@ -4,8 +4,13 @@ import { assert } from 'chai'; import { v4 as generateGuid } from 'uuid'; -import type { WritableDB } from '../../sql/Interface'; -import { createDB, updateToVersion, insertData, getTableData } from './helpers'; +import type { WritableDB } from '../../sql/Interface.js'; +import { + createDB, + updateToVersion, + insertData, + getTableData, +} from './helpers.js'; const CONVO_ID = generateGuid(); const OUR_ACI = generateGuid(); diff --git a/ts/test-node/sql/migration_990_test.ts b/ts/test-node/sql/migration_990_test.ts index c4af41f10e4..2e69b6770a8 100644 --- a/ts/test-node/sql/migration_990_test.ts +++ b/ts/test-node/sql/migration_990_test.ts @@ -3,8 +3,13 @@ import { assert } from 'chai'; -import type { WritableDB } from '../../sql/Interface'; -import { createDB, updateToVersion, insertData, getTableData } from './helpers'; +import type { WritableDB } from '../../sql/Interface.js'; +import { + createDB, + updateToVersion, + insertData, + getTableData, +} from './helpers.js'; describe('SQL/updateToSchemaVersion990', () => { let db: WritableDB; diff --git a/ts/test-node/sql/migrations_test.ts b/ts/test-node/sql/migrations_test.ts index 070df7c0aab..adafdb79ce7 100644 --- a/ts/test-node/sql/migrations_test.ts +++ b/ts/test-node/sql/migrations_test.ts @@ -4,15 +4,19 @@ import { assert } from 'chai'; import { v4 as generateGuid } from 'uuid'; -import { _storyIdPredicate, getJobsInQueue, insertJob } from '../../sql/Server'; -import type { WritableDB } from '../../sql/Interface'; -import { ReadStatus } from '../../messages/MessageReadStatus'; -import { SeenStatus } from '../../MessageSeenStatus'; -import { objectToJSON, sql, sqlJoin } from '../../sql/util'; -import { BodyRange } from '../../types/BodyRange'; -import type { AciString } from '../../types/ServiceId'; -import { generateAci } from '../../types/ServiceId'; -import { createDB, updateToVersion, explain } from './helpers'; +import { + _storyIdPredicate, + getJobsInQueue, + insertJob, +} from '../../sql/Server.js'; +import type { WritableDB } from '../../sql/Interface.js'; +import { ReadStatus } from '../../messages/MessageReadStatus.js'; +import { SeenStatus } from '../../MessageSeenStatus.js'; +import { objectToJSON, sql, sqlJoin } from '../../sql/util.js'; +import { BodyRange } from '../../types/BodyRange.js'; +import type { AciString } from '../../types/ServiceId.js'; +import { generateAci } from '../../types/ServiceId.js'; +import { createDB, updateToVersion, explain } from './helpers.js'; const OUR_UUID = generateGuid(); diff --git a/ts/test-node/state/ducks/audioPlayer_test.ts b/ts/test-node/state/ducks/audioPlayer_test.ts index cc1c415b3d2..15720bfe75c 100644 --- a/ts/test-node/state/ducks/audioPlayer_test.ts +++ b/ts/test-node/state/ducks/audioPlayer_test.ts @@ -3,17 +3,20 @@ import { assert } from 'chai'; -import type { TargetedConversationChangedActionType } from '../../../state/ducks/conversations'; +import type { TargetedConversationChangedActionType } from '../../../state/ducks/conversations.js'; import { TARGETED_CONVERSATION_CHANGED, actions as conversationsActions, -} from '../../../state/ducks/conversations'; -import { noopAction } from '../../../state/ducks/noop'; +} from '../../../state/ducks/conversations.js'; +import { noopAction } from '../../../state/ducks/noop.js'; -import type { StateType } from '../../../state/reducer'; -import { reducer as rootReducer } from '../../../state/reducer'; -import { actions, AudioPlayerContent } from '../../../state/ducks/audioPlayer'; -import type { VoiceNoteAndConsecutiveForPlayback } from '../../../state/selectors/audioPlayer'; +import type { StateType } from '../../../state/reducer.js'; +import { reducer as rootReducer } from '../../../state/reducer.js'; +import { + actions, + AudioPlayerContent, +} from '../../../state/ducks/audioPlayer.js'; +import type { VoiceNoteAndConsecutiveForPlayback } from '../../../state/selectors/audioPlayer.js'; const { messageDeleted, messageChanged } = conversationsActions; diff --git a/ts/test-node/state/ducks/badges_test.ts b/ts/test-node/state/ducks/badges_test.ts index d531d1bc4cc..d877a112e04 100644 --- a/ts/test-node/state/ducks/badges_test.ts +++ b/ts/test-node/state/ducks/badges_test.ts @@ -3,12 +3,12 @@ import { assert } from 'chai'; -import { getFakeBadge } from '../../../test-helpers/getFakeBadge'; -import { repeat, zipObject } from '../../../util/iterables'; -import { BadgeImageTheme } from '../../../badges/BadgeImageTheme'; +import { getFakeBadge } from '../../../test-helpers/getFakeBadge.js'; +import { repeat, zipObject } from '../../../util/iterables.js'; +import { BadgeImageTheme } from '../../../badges/BadgeImageTheme.js'; -import type { BadgesStateType } from '../../../state/ducks/badges'; -import { actions, reducer } from '../../../state/ducks/badges'; +import type { BadgesStateType } from '../../../state/ducks/badges.js'; +import { actions, reducer } from '../../../state/ducks/badges.js'; describe('both/state/ducks/badges', () => { describe('badgeImageFileDownloaded', () => { diff --git a/ts/test-node/state/ducks/composer_test.ts b/ts/test-node/state/ducks/composer_test.ts index 89d383f6051..91bb69b17ad 100644 --- a/ts/test-node/state/ducks/composer_test.ts +++ b/ts/test-node/state/ducks/composer_test.ts @@ -6,19 +6,19 @@ import * as sinon from 'sinon'; import { noop } from 'lodash'; import { v4 as generateUuid } from 'uuid'; -import type { ReduxActions } from '../../../state/types'; +import type { ReduxActions } from '../../../state/types.js'; import { actions, getComposerStateForConversation, getEmptyState, reducer, -} from '../../../state/ducks/composer'; -import { noopAction } from '../../../state/ducks/noop'; -import { reducer as rootReducer } from '../../../state/reducer'; +} from '../../../state/ducks/composer.js'; +import { noopAction } from '../../../state/ducks/noop.js'; +import { reducer as rootReducer } from '../../../state/reducer.js'; -import { IMAGE_JPEG } from '../../../types/MIME'; -import type { AttachmentDraftType } from '../../../types/Attachment'; -import { fakeDraftAttachment } from '../../../test-helpers/fakeAttachment'; +import { IMAGE_JPEG } from '../../../types/MIME.js'; +import type { AttachmentDraftType } from '../../../types/Attachment.js'; +import { fakeDraftAttachment } from '../../../test-helpers/fakeAttachment.js'; describe('both/state/ducks/composer', () => { const QUOTED_MESSAGE = { diff --git a/ts/test-node/state/ducks/donations_test.ts b/ts/test-node/state/ducks/donations_test.ts index b5205054fd9..5af94c1b485 100644 --- a/ts/test-node/state/ducks/donations_test.ts +++ b/ts/test-node/state/ducks/donations_test.ts @@ -4,15 +4,15 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; -import type { StateType } from '../../../state/reducer'; -import { reducer as rootReducer } from '../../../state/reducer'; -import { noopAction } from '../../../state/ducks/noop'; -import { applyDonationBadge } from '../../../state/ducks/donations'; -import * as conversations from '../../../state/ducks/conversations'; -import type { BadgeType } from '../../../badges/types'; -import { BadgeCategory } from '../../../badges/BadgeCategory'; -import type { ConversationType } from '../../../state/ducks/conversations'; -import { generateAci } from '../../../types/ServiceId'; +import type { StateType } from '../../../state/reducer.js'; +import { reducer as rootReducer } from '../../../state/reducer.js'; +import { noopAction } from '../../../state/ducks/noop.js'; +import { applyDonationBadge } from '../../../state/ducks/donations.js'; +import * as conversations from '../../../state/ducks/conversations.js'; +import type { BadgeType } from '../../../badges/types.js'; +import { BadgeCategory } from '../../../badges/BadgeCategory.js'; +import type { ConversationType } from '../../../state/ducks/conversations.js'; +import { generateAci } from '../../../types/ServiceId.js'; describe('donations duck', () => { const getEmptyRootState = (): StateType => diff --git a/ts/test-node/state/ducks/globalModals_test.ts b/ts/test-node/state/ducks/globalModals_test.ts index 1d5dde93fd6..05d1fb4432b 100644 --- a/ts/test-node/state/ducks/globalModals_test.ts +++ b/ts/test-node/state/ducks/globalModals_test.ts @@ -7,7 +7,7 @@ import { actions, getEmptyState, reducer, -} from '../../../state/ducks/globalModals'; +} from '../../../state/ducks/globalModals.js'; describe('both/state/ducks/globalModals', () => { describe('showWhatsNewModal/hideWhatsNewModal', () => { diff --git a/ts/test-node/state/ducks/linkPreviews_test.ts b/ts/test-node/state/ducks/linkPreviews_test.ts index dae781e5055..c11f81d7c1d 100644 --- a/ts/test-node/state/ducks/linkPreviews_test.ts +++ b/ts/test-node/state/ducks/linkPreviews_test.ts @@ -7,8 +7,8 @@ import { actions, getEmptyState, reducer, -} from '../../../state/ducks/linkPreviews'; -import type { LinkPreviewForUIType } from '../../../types/message/LinkPreviews'; +} from '../../../state/ducks/linkPreviews.js'; +import type { LinkPreviewForUIType } from '../../../types/message/LinkPreviews.js'; describe('both/state/ducks/linkPreviews', () => { function getMockLinkPreview(): LinkPreviewForUIType { diff --git a/ts/test-node/state/ducks/network_test.ts b/ts/test-node/state/ducks/network_test.ts index 4b0224a890a..cd3efe5ebc5 100644 --- a/ts/test-node/state/ducks/network_test.ts +++ b/ts/test-node/state/ducks/network_test.ts @@ -3,7 +3,11 @@ import { assert } from 'chai'; -import { actions, getEmptyState, reducer } from '../../../state/ducks/network'; +import { + actions, + getEmptyState, + reducer, +} from '../../../state/ducks/network.js'; describe('both/state/ducks/network', () => { describe('setChallengeStatus', () => { diff --git a/ts/test-node/state/ducks/preferredReactions_test.ts b/ts/test-node/state/ducks/preferredReactions_test.ts index 340e6b516f4..e4b0897ddc5 100644 --- a/ts/test-node/state/ducks/preferredReactions_test.ts +++ b/ts/test-node/state/ducks/preferredReactions_test.ts @@ -3,17 +3,17 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; -import type { StateType } from '../../../state/reducer'; -import { reducer as rootReducer } from '../../../state/reducer'; -import { noopAction } from '../../../state/ducks/noop'; +import type { StateType } from '../../../state/reducer.js'; +import { reducer as rootReducer } from '../../../state/reducer.js'; +import { noopAction } from '../../../state/ducks/noop.js'; -import type { PreferredReactionsStateType } from '../../../state/ducks/preferredReactions'; +import type { PreferredReactionsStateType } from '../../../state/ducks/preferredReactions.js'; import { actions, getEmptyState, reducer, -} from '../../../state/ducks/preferredReactions'; -import { EmojiSkinTone } from '../../../components/fun/data/emojis'; +} from '../../../state/ducks/preferredReactions.js'; +import { EmojiSkinTone } from '../../../components/fun/data/emojis.js'; describe('preferred reactions duck', () => { const getEmptyRootState = (): StateType => diff --git a/ts/test-node/state/selectors/conversations_test.ts b/ts/test-node/state/selectors/conversations_test.ts index e31bb3765fd..7d5d4e31e5f 100644 --- a/ts/test-node/state/selectors/conversations_test.ts +++ b/ts/test-node/state/selectors/conversations_test.ts @@ -8,12 +8,12 @@ import { ComposerStep, ConversationVerificationState, OneTimeModalState, -} from '../../../state/ducks/conversationsEnums'; +} from '../../../state/ducks/conversationsEnums.js'; import type { ConversationLookupType, ConversationType, -} from '../../../state/ducks/conversations'; -import { getEmptyState } from '../../../state/ducks/conversations'; +} from '../../../state/ducks/conversations.js'; +import { getEmptyState } from '../../../state/ducks/conversations.js'; import { _getConversationComparator, _getLeftPaneLists, @@ -42,24 +42,24 @@ import { getSelectedConversationId, hasGroupCreationError, isCreatingGroup, -} from '../../../state/selectors/conversations'; -import { noopAction } from '../../../state/ducks/noop'; -import type { StateType } from '../../../state/reducer'; -import { reducer as rootReducer } from '../../../state/reducer'; -import { setupI18n } from '../../../util/setupI18n'; -import type { ServiceIdString } from '../../../types/ServiceId'; -import { generateAci, getAciFromPrefix } from '../../../types/ServiceId'; +} from '../../../state/selectors/conversations.js'; +import { noopAction } from '../../../state/ducks/noop.js'; +import type { StateType } from '../../../state/reducer.js'; +import { reducer as rootReducer } from '../../../state/reducer.js'; +import { setupI18n } from '../../../util/setupI18n.js'; +import type { ServiceIdString } from '../../../types/ServiceId.js'; +import { generateAci, getAciFromPrefix } from '../../../types/ServiceId.js'; import enMessages from '../../../../_locales/en/messages.json'; import { getDefaultConversation, getDefaultGroup, getDefaultConversationWithServiceId, -} from '../../../test-helpers/getDefaultConversation'; +} from '../../../test-helpers/getDefaultConversation.js'; import { defaultStartDirectConversationComposerState, defaultChooseGroupMembersComposerState, defaultSetGroupMetadataComposerState, -} from '../../../test-helpers/defaultComposerStates'; +} from '../../../test-helpers/defaultComposerStates.js'; describe('both/state/selectors/conversations-extra', () => { const SERVICE_ID_1 = generateAci(); diff --git a/ts/test-node/state/selectors/items_test.ts b/ts/test-node/state/selectors/items_test.ts index 844b402c128..1413c3d1cbf 100644 --- a/ts/test-node/state/selectors/items_test.ts +++ b/ts/test-node/state/selectors/items_test.ts @@ -8,13 +8,13 @@ import { getPinnedConversationIds, getPreferredLeftPaneWidth, getPreferredReactionEmoji, -} from '../../../state/selectors/items'; -import type { StateType } from '../../../state/reducer'; -import type { ItemsStateType } from '../../../state/ducks/items'; +} from '../../../state/selectors/items.js'; +import type { StateType } from '../../../state/reducer.js'; +import type { ItemsStateType } from '../../../state/ducks/items.js'; import { EMOJI_SKIN_TONE_ORDER, EmojiSkinTone, -} from '../../../components/fun/data/emojis'; +} from '../../../components/fun/data/emojis.js'; describe('both/state/selectors/items', () => { // Note: we would like to use the full reducer here, to get a real empty state object diff --git a/ts/test-node/state/selectors/preferredReactions_test.ts b/ts/test-node/state/selectors/preferredReactions_test.ts index 0564e792c1b..8faaee87264 100644 --- a/ts/test-node/state/selectors/preferredReactions_test.ts +++ b/ts/test-node/state/selectors/preferredReactions_test.ts @@ -2,12 +2,12 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { reducer as rootReducer } from '../../../state/reducer'; -import { noopAction } from '../../../state/ducks/noop'; -import type { StateType } from '../../../state/reducer'; -import type { PreferredReactionsStateType } from '../../../state/ducks/preferredReactions'; +import { reducer as rootReducer } from '../../../state/reducer.js'; +import { noopAction } from '../../../state/ducks/noop.js'; +import type { StateType } from '../../../state/reducer.js'; +import type { PreferredReactionsStateType } from '../../../state/ducks/preferredReactions.js'; -import { getIsCustomizingPreferredReactions } from '../../../state/selectors/preferredReactions'; +import { getIsCustomizingPreferredReactions } from '../../../state/selectors/preferredReactions.js'; describe('both/state/selectors/preferredReactions', () => { const getEmptyRootState = (): StateType => diff --git a/ts/test-node/state/selectors/search_test.ts b/ts/test-node/state/selectors/search_test.ts index 12d99a81c70..1b54cac0f34 100644 --- a/ts/test-node/state/selectors/search_test.ts +++ b/ts/test-node/state/selectors/search_test.ts @@ -7,29 +7,29 @@ import sinon from 'sinon'; import type { ConversationType, MessageType, -} from '../../../state/ducks/conversations'; -import { getEmptyState as getEmptyConversationState } from '../../../state/ducks/conversations'; -import { noopAction } from '../../../state/ducks/noop'; -import type { MessageSearchResultType } from '../../../state/ducks/search'; -import { getEmptyState as getEmptySearchState } from '../../../state/ducks/search'; -import { getEmptyState as getEmptyUserState } from '../../../state/ducks/user'; +} from '../../../state/ducks/conversations.js'; +import { getEmptyState as getEmptyConversationState } from '../../../state/ducks/conversations.js'; +import { noopAction } from '../../../state/ducks/noop.js'; +import type { MessageSearchResultType } from '../../../state/ducks/search.js'; +import { getEmptyState as getEmptySearchState } from '../../../state/ducks/search.js'; +import { getEmptyState as getEmptyUserState } from '../../../state/ducks/user.js'; import { getIsSearching, getIsSearchingGlobally, getIsSearchingInAConversation, getMessageSearchResultSelector, getSearchResults, -} from '../../../state/selectors/search'; -import { makeLookup } from '../../../util/makeLookup'; -import { generateAci } from '../../../types/ServiceId'; +} from '../../../state/selectors/search.js'; +import { makeLookup } from '../../../util/makeLookup.js'; +import { generateAci } from '../../../types/ServiceId.js'; import { getDefaultConversation, getDefaultConversationWithServiceId, -} from '../../../test-helpers/getDefaultConversation'; -import { ReadStatus } from '../../../messages/MessageReadStatus'; +} from '../../../test-helpers/getDefaultConversation.js'; +import { ReadStatus } from '../../../messages/MessageReadStatus.js'; -import type { StateType } from '../../../state/reducer'; -import { reducer as rootReducer } from '../../../state/reducer'; +import type { StateType } from '../../../state/reducer.js'; +import { reducer as rootReducer } from '../../../state/reducer.js'; describe('both/state/selectors/search', () => { const NOW = 1_000_000; diff --git a/ts/test-node/state/selectors/user_test.ts b/ts/test-node/state/selectors/user_test.ts index f8f7eac5c52..12e9c8999bd 100644 --- a/ts/test-node/state/selectors/user_test.ts +++ b/ts/test-node/state/selectors/user_test.ts @@ -3,11 +3,11 @@ import { assert } from 'chai'; -import type { StateType } from '../../../state/reducer'; -import type { UserStateType } from '../../../state/ducks/user'; -import { getEmptyState } from '../../../state/ducks/user'; +import type { StateType } from '../../../state/reducer.js'; +import type { UserStateType } from '../../../state/ducks/user.js'; +import { getEmptyState } from '../../../state/ducks/user.js'; -import { getIsNightly, getIsBeta } from '../../../state/selectors/user'; +import { getIsNightly, getIsBeta } from '../../../state/selectors/user.js'; describe('both/state/selectors/user', () => { function getRootState( diff --git a/ts/test-node/types/Attachment_test.ts b/ts/test-node/types/Attachment_test.ts index 75a1487427a..424cf753e9f 100644 --- a/ts/test-node/types/Attachment_test.ts +++ b/ts/test-node/types/Attachment_test.ts @@ -3,15 +3,15 @@ import { assert } from 'chai'; -import * as Attachment from '../../types/Attachment'; -import * as MIME from '../../types/MIME'; -import { SignalService } from '../../protobuf'; -import * as Bytes from '../../Bytes'; -import { createLogger } from '../../logging/log'; +import * as Attachment from '../../types/Attachment.js'; +import * as MIME from '../../types/MIME.js'; +import { SignalService } from '../../protobuf/index.js'; +import * as Bytes from '../../Bytes.js'; +import { createLogger } from '../../logging/log.js'; -import { fakeAttachment } from '../../test-helpers/fakeAttachment'; -import { DAY } from '../../util/durations'; -import { migrateDataToFileSystem } from '../../util/attachments/migrateDataToFilesystem'; +import { fakeAttachment } from '../../test-helpers/fakeAttachment.js'; +import { DAY } from '../../util/durations/index.js'; +import { migrateDataToFileSystem } from '../../util/attachments/migrateDataToFilesystem.js'; const logger = createLogger('Attachment_test'); diff --git a/ts/test-node/types/Avatar_test.ts b/ts/test-node/types/Avatar_test.ts index 5f11481379c..4eaf45d5b92 100644 --- a/ts/test-node/types/Avatar_test.ts +++ b/ts/test-node/types/Avatar_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { getDefaultAvatars } from '../../types/Avatar'; +import { getDefaultAvatars } from '../../types/Avatar.js'; describe('Avatar', () => { describe('getDefaultAvatars', () => { diff --git a/ts/test-node/types/BodyRange_test.ts b/ts/test-node/types/BodyRange_test.ts index 6b557c84d41..bdd3d23aae2 100644 --- a/ts/test-node/types/BodyRange_test.ts +++ b/ts/test-node/types/BodyRange_test.ts @@ -5,7 +5,7 @@ import { assert } from 'chai'; import type { HydratedBodyRangeMention, RangeNode, -} from '../../types/BodyRange'; +} from '../../types/BodyRange.js'; import { BodyRange, DisplayStyle, @@ -15,8 +15,8 @@ import { insertRange, processBodyRangesForSearchResult, trimMessageWhitespace, -} from '../../types/BodyRange'; -import { generateAci } from '../../types/ServiceId'; +} from '../../types/BodyRange.js'; +import { generateAci } from '../../types/ServiceId.js'; const SERVICE_ID_1 = generateAci(); const SERVICE_ID_2 = generateAci(); diff --git a/ts/test-node/types/DonationsCardForm_test.ts b/ts/test-node/types/DonationsCardForm_test.ts index 1fc04dfb349..bb776678c85 100644 --- a/ts/test-node/types/DonationsCardForm_test.ts +++ b/ts/test-node/types/DonationsCardForm_test.ts @@ -6,7 +6,7 @@ import type { CardFormFields, CardFormResult, CardFormSettings, -} from '../../types/DonationsCardForm'; +} from '../../types/DonationsCardForm.js'; import { CardCvcError, CardExpirationError, @@ -19,8 +19,8 @@ import { parseCardExpiration, parseCardForm, parseCardNumber, -} from '../../types/DonationsCardForm'; -import type { CardDetail } from '../../types/Donations'; +} from '../../types/DonationsCardForm.js'; +import type { CardDetail } from '../../types/Donations.js'; function testCard(cardNumber: string, cvcSize: number) { return { cardNumber, cvcSize }; diff --git a/ts/test-node/types/EmbeddedContact_test.ts b/ts/test-node/types/EmbeddedContact_test.ts index 8c289b3aaae..7c1eb07b15c 100644 --- a/ts/test-node/types/EmbeddedContact_test.ts +++ b/ts/test-node/types/EmbeddedContact_test.ts @@ -4,10 +4,10 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; -import { createLogger } from '../../logging/log'; -import { IMAGE_GIF, IMAGE_PNG } from '../../types/MIME'; -import type { MessageAttributesType } from '../../model-types.d'; -import type { Avatar, Email, Phone } from '../../types/EmbeddedContact'; +import { createLogger } from '../../logging/log.js'; +import { IMAGE_GIF, IMAGE_PNG } from '../../types/MIME.js'; +import type { MessageAttributesType } from '../../model-types.d.ts'; +import type { Avatar, Email, Phone } from '../../types/EmbeddedContact.js'; import { _validate, ContactFormType, @@ -15,9 +15,9 @@ import { getName, parseAndWriteAvatar, parsePhoneItem, -} from '../../types/EmbeddedContact'; -import { fakeAttachment } from '../../test-helpers/fakeAttachment'; -import { generateAci } from '../../types/ServiceId'; +} from '../../types/EmbeddedContact.js'; +import { fakeAttachment } from '../../test-helpers/fakeAttachment.js'; +import { generateAci } from '../../types/ServiceId.js'; const logger = createLogger('EmbeddedContact_test'); diff --git a/ts/test-node/types/LinkPreview_test.ts b/ts/test-node/types/LinkPreview_test.ts index 5c9153d8e12..d8a28877490 100644 --- a/ts/test-node/types/LinkPreview_test.ts +++ b/ts/test-node/types/LinkPreview_test.ts @@ -9,7 +9,7 @@ import { isValidLink, shouldLinkifyMessage, shouldPreviewHref, -} from '../../types/LinkPreview'; +} from '../../types/LinkPreview.js'; describe('Link previews', () => { describe('#isValidLink', () => { diff --git a/ts/test-node/types/MIME_test.ts b/ts/test-node/types/MIME_test.ts index 70ef29d02c7..c249483e873 100644 --- a/ts/test-node/types/MIME_test.ts +++ b/ts/test-node/types/MIME_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import * as MIME from '../../types/MIME'; +import * as MIME from '../../types/MIME.js'; describe('MIME', () => { describe('isGif', () => { diff --git a/ts/test-node/types/Message2_test.ts b/ts/test-node/types/Message2_test.ts index d8da132eac5..2ae61c32815 100644 --- a/ts/test-node/types/Message2_test.ts +++ b/ts/test-node/types/Message2_test.ts @@ -4,19 +4,19 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; -import * as Message from '../../types/Message2'; -import { SignalService } from '../../protobuf'; -import * as Bytes from '../../Bytes'; -import * as MIME from '../../types/MIME'; +import * as Message from '../../types/Message2.js'; +import { SignalService } from '../../protobuf/index.js'; +import * as Bytes from '../../Bytes.js'; +import * as MIME from '../../types/MIME.js'; -import type { EmbeddedContactType } from '../../types/EmbeddedContact'; -import type { MessageAttributesType } from '../../model-types.d'; +import type { EmbeddedContactType } from '../../types/EmbeddedContact.js'; +import type { MessageAttributesType } from '../../model-types.d.ts'; import type { AddressableAttachmentType, AttachmentType, LocalAttachmentV2Type, -} from '../../types/Attachment'; -import type { LoggerType } from '../../types/Logging'; +} from '../../types/Attachment.js'; +import type { LoggerType } from '../../types/Logging.js'; const FAKE_LOCAL_ATTACHMENT: LocalAttachmentV2Type = { version: 2, diff --git a/ts/test-node/types/NotificationProfile_test.ts b/ts/test-node/types/NotificationProfile_test.ts index c980b68f6f6..79f52160146 100644 --- a/ts/test-node/types/NotificationProfile_test.ts +++ b/ts/test-node/types/NotificationProfile_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { DAY, HOUR, MINUTE } from '../../util/durations'; +import { DAY, HOUR, MINUTE } from '../../util/durations/index.js'; import { DayOfWeek, @@ -12,13 +12,13 @@ import { getMidnight, loopThroughWeek, sortProfiles, -} from '../../types/NotificationProfile'; -import { generateNotificationProfileId } from '../../types/NotificationProfile-node'; +} from '../../types/NotificationProfile.js'; +import { generateNotificationProfileId } from '../../types/NotificationProfile-node.js'; import type { NextProfileEvent, NotificationProfileType, -} from '../../types/NotificationProfile'; +} from '../../types/NotificationProfile.js'; describe('NotificationProfile', () => { const startingTime = Date.now(); diff --git a/ts/test-node/types/PhoneNumber_test.ts b/ts/test-node/types/PhoneNumber_test.ts index aa22c3993c8..def73416364 100644 --- a/ts/test-node/types/PhoneNumber_test.ts +++ b/ts/test-node/types/PhoneNumber_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { getCountryCode } from '../../types/PhoneNumber'; +import { getCountryCode } from '../../types/PhoneNumber.js'; describe('types/PhoneNumber', () => { describe('#getCountryCode', () => { diff --git a/ts/test-node/types/SchemaVersion_test.ts b/ts/test-node/types/SchemaVersion_test.ts index 172ca411c4d..19a799ddb2c 100644 --- a/ts/test-node/types/SchemaVersion_test.ts +++ b/ts/test-node/types/SchemaVersion_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { isValid } from '../../types/SchemaVersion'; +import { isValid } from '../../types/SchemaVersion.js'; describe('SchemaVersion', () => { describe('isValid', () => { diff --git a/ts/test-node/types/Settings_test.ts b/ts/test-node/types/Settings_test.ts index e875d83b211..b8398ed8b3e 100644 --- a/ts/test-node/types/Settings_test.ts +++ b/ts/test-node/types/Settings_test.ts @@ -1,13 +1,13 @@ // Copyright 2018 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import os from 'os'; +import os from 'node:os'; import Sinon from 'sinon'; import { assert } from 'chai'; -import { getOSFunctions } from '../../util/os/shared'; -import * as Settings from '../../types/Settings'; -import { SystemTraySetting } from '../../types/SystemTraySetting'; +import { getOSFunctions } from '../../util/os/shared.js'; +import * as Settings from '../../types/Settings.js'; +import { SystemTraySetting } from '../../types/SystemTraySetting.js'; describe('Settings', () => { let sandbox: Sinon.SinonSandbox; diff --git a/ts/test-node/types/Stickers_test.ts b/ts/test-node/types/Stickers_test.ts index 2e39c8fdea6..3569ce0ace8 100644 --- a/ts/test-node/types/Stickers_test.ts +++ b/ts/test-node/types/Stickers_test.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import * as Stickers from '../../types/Stickers'; +import * as Stickers from '../../types/Stickers.js'; describe('Stickers', () => { describe('getDataFromLink', () => { diff --git a/ts/test-node/types/StoryDistributionId_test.ts b/ts/test-node/types/StoryDistributionId_test.ts index 7dc576de53f..757d2e84a8e 100644 --- a/ts/test-node/types/StoryDistributionId_test.ts +++ b/ts/test-node/types/StoryDistributionId_test.ts @@ -5,8 +5,8 @@ import { assert } from 'chai'; import { v4 as generateUuid } from 'uuid'; import * as sinon from 'sinon'; -import type { LoggerType } from '../../types/Logging'; -import { normalizeStoryDistributionId } from '../../types/StoryDistributionId'; +import type { LoggerType } from '../../types/Logging.js'; +import { normalizeStoryDistributionId } from '../../types/StoryDistributionId.js'; describe('StoryDistributionId', () => { let warn: sinon.SinonStub; diff --git a/ts/test-node/types/SystemTraySetting_test.ts b/ts/test-node/types/SystemTraySetting_test.ts index 9bd6e2c0d36..51083affb63 100644 --- a/ts/test-node/types/SystemTraySetting_test.ts +++ b/ts/test-node/types/SystemTraySetting_test.ts @@ -7,7 +7,7 @@ import { SystemTraySetting, parseSystemTraySetting, shouldMinimizeToSystemTray, -} from '../../types/SystemTraySetting'; +} from '../../types/SystemTraySetting.js'; describe('system tray setting utilities', () => { describe('shouldMinimizeToSystemTray', () => { diff --git a/ts/test-node/types/errors_test.ts b/ts/test-node/types/errors_test.ts index bdff074c9c8..397a900c01d 100644 --- a/ts/test-node/types/errors_test.ts +++ b/ts/test-node/types/errors_test.ts @@ -1,9 +1,9 @@ // Copyright 2018 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import * as Path from 'path'; +import * as Path from 'node:path'; import { assert } from 'chai'; -import * as Errors from '../../types/errors'; +import * as Errors from '../../types/errors.js'; const APP_ROOT_PATH = Path.join(__dirname, '..', '..', '..'); diff --git a/ts/test-node/types/setupI18n_test.ts b/ts/test-node/types/setupI18n_test.ts index 004884f022e..4271aed77ab 100644 --- a/ts/test-node/types/setupI18n_test.ts +++ b/ts/test-node/types/setupI18n_test.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import type { LocalizerType } from '../../types/Util'; -import { setupI18n } from '../../util/setupI18n'; +import type { LocalizerType } from '../../types/Util.js'; +import { setupI18n } from '../../util/setupI18n.js'; import * as enMessages from '../../../_locales/en/messages.json'; describe('setupI18n', () => { diff --git a/ts/test-node/updater/common_test.ts b/ts/test-node/updater/common_test.ts index c6b278c2854..bbcd024f5b3 100644 --- a/ts/test-node/updater/common_test.ts +++ b/ts/test-node/updater/common_test.ts @@ -3,8 +3,8 @@ import { assert } from 'chai'; import { pathExists } from 'fs-extra'; -import { stat, mkdir } from 'fs/promises'; -import { join } from 'path'; +import { stat, mkdir } from 'node:fs/promises'; +import { join } from 'node:path'; import { createUpdateCacheDirIfNeeded, @@ -16,8 +16,8 @@ import { createTempDir, getTempDir, deleteTempDir, -} from '../../updater/common'; -import { createLogger } from '../../logging/log'; +} from '../../updater/common.js'; +import { createLogger } from '../../logging/log.js'; const log = createLogger('common_test'); diff --git a/ts/test-node/updater/curve_test.ts b/ts/test-node/updater/curve_test.ts index 1d00284bf40..06b0a9535ef 100644 --- a/ts/test-node/updater/curve_test.ts +++ b/ts/test-node/updater/curve_test.ts @@ -4,7 +4,7 @@ import { assert } from 'chai'; import config from 'config'; -import { keyPair, sign, verify } from '../../updater/curve'; +import { keyPair, sign, verify } from '../../updater/curve.js'; describe('updater/curve', () => { it('roundtrips', () => { diff --git a/ts/test-node/updater/differential_test.ts b/ts/test-node/updater/differential_test.ts index 327548ba85b..050bcbed863 100644 --- a/ts/test-node/updater/differential_test.ts +++ b/ts/test-node/updater/differential_test.ts @@ -2,21 +2,21 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import path from 'path'; -import http from 'http'; -import fs from 'fs/promises'; -import { tmpdir } from 'os'; +import path from 'node:path'; +import http from 'node:http'; +import fs from 'node:fs/promises'; +import { tmpdir } from 'node:os'; -import { strictAssert } from '../../util/assert'; -import * as durations from '../../util/durations'; -import { getGotOptions } from '../../updater/got'; +import { strictAssert } from '../../util/assert.js'; +import * as durations from '../../util/durations/index.js'; +import { getGotOptions } from '../../updater/got.js'; import { computeDiff, getBlockMapFileName, prepareDownload, isValidPreparedData, download, -} from '../../updater/differential'; +} from '../../updater/differential.js'; const FIXTURES = path.join(__dirname, '..', '..', '..', 'fixtures'); const CRLF = '\r\n'; diff --git a/ts/test-node/updater/signature_test.ts b/ts/test-node/updater/signature_test.ts index 42a5ec30937..daafaa23665 100644 --- a/ts/test-node/updater/signature_test.ts +++ b/ts/test-node/updater/signature_test.ts @@ -1,8 +1,8 @@ // Copyright 2019 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { existsSync } from 'fs'; -import { join } from 'path'; +import { existsSync } from 'node:fs'; +import { join } from 'node:path'; import { assert } from 'chai'; import { copy } from 'fs-extra'; @@ -14,10 +14,10 @@ import { verifySignature, writeHexToPath, writeSignature, -} from '../../updater/signature'; -import { createTempDir, deleteTempDir } from '../../updater/common'; -import { keyPair } from '../../updater/curve'; -import { createLogger } from '../../logging/log'; +} from '../../updater/signature.js'; +import { createTempDir, deleteTempDir } from '../../updater/common.js'; +import { keyPair } from '../../updater/curve.js'; +import { createLogger } from '../../logging/log.js'; const log = createLogger('signature_test'); diff --git a/ts/test-node/updater/util_test.ts b/ts/test-node/updater/util_test.ts index eaa68bee632..2ffc9278f7d 100644 --- a/ts/test-node/updater/util_test.ts +++ b/ts/test-node/updater/util_test.ts @@ -3,9 +3,9 @@ import { assert } from 'chai'; -import { isTimeToUpdate } from '../../updater/util'; -import { HOUR } from '../../util/durations'; -import { createLogger } from '../../logging/log'; +import { isTimeToUpdate } from '../../updater/util.js'; +import { HOUR } from '../../util/durations/index.js'; +import { createLogger } from '../../logging/log.js'; const logger = createLogger('util_test'); diff --git a/ts/test-node/util/AbortableProcess_test.ts b/ts/test-node/util/AbortableProcess_test.ts index 6492fc64b9c..a3e465a93b0 100644 --- a/ts/test-node/util/AbortableProcess_test.ts +++ b/ts/test-node/util/AbortableProcess_test.ts @@ -4,7 +4,7 @@ import { assert } from 'chai'; import { noop } from 'lodash'; -import { AbortableProcess } from '../../util/AbortableProcess'; +import { AbortableProcess } from '../../util/AbortableProcess.js'; describe('AbortableProcess', () => { it('resolves the result normally', async () => { diff --git a/ts/test-node/util/BackOff_test.ts b/ts/test-node/util/BackOff_test.ts index de53b67c982..aaa09611800 100644 --- a/ts/test-node/util/BackOff_test.ts +++ b/ts/test-node/util/BackOff_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { BackOff } from '../../util/BackOff'; +import { BackOff } from '../../util/BackOff.js'; describe('BackOff', () => { it('should return increasing timeouts', () => { diff --git a/ts/test-node/util/Bytes_test.ts b/ts/test-node/util/Bytes_test.ts index e344aaeb0f8..7ea5d27d4a4 100644 --- a/ts/test-node/util/Bytes_test.ts +++ b/ts/test-node/util/Bytes_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import * as Bytes from '../../Bytes'; +import * as Bytes from '../../Bytes.js'; describe('Bytes', () => { it('converts to base64 and back', () => { diff --git a/ts/test-node/util/DelimitedStream_test.ts b/ts/test-node/util/DelimitedStream_test.ts index 59a91922ddf..f0d400985e8 100644 --- a/ts/test-node/util/DelimitedStream_test.ts +++ b/ts/test-node/util/DelimitedStream_test.ts @@ -2,11 +2,11 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { Readable, Writable } from 'stream'; -import { pipeline } from 'stream/promises'; +import { Readable, Writable } from 'node:stream'; +import { pipeline } from 'node:stream/promises'; import { BufferWriter } from 'protobufjs'; -import { DelimitedStream } from '../../util/DelimitedStream'; +import { DelimitedStream } from '../../util/DelimitedStream.js'; describe('DelimitedStream', () => { function collect(out: Array): Writable { diff --git a/ts/test-node/util/LatestQueue_test.ts b/ts/test-node/util/LatestQueue_test.ts index 65d0ae75aae..53d1428ac8b 100644 --- a/ts/test-node/util/LatestQueue_test.ts +++ b/ts/test-node/util/LatestQueue_test.ts @@ -3,7 +3,7 @@ import * as sinon from 'sinon'; -import { LatestQueue } from '../../util/LatestQueue'; +import { LatestQueue } from '../../util/LatestQueue.js'; describe('LatestQueue', () => { it('if the queue is empty, new tasks are started immediately', done => { diff --git a/ts/test-node/util/appendMacStream_test.ts b/ts/test-node/util/appendMacStream_test.ts index ec1e9c549b8..be5c8aee293 100644 --- a/ts/test-node/util/appendMacStream_test.ts +++ b/ts/test-node/util/appendMacStream_test.ts @@ -2,14 +2,14 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { randomBytes, createHmac } from 'crypto'; +import { randomBytes, createHmac } from 'node:crypto'; import { appendMacStream, MAC_KEY_SIZE, MAC_SIZE, -} from '../../util/appendMacStream'; -import { generateConfigMatrix } from '../../util/generateConfigMatrix'; +} from '../../util/appendMacStream.js'; +import { generateConfigMatrix } from '../../util/generateConfigMatrix.js'; describe('appendMacStream', () => { generateConfigMatrix({ diff --git a/ts/test-node/util/areObjectEntriesEqual_test.ts b/ts/test-node/util/areObjectEntriesEqual_test.ts index e6f6f760c42..2aec73d8f85 100644 --- a/ts/test-node/util/areObjectEntriesEqual_test.ts +++ b/ts/test-node/util/areObjectEntriesEqual_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { areObjectEntriesEqual } from '../../util/areObjectEntriesEqual'; +import { areObjectEntriesEqual } from '../../util/areObjectEntriesEqual.js'; describe('areObjectEntriesEqual', () => { type TestObject = { foo?: number; bar?: number }; diff --git a/ts/test-node/util/arePinnedConversationsEqual_test.ts b/ts/test-node/util/arePinnedConversationsEqual_test.ts index 12850146f61..368f43da596 100644 --- a/ts/test-node/util/arePinnedConversationsEqual_test.ts +++ b/ts/test-node/util/arePinnedConversationsEqual_test.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { arePinnedConversationsEqual } from '../../util/arePinnedConversationsEqual'; -import { SignalService as Proto } from '../../protobuf'; +import { arePinnedConversationsEqual } from '../../util/arePinnedConversationsEqual.js'; +import { SignalService as Proto } from '../../protobuf/index.js'; import PinnedConversation = Proto.AccountRecord.IPinnedConversation; diff --git a/ts/test-node/util/assert_test.ts b/ts/test-node/util/assert_test.ts index 5a25da4def0..19af8580e26 100644 --- a/ts/test-node/util/assert_test.ts +++ b/ts/test-node/util/assert_test.ts @@ -3,7 +3,7 @@ import { assert as chaiAssert } from 'chai'; -import { assertDev, strictAssert } from '../../util/assert'; +import { assertDev, strictAssert } from '../../util/assert.js'; describe('assert utilities', () => { describe('assert', () => { diff --git a/ts/test-node/util/assignWithNoUnnecessaryAllocation_test.ts b/ts/test-node/util/assignWithNoUnnecessaryAllocation_test.ts index ab4c71a9b95..ae8a1b9db89 100644 --- a/ts/test-node/util/assignWithNoUnnecessaryAllocation_test.ts +++ b/ts/test-node/util/assignWithNoUnnecessaryAllocation_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { assignWithNoUnnecessaryAllocation } from '../../util/assignWithNoUnnecessaryAllocation'; +import { assignWithNoUnnecessaryAllocation } from '../../util/assignWithNoUnnecessaryAllocation.js'; describe('assignWithNoUnnecessaryAllocation', () => { type Person = { diff --git a/ts/test-node/util/asyncIterables_test.ts b/ts/test-node/util/asyncIterables_test.ts index 5ccd9d3e2c5..ee5a2d5ddb7 100644 --- a/ts/test-node/util/asyncIterables_test.ts +++ b/ts/test-node/util/asyncIterables_test.ts @@ -3,8 +3,8 @@ import { assert } from 'chai'; -import type { MaybeAsyncIterable } from '../../util/asyncIterables'; -import { concat, wrapPromise } from '../../util/asyncIterables'; +import type { MaybeAsyncIterable } from '../../util/asyncIterables.js'; +import { concat, wrapPromise } from '../../util/asyncIterables.js'; describe('async iterable utilities', () => { describe('concat', () => { diff --git a/ts/test-node/util/awaitObject_test.ts b/ts/test-node/util/awaitObject_test.ts index 0224fa44c7e..f2bff9c00f3 100644 --- a/ts/test-node/util/awaitObject_test.ts +++ b/ts/test-node/util/awaitObject_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { awaitObject } from '../../util/awaitObject'; +import { awaitObject } from '../../util/awaitObject.js'; describe('awaitObject', () => { it('returns correct result', async () => { diff --git a/ts/test-node/util/batcher_test.ts b/ts/test-node/util/batcher_test.ts index 1e72673d6bb..fbff27b6e64 100644 --- a/ts/test-node/util/batcher_test.ts +++ b/ts/test-node/util/batcher_test.ts @@ -4,8 +4,8 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; -import { createBatcher } from '../../util/batcher'; -import { sleep } from '../../util/sleep'; +import { createBatcher } from '../../util/batcher.js'; +import { sleep } from '../../util/sleep.js'; describe('batcher', () => { it('should schedule a full batch', async () => { diff --git a/ts/test-node/util/blockSendUntilConversationsAreVerified_test.ts b/ts/test-node/util/blockSendUntilConversationsAreVerified_test.ts index b98092a5bdf..a9439cd756d 100644 --- a/ts/test-node/util/blockSendUntilConversationsAreVerified_test.ts +++ b/ts/test-node/util/blockSendUntilConversationsAreVerified_test.ts @@ -3,15 +3,15 @@ import { assert } from 'chai'; -import type { RecipientsByConversation } from '../../state/ducks/stories'; -import type { ServiceIdString } from '../../types/ServiceId'; +import type { RecipientsByConversation } from '../../state/ducks/stories.js'; +import type { ServiceIdString } from '../../types/ServiceId.js'; -import { generateAci } from '../../types/ServiceId'; -import { generateStoryDistributionId } from '../../types/StoryDistributionId'; +import { generateAci } from '../../types/ServiceId.js'; +import { generateStoryDistributionId } from '../../types/StoryDistributionId.js'; import { getAllServiceIds, filterServiceIds, -} from '../../util/blockSendUntilConversationsAreVerified'; +} from '../../util/blockSendUntilConversationsAreVerified.js'; describe('both/util/blockSendUntilConversationsAreVerified', () => { const SERVICE_ID_1 = generateAci(); diff --git a/ts/test-node/util/callDisposition_test.ts b/ts/test-node/util/callDisposition_test.ts index 88573d7d046..25dcd7943e8 100644 --- a/ts/test-node/util/callDisposition_test.ts +++ b/ts/test-node/util/callDisposition_test.ts @@ -8,12 +8,12 @@ import { getPeerIdFromConversation, getCallIdFromEra, getGroupCallMeta, -} from '../../util/callDisposition'; +} from '../../util/callDisposition.js'; import { getDefaultConversation, getDefaultGroup, -} from '../../test-helpers/getDefaultConversation'; -import { uuidToBytes } from '../../util/uuidToBytes'; +} from '../../test-helpers/getDefaultConversation.js'; +import { uuidToBytes } from '../../util/uuidToBytes.js'; const MOCK_ERA = 'abc'; const MOCK_CALL_ID = '16919744041952114874'; diff --git a/ts/test-node/util/callLinks_test.ts b/ts/test-node/util/callLinks_test.ts index 081225e1712..c52ea8c4c05 100644 --- a/ts/test-node/util/callLinks_test.ts +++ b/ts/test-node/util/callLinks_test.ts @@ -6,13 +6,13 @@ import { assert } from 'chai'; import { callLinkToRecord, callLinkFromRecord, -} from '../../util/callLinksRingrtc'; +} from '../../util/callLinksRingrtc.js'; import { FAKE_CALL_LINK as CALL_LINK, FAKE_CALL_LINK_WITH_ADMIN_KEY as CALL_LINK_WITH_ADMIN_KEY, FAKE_CALL_LINK_WITH_EPOCH as CALL_LINK_WITH_EPOCH, FAKE_CALL_LINK_WITH_ADMIN_KEY_AND_EPOCH as CALL_LINK_WITH_ADMIN_KEY_AND_EPOCH, -} from '../../test-helpers/fakeCallLink'; +} from '../../test-helpers/fakeCallLink.js'; describe('callLinks', () => { it('callLinkToRecord() and callLinkFromRecord() can convert to record and back', () => { diff --git a/ts/test-node/util/callingGetParticipantName_test.ts b/ts/test-node/util/callingGetParticipantName_test.ts index a0356f56a35..de6cb6f8923 100644 --- a/ts/test-node/util/callingGetParticipantName_test.ts +++ b/ts/test-node/util/callingGetParticipantName_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { getParticipantName } from '../../util/callingGetParticipantName'; +import { getParticipantName } from '../../util/callingGetParticipantName.js'; describe('getParticipantName', () => { it('returns the first name if available', () => { diff --git a/ts/test-node/util/callingMessageToProto_test.ts b/ts/test-node/util/callingMessageToProto_test.ts index f8e751b80a0..ba3ded82bc4 100644 --- a/ts/test-node/util/callingMessageToProto_test.ts +++ b/ts/test-node/util/callingMessageToProto_test.ts @@ -10,9 +10,9 @@ import { HangupType, OpaqueMessage, } from '@signalapp/ringrtc'; -import { SignalService as Proto } from '../../protobuf'; +import { SignalService as Proto } from '../../protobuf/index.js'; -import { callingMessageToProto } from '../../util/callingMessageToProto'; +import { callingMessageToProto } from '../../util/callingMessageToProto.js'; describe('callingMessageToProto', () => { // NOTE: These tests are incomplete. diff --git a/ts/test-node/util/callingNotification_test.ts b/ts/test-node/util/callingNotification_test.ts index 879fc8ef275..df1b63a2994 100644 --- a/ts/test-node/util/callingNotification_test.ts +++ b/ts/test-node/util/callingNotification_test.ts @@ -2,21 +2,21 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { getCallingNotificationText } from '../../util/callingNotification'; +import { getCallingNotificationText } from '../../util/callingNotification.js'; import { CallMode, CallDirection, CallType, GroupCallStatus, -} from '../../types/CallDisposition'; -import { setupI18n } from '../../util/setupI18n'; +} from '../../types/CallDisposition.js'; +import { setupI18n } from '../../util/setupI18n.js'; import enMessages from '../../../_locales/en/messages.json'; import { getDefaultConversation, getDefaultGroup, -} from '../../test-helpers/getDefaultConversation'; -import { getPeerIdFromConversation } from '../../util/callDisposition'; -import { HOUR } from '../../util/durations'; +} from '../../test-helpers/getDefaultConversation.js'; +import { getPeerIdFromConversation } from '../../util/callDisposition.js'; +import { HOUR } from '../../util/durations/index.js'; describe('calling notification helpers', () => { const i18n = setupI18n('en', enMessages); diff --git a/ts/test-node/util/characters_test.ts b/ts/test-node/util/characters_test.ts index b6d02bde681..1ff99a5a587 100644 --- a/ts/test-node/util/characters_test.ts +++ b/ts/test-node/util/characters_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { count } from '../../util/characters'; +import { count } from '../../util/characters.js'; describe('character utilities', () => { describe('count', () => { diff --git a/ts/test-node/util/clearTimeoutIfNecessary_test.ts b/ts/test-node/util/clearTimeoutIfNecessary_test.ts index 0888895f3d2..206b0bf88f3 100644 --- a/ts/test-node/util/clearTimeoutIfNecessary_test.ts +++ b/ts/test-node/util/clearTimeoutIfNecessary_test.ts @@ -3,7 +3,7 @@ import * as sinon from 'sinon'; -import { clearTimeoutIfNecessary } from '../../util/clearTimeoutIfNecessary'; +import { clearTimeoutIfNecessary } from '../../util/clearTimeoutIfNecessary.js'; describe('clearTimeoutIfNecessary', () => { let sandbox: sinon.SinonSandbox; diff --git a/ts/test-node/util/combineNames_test.ts b/ts/test-node/util/combineNames_test.ts index 3059d7be5dc..6f21c5d426b 100644 --- a/ts/test-node/util/combineNames_test.ts +++ b/ts/test-node/util/combineNames_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { combineNames } from '../../util/combineNames'; +import { combineNames } from '../../util/combineNames.js'; describe('combineNames', () => { it('returns undefined if no names provided', () => { diff --git a/ts/test-node/util/countUnreadStats_test.ts b/ts/test-node/util/countUnreadStats_test.ts index 097ecbbe41c..9250a3315fd 100644 --- a/ts/test-node/util/countUnreadStats_test.ts +++ b/ts/test-node/util/countUnreadStats_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { countConversationUnreadStats } from '../../util/countUnreadStats'; +import { countConversationUnreadStats } from '../../util/countUnreadStats.js'; describe('countConversationUnreadStats', () => { const mutedTimestamp = (): number => Date.now() + 12345; diff --git a/ts/test-node/util/createSupportUrl_test.ts b/ts/test-node/util/createSupportUrl_test.ts index d2219e64927..bd2068f1597 100644 --- a/ts/test-node/util/createSupportUrl_test.ts +++ b/ts/test-node/util/createSupportUrl_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { createSupportUrl } from '../../util/createSupportUrl'; +import { createSupportUrl } from '../../util/createSupportUrl.js'; describe('createSupportUrl', () => { it('returns support url for "en" locale', () => { diff --git a/ts/test-node/util/currency_test.ts b/ts/test-node/util/currency_test.ts index 729a435bac1..33a28f81f05 100644 --- a/ts/test-node/util/currency_test.ts +++ b/ts/test-node/util/currency_test.ts @@ -10,7 +10,7 @@ import { toHumanDonationAmount, toHumanCurrencyString, toStripeDonationAmount, -} from '../../util/currency'; +} from '../../util/currency.js'; describe('parseCurrencyString', () => { function testFn( diff --git a/ts/test-node/util/deconstructLookup_test.ts b/ts/test-node/util/deconstructLookup_test.ts index 6dc73fb9473..49f756173d6 100644 --- a/ts/test-node/util/deconstructLookup_test.ts +++ b/ts/test-node/util/deconstructLookup_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { deconstructLookup } from '../../util/deconstructLookup'; +import { deconstructLookup } from '../../util/deconstructLookup.js'; describe('deconstructLookup', () => { it('looks up an array of properties in a lookup', () => { diff --git a/ts/test-node/util/diffArraysAsSets_test.ts b/ts/test-node/util/diffArraysAsSets_test.ts index 52d0918d97d..e2b75a6f794 100644 --- a/ts/test-node/util/diffArraysAsSets_test.ts +++ b/ts/test-node/util/diffArraysAsSets_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { diffArraysAsSets } from '../../util/diffArraysAsSets'; +import { diffArraysAsSets } from '../../util/diffArraysAsSets.js'; function assertMatch({ added, diff --git a/ts/test-node/util/dropNull_test.ts b/ts/test-node/util/dropNull_test.ts index 431779d5812..673af321240 100644 --- a/ts/test-node/util/dropNull_test.ts +++ b/ts/test-node/util/dropNull_test.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { dropNull, shallowDropNull } from '../../util/dropNull'; +import { dropNull, shallowDropNull } from '../../util/dropNull.js'; type Test = { a: number | null; diff --git a/ts/test-node/util/emoji_test.ts b/ts/test-node/util/emoji_test.ts index c86081df67f..3d7cffe5bcd 100644 --- a/ts/test-node/util/emoji_test.ts +++ b/ts/test-node/util/emoji_test.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { replaceEmojiWithSpaces, splitByEmoji } from '../../util/emoji'; +import { replaceEmojiWithSpaces, splitByEmoji } from '../../util/emoji.js'; describe('emoji', () => { describe('replaceEmojiWithSpaces', () => { diff --git a/ts/test-node/util/enum_test.ts b/ts/test-node/util/enum_test.ts index 4a3033865e8..0425a575548 100644 --- a/ts/test-node/util/enum_test.ts +++ b/ts/test-node/util/enum_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { makeEnumParser } from '../../util/enum'; +import { makeEnumParser } from '../../util/enum.js'; describe('enum utils', () => { describe('makeEnumParser', () => { diff --git a/ts/test-node/util/expirationTimer_test.ts b/ts/test-node/util/expirationTimer_test.ts index e14156e00a1..22f2a1ef696 100644 --- a/ts/test-node/util/expirationTimer_test.ts +++ b/ts/test-node/util/expirationTimer_test.ts @@ -5,11 +5,11 @@ import { readFileSync } from 'node:fs'; import { join } from 'node:path'; import { assert } from 'chai'; import * as moment from 'moment'; -import { setupI18n } from '../../util/setupI18n'; -import { DurationInSeconds } from '../../util/durations'; -import type { LocaleMessagesType } from '../../types/I18N'; +import { setupI18n } from '../../util/setupI18n.js'; +import { DurationInSeconds } from '../../util/durations/index.js'; +import type { LocaleMessagesType } from '../../types/I18N.js'; -import * as expirationTimer from '../../util/expirationTimer'; +import * as expirationTimer from '../../util/expirationTimer.js'; function loadMessages(locale: string): LocaleMessagesType { const localePath = join( diff --git a/ts/test-node/util/explodePromise_test.ts b/ts/test-node/util/explodePromise_test.ts index 58639885406..a53653c4f26 100644 --- a/ts/test-node/util/explodePromise_test.ts +++ b/ts/test-node/util/explodePromise_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { explodePromise } from '../../util/explodePromise'; +import { explodePromise } from '../../util/explodePromise.js'; describe('explodePromise', () => { it('resolves the promise', async () => { diff --git a/ts/test-node/util/exponentialBackoff_test.ts b/ts/test-node/util/exponentialBackoff_test.ts index 0f5ff313927..727845de98b 100644 --- a/ts/test-node/util/exponentialBackoff_test.ts +++ b/ts/test-node/util/exponentialBackoff_test.ts @@ -2,12 +2,12 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import * as durations from '../../util/durations'; +import * as durations from '../../util/durations/index.js'; import { exponentialBackoffSleepTime, exponentialBackoffMaxAttempts, -} from '../../util/exponentialBackoff'; +} from '../../util/exponentialBackoff.js'; describe('exponential backoff utilities', () => { describe('exponentialBackoffSleepTime', () => { diff --git a/ts/test-node/util/filterAndSortConversations_test.ts b/ts/test-node/util/filterAndSortConversations_test.ts index c03901a0e3b..165b0f74bcf 100644 --- a/ts/test-node/util/filterAndSortConversations_test.ts +++ b/ts/test-node/util/filterAndSortConversations_test.ts @@ -3,9 +3,9 @@ import { assert } from 'chai'; import { pick } from 'lodash'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation'; -import { filterAndSortConversations } from '../../util/filterAndSortConversations'; -import type { ConversationType } from '../../state/ducks/conversations'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; +import { filterAndSortConversations } from '../../util/filterAndSortConversations.js'; +import type { ConversationType } from '../../state/ducks/conversations.js'; type CheckProps = Pick; diff --git a/ts/test-node/util/finalStream_test.ts b/ts/test-node/util/finalStream_test.ts index 2c0035c7269..54fa01c83e4 100644 --- a/ts/test-node/util/finalStream_test.ts +++ b/ts/test-node/util/finalStream_test.ts @@ -5,7 +5,7 @@ import { assert } from 'chai'; import { Readable } from 'node:stream'; import { pipeline } from 'node:stream/promises'; -import { finalStream } from '../../util/finalStream'; +import { finalStream } from '../../util/finalStream.js'; describe('finalStream', () => { it('should invoke callback before pipeline resolves', async () => { diff --git a/ts/test-node/util/formatTimestamp_test.ts b/ts/test-node/util/formatTimestamp_test.ts index caa06fbb31c..af1b979a438 100644 --- a/ts/test-node/util/formatTimestamp_test.ts +++ b/ts/test-node/util/formatTimestamp_test.ts @@ -3,8 +3,8 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; -import { formatTimestamp } from '../../util/formatTimestamp'; -import { HourCyclePreference } from '../../types/I18N'; +import { formatTimestamp } from '../../util/formatTimestamp.js'; +import { HourCyclePreference } from '../../types/I18N.js'; const min = new Date(2023, 0, 1, 0).getTime(); const max = new Date(2023, 0, 1, 23).getTime(); diff --git a/ts/test-node/util/generateConfigMatrix_test.ts b/ts/test-node/util/generateConfigMatrix_test.ts index dfec3f5fcc3..fbf1c2e93a1 100644 --- a/ts/test-node/util/generateConfigMatrix_test.ts +++ b/ts/test-node/util/generateConfigMatrix_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { generateConfigMatrix } from '../../util/generateConfigMatrix'; +import { generateConfigMatrix } from '../../util/generateConfigMatrix.js'; describe('generateConfigMatrix', () => { it('generates an empty list', () => { diff --git a/ts/test-node/util/getAvatarData_test.ts b/ts/test-node/util/getAvatarData_test.ts index b18149dab9c..c89110f7172 100644 --- a/ts/test-node/util/getAvatarData_test.ts +++ b/ts/test-node/util/getAvatarData_test.ts @@ -3,9 +3,9 @@ import { assert } from 'chai'; import { v4 as uuid } from 'uuid'; -import { getRandomColor } from '../../test-helpers/getRandomColor'; +import { getRandomColor } from '../../test-helpers/getRandomColor.js'; -import { getAvatarData } from '../../util/getAvatarData'; +import { getAvatarData } from '../../util/getAvatarData.js'; describe('getAvatarData', () => { it('returns existing avatars if present', () => { diff --git a/ts/test-node/util/getClassNamesFor_test.ts b/ts/test-node/util/getClassNamesFor_test.ts index 16ca668a6a2..f13d4d444d5 100644 --- a/ts/test-node/util/getClassNamesFor_test.ts +++ b/ts/test-node/util/getClassNamesFor_test.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { getClassNamesFor } from '../../util/getClassNamesFor'; +import { getClassNamesFor } from '../../util/getClassNamesFor.js'; describe('getClassNamesFor', () => { it('returns a function', () => { diff --git a/ts/test-node/util/getCustomColorStyle.ts b/ts/test-node/util/getCustomColorStyle.ts index f82fd178895..7c9938a5236 100644 --- a/ts/test-node/util/getCustomColorStyle.ts +++ b/ts/test-node/util/getCustomColorStyle.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { getCustomColorStyle } from '../../util/getCustomColorStyle'; +import { getCustomColorStyle } from '../../util/getCustomColorStyle.js'; describe('getCustomColorStyle', () => { it('returns undefined if no color passed in', () => { diff --git a/ts/test-node/util/getFontNameByTextScript_test.ts b/ts/test-node/util/getFontNameByTextScript_test.ts index 488405d59d6..c4dfa2a6fa4 100644 --- a/ts/test-node/util/getFontNameByTextScript_test.ts +++ b/ts/test-node/util/getFontNameByTextScript_test.ts @@ -6,8 +6,8 @@ import { assert } from 'chai'; import { fontSniffer, getFontNameByTextScript, -} from '../../util/getFontNameByTextScript'; -import { setupI18n } from '../../util/setupI18n'; +} from '../../util/getFontNameByTextScript.js'; +import { setupI18n } from '../../util/setupI18n.js'; describe('getFontNameByTextScript', () => { it('has arabic', () => { diff --git a/ts/test-node/util/getGroupMemberships_test.ts b/ts/test-node/util/getGroupMemberships_test.ts index 5740b1e7f6b..683f839cc22 100644 --- a/ts/test-node/util/getGroupMemberships_test.ts +++ b/ts/test-node/util/getGroupMemberships_test.ts @@ -2,13 +2,13 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import type { ConversationType } from '../../state/ducks/conversations'; -import { generateAci } from '../../types/ServiceId'; -import { normalizeAci } from '../../util/normalizeAci'; -import type { ServiceIdString } from '../../types/ServiceId'; -import { getDefaultConversationWithServiceId } from '../../test-helpers/getDefaultConversation'; +import type { ConversationType } from '../../state/ducks/conversations.js'; +import { generateAci } from '../../types/ServiceId.js'; +import { normalizeAci } from '../../util/normalizeAci.js'; +import type { ServiceIdString } from '../../types/ServiceId.js'; +import { getDefaultConversationWithServiceId } from '../../test-helpers/getDefaultConversation.js'; -import { getGroupMemberships } from '../../util/getGroupMemberships'; +import { getGroupMemberships } from '../../util/getGroupMemberships.js'; describe('getGroupMemberships', () => { const normalConversation1 = getDefaultConversationWithServiceId(); diff --git a/ts/test-node/util/getHSL_test.ts b/ts/test-node/util/getHSL_test.ts index 75e29833502..ce888b18ad9 100644 --- a/ts/test-node/util/getHSL_test.ts +++ b/ts/test-node/util/getHSL_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { getHSL } from '../../util/getHSL'; +import { getHSL } from '../../util/getHSL.js'; describe('getHSL', () => { it('returns expected lightness values', () => { diff --git a/ts/test-node/util/getInitials_test.ts b/ts/test-node/util/getInitials_test.ts index ee739518b10..ec8fb379cc7 100644 --- a/ts/test-node/util/getInitials_test.ts +++ b/ts/test-node/util/getInitials_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { getInitials } from '../../util/getInitials'; +import { getInitials } from '../../util/getInitials.js'; describe('getInitials', () => { it('returns undefined when passed undefined', () => { diff --git a/ts/test-node/util/getMuteOptions_test.ts b/ts/test-node/util/getMuteOptions_test.ts index dd1f0ece4ee..9ca69668fce 100644 --- a/ts/test-node/util/getMuteOptions_test.ts +++ b/ts/test-node/util/getMuteOptions_test.ts @@ -3,10 +3,10 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; -import { setupI18n } from '../../util/setupI18n'; +import { setupI18n } from '../../util/setupI18n.js'; import enMessages from '../../../_locales/en/messages.json'; -import { getMuteOptions } from '../../util/getMuteOptions'; +import { getMuteOptions } from '../../util/getMuteOptions.js'; describe('getMuteOptions', () => { const HOUR = 3600000; diff --git a/ts/test-node/util/getMutedUntilText_test.ts b/ts/test-node/util/getMutedUntilText_test.ts index 39d8492dfd4..4ab0a8838eb 100644 --- a/ts/test-node/util/getMutedUntilText_test.ts +++ b/ts/test-node/util/getMutedUntilText_test.ts @@ -3,10 +3,10 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; -import { setupI18n } from '../../util/setupI18n'; +import { setupI18n } from '../../util/setupI18n.js'; import enMessages from '../../../_locales/en/messages.json'; -import { getMutedUntilText } from '../../util/getMutedUntilText'; +import { getMutedUntilText } from '../../util/getMutedUntilText.js'; describe('getMutedUntilText', () => { const i18n = setupI18n('en', enMessages); diff --git a/ts/test-node/util/getOwn_test.ts b/ts/test-node/util/getOwn_test.ts index ff789baced6..d4baf8915b1 100644 --- a/ts/test-node/util/getOwn_test.ts +++ b/ts/test-node/util/getOwn_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { getOwn } from '../../util/getOwn'; +import { getOwn } from '../../util/getOwn.js'; describe('getOwn', () => { class Person { diff --git a/ts/test-node/util/getStreamWithTimeout_test.ts b/ts/test-node/util/getStreamWithTimeout_test.ts index 0162db9329d..b35c7bbfa8a 100644 --- a/ts/test-node/util/getStreamWithTimeout_test.ts +++ b/ts/test-node/util/getStreamWithTimeout_test.ts @@ -2,12 +2,12 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { Readable } from 'stream'; +import { Readable } from 'node:stream'; import * as sinon from 'sinon'; import { noop } from 'lodash'; -import { once } from 'events'; +import { once } from 'node:events'; -import { getStreamWithTimeout } from '../../util/getStreamWithTimeout'; +import { getStreamWithTimeout } from '../../util/getStreamWithTimeout.js'; describe('getStreamWithTimeout', () => { let sandbox: sinon.SinonSandbox; diff --git a/ts/test-node/util/getUserAgent_test.ts b/ts/test-node/util/getUserAgent_test.ts index 5eedc7a4468..2dd058f5c6b 100644 --- a/ts/test-node/util/getUserAgent_test.ts +++ b/ts/test-node/util/getUserAgent_test.ts @@ -4,7 +4,7 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; -import { getUserAgent } from '../../util/getUserAgent'; +import { getUserAgent } from '../../util/getUserAgent.js'; describe('getUserAgent', () => { beforeEach(function (this: Mocha.Context) { diff --git a/ts/test-node/util/graphemeAndLinkAwareSlice.ts b/ts/test-node/util/graphemeAndLinkAwareSlice.ts index d27832b3be8..c697dff5bc5 100644 --- a/ts/test-node/util/graphemeAndLinkAwareSlice.ts +++ b/ts/test-node/util/graphemeAndLinkAwareSlice.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { graphemeAndLinkAwareSlice } from '../../util/graphemeAndLinkAwareSlice'; +import { graphemeAndLinkAwareSlice } from '../../util/graphemeAndLinkAwareSlice.js'; describe('graphemeAndLinkAwareSlice', () => { it('returns entire string when shorter than maximum', () => { diff --git a/ts/test-node/util/grapheme_test.ts b/ts/test-node/util/grapheme_test.ts index 28f0f610064..3d1cccdf0bb 100644 --- a/ts/test-node/util/grapheme_test.ts +++ b/ts/test-node/util/grapheme_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { getGraphemes, count, isSingleGrapheme } from '../../util/grapheme'; +import { getGraphemes, count, isSingleGrapheme } from '../../util/grapheme.js'; describe('grapheme utilities', () => { describe('getGraphemes', () => { diff --git a/ts/test-node/util/groupBy_test.ts b/ts/test-node/util/groupBy_test.ts index 3539cf087df..9c2ef1564b0 100644 --- a/ts/test-node/util/groupBy_test.ts +++ b/ts/test-node/util/groupBy_test.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { groupWhile, formatGroups } from '../../util/groupWhile'; +import { groupWhile, formatGroups } from '../../util/groupWhile.js'; describe('groupWhile/formatGroups', () => { function check( diff --git a/ts/test-node/util/groupMemberNameCollisions_test.ts b/ts/test-node/util/groupMemberNameCollisions_test.ts index 6eabcf538c5..c559c35d027 100644 --- a/ts/test-node/util/groupMemberNameCollisions_test.ts +++ b/ts/test-node/util/groupMemberNameCollisions_test.ts @@ -2,14 +2,14 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; import { dehydrateCollisionsWithConversations, getCollisionsFromMemberships, hasUnacknowledgedCollisions, invertIdsByTitle, -} from '../../util/groupMemberNameCollisions'; +} from '../../util/groupMemberNameCollisions.js'; describe('group member name collision utilities', () => { describe('dehydrateCollisionsWithConversations', () => { diff --git a/ts/test-node/util/groupSendEndorsements_test.ts b/ts/test-node/util/groupSendEndorsements_test.ts index 02e54359305..96e49c766da 100644 --- a/ts/test-node/util/groupSendEndorsements_test.ts +++ b/ts/test-node/util/groupSendEndorsements_test.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import assert from 'node:assert/strict'; -import { validateGroupSendEndorsementsExpiration } from '../../util/groupSendEndorsements'; -import { DAY, HOUR, SECOND } from '../../util/durations'; +import { validateGroupSendEndorsementsExpiration } from '../../util/groupSendEndorsements.js'; +import { DAY, HOUR, SECOND } from '../../util/durations/index.js'; describe('groupSendEndorsements', () => { describe('validateGroupSendEndorsementsExpiration', () => { diff --git a/ts/test-node/util/hslToRGB_test.ts b/ts/test-node/util/hslToRGB_test.ts index e9b7c54257b..2542a9364fd 100644 --- a/ts/test-node/util/hslToRGB_test.ts +++ b/ts/test-node/util/hslToRGB_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { hslToRGB, hslToRGBInt } from '../../util/hslToRGB'; +import { hslToRGB, hslToRGBInt } from '../../util/hslToRGB.js'; describe('hslToRGB', () => { it('converts pure rgb colors', () => { diff --git a/ts/test-node/util/isConversationMuted_test.ts b/ts/test-node/util/isConversationMuted_test.ts index b9ddadc096e..08fd4b632df 100644 --- a/ts/test-node/util/isConversationMuted_test.ts +++ b/ts/test-node/util/isConversationMuted_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { isConversationMuted } from '../../util/isConversationMuted'; +import { isConversationMuted } from '../../util/isConversationMuted.js'; describe('isConversationMuted', () => { it('returns false if passed an undefined expiry time', () => { diff --git a/ts/test-node/util/isConversationNameKnown_test.ts b/ts/test-node/util/isConversationNameKnown_test.ts index 9845d96c178..0bb9ffa424d 100644 --- a/ts/test-node/util/isConversationNameKnown_test.ts +++ b/ts/test-node/util/isConversationNameKnown_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { isConversationNameKnown } from '../../util/isConversationNameKnown'; +import { isConversationNameKnown } from '../../util/isConversationNameKnown.js'; describe('isConversationNameKnown', () => { describe('for direct conversations', () => { diff --git a/ts/test-node/util/isConversationSMSOnly_test.ts b/ts/test-node/util/isConversationSMSOnly_test.ts index d9a69a5d82a..0be1798c44c 100644 --- a/ts/test-node/util/isConversationSMSOnly_test.ts +++ b/ts/test-node/util/isConversationSMSOnly_test.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { generateAci } from '../../types/ServiceId'; +import { generateAci } from '../../types/ServiceId.js'; -import { isConversationSMSOnly } from '../../util/isConversationSMSOnly'; +import { isConversationSMSOnly } from '../../util/isConversationSMSOnly.js'; const serviceId = generateAci(); diff --git a/ts/test-node/util/isConversationUnread_test.ts b/ts/test-node/util/isConversationUnread_test.ts index 18ad7723f3c..d81aea9c971 100644 --- a/ts/test-node/util/isConversationUnread_test.ts +++ b/ts/test-node/util/isConversationUnread_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { isConversationUnread } from '../../util/isConversationUnread'; +import { isConversationUnread } from '../../util/isConversationUnread.js'; describe('isConversationUnread', () => { it('returns false if both markedUnread and unreadCount are undefined', () => { diff --git a/ts/test-node/util/isConversationUnregistered_test.ts b/ts/test-node/util/isConversationUnregistered_test.ts index 61af2d1444a..0231ced4752 100644 --- a/ts/test-node/util/isConversationUnregistered_test.ts +++ b/ts/test-node/util/isConversationUnregistered_test.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { generateAci } from '../../types/ServiceId'; -import * as durations from '../../util/durations'; +import { generateAci } from '../../types/ServiceId.js'; +import * as durations from '../../util/durations/index.js'; -import { isConversationUnregistered } from '../../util/isConversationUnregistered'; +import { isConversationUnregistered } from '../../util/isConversationUnregistered.js'; const serviceId = generateAci(); diff --git a/ts/test-node/util/isFileDangerous_test.ts b/ts/test-node/util/isFileDangerous_test.ts index 6a86f742976..868d7d98d41 100644 --- a/ts/test-node/util/isFileDangerous_test.ts +++ b/ts/test-node/util/isFileDangerous_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { isFileDangerous } from '../../util/isFileDangerous'; +import { isFileDangerous } from '../../util/isFileDangerous.js'; describe('isFileDangerous', () => { it('returns false for images', () => { diff --git a/ts/test-node/util/isInSystemContacts_test.ts b/ts/test-node/util/isInSystemContacts_test.ts index 70ee5623e78..48075374264 100644 --- a/ts/test-node/util/isInSystemContacts_test.ts +++ b/ts/test-node/util/isInSystemContacts_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { isInSystemContacts } from '../../util/isInSystemContacts'; +import { isInSystemContacts } from '../../util/isInSystemContacts.js'; describe('isInSystemContacts', () => { it('returns true for direct conversations that have a `name` property', () => { diff --git a/ts/test-node/util/isMessageUnread_test.ts b/ts/test-node/util/isMessageUnread_test.ts index 4e2670fea32..6b39f6540d7 100644 --- a/ts/test-node/util/isMessageUnread_test.ts +++ b/ts/test-node/util/isMessageUnread_test.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { ReadStatus } from '../../messages/MessageReadStatus'; +import { ReadStatus } from '../../messages/MessageReadStatus.js'; -import { isMessageUnread } from '../../util/isMessageUnread'; +import { isMessageUnread } from '../../util/isMessageUnread.js'; describe('isMessageUnread', () => { it("returns false if the message's `readStatus` field is undefined", () => { diff --git a/ts/test-node/util/isNormalNumber_test.ts b/ts/test-node/util/isNormalNumber_test.ts index bb8a72ac08c..6e9da749c31 100644 --- a/ts/test-node/util/isNormalNumber_test.ts +++ b/ts/test-node/util/isNormalNumber_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { isNormalNumber } from '../../util/isNormalNumber'; +import { isNormalNumber } from '../../util/isNormalNumber.js'; describe('isNormalNumber', () => { it('returns false for non-numbers', () => { diff --git a/ts/test-node/util/isNotNil_test.ts b/ts/test-node/util/isNotNil_test.ts index 1cdcf8343a0..f4c372bcb7f 100644 --- a/ts/test-node/util/isNotNil_test.ts +++ b/ts/test-node/util/isNotNil_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { isNotNil } from '../../util/isNotNil'; +import { isNotNil } from '../../util/isNotNil.js'; describe('isNotNil', () => { it('returns false if provided null value', () => { diff --git a/ts/test-node/util/isPathInside_test.ts b/ts/test-node/util/isPathInside_test.ts index 3968527e420..8ace6e9ce21 100644 --- a/ts/test-node/util/isPathInside_test.ts +++ b/ts/test-node/util/isPathInside_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { isPathInside } from '../../util/isPathInside'; +import { isPathInside } from '../../util/isPathInside.js'; describe('isPathInside', () => { it('returns false if the child path is not inside the parent path', () => { diff --git a/ts/test-node/util/isRecord_test.ts b/ts/test-node/util/isRecord_test.ts index ca5ed43f62c..d058d500f56 100644 --- a/ts/test-node/util/isRecord_test.ts +++ b/ts/test-node/util/isRecord_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { isRecord } from '../../util/isRecord'; +import { isRecord } from '../../util/isRecord.js'; describe('isRecord', () => { it('returns false for primitives', () => { diff --git a/ts/test-node/util/isSorted_test.ts b/ts/test-node/util/isSorted_test.ts index da3129e6d3b..c97660a4b43 100644 --- a/ts/test-node/util/isSorted_test.ts +++ b/ts/test-node/util/isSorted_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { isSorted } from '../../util/isSorted'; +import { isSorted } from '../../util/isSorted.js'; describe('isSorted', () => { it('returns true for empty lists', () => { diff --git a/ts/test-node/util/isValidE164_test.ts b/ts/test-node/util/isValidE164_test.ts index b46bfb83941..da3aba1291d 100644 --- a/ts/test-node/util/isValidE164_test.ts +++ b/ts/test-node/util/isValidE164_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { isValidE164 } from '../../util/isValidE164'; +import { isValidE164 } from '../../util/isValidE164.js'; describe('isValidE164', () => { it('returns false for non-strings', () => { diff --git a/ts/test-node/util/isValidUuid.ts b/ts/test-node/util/isValidUuid.ts index 8d4c328ab3f..2c65ad824ee 100644 --- a/ts/test-node/util/isValidUuid.ts +++ b/ts/test-node/util/isValidUuid.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { isValidUuid } from '../../util/isValidUuid'; +import { isValidUuid } from '../../util/isValidUuid.js'; describe('isValidUuid', () => { const LOWERCASE_V4_UUID = '9cb737ce-2bb3-4c21-9fe0-d286caa0ca68'; diff --git a/ts/test-node/util/iterables_test.ts b/ts/test-node/util/iterables_test.ts index cf079e3b5d8..19fcb66d59f 100644 --- a/ts/test-node/util/iterables_test.ts +++ b/ts/test-node/util/iterables_test.ts @@ -20,7 +20,7 @@ import { size, take, zipObject, -} from '../../util/iterables'; +} from '../../util/iterables.js'; describe('iterable utilities', () => { describe('isIterable', () => { diff --git a/ts/test-node/util/libphonenumberUtil_test.ts b/ts/test-node/util/libphonenumberUtil_test.ts index 53d6f859111..494d4f3c4a6 100644 --- a/ts/test-node/util/libphonenumberUtil_test.ts +++ b/ts/test-node/util/libphonenumberUtil_test.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert, AssertionError } from 'chai'; -import { parseNumber } from '../../util/libphonenumberUtil'; +import { parseNumber } from '../../util/libphonenumberUtil.js'; describe('libphonenumber util', () => { describe('parseNumber', () => { diff --git a/ts/test-node/util/logPadding_test.ts b/ts/test-node/util/logPadding_test.ts index 7ec4baa903f..6f7c567a03d 100644 --- a/ts/test-node/util/logPadding_test.ts +++ b/ts/test-node/util/logPadding_test.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { Readable } from 'stream'; +import { Readable } from 'node:stream'; -import { logPadSize, appendPaddingStream } from '../../util/logPadding'; +import { logPadSize, appendPaddingStream } from '../../util/logPadding.js'; const BUCKET_SIZES = [ 541, 568, 596, 626, 657, 690, 725, 761, 799, 839, 881, 925, 972, 1020, 1071, diff --git a/ts/test-node/util/makeLookup_test.ts b/ts/test-node/util/makeLookup_test.ts index 8fa0da61a2f..e99aca030a8 100644 --- a/ts/test-node/util/makeLookup_test.ts +++ b/ts/test-node/util/makeLookup_test.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { makeLookup } from '../../util/makeLookup'; +import { makeLookup } from '../../util/makeLookup.js'; describe('makeLookup', () => { it('returns an empty object if passed an empty array', () => { diff --git a/ts/test-node/util/mapEmplace_test.ts b/ts/test-node/util/mapEmplace_test.ts index 41aaba272d4..e7a9a096f87 100644 --- a/ts/test-node/util/mapEmplace_test.ts +++ b/ts/test-node/util/mapEmplace_test.ts @@ -3,8 +3,8 @@ import * as sinon from 'sinon'; import assert from 'node:assert/strict'; -import type { MapEmplaceOptions } from '../../util/mapEmplace'; -import { mapEmplace } from '../../util/mapEmplace'; +import type { MapEmplaceOptions } from '../../util/mapEmplace.js'; +import { mapEmplace } from '../../util/mapEmplace.js'; type InsertFn = NonNullable>['insert']>; type UpdateFn = NonNullable>['update']>; diff --git a/ts/test-node/util/mapObjectWithSpec_test.ts b/ts/test-node/util/mapObjectWithSpec_test.ts index 7f0bbf5ce16..deb5007d0f3 100644 --- a/ts/test-node/util/mapObjectWithSpec_test.ts +++ b/ts/test-node/util/mapObjectWithSpec_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { mapObjectWithSpec } from '../../util/mapObjectWithSpec'; +import { mapObjectWithSpec } from '../../util/mapObjectWithSpec.js'; describe('mapObjectWithSpec', () => { const increment = (value: number) => value + 1; diff --git a/ts/test-node/util/mapUtil_test.ts b/ts/test-node/util/mapUtil_test.ts index 6d7b091b0dd..100feeab567 100644 --- a/ts/test-node/util/mapUtil_test.ts +++ b/ts/test-node/util/mapUtil_test.ts @@ -4,7 +4,7 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; -import { groupBy, isEqual } from '../../util/mapUtil'; +import { groupBy, isEqual } from '../../util/mapUtil.js'; describe('map utilities', () => { describe('groupBy', () => { diff --git a/ts/test-node/util/messageFailures.ts b/ts/test-node/util/messageFailures.ts index de13095bcae..285091caf79 100644 --- a/ts/test-node/util/messageFailures.ts +++ b/ts/test-node/util/messageFailures.ts @@ -3,27 +3,27 @@ import { mapValues, pick } from 'lodash'; -import type { CustomError } from '../../textsecure/Types'; +import type { CustomError } from '../../textsecure/Types.js'; -import type { MessageAttributesType } from '../../model-types'; -import { createLogger } from '../../logging/log'; -import * as Errors from '../../types/errors'; +import type { MessageAttributesType } from '../../model-types.js'; +import { createLogger } from '../../logging/log.js'; +import * as Errors from '../../types/errors.js'; import { getChangesForPropAtTimestamp, getPropForTimestamp, -} from '../../util/editHelpers'; +} from '../../util/editHelpers.js'; import { isSent, SendActionType, sendStateReducer, someRecipientSendStatus, -} from '../../messages/MessageSendState'; -import { isStory } from '../../messages/helpers'; +} from '../../messages/MessageSendState.js'; +import { isStory } from '../../messages/helpers.js'; import { notificationService, NotificationType, -} from '../../services/notifications'; -import type { MessageModel } from '../../models/messages'; +} from '../../services/notifications.js'; +import type { MessageModel } from '../../models/messages.js'; const log = createLogger('messageFailures'); diff --git a/ts/test-node/util/normalizeDeviceName_test.ts b/ts/test-node/util/normalizeDeviceName_test.ts index dad5aaa3fe3..2761c851400 100644 --- a/ts/test-node/util/normalizeDeviceName_test.ts +++ b/ts/test-node/util/normalizeDeviceName_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { normalizeDeviceName } from '../../util/normalizeDeviceName'; +import { normalizeDeviceName } from '../../util/normalizeDeviceName.js'; describe('normalizeDeviceName', () => { it('leaves normal device names untouched', () => { diff --git a/ts/test-node/util/parseIntOrThrow_test.ts b/ts/test-node/util/parseIntOrThrow_test.ts index 8e2abf4c8d4..7a65a8b0beb 100644 --- a/ts/test-node/util/parseIntOrThrow_test.ts +++ b/ts/test-node/util/parseIntOrThrow_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { parseIntOrThrow } from '../../util/parseIntOrThrow'; +import { parseIntOrThrow } from '../../util/parseIntOrThrow.js'; describe('parseIntOrThrow', () => { describe('when passed a number argument', () => { diff --git a/ts/test-node/util/parseIntWithFallback_test.ts b/ts/test-node/util/parseIntWithFallback_test.ts index f5e68f911ea..9cad8935fd7 100644 --- a/ts/test-node/util/parseIntWithFallback_test.ts +++ b/ts/test-node/util/parseIntWithFallback_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { parseIntWithFallback } from '../../util/parseIntWithFallback'; +import { parseIntWithFallback } from '../../util/parseIntWithFallback.js'; describe('parseIntWithFallback', () => { describe('when passed a number argument', () => { diff --git a/ts/test-node/util/parseRetryAfter_test.ts b/ts/test-node/util/parseRetryAfter_test.ts index f072ff8d372..b2f4c090454 100644 --- a/ts/test-node/util/parseRetryAfter_test.ts +++ b/ts/test-node/util/parseRetryAfter_test.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { MINUTE } from '../../util/durations'; +import { MINUTE } from '../../util/durations/index.js'; -import { parseRetryAfterWithDefault } from '../../util/parseRetryAfter'; +import { parseRetryAfterWithDefault } from '../../util/parseRetryAfter.js'; describe('parseRetryAfter', () => { it('should return 1 minute when passed non-strings', () => { diff --git a/ts/test-node/util/prependStream_test.ts b/ts/test-node/util/prependStream_test.ts index 009298f46c5..34689fc8873 100644 --- a/ts/test-node/util/prependStream_test.ts +++ b/ts/test-node/util/prependStream_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { prependStream } from '../../util/prependStream'; +import { prependStream } from '../../util/prependStream.js'; describe('prependStream', () => { it('should prepend stream with a prefix', async () => { diff --git a/ts/test-node/util/privacy_test.ts b/ts/test-node/util/privacy_test.ts index ebb16d75101..467021d42d1 100644 --- a/ts/test-node/util/privacy_test.ts +++ b/ts/test-node/util/privacy_test.ts @@ -3,8 +3,8 @@ import { assert } from 'chai'; -import * as Privacy from '../../util/privacy'; -import { APP_ROOT_PATH } from '../../util/privacy'; +import * as Privacy from '../../util/privacy.js'; +import { APP_ROOT_PATH } from '../../util/privacy.js'; Privacy.addSensitivePath('sensitive-path'); diff --git a/ts/test-node/util/queueAttachmentDownloads_test.ts b/ts/test-node/util/queueAttachmentDownloads_test.ts index 373cdd86889..4c932e0babe 100644 --- a/ts/test-node/util/queueAttachmentDownloads_test.ts +++ b/ts/test-node/util/queueAttachmentDownloads_test.ts @@ -3,12 +3,12 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ import { assert } from 'chai'; -import type { MessageAttributesType } from '../../model-types'; -import type { AttachmentType } from '../../types/Attachment'; -import { IMAGE_JPEG, LONG_MESSAGE } from '../../types/MIME'; -import { generateMessageId } from '../../util/generateMessageId'; -import { ensureBodyAttachmentsAreSeparated } from '../../util/queueAttachmentDownloads'; -import { createLogger } from '../../logging/log'; +import type { MessageAttributesType } from '../../model-types.js'; +import type { AttachmentType } from '../../types/Attachment.js'; +import { IMAGE_JPEG, LONG_MESSAGE } from '../../types/MIME.js'; +import { generateMessageId } from '../../util/generateMessageId.js'; +import { ensureBodyAttachmentsAreSeparated } from '../../util/queueAttachmentDownloads.js'; +import { createLogger } from '../../logging/log.js'; const logger = createLogger('queueAttachmentDownloads_test'); diff --git a/ts/test-node/util/reallyJsonStringify_test.ts b/ts/test-node/util/reallyJsonStringify_test.ts index a3a3764a0ee..5c7bffe44a4 100644 --- a/ts/test-node/util/reallyJsonStringify_test.ts +++ b/ts/test-node/util/reallyJsonStringify_test.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { reallyJsonStringify } from '../../util/reallyJsonStringify'; +import { reallyJsonStringify } from '../../util/reallyJsonStringify.js'; describe('reallyJsonStringify', () => { it('returns the same thing as JSON.stringify when JSON.stringify returns a string', () => { diff --git a/ts/test-node/util/replaceIndex_test.ts b/ts/test-node/util/replaceIndex_test.ts index 8544a133cf5..2387385b3f2 100644 --- a/ts/test-node/util/replaceIndex_test.ts +++ b/ts/test-node/util/replaceIndex_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { replaceIndex } from '../../util/replaceIndex'; +import { replaceIndex } from '../../util/replaceIndex.js'; describe('replaceIndex', () => { it('returns a new array with an index replaced', () => { diff --git a/ts/test-node/util/resolveCanonicalLocales_test.ts b/ts/test-node/util/resolveCanonicalLocales_test.ts index 273a46ce863..b77c36ee6f3 100644 --- a/ts/test-node/util/resolveCanonicalLocales_test.ts +++ b/ts/test-node/util/resolveCanonicalLocales_test.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import assert from 'node:assert/strict'; -import { resolveCanonicalLocales } from '../../util/resolveCanonicalLocales'; +import { resolveCanonicalLocales } from '../../util/resolveCanonicalLocales.js'; describe('resolveCanonicalLocales', () => { it('returns an array of canonical locales', () => { diff --git a/ts/test-node/util/retryPlaceholders_test.ts b/ts/test-node/util/retryPlaceholders_test.ts index 3e2f764d688..6e300863292 100644 --- a/ts/test-node/util/retryPlaceholders_test.ts +++ b/ts/test-node/util/retryPlaceholders_test.ts @@ -4,13 +4,13 @@ import { assert } from 'chai'; import sinon from 'sinon'; -import { generateAci } from '../../types/ServiceId'; -import type { RetryItemType } from '../../util/retryPlaceholders'; +import { generateAci } from '../../types/ServiceId.js'; +import type { RetryItemType } from '../../util/retryPlaceholders.js'; import { getDeltaIntoPast, RetryPlaceholders, STORAGE_KEY, -} from '../../util/retryPlaceholders'; +} from '../../util/retryPlaceholders.js'; /* eslint-disable @typescript-eslint/no-explicit-any */ diff --git a/ts/test-node/util/rgbToHSL_test.ts b/ts/test-node/util/rgbToHSL_test.ts index f3a5139f560..e68f0a97a84 100644 --- a/ts/test-node/util/rgbToHSL_test.ts +++ b/ts/test-node/util/rgbToHSL_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { rgbIntToHSL, rgbToHSL } from '../../util/rgbToHSL'; +import { rgbIntToHSL, rgbToHSL } from '../../util/rgbToHSL.js'; describe('rgbToHSL', () => { it('converts pure rgb colors', () => { diff --git a/ts/test-node/util/ringrtc/nonRenderedRemoteParticipant_test.ts b/ts/test-node/util/ringrtc/nonRenderedRemoteParticipant_test.ts index 1464a4e6132..9fdb60ff597 100644 --- a/ts/test-node/util/ringrtc/nonRenderedRemoteParticipant_test.ts +++ b/ts/test-node/util/ringrtc/nonRenderedRemoteParticipant_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { nonRenderedRemoteParticipant } from '../../../util/ringrtc/nonRenderedRemoteParticipant'; +import { nonRenderedRemoteParticipant } from '../../../util/ringrtc/nonRenderedRemoteParticipant.js'; describe('nonRenderedRemoteParticipant', () => { it('returns a video request object a width and height of 0', () => { diff --git a/ts/test-node/util/ringrtc/normalizeGroupCallTimestamp_test.ts b/ts/test-node/util/ringrtc/normalizeGroupCallTimestamp_test.ts index d4804700f2f..a41d7b10b85 100644 --- a/ts/test-node/util/ringrtc/normalizeGroupCallTimestamp_test.ts +++ b/ts/test-node/util/ringrtc/normalizeGroupCallTimestamp_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { normalizeGroupCallTimestamp } from '../../../util/ringrtc/normalizeGroupCallTimestamp'; +import { normalizeGroupCallTimestamp } from '../../../util/ringrtc/normalizeGroupCallTimestamp.js'; describe('normalizeGroupCallTimestamp', () => { it('returns undefined if passed a string that cannot be parsed as a number', () => { diff --git a/ts/test-node/util/schemas_test.ts b/ts/test-node/util/schemas_test.ts index c83be79a0e7..cabddd68b60 100644 --- a/ts/test-node/util/schemas_test.ts +++ b/ts/test-node/util/schemas_test.ts @@ -9,7 +9,7 @@ import { parseStrict, parseUnknown, SchemaParseError, -} from '../../util/schemas'; +} from '../../util/schemas.js'; describe('schemas', () => { const schema = z.object({ prop: z.literal('value') }); diff --git a/ts/test-node/util/searchConversationTitles_test.ts b/ts/test-node/util/searchConversationTitles_test.ts index 81175da926c..99ced264e38 100644 --- a/ts/test-node/util/searchConversationTitles_test.ts +++ b/ts/test-node/util/searchConversationTitles_test.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation'; -import { searchConversationTitles } from '../../util/searchConversationTitles'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; +import { searchConversationTitles } from '../../util/searchConversationTitles.js'; describe('searchContactTitles', () => { const conversations = [ diff --git a/ts/test-node/util/search_test.ts b/ts/test-node/util/search_test.ts index 249b72d4fb3..f03b992d15c 100644 --- a/ts/test-node/util/search_test.ts +++ b/ts/test-node/util/search_test.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { generateSnippetAroundMention } from '../../util/search'; +import { generateSnippetAroundMention } from '../../util/search.js'; describe('generateSnippetAroundMention', () => { it('generates snippet around mention at start of body', () => { diff --git a/ts/test-node/util/serverAlerts_test.ts b/ts/test-node/util/serverAlerts_test.ts index 3059b62d2c3..84676befbe3 100644 --- a/ts/test-node/util/serverAlerts_test.ts +++ b/ts/test-node/util/serverAlerts_test.ts @@ -5,8 +5,8 @@ import { assert } from 'chai'; import { getServerAlertToShow, ServerAlert, -} from '../../util/handleServerAlerts'; -import { DAY, MONTH, WEEK } from '../../util/durations'; +} from '../../util/handleServerAlerts.js'; +import { DAY, MONTH, WEEK } from '../../util/durations/index.js'; describe('serverAlerts', () => { it('should prefer critical alerts', () => { diff --git a/ts/test-node/util/sessionTranslation_test.ts b/ts/test-node/util/sessionTranslation_test.ts index f56c1ffee3e..b7b2948808e 100644 --- a/ts/test-node/util/sessionTranslation_test.ts +++ b/ts/test-node/util/sessionTranslation_test.ts @@ -6,9 +6,9 @@ import { assert } from 'chai'; import Long from 'long'; -import * as Bytes from '../../Bytes'; -import type { LocalUserDataType } from '../../util/sessionTranslation'; -import { sessionRecordToProtobuf } from '../../util/sessionTranslation'; +import * as Bytes from '../../Bytes.js'; +import type { LocalUserDataType } from '../../util/sessionTranslation.js'; +import { sessionRecordToProtobuf } from '../../util/sessionTranslation.js'; const getRecordCopy = (record: any): any => JSON.parse(JSON.stringify(record)); diff --git a/ts/test-node/util/setUtil_test.ts b/ts/test-node/util/setUtil_test.ts index ee9440e030c..7b4adc29c13 100644 --- a/ts/test-node/util/setUtil_test.ts +++ b/ts/test-node/util/setUtil_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { difference, isEqual, remove, toggle } from '../../util/setUtil'; +import { difference, isEqual, remove, toggle } from '../../util/setUtil.js'; describe('set utilities', () => { const original = new Set([1, 2, 3]); diff --git a/ts/test-node/util/signalRoutes_test.ts b/ts/test-node/util/signalRoutes_test.ts index 243bf29f0a0..671c9239732 100644 --- a/ts/test-node/util/signalRoutes_test.ts +++ b/ts/test-node/util/signalRoutes_test.ts @@ -1,14 +1,14 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import type { ParsedSignalRoute } from '../../util/signalRoutes'; +import type { ParsedSignalRoute } from '../../util/signalRoutes.js'; import { isSignalRoute, parseSignalRoute, toSignalRouteAppUrl, toSignalRouteUrl, toSignalRouteWebUrl, -} from '../../util/signalRoutes'; +} from '../../util/signalRoutes.js'; describe('signalRoutes', () => { type CheckConfig = { diff --git a/ts/test-node/util/sleep_test.ts b/ts/test-node/util/sleep_test.ts index 6165d32b2e9..42850d0285f 100644 --- a/ts/test-node/util/sleep_test.ts +++ b/ts/test-node/util/sleep_test.ts @@ -4,7 +4,7 @@ import { assert } from 'chai'; import { useFakeTimers } from 'sinon'; -import { sleep } from '../../util/sleep'; +import { sleep } from '../../util/sleep.js'; describe('sleep', () => { beforeEach(function (this: Mocha.Context) { diff --git a/ts/test-node/util/sniffImageMimeType_test.ts b/ts/test-node/util/sniffImageMimeType_test.ts index 2115f0be0f3..f833507e121 100644 --- a/ts/test-node/util/sniffImageMimeType_test.ts +++ b/ts/test-node/util/sniffImageMimeType_test.ts @@ -1,8 +1,8 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import * as fs from 'fs'; -import * as path from 'path'; +import * as fs from 'node:fs'; +import * as path from 'node:path'; import { assert } from 'chai'; import { IMAGE_BMP, @@ -11,9 +11,9 @@ import { IMAGE_JPEG, IMAGE_PNG, IMAGE_WEBP, -} from '../../types/MIME'; +} from '../../types/MIME.js'; -import { sniffImageMimeType } from '../../util/sniffImageMimeType'; +import { sniffImageMimeType } from '../../util/sniffImageMimeType.js'; describe('sniffImageMimeType', () => { const fixture = (filename: string): Promise => { diff --git a/ts/test-node/util/sortByTitle_test.ts b/ts/test-node/util/sortByTitle_test.ts index c22cde7a08a..227212287e9 100644 --- a/ts/test-node/util/sortByTitle_test.ts +++ b/ts/test-node/util/sortByTitle_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { sortByTitle } from '../../util/sortByTitle'; +import { sortByTitle } from '../../util/sortByTitle.js'; describe('sortByTitle', () => { it("does nothing to arrays that don't need to be sorted", () => { diff --git a/ts/test-node/util/splitText_test.ts b/ts/test-node/util/splitText_test.ts index 3a64a00967f..63ef8b44f15 100644 --- a/ts/test-node/util/splitText_test.ts +++ b/ts/test-node/util/splitText_test.ts @@ -3,8 +3,8 @@ import { assert } from 'chai'; -import type { SplitTextOptionsType } from '../../util/splitText'; -import { splitText } from '../../util/splitText'; +import type { SplitTextOptionsType } from '../../util/splitText.js'; +import { splitText } from '../../util/splitText.js'; describe('splitText', () => { describe('grapheme granularity', () => { diff --git a/ts/test-node/util/startTimeTravelDetector_test.ts b/ts/test-node/util/startTimeTravelDetector_test.ts index 346cb229b6a..ec1a190b49b 100644 --- a/ts/test-node/util/startTimeTravelDetector_test.ts +++ b/ts/test-node/util/startTimeTravelDetector_test.ts @@ -3,7 +3,7 @@ import * as sinon from 'sinon'; -import { startTimeTravelDetector } from '../../util/startTimeTravelDetector'; +import { startTimeTravelDetector } from '../../util/startTimeTravelDetector.js'; describe('startTimeTravelDetector', () => { let sandbox: sinon.SinonSandbox; diff --git a/ts/test-node/util/theme_test.ts b/ts/test-node/util/theme_test.ts index 4d8ed38ddaa..7769fb320cb 100644 --- a/ts/test-node/util/theme_test.ts +++ b/ts/test-node/util/theme_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { Theme, themeClassName } from '../../util/theme'; +import { Theme, themeClassName } from '../../util/theme.js'; describe('themeClassName', () => { it('returns "light-theme" when passed a light theme', () => { diff --git a/ts/test-node/util/timelineUtil_test.ts b/ts/test-node/util/timelineUtil_test.ts index 9ce81d353bc..f1bc31ac41a 100644 --- a/ts/test-node/util/timelineUtil_test.ts +++ b/ts/test-node/util/timelineUtil_test.ts @@ -4,16 +4,16 @@ import { assert } from 'chai'; import { times } from 'lodash'; import { v4 as uuid } from 'uuid'; -import type { LastMessageStatus } from '../../model-types.d'; -import { MINUTE, SECOND } from '../../util/durations'; -import type { MaybeMessageTimelineItemType } from '../../util/timelineUtil'; +import type { LastMessageStatus } from '../../model-types.d.ts'; +import { MINUTE, SECOND } from '../../util/durations/index.js'; +import type { MaybeMessageTimelineItemType } from '../../util/timelineUtil.js'; import { ScrollAnchor, areMessagesInSameGroup, getScrollAnchorBeforeUpdate, shouldCurrentMessageHideMetadata, TimelineMessageLoadingState, -} from '../../util/timelineUtil'; +} from '../../util/timelineUtil.js'; describe(' utilities', () => { describe('areMessagesInSameGroup', () => { diff --git a/ts/test-node/util/timestampLongUtils_test.ts b/ts/test-node/util/timestampLongUtils_test.ts index f3d33c9c5b6..192df07a407 100644 --- a/ts/test-node/util/timestampLongUtils_test.ts +++ b/ts/test-node/util/timestampLongUtils_test.ts @@ -10,8 +10,8 @@ import { getTimestampOrUndefinedFromLong, getCheckedTimestampFromLong, getCheckedTimestampOrUndefinedFromLong, -} from '../../util/timestampLongUtils'; -import { MAX_SAFE_DATE } from '../../util/timestamp'; +} from '../../util/timestampLongUtils.js'; +import { MAX_SAFE_DATE } from '../../util/timestamp.js'; describe('getSafeLongFromTimestamp', () => { it('returns zero when passed undefined', () => { diff --git a/ts/test-node/util/timestamp_test.ts b/ts/test-node/util/timestamp_test.ts index 45dfa6a3129..f6bde1a3060 100644 --- a/ts/test-node/util/timestamp_test.ts +++ b/ts/test-node/util/timestamp_test.ts @@ -4,8 +4,8 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; import moment from 'moment'; -import { HOUR, DAY } from '../../util/durations'; -import { setupI18n } from '../../util/setupI18n'; +import { HOUR, DAY } from '../../util/durations/index.js'; +import { setupI18n } from '../../util/setupI18n.js'; import enMessages from '../../../_locales/en/messages.json'; import { @@ -18,7 +18,7 @@ import { isSameDay, isToday, toDayMillis, -} from '../../util/timestamp'; +} from '../../util/timestamp.js'; const FAKE_NOW = new Date('2020-01-23T04:56:00.000'); diff --git a/ts/test-node/util/toWebStream_test.ts b/ts/test-node/util/toWebStream_test.ts index 618ae0dd510..3116f56d54f 100644 --- a/ts/test-node/util/toWebStream_test.ts +++ b/ts/test-node/util/toWebStream_test.ts @@ -4,7 +4,7 @@ import { assert } from 'chai'; import { Readable } from 'node:stream'; import { once } from 'node:events'; -import { toWebStream } from '../../util/toWebStream'; +import { toWebStream } from '../../util/toWebStream.js'; describe('toWebStream', () => { it('only reads what it needs', async () => { diff --git a/ts/test-node/util/toggleMaximizedBrowserWindow_test.ts b/ts/test-node/util/toggleMaximizedBrowserWindow_test.ts index 8fe75c0c1d6..68360fcb8bb 100644 --- a/ts/test-node/util/toggleMaximizedBrowserWindow_test.ts +++ b/ts/test-node/util/toggleMaximizedBrowserWindow_test.ts @@ -4,7 +4,7 @@ import * as sinon from 'sinon'; import type { BrowserWindow } from 'electron'; -import { toggleMaximizedBrowserWindow } from '../../util/toggleMaximizedBrowserWindow'; +import { toggleMaximizedBrowserWindow } from '../../util/toggleMaximizedBrowserWindow.js'; describe('toggleMaximizedBrowserWindow', () => { const createFakeWindow = () => ({ diff --git a/ts/test-node/util/unicodeBidi_test.ts b/ts/test-node/util/unicodeBidi_test.ts index edb9d4e2b88..8a80eae3923 100644 --- a/ts/test-node/util/unicodeBidi_test.ts +++ b/ts/test-node/util/unicodeBidi_test.ts @@ -13,7 +13,7 @@ import { LTR_OVERRIDE, RTL_EMBEDDING, RTL_OVERRIDE, -} from '../../util/unicodeBidi'; +} from '../../util/unicodeBidi.js'; function debugUnicode(text: string) { return text diff --git a/ts/test-node/util/unicodeSlice_test.ts b/ts/test-node/util/unicodeSlice_test.ts index af675a01fed..05ec01ddbf7 100644 --- a/ts/test-node/util/unicodeSlice_test.ts +++ b/ts/test-node/util/unicodeSlice_test.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import assert from 'node:assert/strict'; -import { unicodeSlice } from '../../util/unicodeSlice'; -import { byteLength } from '../../Bytes'; +import { unicodeSlice } from '../../util/unicodeSlice.js'; +import { byteLength } from '../../Bytes.js'; describe('unicodeSlice()', () => { function test( diff --git a/ts/test-node/util/uploads/helpers.ts b/ts/test-node/util/uploads/helpers.ts index 6a9e3757b3b..5216c2798f9 100644 --- a/ts/test-node/util/uploads/helpers.ts +++ b/ts/test-node/util/uploads/helpers.ts @@ -1,15 +1,15 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { EventEmitter, once } from 'events'; -import { Readable } from 'stream'; -import { createServer } from 'http'; +import { EventEmitter, once } from 'node:events'; +import { Readable } from 'node:stream'; +import { createServer } from 'node:http'; import type { IncomingMessage, ServerResponse, Server, OutgoingHttpHeaders, -} from 'http'; -import { strictAssert } from '../../../util/assert'; +} from 'node:http'; +import { strictAssert } from '../../../util/assert.js'; export type NextResponse = Readonly<{ status: number; diff --git a/ts/test-node/util/uploads/tusProtocol_test.ts b/ts/test-node/util/uploads/tusProtocol_test.ts index 057e16d2155..468ff929b4c 100644 --- a/ts/test-node/util/uploads/tusProtocol_test.ts +++ b/ts/test-node/util/uploads/tusProtocol_test.ts @@ -8,9 +8,9 @@ import { _tusGetCurrentOffsetRequest, _tusResumeUploadRequest, tusUpload, -} from '../../../util/uploads/tusProtocol'; -import { TestServer, body } from './helpers'; -import { toLogFormat } from '../../../types/errors'; +} from '../../../util/uploads/tusProtocol.js'; +import { TestServer, body } from './helpers.js'; +import { toLogFormat } from '../../../types/errors.js'; describe('tusProtocol', () => { describe('_getUploadMetadataHeader', () => { diff --git a/ts/test-node/util/url_test.ts b/ts/test-node/util/url_test.ts index 0d0bc4335ab..bb920a245c7 100644 --- a/ts/test-node/util/url_test.ts +++ b/ts/test-node/util/url_test.ts @@ -2,13 +2,13 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { size } from '../../util/iterables'; +import { size } from '../../util/iterables.js'; import { maybeParseUrl, setUrlSearchParams, urlPathFromComponents, -} from '../../util/url'; +} from '../../util/url.js'; describe('URL utilities', () => { describe('maybeParseUrl', () => { diff --git a/ts/test-node/util/userLanguages_test.ts b/ts/test-node/util/userLanguages_test.ts index f9261d1d187..7da216a45d7 100644 --- a/ts/test-node/util/userLanguages_test.ts +++ b/ts/test-node/util/userLanguages_test.ts @@ -5,7 +5,7 @@ import { assert } from 'chai'; import { formatAcceptLanguageHeader, getUserLanguages, -} from '../../util/userLanguages'; +} from '../../util/userLanguages.js'; describe('user language utilities', () => { describe('formatAcceptLanguageHeader', () => { diff --git a/ts/test-node/util/version_test.ts b/ts/test-node/util/version_test.ts index ca3ae4dfc0a..e3262a30061 100644 --- a/ts/test-node/util/version_test.ts +++ b/ts/test-node/util/version_test.ts @@ -13,7 +13,7 @@ import { isBeta, isProduction, isStaging, -} from '../../util/version'; +} from '../../util/version.js'; describe('version utilities', () => { describe('isProduction', () => { diff --git a/ts/test-node/util/waitBatcher_test.ts b/ts/test-node/util/waitBatcher_test.ts index a6e9b476bc8..4f75586f736 100644 --- a/ts/test-node/util/waitBatcher_test.ts +++ b/ts/test-node/util/waitBatcher_test.ts @@ -4,9 +4,9 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; -import { createWaitBatcher } from '../../util/waitBatcher'; -import { drop } from '../../util/drop'; -import { sleep } from '../../util/sleep'; +import { createWaitBatcher } from '../../util/waitBatcher.js'; +import { drop } from '../../util/drop.js'; +import { sleep } from '../../util/sleep.js'; describe('waitBatcher', () => { let processBatch: sinon.SinonSpy; diff --git a/ts/test-node/util/waitForAll.ts b/ts/test-node/util/waitForAll.ts index 52d64179146..f64c6b995e5 100644 --- a/ts/test-node/util/waitForAll.ts +++ b/ts/test-node/util/waitForAll.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { waitForAll } from '../../util/waitForAll'; +import { waitForAll } from '../../util/waitForAll.js'; describe('util/waitForAll', () => { it('returns result of provided tasks', async () => { diff --git a/ts/test-node/util/webSafeBase64_test.ts b/ts/test-node/util/webSafeBase64_test.ts index 7e0fe2f5d5a..3d39a4f4772 100644 --- a/ts/test-node/util/webSafeBase64_test.ts +++ b/ts/test-node/util/webSafeBase64_test.ts @@ -3,7 +3,10 @@ import { assert } from 'chai'; -import { toWebSafeBase64, fromWebSafeBase64 } from '../../util/webSafeBase64'; +import { + toWebSafeBase64, + fromWebSafeBase64, +} from '../../util/webSafeBase64.js'; describe('both/util/webSafeBase64', () => { it('roundtrips with all elements', () => { diff --git a/ts/test-node/util/windowsZoneIdentifier_test.ts b/ts/test-node/util/windowsZoneIdentifier_test.ts index 74f70bcffb1..0be2625a57b 100644 --- a/ts/test-node/util/windowsZoneIdentifier_test.ts +++ b/ts/test-node/util/windowsZoneIdentifier_test.ts @@ -2,13 +2,13 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import * as path from 'path'; -import * as os from 'os'; -import * as fs from 'fs'; +import * as path from 'node:path'; +import * as os from 'node:os'; +import * as fs from 'node:fs'; import * as fse from 'fs-extra'; import * as Sinon from 'sinon'; -import { writeWindowsZoneIdentifier } from '../../util/windowsZoneIdentifier'; +import { writeWindowsZoneIdentifier } from '../../util/windowsZoneIdentifier.js'; describe('writeWindowsZoneIdentifier', () => { before(function (this: Mocha.Context) { diff --git a/ts/test-node/util/wrapEventEmitterOnce_test.ts b/ts/test-node/util/wrapEventEmitterOnce_test.ts index d5b3b033430..fe8904e3ca1 100644 --- a/ts/test-node/util/wrapEventEmitterOnce_test.ts +++ b/ts/test-node/util/wrapEventEmitterOnce_test.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { EventEmitter } from 'events'; +import { EventEmitter } from 'node:events'; -import { wrapEventEmitterOnce as once } from '../../util/wrapEventEmitterOnce'; +import { wrapEventEmitterOnce as once } from '../../util/wrapEventEmitterOnce.js'; describe('wrapEventEmitterOnce', () => { let ee: EventEmitter; diff --git a/ts/textsecure/AccountManager.ts b/ts/textsecure/AccountManager.ts index e99df27ca8d..24499836603 100644 --- a/ts/textsecure/AccountManager.ts +++ b/ts/textsecure/AccountManager.ts @@ -8,29 +8,29 @@ import { AccountEntropyPool, BackupKey, } from '@signalapp/libsignal-client/dist/AccountKeys'; -import { Readable } from 'stream'; +import { Readable } from 'node:stream'; -import EventTarget from './EventTarget'; +import EventTarget from './EventTarget.js'; import type { UploadKeysType, UploadKyberPreKeyType, UploadPreKeyType, UploadSignedPreKeyType, WebAPIType, -} from './WebAPI'; +} from './WebAPI.js'; import type { CompatPreKeyType, CompatSignedPreKeyType, KeyPairType, KyberPreKeyType, PniKeyMaterialType, -} from './Types.d'; -import createTaskWithTimeout from './TaskWithTimeout'; -import * as Bytes from '../Bytes'; -import * as Errors from '../types/errors'; -import { isMockEnvironment } from '../environment'; -import { senderCertificateService } from '../services/senderCertificate'; -import { backupsService } from '../services/backups'; +} from './Types.d.ts'; +import createTaskWithTimeout from './TaskWithTimeout.js'; +import * as Bytes from '../Bytes.js'; +import * as Errors from '../types/errors.js'; +import { isMockEnvironment } from '../environment.js'; +import { senderCertificateService } from '../services/senderCertificate.js'; +import { backupsService } from '../services/backups/index.js'; import { decryptDeviceName, deriveAccessKey, @@ -39,35 +39,39 @@ import { encryptDeviceName, generateRegistrationId, getRandomBytes, -} from '../Crypto'; +} from '../Crypto.js'; import { generateKeyPair, generateKyberPreKey, generatePreKey, generateSignedPreKey, -} from '../Curve'; -import type { AciString, PniString, ServiceIdString } from '../types/ServiceId'; +} from '../Curve.js'; +import type { + AciString, + PniString, + ServiceIdString, +} from '../types/ServiceId.js'; import { isUntaggedPniString, normalizePni, ServiceIdKind, toTaggedPni, -} from '../types/ServiceId'; -import { normalizeAci } from '../util/normalizeAci'; -import { drop } from '../util/drop'; -import { isMoreRecentThan, isOlderThan } from '../util/timestamp'; -import { ourProfileKeyService } from '../services/ourProfileKey'; -import { strictAssert } from '../util/assert'; -import { getRegionCodeForNumber } from '../util/libphonenumberUtil'; -import { isNotNil } from '../util/isNotNil'; -import { missingCaseError } from '../util/missingCaseError'; -import { SignalService as Proto } from '../protobuf'; -import { createLogger } from '../logging/log'; -import type { StorageAccessType } from '../types/Storage'; -import { getRelativePath, createName } from '../util/attachmentPath'; -import { isLinkAndSyncEnabled } from '../util/isLinkAndSyncEnabled'; -import { getMessageQueueTime } from '../util/getMessageQueueTime'; -import { canAttemptRemoteBackupDownload } from '../util/isBackupEnabled'; +} from '../types/ServiceId.js'; +import { normalizeAci } from '../util/normalizeAci.js'; +import { drop } from '../util/drop.js'; +import { isMoreRecentThan, isOlderThan } from '../util/timestamp.js'; +import { ourProfileKeyService } from '../services/ourProfileKey.js'; +import { strictAssert } from '../util/assert.js'; +import { getRegionCodeForNumber } from '../util/libphonenumberUtil.js'; +import { isNotNil } from '../util/isNotNil.js'; +import { missingCaseError } from '../util/missingCaseError.js'; +import { SignalService as Proto } from '../protobuf/index.js'; +import { createLogger } from '../logging/log.js'; +import type { StorageAccessType } from '../types/Storage.js'; +import { getRelativePath, createName } from '../util/attachmentPath.js'; +import { isLinkAndSyncEnabled } from '../util/isLinkAndSyncEnabled.js'; +import { getMessageQueueTime } from '../util/getMessageQueueTime.js'; +import { canAttemptRemoteBackupDownload } from '../util/isBackupEnabled.js'; const log = createLogger('AccountManager'); diff --git a/ts/textsecure/ContactsParser.ts b/ts/textsecure/ContactsParser.ts index 2d9aef7128b..e7fabbea357 100644 --- a/ts/textsecure/ContactsParser.ts +++ b/ts/textsecure/ContactsParser.ts @@ -1,23 +1,23 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { Transform } from 'stream'; +import { Transform } from 'node:stream'; -import { createLogger } from '../logging/log'; -import { SignalService as Proto } from '../protobuf'; -import protobuf from '../protobuf/wrap'; -import { DurationInSeconds } from '../util/durations'; -import type { ContactAvatarType } from '../types/Avatar'; -import type { AttachmentType } from '../types/Attachment'; -import type { AciString } from '../types/ServiceId'; -import { computeHash } from '../Crypto'; -import { dropNull } from '../util/dropNull'; -import { fromAciUuidBytesOrString } from '../util/ServiceId'; -import * as Bytes from '../Bytes'; -import { decryptAttachmentV2ToSink } from '../AttachmentCrypto'; +import { createLogger } from '../logging/log.js'; +import { SignalService as Proto } from '../protobuf/index.js'; +import protobuf from '../protobuf/wrap.js'; +import { DurationInSeconds } from '../util/durations/index.js'; +import type { ContactAvatarType } from '../types/Avatar.js'; +import type { AttachmentType } from '../types/Attachment.js'; +import type { AciString } from '../types/ServiceId.js'; +import { computeHash } from '../Crypto.js'; +import { dropNull } from '../util/dropNull.js'; +import { fromAciUuidBytesOrString } from '../util/ServiceId.js'; +import * as Bytes from '../Bytes.js'; +import { decryptAttachmentV2ToSink } from '../AttachmentCrypto.js'; import Avatar = Proto.ContactDetails.IAvatar; -import { stringToMIMEType } from '../types/MIME'; +import { stringToMIMEType } from '../types/MIME.js'; const log = createLogger('ContactsParser'); diff --git a/ts/textsecure/Errors.ts b/ts/textsecure/Errors.ts index eb7d1b7f847..05c062d7339 100644 --- a/ts/textsecure/Errors.ts +++ b/ts/textsecure/Errors.ts @@ -6,11 +6,11 @@ import type { Response } from 'node-fetch'; import type { LibSignalErrorBase } from '@signalapp/libsignal-client'; -import { parseRetryAfter } from '../util/parseRetryAfter'; -import type { ServiceIdString } from '../types/ServiceId'; +import { parseRetryAfter } from '../util/parseRetryAfter.js'; +import type { ServiceIdString } from '../types/ServiceId.js'; -import type { CallbackResultType } from './Types.d'; -import type { HeaderListType } from './WebAPI'; +import type { CallbackResultType } from './Types.d.ts'; +import type { HeaderListType } from './WebAPI.js'; function appendStack(newError: Error, originalError: Error) { // eslint-disable-next-line no-param-reassign diff --git a/ts/textsecure/KeyChangeListener.ts b/ts/textsecure/KeyChangeListener.ts index 58e5ca170f6..d8a08b3c575 100644 --- a/ts/textsecure/KeyChangeListener.ts +++ b/ts/textsecure/KeyChangeListener.ts @@ -1,8 +1,8 @@ // Copyright 2017 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ServiceIdString } from '../types/ServiceId'; -import type { SignalProtocolStore } from '../SignalProtocolStore'; +import type { ServiceIdString } from '../types/ServiceId.js'; +import type { SignalProtocolStore } from '../SignalProtocolStore.js'; export function init(signalProtocolStore: SignalProtocolStore): void { signalProtocolStore.on( diff --git a/ts/textsecure/MessageReceiver.ts b/ts/textsecure/MessageReceiver.ts index 0af97811b72..92f06412607 100644 --- a/ts/textsecure/MessageReceiver.ts +++ b/ts/textsecure/MessageReceiver.ts @@ -38,22 +38,22 @@ import { SenderKeys, Sessions, SignedPreKeys, -} from '../LibSignalStores'; -import { createName } from '../util/attachmentPath'; -import { assertDev, strictAssert } from '../util/assert'; -import type { BatcherType } from '../util/batcher'; -import { createBatcher } from '../util/batcher'; -import { drop } from '../util/drop'; -import { dropNull } from '../util/dropNull'; -import { parseIntOrThrow } from '../util/parseIntOrThrow'; -import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary'; -import { Zone } from '../util/Zone'; -import * as durations from '../util/durations'; -import { DurationInSeconds } from '../util/durations'; -import { Address } from '../types/Address'; -import { QualifiedAddress } from '../types/QualifiedAddress'; -import { normalizeStoryDistributionId } from '../types/StoryDistributionId'; -import type { ServiceIdString, AciString } from '../types/ServiceId'; +} from '../LibSignalStores.js'; +import { createName } from '../util/attachmentPath.js'; +import { assertDev, strictAssert } from '../util/assert.js'; +import type { BatcherType } from '../util/batcher.js'; +import { createBatcher } from '../util/batcher.js'; +import { drop } from '../util/drop.js'; +import { dropNull } from '../util/dropNull.js'; +import { parseIntOrThrow } from '../util/parseIntOrThrow.js'; +import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary.js'; +import { Zone } from '../util/Zone.js'; +import * as durations from '../util/durations/index.js'; +import { DurationInSeconds } from '../util/durations/index.js'; +import { Address } from '../types/Address.js'; +import { QualifiedAddress } from '../types/QualifiedAddress.js'; +import { normalizeStoryDistributionId } from '../types/StoryDistributionId.js'; +import type { ServiceIdString, AciString } from '../types/ServiceId.js'; import { fromPniObject, isPniString, @@ -63,30 +63,30 @@ import { normalizeServiceId, ServiceIdKind, toTaggedPni, -} from '../types/ServiceId'; -import { normalizeAci } from '../util/normalizeAci'; -import { isAciString } from '../util/isAciString'; -import * as Errors from '../types/errors'; -import { isPQRatchetEnabled } from '../util/isPQRatchetEnabled'; +} from '../types/ServiceId.js'; +import { normalizeAci } from '../util/normalizeAci.js'; +import { isAciString } from '../util/isAciString.js'; +import * as Errors from '../types/errors.js'; +import { isPQRatchetEnabled } from '../util/isPQRatchetEnabled.js'; -import { SignalService as Proto } from '../protobuf'; -import { deriveGroupFields, MASTER_KEY_LENGTH } from '../groups'; +import { SignalService as Proto } from '../protobuf/index.js'; +import { deriveGroupFields, MASTER_KEY_LENGTH } from '../groups.js'; -import createTaskWithTimeout from './TaskWithTimeout'; +import createTaskWithTimeout from './TaskWithTimeout.js'; import { processAttachment, processDataMessage, processGroupV2Context, processPreview, -} from './processDataMessage'; -import { processSyncMessage } from './processSyncMessage'; -import type { EventHandler } from './EventTarget'; -import EventTarget from './EventTarget'; -import type { IncomingWebSocketRequest } from './WebsocketResources'; -import { ServerRequestType } from './WebsocketResources'; -import type { Storage } from './Storage'; -import { WarnOnlyError } from './Errors'; -import * as Bytes from '../Bytes'; +} from './processDataMessage.js'; +import { processSyncMessage } from './processSyncMessage.js'; +import type { EventHandler } from './EventTarget.js'; +import EventTarget from './EventTarget.js'; +import type { IncomingWebSocketRequest } from './WebsocketResources.js'; +import { ServerRequestType } from './WebsocketResources.js'; +import type { Storage } from './Storage.js'; +import { WarnOnlyError } from './Errors.js'; +import * as Bytes from '../Bytes.js'; import type { IRequestHandler, ProcessedAttachment, @@ -96,7 +96,7 @@ import type { ProcessedSent, ProcessedSyncMessage, UnprocessedType, -} from './Types.d'; +} from './Types.d.ts'; import type { ConversationIdentifier, DeleteForMeSyncEventData, @@ -106,7 +106,7 @@ import type { AddressableMessage, ReadSyncEventData, ViewSyncEventData, -} from './messageReceiverEvents'; +} from './messageReceiverEvents.js'; import { AttachmentBackfillResponseSyncEvent, CallEventSyncEvent, @@ -139,36 +139,36 @@ import { ViewEvent, ViewOnceOpenSyncEvent, ViewSyncEvent, -} from './messageReceiverEvents'; -import { createLogger } from '../logging/log'; -import { diffArraysAsSets } from '../util/diffArraysAsSets'; -import { generateBlurHash } from '../util/generateBlurHash'; -import { TEXT_ATTACHMENT } from '../types/MIME'; -import type { SendTypesType } from '../util/handleMessageSend'; -import { getStoriesBlocked } from '../util/stories'; -import { isNotNil } from '../util/isNotNil'; -import { chunk } from '../util/iterables'; -import { inspectUnknownFieldTags } from '../util/inspectProtobufs'; -import { incrementMessageCounter } from '../util/incrementMessageCounter'; -import { filterAndClean } from '../types/BodyRange'; +} from './messageReceiverEvents.js'; +import { createLogger } from '../logging/log.js'; +import { diffArraysAsSets } from '../util/diffArraysAsSets.js'; +import { generateBlurHash } from '../util/generateBlurHash.js'; +import { TEXT_ATTACHMENT } from '../types/MIME.js'; +import type { SendTypesType } from '../util/handleMessageSend.js'; +import { getStoriesBlocked } from '../util/stories.js'; +import { isNotNil } from '../util/isNotNil.js'; +import { chunk } from '../util/iterables.js'; +import { inspectUnknownFieldTags } from '../util/inspectProtobufs.js'; +import { incrementMessageCounter } from '../util/incrementMessageCounter.js'; +import { filterAndClean } from '../types/BodyRange.js'; import { getCallEventForProto, getCallLogEventForProto, -} from '../util/callDisposition'; -import { checkOurPniIdentityKey } from '../util/checkOurPniIdentityKey'; -import { CallLinkUpdateSyncType } from '../types/CallLink'; -import { bytesToUuid } from '../util/uuidToBytes'; -import { isBodyTooLong } from '../util/longAttachment'; +} from '../util/callDisposition.js'; +import { checkOurPniIdentityKey } from '../util/checkOurPniIdentityKey.js'; +import { CallLinkUpdateSyncType } from '../types/CallLink.js'; +import { bytesToUuid } from '../util/uuidToBytes.js'; +import { isBodyTooLong } from '../util/longAttachment.js'; import { fromServiceIdBinaryOrString, fromAciUuidBytes, fromAciUuidBytesOrString, fromPniUuidBytesOrUntaggedString, -} from '../util/ServiceId'; +} from '../util/ServiceId.js'; import { type MessageRequestResponseInfo, MessageRequestResponseSource, -} from '../types/MessageRequestResponseEvent'; +} from '../types/MessageRequestResponseEvent.js'; const log = createLogger('MessageReceiver'); diff --git a/ts/textsecure/OutgoingMessage.ts b/ts/textsecure/OutgoingMessage.ts index 4dfbec35c99..20e8a5ef56c 100644 --- a/ts/textsecure/OutgoingMessage.ts +++ b/ts/textsecure/OutgoingMessage.ts @@ -23,8 +23,8 @@ import { UnidentifiedSenderMessageContent, } from '@signalapp/libsignal-client'; -import type { WebAPIType, MessageType } from './WebAPI'; -import type { SendMetadataType, SendOptionsType } from './SendMessage'; +import type { WebAPIType, MessageType } from './WebAPI.js'; +import type { SendMetadataType, SendOptionsType } from './SendMessage.js'; import { OutgoingIdentityKeyError, OutgoingMessageError, @@ -32,19 +32,19 @@ import { SendMessageChallengeError, UnregisteredUserError, HTTPError, -} from './Errors'; -import type { CallbackResultType, CustomError } from './Types.d'; -import { Address } from '../types/Address'; -import * as Errors from '../types/errors'; -import { QualifiedAddress } from '../types/QualifiedAddress'; -import type { ServiceIdString } from '../types/ServiceId'; -import { Sessions, IdentityKeys } from '../LibSignalStores'; -import { getKeysForServiceId } from './getKeysForServiceId'; -import { SignalService as Proto } from '../protobuf'; -import { createLogger } from '../logging/log'; -import type { GroupSendToken } from '../types/GroupSendEndorsements'; -import { isSignalServiceId } from '../util/isSignalConversation'; -import * as Bytes from '../Bytes'; +} from './Errors.js'; +import type { CallbackResultType, CustomError } from './Types.d.ts'; +import { Address } from '../types/Address.js'; +import * as Errors from '../types/errors.js'; +import { QualifiedAddress } from '../types/QualifiedAddress.js'; +import type { ServiceIdString } from '../types/ServiceId.js'; +import { Sessions, IdentityKeys } from '../LibSignalStores.js'; +import { getKeysForServiceId } from './getKeysForServiceId.js'; +import { SignalService as Proto } from '../protobuf/index.js'; +import { createLogger } from '../logging/log.js'; +import type { GroupSendToken } from '../types/GroupSendEndorsements.js'; +import { isSignalServiceId } from '../util/isSignalConversation.js'; +import * as Bytes from '../Bytes.js'; const log = createLogger('OutgoingMessage'); diff --git a/ts/textsecure/Provisioner.ts b/ts/textsecure/Provisioner.ts index 7f0d40abcff..d8be501006d 100644 --- a/ts/textsecure/Provisioner.ts +++ b/ts/textsecure/Provisioner.ts @@ -3,35 +3,35 @@ import pTimeout, { TimeoutError as PTimeoutError } from 'p-timeout'; -import { createLogger } from '../logging/log'; -import * as Errors from '../types/errors'; -import { MAX_DEVICE_NAME_LENGTH } from '../types/InstallScreen'; -import { strictAssert } from '../util/assert'; -import { BackOff, FIBONACCI_TIMEOUTS } from '../util/BackOff'; -import { SECOND } from '../util/durations'; -import { explodePromise } from '../util/explodePromise'; -import { drop } from '../util/drop'; -import { isLinkAndSyncEnabled } from '../util/isLinkAndSyncEnabled'; -import { normalizeDeviceName } from '../util/normalizeDeviceName'; -import { linkDeviceRoute } from '../util/signalRoutes'; -import { sleep } from '../util/sleep'; -import * as Bytes from '../Bytes'; -import { SignalService as Proto } from '../protobuf'; +import { createLogger } from '../logging/log.js'; +import * as Errors from '../types/errors.js'; +import { MAX_DEVICE_NAME_LENGTH } from '../types/InstallScreen.js'; +import { strictAssert } from '../util/assert.js'; +import { BackOff, FIBONACCI_TIMEOUTS } from '../util/BackOff.js'; +import { SECOND } from '../util/durations/index.js'; +import { explodePromise } from '../util/explodePromise.js'; +import { drop } from '../util/drop.js'; +import { isLinkAndSyncEnabled } from '../util/isLinkAndSyncEnabled.js'; +import { normalizeDeviceName } from '../util/normalizeDeviceName.js'; +import { linkDeviceRoute } from '../util/signalRoutes.js'; +import { sleep } from '../util/sleep.js'; +import * as Bytes from '../Bytes.js'; +import { SignalService as Proto } from '../protobuf/index.js'; import { type CreateLinkedDeviceOptionsType, AccountType, -} from './AccountManager'; +} from './AccountManager.js'; import ProvisioningCipher, { type ProvisionDecryptResult, -} from './ProvisioningCipher'; +} from './ProvisioningCipher.js'; import { type IWebSocketResource, type IncomingWebSocketRequest, ServerRequestType, -} from './WebsocketResources'; -import { ConnectTimeoutError } from './Errors'; -import { type WebAPIType } from './WebAPI'; +} from './WebsocketResources.js'; +import { ConnectTimeoutError } from './Errors.js'; +import { type WebAPIType } from './WebAPI.js'; const log = createLogger('Provisioner'); diff --git a/ts/textsecure/ProvisioningCipher.ts b/ts/textsecure/ProvisioningCipher.ts index a003b7867a0..48760177023 100644 --- a/ts/textsecure/ProvisioningCipher.ts +++ b/ts/textsecure/ProvisioningCipher.ts @@ -4,18 +4,22 @@ /* eslint-disable max-classes-per-file */ import { PublicKey, Aci, Pni } from '@signalapp/libsignal-client'; -import type { KeyPairType } from './Types.d'; -import * as Bytes from '../Bytes'; +import type { KeyPairType } from './Types.d.ts'; +import * as Bytes from '../Bytes.js'; import { decryptAes256CbcPkcsPadding, deriveSecrets, verifyHmacSha256, -} from '../Crypto'; -import { calculateAgreement, createKeyPair, generateKeyPair } from '../Curve'; -import { SignalService as Proto } from '../protobuf'; -import { strictAssert } from '../util/assert'; -import { dropNull } from '../util/dropNull'; -import { normalizeAci } from '../util/normalizeAci'; +} from '../Crypto.js'; +import { + calculateAgreement, + createKeyPair, + generateKeyPair, +} from '../Curve.js'; +import { SignalService as Proto } from '../protobuf/index.js'; +import { strictAssert } from '../util/assert.js'; +import { dropNull } from '../util/dropNull.js'; +import { normalizeAci } from '../util/normalizeAci.js'; import { type AciString, type PniString, @@ -24,7 +28,7 @@ import { isUntaggedPniString, fromAciObject, fromPniObject, -} from '../types/ServiceId'; +} from '../types/ServiceId.js'; export type ProvisionDecryptResult = Readonly<{ aciKeyPair: KeyPairType; diff --git a/ts/textsecure/SendMessage.ts b/ts/textsecure/SendMessage.ts index 390279080a8..49edf445e70 100644 --- a/ts/textsecure/SendMessage.ts +++ b/ts/textsecure/SendMessage.ts @@ -15,94 +15,101 @@ import { SenderKeyDistributionMessage, } from '@signalapp/libsignal-client'; -import { DataWriter } from '../sql/Client'; -import type { ConversationModel } from '../models/conversations'; -import { GLOBAL_ZONE } from '../SignalProtocolStore'; -import { assertDev, strictAssert } from '../util/assert'; -import { parseIntOrThrow } from '../util/parseIntOrThrow'; -import { Address } from '../types/Address'; -import { QualifiedAddress } from '../types/QualifiedAddress'; -import { SenderKeys } from '../LibSignalStores'; +import { DataWriter } from '../sql/Client.js'; +import type { ConversationModel } from '../models/conversations.js'; +import { GLOBAL_ZONE } from '../SignalProtocolStore.js'; +import { assertDev, strictAssert } from '../util/assert.js'; +import { parseIntOrThrow } from '../util/parseIntOrThrow.js'; +import { Address } from '../types/Address.js'; +import { QualifiedAddress } from '../types/QualifiedAddress.js'; +import { SenderKeys } from '../LibSignalStores.js'; import type { TextAttachmentType, UploadedAttachmentType, -} from '../types/Attachment'; -import type { AciString, ServiceIdString } from '../types/ServiceId'; +} from '../types/Attachment.js'; +import type { AciString, ServiceIdString } from '../types/ServiceId.js'; import { ServiceIdKind, serviceIdSchema, isPniString, -} from '../types/ServiceId'; -import { toAciObject, toPniObject, toServiceIdObject } from '../util/ServiceId'; +} from '../types/ServiceId.js'; +import { + toAciObject, + toPniObject, + toServiceIdObject, +} from '../util/ServiceId.js'; import type { ChallengeType, GetGroupLogOptionsType, GroupCredentialsType, GroupLogResponseType, WebAPIType, -} from './WebAPI'; -import createTaskWithTimeout from './TaskWithTimeout'; +} from './WebAPI.js'; +import createTaskWithTimeout from './TaskWithTimeout.js'; import type { CallbackResultType, StorageServiceCallOptionsType, StorageServiceCredentials, -} from './Types.d'; +} from './Types.d.ts'; import type { SerializedCertificateType, SendLogCallbackType, -} from './OutgoingMessage'; -import OutgoingMessage from './OutgoingMessage'; -import * as Bytes from '../Bytes'; -import { getRandomBytes } from '../Crypto'; +} from './OutgoingMessage.js'; +import OutgoingMessage from './OutgoingMessage.js'; +import * as Bytes from '../Bytes.js'; +import { getRandomBytes } from '../Crypto.js'; import { MessageError, SendMessageProtoError, HTTPError, NoSenderKeyError, -} from './Errors'; -import { BodyRange } from '../types/BodyRange'; -import type { RawBodyRange } from '../types/BodyRange'; -import type { StoryContextType } from '../types/Util'; +} from './Errors.js'; +import { BodyRange } from '../types/BodyRange.js'; +import type { RawBodyRange } from '../types/BodyRange.js'; +import type { StoryContextType } from '../types/Util.js'; import type { LinkPreviewImage, LinkPreviewMetadata, -} from '../linkPreviews/linkPreviewFetch'; -import { concat, isEmpty } from '../util/iterables'; -import type { SendTypesType } from '../util/handleMessageSend'; -import { shouldSaveProto, sendTypesEnum } from '../util/handleMessageSend'; -import type { DurationInSeconds } from '../util/durations'; -import { SignalService as Proto } from '../protobuf'; -import { createLogger } from '../logging/log'; -import type { EmbeddedContactWithUploadedAvatar } from '../types/EmbeddedContact'; +} from '../linkPreviews/linkPreviewFetch.js'; +import { concat, isEmpty } from '../util/iterables.js'; +import type { SendTypesType } from '../util/handleMessageSend.js'; +import { shouldSaveProto, sendTypesEnum } from '../util/handleMessageSend.js'; +import type { DurationInSeconds } from '../util/durations/index.js'; +import { SignalService as Proto } from '../protobuf/index.js'; +import { createLogger } from '../logging/log.js'; +import type { EmbeddedContactWithUploadedAvatar } from '../types/EmbeddedContact.js'; import { numberToPhoneType, numberToEmailType, numberToAddressType, -} from '../types/EmbeddedContact'; -import { missingCaseError } from '../util/missingCaseError'; -import { drop } from '../util/drop'; +} from '../types/EmbeddedContact.js'; +import { missingCaseError } from '../util/missingCaseError.js'; +import { drop } from '../util/drop.js'; import type { ConversationIdentifier, DeleteForMeSyncEventData, DeleteMessageSyncTarget, AddressableMessage, -} from './messageReceiverEvents'; -import { getConversationFromTarget } from '../util/syncIdentifiers'; -import type { CallDetails, CallHistoryDetails } from '../types/CallDisposition'; +} from './messageReceiverEvents.js'; +import { getConversationFromTarget } from '../util/syncIdentifiers.js'; +import type { + CallDetails, + CallHistoryDetails, +} from '../types/CallDisposition.js'; import { AdhocCallStatus, DirectCallStatus, GroupCallStatus, CallMode, -} from '../types/CallDisposition'; +} from '../types/CallDisposition.js'; import { getBytesForPeerId, getCallIdForProto, getProtoForCallHistory, -} from '../util/callDisposition'; -import { MAX_MESSAGE_COUNT } from '../util/deleteForMe.types'; -import { isProtoBinaryEncodingEnabled } from '../util/isProtoBinaryEncodingEnabled'; -import type { GroupSendToken } from '../types/GroupSendEndorsements'; +} from '../util/callDisposition.js'; +import { MAX_MESSAGE_COUNT } from '../util/deleteForMe.types.js'; +import { isProtoBinaryEncodingEnabled } from '../util/isProtoBinaryEncodingEnabled.js'; +import type { GroupSendToken } from '../types/GroupSendEndorsements.js'; const log = createLogger('SendMessage'); diff --git a/ts/textsecure/SocketManager.ts b/ts/textsecure/SocketManager.ts index 5b47bf170e0..a258e9e3c10 100644 --- a/ts/textsecure/SocketManager.ts +++ b/ts/textsecure/SocketManager.ts @@ -6,47 +6,47 @@ import { LibSignalErrorBase, type Net, } from '@signalapp/libsignal-client'; -import URL from 'url'; +import URL from 'node:url'; import type { RequestInit, Response } from 'node-fetch'; import { Headers } from 'node-fetch'; import type { connection as WebSocket } from 'websocket'; -import qs from 'querystring'; -import EventListener from 'events'; -import type { IncomingMessage } from 'http'; +import qs from 'node:querystring'; +import EventListener from 'node:events'; +import type { IncomingMessage } from 'node:http'; import { setTimeout as sleep } from 'node:timers/promises'; -import type { AbortableProcess } from '../util/AbortableProcess'; -import { strictAssert } from '../util/assert'; -import { explodePromise } from '../util/explodePromise'; +import type { AbortableProcess } from '../util/AbortableProcess.js'; +import { strictAssert } from '../util/assert.js'; +import { explodePromise } from '../util/explodePromise.js'; import { BackOff, EXTENDED_FIBONACCI_TIMEOUTS, FIBONACCI_TIMEOUTS, -} from '../util/BackOff'; -import * as durations from '../util/durations'; -import { drop } from '../util/drop'; -import type { ProxyAgent } from '../util/createProxyAgent'; -import { createProxyAgent } from '../util/createProxyAgent'; -import { type SocketInfo, SocketStatus } from '../types/SocketStatus'; -import * as Errors from '../types/errors'; -import * as Bytes from '../Bytes'; -import { createLogger } from '../logging/log'; +} from '../util/BackOff.js'; +import * as durations from '../util/durations/index.js'; +import { drop } from '../util/drop.js'; +import type { ProxyAgent } from '../util/createProxyAgent.js'; +import { createProxyAgent } from '../util/createProxyAgent.js'; +import { type SocketInfo, SocketStatus } from '../types/SocketStatus.js'; +import * as Errors from '../types/errors.js'; +import * as Bytes from '../Bytes.js'; +import { createLogger } from '../logging/log.js'; import type { IncomingWebSocketRequest, IWebSocketResource, WebSocketResourceOptions, -} from './WebsocketResources'; +} from './WebsocketResources.js'; import WebSocketResource, { connectAuthenticatedLibsignal, connectUnauthenticatedLibsignal, ServerRequestType, -} from './WebsocketResources'; -import { ConnectTimeoutError, HTTPError } from './Errors'; -import type { IRequestHandler, WebAPICredentials } from './Types.d'; -import { connect as connectWebSocket } from './WebSocket'; -import { type ServerAlert } from '../util/handleServerAlerts'; -import { getUserLanguages } from '../util/userLanguages'; +} from './WebsocketResources.js'; +import { ConnectTimeoutError, HTTPError } from './Errors.js'; +import type { IRequestHandler, WebAPICredentials } from './Types.d.ts'; +import { connect as connectWebSocket } from './WebSocket.js'; +import { type ServerAlert } from '../util/handleServerAlerts.js'; +import { getUserLanguages } from '../util/userLanguages.js'; const log = createLogger('SocketManager'); diff --git a/ts/textsecure/Storage.ts b/ts/textsecure/Storage.ts index 46c2bc63591..ab2e7de68e2 100644 --- a/ts/textsecure/Storage.ts +++ b/ts/textsecure/Storage.ts @@ -4,14 +4,14 @@ import type { StorageAccessType as Access, StorageInterface, -} from '../types/Storage.d'; -import { User } from './storage/User'; -import { Blocked } from './storage/Blocked'; +} from '../types/Storage.d.ts'; +import { User } from './storage/User.js'; +import { Blocked } from './storage/Blocked.js'; -import { assertDev } from '../util/assert'; -import { DataReader, DataWriter } from '../sql/Client'; -import type { SignalProtocolStore } from '../SignalProtocolStore'; -import { createLogger } from '../logging/log'; +import { assertDev } from '../util/assert.js'; +import { DataReader, DataWriter } from '../sql/Client.js'; +import type { SignalProtocolStore } from '../SignalProtocolStore.js'; +import { createLogger } from '../logging/log.js'; const log = createLogger('Storage'); diff --git a/ts/textsecure/TaskWithTimeout.ts b/ts/textsecure/TaskWithTimeout.ts index f3904a4ee2e..897c29ab636 100644 --- a/ts/textsecure/TaskWithTimeout.ts +++ b/ts/textsecure/TaskWithTimeout.ts @@ -1,11 +1,11 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { MINUTE } from '../util/durations'; -import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary'; -import { explodePromise } from '../util/explodePromise'; -import { toLogFormat } from '../types/errors'; -import { createLogger } from '../logging/log'; +import { MINUTE } from '../util/durations/index.js'; +import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary.js'; +import { explodePromise } from '../util/explodePromise.js'; +import { toLogFormat } from '../types/errors.js'; +import { createLogger } from '../logging/log.js'; const log = createLogger('TaskWithTimeout'); diff --git a/ts/textsecure/Types.d.ts b/ts/textsecure/Types.d.ts index 8bd4b6f1d1c..7539bad8067 100644 --- a/ts/textsecure/Types.d.ts +++ b/ts/textsecure/Types.d.ts @@ -3,15 +3,19 @@ import type * as client from '@signalapp/libsignal-client'; -import type { SignalService as Proto } from '../protobuf'; -import type { IncomingWebSocketRequest } from './WebsocketResources'; -import type { ServiceIdString, AciString, PniString } from '../types/ServiceId'; -import type { TextAttachmentType } from '../types/Attachment'; -import type { GiftBadgeStates } from '../components/conversation/Message'; -import type { MIMEType } from '../types/MIME'; -import type { DurationInSeconds } from '../util/durations'; -import type { AnyPaymentEvent } from '../types/Payment'; -import type { RawBodyRange } from '../types/BodyRange'; +import type { SignalService as Proto } from '../protobuf/index.js'; +import type { IncomingWebSocketRequest } from './WebsocketResources.js'; +import type { + ServiceIdString, + AciString, + PniString, +} from '../types/ServiceId.js'; +import type { TextAttachmentType } from '../types/Attachment.js'; +import type { GiftBadgeStates } from '../components/conversation/Message.js'; +import type { MIMEType } from '../types/MIME.js'; +import type { DurationInSeconds } from '../util/durations/index.js'; +import type { AnyPaymentEvent } from '../types/Payment.js'; +import type { RawBodyRange } from '../types/BodyRange.js'; export { IdentityKeyType, @@ -26,7 +30,7 @@ export { SignedPreKeyIdType, SignedPreKeyType, UnprocessedType, -} from '../sql/Interface'; +} from '../sql/Interface.js'; export type StorageServiceCallOptionsType = { credentials?: StorageServiceCredentials; diff --git a/ts/textsecure/UpdateKeysListener.ts b/ts/textsecure/UpdateKeysListener.ts index e811a442405..c7d429ecb9b 100644 --- a/ts/textsecure/UpdateKeysListener.ts +++ b/ts/textsecure/UpdateKeysListener.ts @@ -1,13 +1,13 @@ // Copyright 2017 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import * as durations from '../util/durations'; -import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary'; -import * as Registration from '../util/registration'; -import { ServiceIdKind } from '../types/ServiceId'; -import { createLogger } from '../logging/log'; -import * as Errors from '../types/errors'; -import { HTTPError } from './Errors'; +import * as durations from '../util/durations/index.js'; +import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary.js'; +import * as Registration from '../util/registration.js'; +import { ServiceIdKind } from '../types/ServiceId.js'; +import { createLogger } from '../logging/log.js'; +import * as Errors from '../types/errors.js'; +import { HTTPError } from './Errors.js'; const log = createLogger('UpdateKeysListener'); diff --git a/ts/textsecure/Utils.ts b/ts/textsecure/Utils.ts index 99bbd5b698f..dc499a3f879 100644 --- a/ts/textsecure/Utils.ts +++ b/ts/textsecure/Utils.ts @@ -1,7 +1,7 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { HTTPError } from './Errors'; +import type { HTTPError } from './Errors.js'; export async function handleStatusCode(status: number): Promise { if (status === 499) { diff --git a/ts/textsecure/WebAPI.ts b/ts/textsecure/WebAPI.ts index c3ddfff4c2a..3cfab630fed 100644 --- a/ts/textsecure/WebAPI.ts +++ b/ts/textsecure/WebAPI.ts @@ -8,13 +8,13 @@ import type { RequestInit, Response } from 'node-fetch'; import fetch from 'node-fetch'; -import type { Agent } from 'https'; +import type { Agent } from 'node:https'; import { escapeRegExp, isNumber, isString, isObject, throttle } from 'lodash'; import PQueue from 'p-queue'; import { v4 as getGuid } from 'uuid'; import { z } from 'zod'; -import type { Readable } from 'stream'; -import qs from 'querystring'; +import type { Readable } from 'node:stream'; +import qs from 'node:querystring'; import type { KEMPublicKey, PublicKey, @@ -23,82 +23,83 @@ import type { } from '@signalapp/libsignal-client'; import { AccountAttributes } from '@signalapp/libsignal-client/dist/net'; -import { assertDev, strictAssert } from '../util/assert'; -import * as durations from '../util/durations'; -import type { ExplodePromiseResultType } from '../util/explodePromise'; -import { explodePromise } from '../util/explodePromise'; -import { getUserAgent } from '../util/getUserAgent'; -import { getTimeoutStream } from '../util/getStreamWithTimeout'; -import { toWebSafeBase64, fromWebSafeBase64 } from '../util/webSafeBase64'; -import { getBasicAuth } from '../util/getBasicAuth'; -import { createHTTPSAgent } from '../util/createHTTPSAgent'; -import { createProxyAgent } from '../util/createProxyAgent'; -import type { ProxyAgent } from '../util/createProxyAgent'; -import type { FetchFunctionType } from '../util/uploads/tusProtocol'; -import { VerificationTransport } from '../types/VerificationTransport'; -import { ZERO_ACCESS_KEY } from '../types/SealedSender'; -import { toLogFormat } from '../types/errors'; -import { isPackIdValid, redactPackId } from '../types/Stickers'; +import { assertDev, strictAssert } from '../util/assert.js'; +import * as durations from '../util/durations/index.js'; +import type { ExplodePromiseResultType } from '../util/explodePromise.js'; +import { explodePromise } from '../util/explodePromise.js'; +import { getUserAgent } from '../util/getUserAgent.js'; +import { getTimeoutStream } from '../util/getStreamWithTimeout.js'; +import { toWebSafeBase64, fromWebSafeBase64 } from '../util/webSafeBase64.js'; +import { getBasicAuth } from '../util/getBasicAuth.js'; +import { createHTTPSAgent } from '../util/createHTTPSAgent.js'; +import { createProxyAgent } from '../util/createProxyAgent.js'; +import type { ProxyAgent } from '../util/createProxyAgent.js'; +import type { FetchFunctionType } from '../util/uploads/tusProtocol.js'; +import { VerificationTransport } from '../types/VerificationTransport.js'; +import { ZERO_ACCESS_KEY } from '../types/SealedSender.js'; +import { toLogFormat } from '../types/errors.js'; +import { isPackIdValid, redactPackId } from '../types/Stickers.js'; import type { ServiceIdString, AciString, UntaggedPniString, -} from '../types/ServiceId'; +} from '../types/ServiceId.js'; import { ServiceIdKind, serviceIdSchema, aciSchema, untaggedPniSchema, -} from '../types/ServiceId'; -import type { BackupPresentationHeadersType } from '../types/backups'; -import * as Bytes from '../Bytes'; -import { getRandomBytes, randomInt } from '../Crypto'; -import * as linkPreviewFetch from '../linkPreviews/linkPreviewFetch'; -import { isBadgeImageFileUrlValid } from '../badges/isBadgeImageFileUrlValid'; +} from '../types/ServiceId.js'; +import type { BackupPresentationHeadersType } from '../types/backups.js'; +import * as Bytes from '../Bytes.js'; +import { getRandomBytes, randomInt } from '../Crypto.js'; +import * as linkPreviewFetch from '../linkPreviews/linkPreviewFetch.js'; +import { isBadgeImageFileUrlValid } from '../badges/isBadgeImageFileUrlValid.js'; import { SocketManager, type SocketStatuses, type SocketExpirationReason, -} from './SocketManager'; -import type { CDSAuthType, CDSResponseType } from './cds/Types.d'; -import { CDSI } from './cds/CDSI'; -import { SignalService as Proto } from '../protobuf'; +} from './SocketManager.js'; +import type { CDSAuthType, CDSResponseType } from './cds/Types.d.ts'; +import { CDSI } from './cds/CDSI.js'; +import { SignalService as Proto } from '../protobuf/index.js'; -import { HTTPError } from './Errors'; -import type MessageSender from './SendMessage'; +import { HTTPError } from './Errors.js'; +import type MessageSender from './SendMessage.js'; import type { WebAPICredentials, IRequestHandler, StorageServiceCallOptionsType, StorageServiceCredentials, -} from './Types.d'; -import { handleStatusCode, translateError } from './Utils'; -import { createLogger } from '../logging/log'; -import { maybeParseUrl, urlPathFromComponents } from '../util/url'; -import { HOUR, MINUTE, SECOND } from '../util/durations'; -import { safeParseNumber } from '../util/numbers'; -import type { IWebSocketResource } from './WebsocketResources'; -import { getLibsignalNet } from './preconnect'; -import type { GroupSendToken } from '../types/GroupSendEndorsements'; -import { parseUnknown, safeParseUnknown, type Schema } from '../util/schemas'; +} from './Types.d.ts'; +import { handleStatusCode, translateError } from './Utils.js'; +import { createLogger } from '../logging/log.js'; +import { maybeParseUrl, urlPathFromComponents } from '../util/url.js'; +import { HOUR, MINUTE, SECOND } from '../util/durations/index.js'; +import { safeParseNumber } from '../util/numbers.js'; +import type { IWebSocketResource } from './WebsocketResources.js'; +import { getLibsignalNet } from './preconnect.js'; +import type { GroupSendToken } from '../types/GroupSendEndorsements.js'; +import { + parseUnknown, + safeParseUnknown, + type Schema, +} from '../util/schemas.js'; import type { ProfileFetchAuthRequestOptions, ProfileFetchUnauthRequestOptions, -} from '../services/profiles'; -import { ToastType } from '../types/Toast'; -import { isProduction } from '../util/version'; -import type { ServerAlert } from '../util/handleServerAlerts'; -import { isAbortError } from '../util/isAbortError'; -import { missingCaseError } from '../util/missingCaseError'; -import { drop } from '../util/drop'; -import type { StripeDonationAmount } from '../types/Donations'; -import { - subscriptionConfigurationCurrencyZod, - type CardDetail, -} from '../types/Donations'; -import { badgeFromServerSchema } from '../badges/parseBadgesFromServer'; -import { ZERO_DECIMAL_CURRENCIES } from '../util/currency'; +} from '../services/profiles.js'; +import { ToastType } from '../types/Toast.js'; +import { isProduction } from '../util/version.js'; +import type { ServerAlert } from '../util/handleServerAlerts.js'; +import { isAbortError } from '../util/isAbortError.js'; +import { missingCaseError } from '../util/missingCaseError.js'; +import { drop } from '../util/drop.js'; +import { subscriptionConfigurationCurrencyZod } from '../types/Donations.js'; +import type { StripeDonationAmount, CardDetail } from '../types/Donations.js'; +import { badgeFromServerSchema } from '../badges/parseBadgesFromServer.js'; +import { ZERO_DECIMAL_CURRENCIES } from '../util/currency.js'; const log = createLogger('WebAPI'); diff --git a/ts/textsecure/WebSocket.ts b/ts/textsecure/WebSocket.ts index 4794b629b3b..c533621505e 100644 --- a/ts/textsecure/WebSocket.ts +++ b/ts/textsecure/WebSocket.ts @@ -3,19 +3,19 @@ import { client as WebSocketClient } from 'websocket'; import type { connection as WebSocket } from 'websocket'; -import type { IncomingMessage } from 'http'; +import type { IncomingMessage } from 'node:http'; -import { AbortableProcess } from '../util/AbortableProcess'; -import { strictAssert } from '../util/assert'; -import { explodePromise } from '../util/explodePromise'; -import { getUserAgent } from '../util/getUserAgent'; -import * as durations from '../util/durations'; -import type { ProxyAgent } from '../util/createProxyAgent'; -import { createHTTPSAgent } from '../util/createHTTPSAgent'; -import { createLogger } from '../logging/log'; -import * as Timers from '../Timers'; -import { ConnectTimeoutError, HTTPError } from './Errors'; -import { handleStatusCode, translateError } from './Utils'; +import { AbortableProcess } from '../util/AbortableProcess.js'; +import { strictAssert } from '../util/assert.js'; +import { explodePromise } from '../util/explodePromise.js'; +import { getUserAgent } from '../util/getUserAgent.js'; +import * as durations from '../util/durations/index.js'; +import type { ProxyAgent } from '../util/createProxyAgent.js'; +import { createHTTPSAgent } from '../util/createHTTPSAgent.js'; +import { createLogger } from '../logging/log.js'; +import * as Timers from '../Timers.js'; +import { ConnectTimeoutError, HTTPError } from './Errors.js'; +import { handleStatusCode, translateError } from './Utils.js'; const log = createLogger('WebSocket'); diff --git a/ts/textsecure/WebsocketResources.ts b/ts/textsecure/WebsocketResources.ts index 93ee2b92a8d..d18391da783 100644 --- a/ts/textsecure/WebsocketResources.ts +++ b/ts/textsecure/WebsocketResources.ts @@ -30,7 +30,7 @@ import type { connection as WebSocket, IMessage } from 'websocket'; import Long from 'long'; import pTimeout from 'p-timeout'; import { Response } from 'node-fetch'; -import net from 'net'; +import net from 'node:net'; import { z } from 'zod'; import type { LibSignalError, Net } from '@signalapp/libsignal-client'; @@ -41,28 +41,28 @@ import type { ChatServiceListener, ConnectionEventsListener, } from '@signalapp/libsignal-client/dist/net/Chat'; -import type { EventHandler } from './EventTarget'; -import EventTarget from './EventTarget'; +import type { EventHandler } from './EventTarget.js'; +import EventTarget from './EventTarget.js'; -import * as durations from '../util/durations'; -import { dropNull } from '../util/dropNull'; -import { drop } from '../util/drop'; -import { isOlderThan } from '../util/timestamp'; -import { strictAssert } from '../util/assert'; -import * as Errors from '../types/errors'; -import { SignalService as Proto } from '../protobuf'; -import { createLogger } from '../logging/log'; -import * as Timers from '../Timers'; -import type { IResource } from './WebSocket'; +import * as durations from '../util/durations/index.js'; +import { dropNull } from '../util/dropNull.js'; +import { drop } from '../util/drop.js'; +import { isOlderThan } from '../util/timestamp.js'; +import { strictAssert } from '../util/assert.js'; +import * as Errors from '../types/errors.js'; +import { SignalService as Proto } from '../protobuf/index.js'; +import { createLogger } from '../logging/log.js'; +import * as Timers from '../Timers.js'; +import type { IResource } from './WebSocket.js'; -import { AbortableProcess } from '../util/AbortableProcess'; -import type { WebAPICredentials } from './Types'; -import { NORMAL_DISCONNECT_CODE } from './SocketManager'; -import { parseUnknown } from '../util/schemas'; +import { AbortableProcess } from '../util/AbortableProcess.js'; +import type { WebAPICredentials } from './Types.js'; +import { NORMAL_DISCONNECT_CODE } from './SocketManager.js'; +import { parseUnknown } from '../util/schemas.js'; import { parseServerAlertsFromHeader, type ServerAlert, -} from '../util/handleServerAlerts'; +} from '../util/handleServerAlerts.js'; const log = createLogger('WebsocketResources'); diff --git a/ts/textsecure/cds/CDSBase.ts b/ts/textsecure/cds/CDSBase.ts index 29273278adc..2e246b39d91 100644 --- a/ts/textsecure/cds/CDSBase.ts +++ b/ts/textsecure/cds/CDSBase.ts @@ -5,12 +5,12 @@ import type { CDSAuthType, CDSRequestOptionsType, CDSResponseType, -} from './Types.d'; -import type { LoggerType } from '../../types/Logging'; -import { isOlderThan } from '../../util/timestamp'; -import { HOUR } from '../../util/durations'; -import { createProxyAgent } from '../../util/createProxyAgent'; -import type { ProxyAgent } from '../../util/createProxyAgent'; +} from './Types.d.ts'; +import type { LoggerType } from '../../types/Logging.js'; +import { isOlderThan } from '../../util/timestamp.js'; +import { HOUR } from '../../util/durations/index.js'; +import { createProxyAgent } from '../../util/createProxyAgent.js'; +import type { ProxyAgent } from '../../util/createProxyAgent.js'; // It is 24 hours, but we don't want latency between server and client to be // count. diff --git a/ts/textsecure/cds/CDSI.ts b/ts/textsecure/cds/CDSI.ts index 8590101056e..fa1be833464 100644 --- a/ts/textsecure/cds/CDSI.ts +++ b/ts/textsecure/cds/CDSI.ts @@ -10,11 +10,11 @@ import { LibSignalErrorBase, } from '@signalapp/libsignal-client'; import pTimeout from 'p-timeout'; -import type { CDSBaseOptionsType } from './CDSBase'; -import { CDSBase } from './CDSBase'; -import type { CDSRequestOptionsType, CDSResponseType } from './Types'; -import { sleep } from '../../util/sleep'; -import * as durations from '../../util/durations'; +import type { CDSBaseOptionsType } from './CDSBase.js'; +import { CDSBase } from './CDSBase.js'; +import type { CDSRequestOptionsType, CDSResponseType } from './Types.js'; +import { sleep } from '../../util/sleep.js'; +import * as durations from '../../util/durations/index.js'; export type CDSIOptionsType = CDSBaseOptionsType; diff --git a/ts/textsecure/cds/CDSISocket.ts b/ts/textsecure/cds/CDSISocket.ts index d71b1e6217d..052e62798d2 100644 --- a/ts/textsecure/cds/CDSISocket.ts +++ b/ts/textsecure/cds/CDSISocket.ts @@ -3,10 +3,10 @@ import { Cds2Client } from '@signalapp/libsignal-client'; -import { strictAssert } from '../../util/assert'; -import { SignalService as Proto } from '../../protobuf'; -import { CDSSocketBase, CDSSocketState } from './CDSSocketBase'; -import type { CDSSocketBaseOptionsType } from './CDSSocketBase'; +import { strictAssert } from '../../util/assert.js'; +import { SignalService as Proto } from '../../protobuf/index.js'; +import { CDSSocketBase, CDSSocketState } from './CDSSocketBase.js'; +import type { CDSSocketBaseOptionsType } from './CDSSocketBase.js'; export type CDSISocketOptionsType = Readonly<{ mrenclave: Uint8Array; diff --git a/ts/textsecure/cds/CDSSocketBase.ts b/ts/textsecure/cds/CDSSocketBase.ts index 8f085bd1675..77057f14343 100644 --- a/ts/textsecure/cds/CDSSocketBase.ts +++ b/ts/textsecure/cds/CDSSocketBase.ts @@ -1,26 +1,26 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { EventEmitter } from 'events'; -import { Readable } from 'stream'; +import { EventEmitter } from 'node:events'; +import { Readable } from 'node:stream'; import { noop } from 'lodash'; import type { connection as WebSocket } from 'websocket'; import Long from 'long'; -import type { LoggerType } from '../../types/Logging'; -import { strictAssert } from '../../util/assert'; -import { isUntaggedPniString, toTaggedPni } from '../../types/ServiceId'; -import { isAciString } from '../../util/isAciString'; -import * as Bytes from '../../Bytes'; -import { UUID_BYTE_SIZE } from '../../types/Crypto'; -import { uuidToBytes, bytesToUuid } from '../../util/uuidToBytes'; -import { SignalService as Proto } from '../../protobuf'; +import type { LoggerType } from '../../types/Logging.js'; +import { strictAssert } from '../../util/assert.js'; +import { isUntaggedPniString, toTaggedPni } from '../../types/ServiceId.js'; +import { isAciString } from '../../util/isAciString.js'; +import * as Bytes from '../../Bytes.js'; +import { UUID_BYTE_SIZE } from '../../types/Crypto.js'; +import { uuidToBytes, bytesToUuid } from '../../util/uuidToBytes.js'; +import { SignalService as Proto } from '../../protobuf/index.js'; import type { CDSRequestOptionsType, CDSResponseEntryType, CDSResponseType, -} from './Types.d'; -import { RateLimitedError } from './RateLimitedError'; +} from './Types.d.ts'; +import { RateLimitedError } from './RateLimitedError.js'; export type CDSSocketBaseOptionsType = Readonly<{ logger: LoggerType; diff --git a/ts/textsecure/cds/Types.d.ts b/ts/textsecure/cds/Types.d.ts index 9e30c380910..7bf9ee2ad8f 100644 --- a/ts/textsecure/cds/Types.d.ts +++ b/ts/textsecure/cds/Types.d.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { Net } from '@signalapp/libsignal-client'; -import type { AciString, PniString } from '../../types/ServiceId'; +import type { AciString, PniString } from '../../types/ServiceId.js'; export type CDSAuthType = Net.ServiceAuth; export type CDSResponseEntryType = Net.CDSResponseEntryType< diff --git a/ts/textsecure/downloadAttachment.ts b/ts/textsecure/downloadAttachment.ts index c98161acd3d..b35cc001a74 100644 --- a/ts/textsecure/downloadAttachment.ts +++ b/ts/textsecure/downloadAttachment.ts @@ -4,14 +4,14 @@ import { createWriteStream } from 'node:fs'; import { stat } from 'node:fs/promises'; import { isNumber } from 'lodash'; -import type { Readable, Writable } from 'stream'; -import { Transform } from 'stream'; -import { pipeline } from 'stream/promises'; +import type { Readable, Writable } from 'node:stream'; +import { Transform } from 'node:stream'; +import { pipeline } from 'node:stream/promises'; import { ensureFile } from 'fs-extra'; -import { createLogger } from '../logging/log'; -import * as Errors from '../types/errors'; -import { strictAssert } from '../util/assert'; +import { createLogger } from '../logging/log.js'; +import * as Errors from '../types/errors.js'; +import { strictAssert } from '../util/assert.js'; import { AttachmentSizeError, type AttachmentType, @@ -19,8 +19,8 @@ import { AttachmentPermanentlyUndownloadableError, hasRequiredInformationForBackup, type BackupableAttachmentType, -} from '../types/Attachment'; -import * as Bytes from '../Bytes'; +} from '../types/Attachment.js'; +import * as Bytes from '../Bytes.js'; import { getAttachmentCiphertextLength, safeUnlink, @@ -29,29 +29,29 @@ import { decryptAndReencryptLocally, measureSize, type IntegrityCheckType, -} from '../AttachmentCrypto'; -import type { ProcessedAttachment } from './Types.d'; -import type { WebAPIType } from './WebAPI'; -import { createName, getRelativePath } from '../util/attachmentPath'; -import { MediaTier } from '../types/AttachmentDownload'; +} from '../AttachmentCrypto.js'; +import type { ProcessedAttachment } from './Types.d.ts'; +import type { WebAPIType } from './WebAPI.js'; +import { createName, getRelativePath } from '../util/attachmentPath.js'; +import { MediaTier } from '../types/AttachmentDownload.js'; import { getBackupMediaRootKey, deriveBackupMediaKeyMaterial, type BackupMediaKeyMaterialType, deriveBackupThumbnailTransitKeyMaterial, -} from '../services/backups/crypto'; -import { backupsService } from '../services/backups'; +} from '../services/backups/crypto.js'; +import { backupsService } from '../services/backups/index.js'; import { getMediaIdForAttachment, getMediaIdForAttachmentThumbnail, -} from '../services/backups/util/mediaId'; -import { MAX_BACKUP_THUMBNAIL_SIZE } from '../types/VisualAttachment'; -import { missingCaseError } from '../util/missingCaseError'; -import { IV_LENGTH, MAC_LENGTH } from '../types/Crypto'; -import { BackupCredentialType } from '../types/backups'; -import { getValue } from '../RemoteConfig'; -import { parseIntOrThrow } from '../util/parseIntOrThrow'; -import { HTTPError } from './Errors'; +} from '../services/backups/util/mediaId.js'; +import { MAX_BACKUP_THUMBNAIL_SIZE } from '../types/VisualAttachment.js'; +import { missingCaseError } from '../util/missingCaseError.js'; +import { IV_LENGTH, MAC_LENGTH } from '../types/Crypto.js'; +import { BackupCredentialType } from '../types/backups.js'; +import { getValue } from '../RemoteConfig.js'; +import { parseIntOrThrow } from '../util/parseIntOrThrow.js'; +import { HTTPError } from './Errors.js'; const log = createLogger('downloadAttachment'); diff --git a/ts/textsecure/getKeysForServiceId.ts b/ts/textsecure/getKeysForServiceId.ts index ee6eb658900..ebc46de56dc 100644 --- a/ts/textsecure/getKeysForServiceId.ts +++ b/ts/textsecure/getKeysForServiceId.ts @@ -15,17 +15,17 @@ import { OutgoingIdentityKeyError, UnregisteredUserError, HTTPError, -} from './Errors'; -import { Sessions, IdentityKeys } from '../LibSignalStores'; -import { Address } from '../types/Address'; -import { QualifiedAddress } from '../types/QualifiedAddress'; -import type { ServiceIdString } from '../types/ServiceId'; -import type { ServerKeysType, WebAPIType } from './WebAPI'; -import { createLogger } from '../logging/log'; -import { isRecord } from '../util/isRecord'; -import type { GroupSendToken } from '../types/GroupSendEndorsements'; -import { onFailedToSendWithEndorsements } from '../util/groupSendEndorsements'; -import { isPQRatchetEnabled } from '../util/isPQRatchetEnabled'; +} from './Errors.js'; +import { Sessions, IdentityKeys } from '../LibSignalStores.js'; +import { Address } from '../types/Address.js'; +import { QualifiedAddress } from '../types/QualifiedAddress.js'; +import type { ServiceIdString } from '../types/ServiceId.js'; +import type { ServerKeysType, WebAPIType } from './WebAPI.js'; +import { createLogger } from '../logging/log.js'; +import { isRecord } from '../util/isRecord.js'; +import type { GroupSendToken } from '../types/GroupSendEndorsements.js'; +import { onFailedToSendWithEndorsements } from '../util/groupSendEndorsements.js'; +import { isPQRatchetEnabled } from '../util/isPQRatchetEnabled.js'; const log = createLogger('getKeysForServiceId'); diff --git a/ts/textsecure/index.ts b/ts/textsecure/index.ts index c3220a68969..c01ac8306ef 100644 --- a/ts/textsecure/index.ts +++ b/ts/textsecure/index.ts @@ -1,14 +1,14 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import EventTarget from './EventTarget'; -import AccountManager from './AccountManager'; -import MessageReceiver from './MessageReceiver'; -import utils from './Helpers'; -import MessageSender from './SendMessage'; -import { Storage } from './Storage'; -import * as WebAPI from './WebAPI'; -import WebSocketResource from './WebsocketResources'; +import EventTarget from './EventTarget.js'; +import AccountManager from './AccountManager.js'; +import MessageReceiver from './MessageReceiver.js'; +import utils from './Helpers.js'; +import MessageSender from './SendMessage.js'; +import { Storage } from './Storage.js'; +import * as WebAPI from './WebAPI.js'; +import WebSocketResource from './WebsocketResources.js'; export type TextSecureType = { utils: typeof utils; diff --git a/ts/textsecure/messageReceiverEvents.ts b/ts/textsecure/messageReceiverEvents.ts index 9eed37f2248..10cbd2fd6c8 100644 --- a/ts/textsecure/messageReceiverEvents.ts +++ b/ts/textsecure/messageReceiverEvents.ts @@ -5,25 +5,25 @@ import type { PublicKey } from '@signalapp/libsignal-client'; import { z } from 'zod'; -import type { SignalService as Proto } from '../protobuf'; +import type { SignalService as Proto } from '../protobuf/index.js'; import { type ServiceIdString, type AciString, isPniString, -} from '../types/ServiceId'; -import type { StoryDistributionIdString } from '../types/StoryDistributionId'; +} from '../types/ServiceId.js'; +import type { StoryDistributionIdString } from '../types/StoryDistributionId.js'; import type { ProcessedEnvelope, ProcessedDataMessage, ProcessedSent, ProcessedAttachment, -} from './Types.d'; +} from './Types.d.ts'; import type { CallEventDetails, CallLogEventDetails, -} from '../types/CallDisposition'; -import type { CallLinkUpdateSyncType } from '../types/CallLink'; -import { isAciString } from '../util/isAciString'; +} from '../types/CallDisposition.js'; +import type { CallLinkUpdateSyncType } from '../types/CallLink.js'; +import { isAciString } from '../util/isAciString.js'; export class EmptyEvent extends Event { constructor() { diff --git a/ts/textsecure/preconnect.ts b/ts/textsecure/preconnect.ts index c54a29287bd..0032a7692ce 100644 --- a/ts/textsecure/preconnect.ts +++ b/ts/textsecure/preconnect.ts @@ -3,14 +3,14 @@ import { Net } from '@signalapp/libsignal-client'; -import { getUserAgent } from '../util/getUserAgent'; -import { isStagingServer } from '../util/isStagingServer'; -import { getMockServerPort } from '../util/getMockServerPort'; -import { isMockServer } from '../util/isMockServer'; -import { pemToDer } from '../util/pemToDer'; -import { drop } from '../util/drop'; -import { toLogFormat } from '../types/errors'; -import { createLogger } from '../logging/log'; +import { getUserAgent } from '../util/getUserAgent.js'; +import { isStagingServer } from '../util/isStagingServer.js'; +import { getMockServerPort } from '../util/getMockServerPort.js'; +import { isMockServer } from '../util/isMockServer.js'; +import { pemToDer } from '../util/pemToDer.js'; +import { drop } from '../util/drop.js'; +import { toLogFormat } from '../types/errors.js'; +import { createLogger } from '../logging/log.js'; const log = createLogger('preconnect'); diff --git a/ts/textsecure/processDataMessage.ts b/ts/textsecure/processDataMessage.ts index a40f656677f..1bf18d629b8 100644 --- a/ts/textsecure/processDataMessage.ts +++ b/ts/textsecure/processDataMessage.ts @@ -5,13 +5,13 @@ import Long from 'long'; import { ReceiptCredentialPresentation } from '@signalapp/libsignal-client/zkgroup'; import { isNumber } from 'lodash'; -import { assertDev, strictAssert } from '../util/assert'; -import { dropNull, shallowDropNull } from '../util/dropNull'; -import { fromAciUuidBytesOrString } from '../util/ServiceId'; -import { getTimestampFromLong } from '../util/timestampLongUtils'; -import { SignalService as Proto } from '../protobuf'; -import { deriveGroupFields } from '../groups'; -import * as Bytes from '../Bytes'; +import { assertDev, strictAssert } from '../util/assert.js'; +import { dropNull, shallowDropNull } from '../util/dropNull.js'; +import { fromAciUuidBytesOrString } from '../util/ServiceId.js'; +import { getTimestampFromLong } from '../util/timestampLongUtils.js'; +import { SignalService as Proto } from '../protobuf/index.js'; +import { deriveGroupFields } from '../groups.js'; +import * as Bytes from '../Bytes.js'; import type { ProcessedAttachment, @@ -25,17 +25,17 @@ import type { ProcessedDelete, ProcessedGiftBadge, ProcessedStoryContext, -} from './Types.d'; -import { GiftBadgeStates } from '../components/conversation/Message'; -import { APPLICATION_OCTET_STREAM, stringToMIMEType } from '../types/MIME'; -import { SECOND, DurationInSeconds } from '../util/durations'; -import type { AnyPaymentEvent } from '../types/Payment'; -import { PaymentEventKind } from '../types/Payment'; -import { filterAndClean } from '../types/BodyRange'; -import { bytesToUuid } from '../util/uuidToBytes'; -import { createName } from '../util/attachmentPath'; -import { partitionBodyAndNormalAttachments } from '../types/Attachment'; -import { isNotNil } from '../util/isNotNil'; +} from './Types.d.ts'; +import { GiftBadgeStates } from '../components/conversation/Message.js'; +import { APPLICATION_OCTET_STREAM, stringToMIMEType } from '../types/MIME.js'; +import { SECOND, DurationInSeconds } from '../util/durations/index.js'; +import type { AnyPaymentEvent } from '../types/Payment.js'; +import { PaymentEventKind } from '../types/Payment.js'; +import { filterAndClean } from '../types/BodyRange.js'; +import { bytesToUuid } from '../util/uuidToBytes.js'; +import { createName } from '../util/attachmentPath.js'; +import { partitionBodyAndNormalAttachments } from '../types/Attachment.js'; +import { isNotNil } from '../util/isNotNil.js'; const FLAGS = Proto.DataMessage.Flags; export const ATTACHMENT_MAX = 32; diff --git a/ts/textsecure/processSyncMessage.ts b/ts/textsecure/processSyncMessage.ts index ffa19b9466b..03681e7676d 100644 --- a/ts/textsecure/processSyncMessage.ts +++ b/ts/textsecure/processSyncMessage.ts @@ -1,10 +1,10 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { SignalService as Proto } from '../protobuf'; -import type { ServiceIdString } from '../types/ServiceId'; -import { fromServiceIdBinaryOrString } from '../util/ServiceId'; -import type { ProcessedSent, ProcessedSyncMessage } from './Types.d'; +import type { SignalService as Proto } from '../protobuf/index.js'; +import type { ServiceIdString } from '../types/ServiceId.js'; +import { fromServiceIdBinaryOrString } from '../util/ServiceId.js'; +import type { ProcessedSent, ProcessedSyncMessage } from './Types.d.ts'; type ProtoServiceId = Readonly<{ destinationServiceId?: string | null; diff --git a/ts/textsecure/storage/Blocked.ts b/ts/textsecure/storage/Blocked.ts index 826f03a6b6d..677b087626e 100644 --- a/ts/textsecure/storage/Blocked.ts +++ b/ts/textsecure/storage/Blocked.ts @@ -3,11 +3,11 @@ import { without } from 'lodash'; -import { createLogger } from '../../logging/log'; -import * as Bytes from '../../Bytes'; -import { isAciString } from '../../util/isAciString'; -import type { StorageInterface } from '../../types/Storage.d'; -import type { AciString, ServiceIdString } from '../../types/ServiceId'; +import { createLogger } from '../../logging/log.js'; +import * as Bytes from '../../Bytes.js'; +import { isAciString } from '../../util/isAciString.js'; +import type { StorageInterface } from '../../types/Storage.d.ts'; +import type { AciString, ServiceIdString } from '../../types/ServiceId.js'; const log = createLogger('Blocked'); diff --git a/ts/textsecure/storage/User.ts b/ts/textsecure/storage/User.ts index 93beba6ffbe..bded556f746 100644 --- a/ts/textsecure/storage/User.ts +++ b/ts/textsecure/storage/User.ts @@ -1,20 +1,20 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { WebAPICredentials } from '../Types.d'; +import type { WebAPICredentials } from '../Types.d.ts'; -import { strictAssert } from '../../util/assert'; -import type { StorageInterface } from '../../types/Storage.d'; +import { strictAssert } from '../../util/assert.js'; +import type { StorageInterface } from '../../types/Storage.d.ts'; import type { AciString, PniString, ServiceIdString, -} from '../../types/ServiceId'; -import { ServiceIdKind, isPniString } from '../../types/ServiceId'; -import { isAciString } from '../../util/isAciString'; -import { createLogger } from '../../logging/log'; +} from '../../types/ServiceId.js'; +import { ServiceIdKind, isPniString } from '../../types/ServiceId.js'; +import { isAciString } from '../../util/isAciString.js'; +import { createLogger } from '../../logging/log.js'; -import Helpers from '../Helpers'; +import Helpers from '../Helpers.js'; const log = createLogger('User'); diff --git a/ts/textsecure/syncRequests.ts b/ts/textsecure/syncRequests.ts index 3c35cf308fa..bc6707ffcf2 100644 --- a/ts/textsecure/syncRequests.ts +++ b/ts/textsecure/syncRequests.ts @@ -1,10 +1,10 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log'; -import { singleProtoJobQueue } from '../jobs/singleProtoJobQueue'; -import MessageSender from './SendMessage'; -import { toLogFormat } from '../types/errors'; +import { createLogger } from '../logging/log.js'; +import { singleProtoJobQueue } from '../jobs/singleProtoJobQueue.js'; +import MessageSender from './SendMessage.js'; +import { toLogFormat } from '../types/errors.js'; const log = createLogger('syncRequests'); diff --git a/ts/types/Address.ts b/ts/types/Address.ts index d22b49fd4f9..029eaef1ae7 100644 --- a/ts/types/Address.ts +++ b/ts/types/Address.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ServiceIdString } from './ServiceId'; +import type { ServiceIdString } from './ServiceId.js'; export type AddressStringType = `${ServiceIdString}.${number}`; diff --git a/ts/types/Attachment.ts b/ts/types/Attachment.ts index c87087f0516..4add74bcce3 100644 --- a/ts/types/Attachment.ts +++ b/ts/types/Attachment.ts @@ -14,37 +14,37 @@ import { } from 'lodash'; import { blobToArrayBuffer } from 'blob-util'; -import type { LinkPreviewForUIType } from './message/LinkPreviews'; -import type { LoggerType } from './Logging'; -import { createLogger } from '../logging/log'; -import * as MIME from './MIME'; -import { toLogFormat } from './errors'; -import { SignalService } from '../protobuf'; +import type { LinkPreviewForUIType } from './message/LinkPreviews.js'; +import type { LoggerType } from './Logging.js'; +import { createLogger } from '../logging/log.js'; +import * as MIME from './MIME.js'; +import { toLogFormat } from './errors.js'; +import { SignalService } from '../protobuf/index.js'; import { isImageTypeSupported, isVideoTypeSupported, -} from '../util/GoogleChrome'; +} from '../util/GoogleChrome.js'; import type { LocalizerType, WithOptionalProperties, WithRequiredProperties, -} from './Util'; -import { ThemeType } from './Util'; -import * as GoogleChrome from '../util/GoogleChrome'; -import { ReadStatus } from '../messages/MessageReadStatus'; -import type { MessageStatusType } from '../components/conversation/Message'; -import type { SignalService as Proto } from '../protobuf'; -import { isMoreRecentThan } from '../util/timestamp'; -import { DAY } from '../util/durations'; -import { getMessageQueueTime } from '../util/getMessageQueueTime'; -import { getLocalAttachmentUrl } from '../util/getLocalAttachmentUrl'; +} from './Util.js'; +import { ThemeType } from './Util.js'; +import * as GoogleChrome from '../util/GoogleChrome.js'; +import { ReadStatus } from '../messages/MessageReadStatus.js'; +import type { MessageStatusType } from '../components/conversation/Message.js'; +import type { SignalService as Proto } from '../protobuf/index.js'; +import { isMoreRecentThan } from '../util/timestamp.js'; +import { DAY } from '../util/durations/index.js'; +import { getMessageQueueTime } from '../util/getMessageQueueTime.js'; +import { getLocalAttachmentUrl } from '../util/getLocalAttachmentUrl.js'; import { isValidAttachmentKey, isValidDigest, isValidPlaintextHash, -} from './Crypto'; -import { missingCaseError } from '../util/missingCaseError'; -import type { MakeVideoScreenshotResultType } from './VisualAttachment'; +} from './Crypto.js'; +import { missingCaseError } from '../util/missingCaseError.js'; +import type { MakeVideoScreenshotResultType } from './VisualAttachment.js'; const logging = createLogger('Attachment'); diff --git a/ts/types/AttachmentBackup.ts b/ts/types/AttachmentBackup.ts index 11f63267c7d..db2cae7dbce 100644 --- a/ts/types/AttachmentBackup.ts +++ b/ts/types/AttachmentBackup.ts @@ -4,8 +4,8 @@ import { z } from 'zod'; import { type JobManagerJobType, jobManagerJobSchema, -} from '../jobs/JobManager'; -import { type MIMEType, MIMETypeSchema } from './MIME'; +} from '../jobs/JobManager.js'; +import { type MIMEType, MIMETypeSchema } from './MIME.js'; export type CoreAttachmentBackupJobType = | StandardAttachmentBackupJobType diff --git a/ts/types/AttachmentDownload.ts b/ts/types/AttachmentDownload.ts index 78d19cee9d1..8d34104868b 100644 --- a/ts/types/AttachmentDownload.ts +++ b/ts/types/AttachmentDownload.ts @@ -1,13 +1,13 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import { z } from 'zod'; -import { MIMETypeSchema, type MIMEType } from './MIME'; -import type { AttachmentType } from './Attachment'; +import { MIMETypeSchema, type MIMEType } from './MIME.js'; +import type { AttachmentType } from './Attachment.js'; import { type JobManagerJobType, jobManagerJobSchema, -} from '../jobs/JobManager'; -import { AttachmentDownloadSource } from '../sql/Interface'; +} from '../jobs/JobManager.js'; +import { AttachmentDownloadSource } from '../sql/Interface.js'; export enum MediaTier { STANDARD = 'standard', diff --git a/ts/types/AttachmentSize.ts b/ts/types/AttachmentSize.ts index fe74809fa78..203bc2924a0 100644 --- a/ts/types/AttachmentSize.ts +++ b/ts/types/AttachmentSize.ts @@ -1,9 +1,9 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log'; -import { parseIntOrThrow } from '../util/parseIntOrThrow'; -import type * as RemoteConfig from '../RemoteConfig'; +import { createLogger } from '../logging/log.js'; +import { parseIntOrThrow } from '../util/parseIntOrThrow.js'; +import type * as RemoteConfig from '../RemoteConfig.js'; const log = createLogger('AttachmentSize'); diff --git a/ts/types/Avatar.ts b/ts/types/Avatar.ts index e69017af61b..209a34249b4 100644 --- a/ts/types/Avatar.ts +++ b/ts/types/Avatar.ts @@ -1,9 +1,9 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AvatarColorType } from './Colors'; -import type { AddressableAttachmentType } from './Attachment'; -import { strictAssert } from '../util/assert'; +import type { AvatarColorType } from './Colors.js'; +import type { AddressableAttachmentType } from './Attachment.js'; +import { strictAssert } from '../util/assert.js'; export const PersonalAvatarIcons = [ 'abstract_01', diff --git a/ts/types/BodyRange.ts b/ts/types/BodyRange.ts index 5b718060d33..37d6ad16d68 100644 --- a/ts/types/BodyRange.ts +++ b/ts/types/BodyRange.ts @@ -5,19 +5,19 @@ import { isEqual, isNumber, omit, orderBy, partition } from 'lodash'; -import { SignalService as Proto } from '../protobuf'; -import { createLogger } from '../logging/log'; -import { missingCaseError } from '../util/missingCaseError'; -import { isNotNil } from '../util/isNotNil'; -import type { ConversationType } from '../state/ducks/conversations'; +import { SignalService as Proto } from '../protobuf/index.js'; +import { createLogger } from '../logging/log.js'; +import { missingCaseError } from '../util/missingCaseError.js'; +import { isNotNil } from '../util/isNotNil.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; import { SNIPPET_LEFT_PLACEHOLDER, SNIPPET_RIGHT_PLACEHOLDER, SNIPPET_TRUNCATION_PLACEHOLDER, -} from '../util/search'; -import { assertDev } from '../util/assert'; -import type { AciString } from './ServiceId'; -import { normalizeAci } from '../util/normalizeAci'; +} from '../util/search.js'; +import { assertDev } from '../util/assert.js'; +import type { AciString } from './ServiceId.js'; +import { normalizeAci } from '../util/normalizeAci.js'; const log = createLogger('BodyRange'); diff --git a/ts/types/CallDisposition.ts b/ts/types/CallDisposition.ts index 6f5969d04d2..63bd4487d96 100644 --- a/ts/types/CallDisposition.ts +++ b/ts/types/CallDisposition.ts @@ -3,12 +3,12 @@ import { z } from 'zod'; import Long from 'long'; -import type { AciString } from './ServiceId'; -import { aciSchema } from './ServiceId'; -import { bytesToUuid } from '../util/uuidToBytes'; -import { SignalService as Proto } from '../protobuf'; -import * as Bytes from '../Bytes'; -import { UUID_BYTE_SIZE } from './Crypto'; +import type { AciString } from './ServiceId.js'; +import { aciSchema } from './ServiceId.js'; +import { bytesToUuid } from '../util/uuidToBytes.js'; +import { SignalService as Proto } from '../protobuf/index.js'; +import * as Bytes from '../Bytes.js'; +import { UUID_BYTE_SIZE } from './Crypto.js'; // These are strings (1) for the backup (2) for Storybook. export enum CallMode { diff --git a/ts/types/CallLink.ts b/ts/types/CallLink.ts index 2392ab5c572..f6bce4a44fc 100644 --- a/ts/types/CallLink.ts +++ b/ts/types/CallLink.ts @@ -2,11 +2,11 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { ReadonlyDeep } from 'type-fest'; import { z } from 'zod'; -import type { ConversationType } from '../state/ducks/conversations'; -import { safeParseInteger } from '../util/numbers'; -import { byteLength } from '../Bytes'; -import type { StorageServiceFieldsType } from '../sql/Interface'; -import { parsePartial } from '../util/schemas'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import { safeParseInteger } from '../util/numbers.js'; +import { byteLength } from '../Bytes.js'; +import type { StorageServiceFieldsType } from '../sql/Interface.js'; +import { parsePartial } from '../util/schemas.js'; export enum CallLinkUpdateSyncType { Update = 'Update', diff --git a/ts/types/Calling.ts b/ts/types/Calling.ts index 0f055dc0d9d..8b82e414e42 100644 --- a/ts/types/Calling.ts +++ b/ts/types/Calling.ts @@ -3,10 +3,10 @@ import type { ReadonlyDeep } from 'type-fest'; import type { AudioDevice, Reaction as CallReaction } from '@signalapp/ringrtc'; -import type { ConversationType } from '../state/ducks/conversations'; -import type { AciString, ServiceIdString } from './ServiceId'; -import type { CallLinkConversationType } from './CallLink'; -import type { CallMode } from './CallDisposition'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import type { AciString, ServiceIdString } from './ServiceId.js'; +import type { CallLinkConversationType } from './CallLink.js'; +import type { CallMode } from './CallDisposition.js'; export const MAX_CALLING_REACTIONS = 5; export const CALLING_REACTIONS_LIFETIME = 4000; diff --git a/ts/types/ChatFolder.ts b/ts/types/ChatFolder.ts index fe3df86b6bc..5febf89df1f 100644 --- a/ts/types/ChatFolder.ts +++ b/ts/types/ChatFolder.ts @@ -1,10 +1,14 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import { z } from 'zod'; -import { Environment, getEnvironment, isMockEnvironment } from '../environment'; -import * as grapheme from '../util/grapheme'; -import * as RemoteConfig from '../RemoteConfig'; -import { isAlpha, isBeta, isProduction } from '../util/version'; +import { + Environment, + getEnvironment, + isMockEnvironment, +} from '../environment.js'; +import * as grapheme from '../util/grapheme.js'; +import * as RemoteConfig from '../RemoteConfig.js'; +import { isAlpha, isBeta, isProduction } from '../util/version.js'; export const CHAT_FOLDER_NAME_MAX_CHAR_LENGTH = 32; diff --git a/ts/types/Conversation.ts b/ts/types/Conversation.ts index 1a04fe79b8c..798643b006a 100644 --- a/ts/types/Conversation.ts +++ b/ts/types/Conversation.ts @@ -1,11 +1,11 @@ // Copyright 2018 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationAttributesType } from '../model-types.d'; -import type { ContactAvatarType } from './Avatar'; -import type { LocalAttachmentV2Type } from './Attachment'; -import { computeHash } from '../Crypto'; -import { createLogger } from '../logging/log'; +import type { ConversationAttributesType } from '../model-types.d.ts'; +import type { ContactAvatarType } from './Avatar.js'; +import type { LocalAttachmentV2Type } from './Attachment.js'; +import { computeHash } from '../Crypto.js'; +import { createLogger } from '../logging/log.js'; const log = createLogger('Conversation'); diff --git a/ts/types/Crypto.ts b/ts/types/Crypto.ts index 81317105dc2..841e89f77c4 100644 --- a/ts/types/Crypto.ts +++ b/ts/types/Crypto.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { fromBase64, fromHex } from '../Bytes'; +import { fromBase64, fromHex } from '../Bytes.js'; export enum HashType { size256 = 'sha256', diff --git a/ts/types/DonationsCardForm.ts b/ts/types/DonationsCardForm.ts index 73b8c014159..955a33bed8f 100644 --- a/ts/types/DonationsCardForm.ts +++ b/ts/types/DonationsCardForm.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import cardValidator from 'card-validator'; import creditCardType from 'credit-card-type'; -import { strictAssert } from '../util/assert'; -import type { CardDetail } from './Donations'; +import { strictAssert } from '../util/assert.js'; +import type { CardDetail } from './Donations.js'; export type CardFormat = Readonly<{ _debugName: string; diff --git a/ts/types/EmbeddedContact.ts b/ts/types/EmbeddedContact.ts index 4a8c94b0406..4d5abb76050 100644 --- a/ts/types/EmbeddedContact.ts +++ b/ts/types/EmbeddedContact.ts @@ -4,26 +4,26 @@ import { omit } from 'lodash'; import type { ReadonlyDeep } from 'type-fest'; -import { SignalService as Proto } from '../protobuf'; -import type { ReadonlyMessageAttributesType } from '../model-types.d'; +import { SignalService as Proto } from '../protobuf/index.js'; +import type { ReadonlyMessageAttributesType } from '../model-types.d.ts'; -import { isNotNil } from '../util/isNotNil'; +import { isNotNil } from '../util/isNotNil.js'; import { format as formatPhoneNumber, normalize as normalizePhoneNumber, -} from './PhoneNumber'; +} from './PhoneNumber.js'; import type { AttachmentType, AttachmentForUIType, AttachmentWithHydratedData, LocalAttachmentV2Type, UploadedAttachmentType, -} from './Attachment'; -import { toLogFormat } from './errors'; -import type { LoggerType } from './Logging'; -import type { ServiceIdString } from './ServiceId'; -import type { migrateDataToFileSystem } from '../util/attachments/migrateDataToFilesystem'; -import { getLocalAttachmentUrl } from '../util/getLocalAttachmentUrl'; +} from './Attachment.js'; +import { toLogFormat } from './errors.js'; +import type { LoggerType } from './Logging.js'; +import type { ServiceIdString } from './ServiceId.js'; +import type { migrateDataToFileSystem } from '../util/attachments/migrateDataToFilesystem.js'; +import { getLocalAttachmentUrl } from '../util/getLocalAttachmentUrl.js'; type GenericEmbeddedContactType = { name?: Name; diff --git a/ts/types/ErrorWithToast.ts b/ts/types/ErrorWithToast.ts index f3cd20931dc..67ebc228b97 100644 --- a/ts/types/ErrorWithToast.ts +++ b/ts/types/ErrorWithToast.ts @@ -1,7 +1,7 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ToastType } from './Toast'; +import type { ToastType } from './Toast.js'; export class ErrorWithToast extends Error { public toastType: ToastType; diff --git a/ts/types/ForwardDraft.ts b/ts/types/ForwardDraft.ts index ba035e81b36..7345c241dde 100644 --- a/ts/types/ForwardDraft.ts +++ b/ts/types/ForwardDraft.ts @@ -2,14 +2,14 @@ // SPDX-License-Identifier: AGPL-3.0-only import { orderBy } from 'lodash'; -import type { ReadonlyMessageAttributesType } from '../model-types'; +import type { ReadonlyMessageAttributesType } from '../model-types.js'; import { isVoiceMessage, type AttachmentForUIType, isDownloaded, -} from './Attachment'; -import type { HydratedBodyRangesType } from './BodyRange'; -import type { LinkPreviewForUIType } from './message/LinkPreviews'; +} from './Attachment.js'; +import type { HydratedBodyRangesType } from './BodyRange.js'; +import type { LinkPreviewForUIType } from './message/LinkPreviews.js'; export type MessageForwardDraft = Readonly<{ attachments?: ReadonlyArray; diff --git a/ts/types/GroupSendEndorsements.ts b/ts/types/GroupSendEndorsements.ts index fc04fdcaad1..cf36ef99611 100644 --- a/ts/types/GroupSendEndorsements.ts +++ b/ts/types/GroupSendEndorsements.ts @@ -1,9 +1,9 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import { z } from 'zod'; -import { aciSchema, type AciString } from './ServiceId'; -import * as Bytes from '../Bytes'; -import { parseStrict } from '../util/schemas'; +import { aciSchema, type AciString } from './ServiceId.js'; +import * as Bytes from '../Bytes.js'; +import { parseStrict } from '../util/schemas.js'; const GROUPV2_ID_LENGTH = 32; // 32 bytes diff --git a/ts/types/I18N.ts b/ts/types/I18N.ts index fb8c2e8cd51..bf8157750c3 100644 --- a/ts/types/I18N.ts +++ b/ts/types/I18N.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import { z } from 'zod'; -import type { LocalizerType } from './Util'; +import type { LocalizerType } from './Util.js'; -export type { LocalizerType } from './Util'; +export type { LocalizerType } from './Util.js'; type SmartlingConfigType = { placeholder_format_custom: string; diff --git a/ts/types/LinkPreview.ts b/ts/types/LinkPreview.ts index 2b871a057f0..fa44a48254e 100644 --- a/ts/types/LinkPreview.ts +++ b/ts/types/LinkPreview.ts @@ -2,20 +2,23 @@ // SPDX-License-Identifier: AGPL-3.0-only import { isNumber, compact, isEmpty, range } from 'lodash'; +// This file gets imported into renderer that does not have access to Node.js +// builtins, use an `npm` package. +// eslint-disable-next-line import/enforce-node-protocol-usage import nodeUrl from 'url'; import LinkifyIt from 'linkify-it'; -import { maybeParseUrl } from '../util/url'; -import { replaceEmojiWithSpaces } from '../util/emoji'; +import { maybeParseUrl } from '../util/url.js'; +import { replaceEmojiWithSpaces } from '../util/emoji.js'; -import type { AttachmentWithHydratedData } from './Attachment'; +import type { AttachmentWithHydratedData } from './Attachment.js'; import { artAddStickersRoute, groupInvitesRoute, linkCallRoute, -} from '../util/signalRoutes'; -import type { Backups } from '../protobuf'; -import type { LinkPreviewType } from './message/LinkPreviews'; +} from '../util/signalRoutes.js'; +import type { Backups } from '../protobuf/index.js'; +import type { LinkPreviewType } from './message/LinkPreviews.js'; export type LinkPreviewImage = AttachmentWithHydratedData; diff --git a/ts/types/MediaItem.ts b/ts/types/MediaItem.ts index b8824241705..f1df97799bb 100644 --- a/ts/types/MediaItem.ts +++ b/ts/types/MediaItem.ts @@ -1,8 +1,8 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AttachmentForUIType } from './Attachment'; -import type { MessageAttributesType } from '../model-types.d'; +import type { AttachmentForUIType } from './Attachment.js'; +import type { MessageAttributesType } from '../model-types.d.ts'; export type MediaItemMessageType = Readonly<{ id: string; diff --git a/ts/types/Message.ts b/ts/types/Message.ts index 695494ec71f..248d4f8e461 100644 --- a/ts/types/Message.ts +++ b/ts/types/Message.ts @@ -1,9 +1,9 @@ // Copyright 2018 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { DurationInSeconds } from '../util/durations'; -import type { AttachmentType } from './Attachment'; -import type { EmbeddedContactType } from './EmbeddedContact'; +import type { DurationInSeconds } from '../util/durations/index.js'; +import type { AttachmentType } from './Attachment.js'; +import type { EmbeddedContactType } from './EmbeddedContact.js'; export function getMentionsRegex(): RegExp { return /\uFFFC/g; diff --git a/ts/types/Message2.ts b/ts/types/Message2.ts index 81c155ee989..0d0b13565a9 100644 --- a/ts/types/Message2.ts +++ b/ts/types/Message2.ts @@ -4,50 +4,50 @@ import { isFunction, isObject, identity } from 'lodash'; import type { ReadonlyDeep } from 'type-fest'; -import * as Contact from './EmbeddedContact'; +import * as Contact from './EmbeddedContact.js'; import type { AddressableAttachmentType, AttachmentType, AttachmentWithHydratedData, LocalAttachmentV2Type, -} from './Attachment'; +} from './Attachment.js'; import { captureDimensionsAndScreenshot, removeSchemaVersion, replaceUnicodeOrderOverrides, replaceUnicodeV2, -} from './Attachment'; -import type { MakeVideoScreenshotResultType } from './VisualAttachment'; -import * as Errors from './errors'; -import * as SchemaVersion from './SchemaVersion'; +} from './Attachment.js'; +import type { MakeVideoScreenshotResultType } from './VisualAttachment.js'; +import * as Errors from './errors.js'; +import * as SchemaVersion from './SchemaVersion.js'; -import { LONG_MESSAGE } from './MIME'; -import type * as MIME from './MIME'; -import type { LoggerType } from './Logging'; +import { LONG_MESSAGE } from './MIME.js'; +import type * as MIME from './MIME.js'; +import type { LoggerType } from './Logging.js'; import type { EmbeddedContactType, EmbeddedContactWithHydratedAvatar, -} from './EmbeddedContact'; +} from './EmbeddedContact.js'; import type { MessageAttributesType, QuotedAttachmentType, QuotedMessageType, -} from '../model-types.d'; +} from '../model-types.d.ts'; import type { LinkPreviewType, LinkPreviewWithHydratedData, -} from './message/LinkPreviews'; -import type { StickerType, StickerWithHydratedData } from './Stickers'; -import { migrateDataToFileSystem } from '../util/attachments/migrateDataToFilesystem'; +} from './message/LinkPreviews.js'; +import type { StickerType, StickerWithHydratedData } from './Stickers.js'; +import { migrateDataToFileSystem } from '../util/attachments/migrateDataToFilesystem.js'; import { getLocalAttachmentUrl, AttachmentDisposition, -} from '../util/getLocalAttachmentUrl'; -import { encryptLegacyAttachment } from '../util/encryptLegacyAttachment'; -import { deepClone } from '../util/deepClone'; -import * as Bytes from '../Bytes'; -import { isBodyTooLong } from '../util/longAttachment'; +} from '../util/getLocalAttachmentUrl.js'; +import { encryptLegacyAttachment } from '../util/encryptLegacyAttachment.js'; +import { deepClone } from '../util/deepClone.js'; +import * as Bytes from '../Bytes.js'; +import { isBodyTooLong } from '../util/longAttachment.js'; export const GROUP = 'group'; export const PRIVATE = 'private'; diff --git a/ts/types/NotificationProfile-node.ts b/ts/types/NotificationProfile-node.ts index ccf01c4d6e5..eb88d2ea45d 100644 --- a/ts/types/NotificationProfile-node.ts +++ b/ts/types/NotificationProfile-node.ts @@ -2,15 +2,15 @@ // SPDX-License-Identifier: AGPL-3.0-only // Note: this is a dangerous import; it will break storybook -import { getRandomBytes } from '../Crypto'; +import { getRandomBytes } from '../Crypto.js'; -import * as Bytes from '../Bytes'; -import { createLogger } from '../logging/log'; +import * as Bytes from '../Bytes.js'; +import { createLogger } from '../logging/log.js'; -import { NOTIFICATION_PROFILE_ID_LENGTH } from './NotificationProfile'; +import { NOTIFICATION_PROFILE_ID_LENGTH } from './NotificationProfile.js'; -import type { NotificationProfileIdString } from './NotificationProfile'; -import type { LoggerType } from './Logging'; +import type { NotificationProfileIdString } from './NotificationProfile.js'; +import type { LoggerType } from './Logging.js'; const log = createLogger('NotificationProfile-node'); diff --git a/ts/types/NotificationProfile.ts b/ts/types/NotificationProfile.ts index 68119a20689..a1cce43cd24 100644 --- a/ts/types/NotificationProfile.ts +++ b/ts/types/NotificationProfile.ts @@ -3,10 +3,10 @@ import { isNumber, orderBy } from 'lodash'; -import { DAY, HOUR, MINUTE } from '../util/durations'; -import { strictAssert } from '../util/assert'; +import { DAY, HOUR, MINUTE } from '../util/durations/index.js'; +import { strictAssert } from '../util/assert.js'; -import type { StorageServiceFieldsType } from '../sql/Interface'; +import type { StorageServiceFieldsType } from '../sql/Interface.js'; // Note: this must match the Backup and Storage Service protos for NotificationProfile // This variable is separate so we aren't forced to add it to ScheduleDays object below diff --git a/ts/types/Panels.ts b/ts/types/Panels.ts index 590a139b004..dac0f57b6f7 100644 --- a/ts/types/Panels.ts +++ b/ts/types/Panels.ts @@ -3,7 +3,7 @@ import type { ReadonlyDeep } from 'type-fest'; -import type { ReadonlyMessageAttributesType } from '../model-types.d'; +import type { ReadonlyMessageAttributesType } from '../model-types.d.ts'; export enum PanelType { AllMedia = 'AllMedia', diff --git a/ts/types/PhoneNumber.ts b/ts/types/PhoneNumber.ts index e363e336780..4a19c6bd3ad 100644 --- a/ts/types/PhoneNumber.ts +++ b/ts/types/PhoneNumber.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import memoizee from 'memoizee'; -import { instance, PhoneNumberFormat } from '../util/libphonenumberInstance'; -import { createLogger } from '../logging/log'; -import * as Errors from './errors'; +import { instance, PhoneNumberFormat } from '../util/libphonenumberInstance.js'; +import { createLogger } from '../logging/log.js'; +import * as Errors from './errors.js'; const log = createLogger('PhoneNumber'); diff --git a/ts/types/PreferencesBackupPage.ts b/ts/types/PreferencesBackupPage.ts index 13ea174d1f9..fbd70023844 100644 --- a/ts/types/PreferencesBackupPage.ts +++ b/ts/types/PreferencesBackupPage.ts @@ -1,7 +1,7 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { SettingsPage } from './Nav'; +import { SettingsPage } from './Nav.js'; // Should be in sync with isBackupPage() export type PreferencesBackupPage = diff --git a/ts/types/QualifiedAddress.ts b/ts/types/QualifiedAddress.ts index 9d7c849ca63..44798a255e5 100644 --- a/ts/types/QualifiedAddress.ts +++ b/ts/types/QualifiedAddress.ts @@ -1,12 +1,12 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { strictAssert } from '../util/assert'; +import { strictAssert } from '../util/assert.js'; -import type { ServiceIdString } from './ServiceId'; -import { isServiceIdString } from './ServiceId'; -import type { AddressStringType } from './Address'; -import { Address } from './Address'; +import type { ServiceIdString } from './ServiceId.js'; +import { isServiceIdString } from './ServiceId.js'; +import type { AddressStringType } from './Address.js'; +import { Address } from './Address.js'; const QUALIFIED_ADDRESS_REGEXP = /^((?:PNI:)?[:0-9a-f-]+):((?:PNI:)?[:0-9a-f-]+).(\d+)$/i; diff --git a/ts/types/Reactions.ts b/ts/types/Reactions.ts index 5d5f210301d..c89373cec3d 100644 --- a/ts/types/Reactions.ts +++ b/ts/types/Reactions.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AciString } from './ServiceId'; +import type { AciString } from './ServiceId.js'; export type ReactionType = Readonly<{ conversationId: string; diff --git a/ts/types/Receipt.ts b/ts/types/Receipt.ts index d5029bc12e5..0bed06245b3 100644 --- a/ts/types/Receipt.ts +++ b/ts/types/Receipt.ts @@ -3,7 +3,7 @@ import { z } from 'zod'; -import { aciSchema } from './ServiceId'; +import { aciSchema } from './ServiceId.js'; export const receiptSchema = z.object({ messageId: z.string(), diff --git a/ts/types/RendererConfig.ts b/ts/types/RendererConfig.ts index 3519e4bce1e..1c0312c768f 100644 --- a/ts/types/RendererConfig.ts +++ b/ts/types/RendererConfig.ts @@ -3,10 +3,10 @@ import { z } from 'zod'; -import { Environment } from '../environment'; -import { themeSettingSchema } from './StorageUIKeys'; -import { HourCyclePreferenceSchema } from './I18N'; -import { DNSFallbackSchema } from './DNSFallback'; +import { Environment } from '../environment.js'; +import { themeSettingSchema } from './StorageUIKeys.js'; +import { HourCyclePreferenceSchema } from './I18N.js'; +import { DNSFallbackSchema } from './DNSFallback.js'; const environmentSchema = z.nativeEnum(Environment); diff --git a/ts/types/ServiceId.ts b/ts/types/ServiceId.ts index f1745f57041..d14ce48191f 100644 --- a/ts/types/ServiceId.ts +++ b/ts/types/ServiceId.ts @@ -5,10 +5,10 @@ import { v4 as generateUuid } from 'uuid'; import { z } from 'zod'; import type { ServiceId, Aci, Pni } from '@signalapp/libsignal-client'; -import { isValidUuid } from '../util/isValidUuid'; -import { createLogger } from '../logging/log'; -import type { LoggerType } from './Logging'; -import { isAciString } from '../util/isAciString'; +import { isValidUuid } from '../util/isValidUuid.js'; +import { createLogger } from '../logging/log.js'; +import type { LoggerType } from './Logging.js'; +import { isAciString } from '../util/isAciString.js'; const log = createLogger('ServiceId'); diff --git a/ts/types/Settings.ts b/ts/types/Settings.ts index bc910109aa3..bff70eca0ff 100644 --- a/ts/types/Settings.ts +++ b/ts/types/Settings.ts @@ -3,9 +3,9 @@ import semver from 'semver'; -import type { OSType } from '../util/os/shared'; -import { SystemTraySetting } from './SystemTraySetting'; -import { isNotUpdatable, isProduction } from '../util/version'; +import type { OSType } from '../util/os/shared.js'; +import { SystemTraySetting } from './SystemTraySetting.js'; +import { isNotUpdatable, isProduction } from '../util/version.js'; const MIN_WINDOWS_VERSION = '8.0.0'; diff --git a/ts/types/SignalConversation.ts b/ts/types/SignalConversation.ts index f32d7a18984..111d66fedbd 100644 --- a/ts/types/SignalConversation.ts +++ b/ts/types/SignalConversation.ts @@ -1,7 +1,7 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AciString } from './ServiceId'; +import type { AciString } from './ServiceId.js'; export const SIGNAL_ACI = '11111111-1111-4111-8111-111111111111' as AciString; export const SIGNAL_AVATAR_PATH = 'images/profile-avatar.svg'; diff --git a/ts/types/Stickers.ts b/ts/types/Stickers.ts index 4c2ce6f6b41..35389a86a70 100644 --- a/ts/types/Stickers.ts +++ b/ts/types/Stickers.ts @@ -5,33 +5,36 @@ import { isNumber, reject, groupBy, values, chunk } from 'lodash'; import pMap from 'p-map'; import Queue from 'p-queue'; -import { strictAssert } from '../util/assert'; -import { dropNull } from '../util/dropNull'; -import { makeLookup } from '../util/makeLookup'; -import { maybeParseUrl } from '../util/url'; -import { getMessagesById } from '../messages/getMessagesById'; -import * as Bytes from '../Bytes'; -import * as Errors from './errors'; -import { deriveStickerPackKey, decryptAttachmentV1 } from '../Crypto'; -import { IMAGE_WEBP } from './MIME'; -import { sniffImageMimeType } from '../util/sniffImageMimeType'; -import type { AttachmentType, AttachmentWithHydratedData } from './Attachment'; +import { strictAssert } from '../util/assert.js'; +import { dropNull } from '../util/dropNull.js'; +import { makeLookup } from '../util/makeLookup.js'; +import { maybeParseUrl } from '../util/url.js'; +import { getMessagesById } from '../messages/getMessagesById.js'; +import * as Bytes from '../Bytes.js'; +import * as Errors from './errors.js'; +import { deriveStickerPackKey, decryptAttachmentV1 } from '../Crypto.js'; +import { IMAGE_WEBP } from './MIME.js'; +import { sniffImageMimeType } from '../util/sniffImageMimeType.js'; +import type { + AttachmentType, + AttachmentWithHydratedData, +} from './Attachment.js'; import type { StickerType as StickerFromDBType, StickerPackType, StickerPackStatusType, UninstalledStickerPackType, -} from '../sql/Interface'; -import { DataReader, DataWriter } from '../sql/Client'; -import { SignalService as Proto } from '../protobuf'; -import { createLogger } from '../logging/log'; -import type { StickersStateType } from '../state/ducks/stickers'; -import { MINUTE } from '../util/durations'; -import { drop } from '../util/drop'; -import { isNotNil } from '../util/isNotNil'; -import { encryptLegacyAttachment } from '../util/encryptLegacyAttachment'; -import { AttachmentDisposition } from '../util/getLocalAttachmentUrl'; -import { getPlaintextHashForInMemoryAttachment } from '../AttachmentCrypto'; +} from '../sql/Interface.js'; +import { DataReader, DataWriter } from '../sql/Client.js'; +import { SignalService as Proto } from '../protobuf/index.js'; +import { createLogger } from '../logging/log.js'; +import type { StickersStateType } from '../state/ducks/stickers.js'; +import { MINUTE } from '../util/durations/index.js'; +import { drop } from '../util/drop.js'; +import { isNotNil } from '../util/isNotNil.js'; +import { encryptLegacyAttachment } from '../util/encryptLegacyAttachment.js'; +import { AttachmentDisposition } from '../util/getLocalAttachmentUrl.js'; +import { getPlaintextHashForInMemoryAttachment } from '../AttachmentCrypto.js'; const log = createLogger('Stickers'); diff --git a/ts/types/Storage.d.ts b/ts/types/Storage.d.ts index 78b147a00be..1414c89fbd1 100644 --- a/ts/types/Storage.d.ts +++ b/ts/types/Storage.d.ts @@ -5,27 +5,27 @@ import type { AudioDevice } from '@signalapp/ringrtc'; import type { CustomColorsItemType, DefaultConversationColorType, -} from './Colors'; -import type { PhoneNumberDiscoverability } from '../util/phoneNumberDiscoverability'; -import type { PhoneNumberSharingMode } from '../util/phoneNumberSharingMode'; -import type { RetryItemType } from '../util/retryPlaceholders'; -import type { ConfigMapType as RemoteConfigType } from '../RemoteConfig'; -import type { ExtendedStorageID, UnknownRecord } from './StorageService.d'; +} from './Colors.js'; +import type { PhoneNumberDiscoverability } from '../util/phoneNumberDiscoverability.js'; +import type { PhoneNumberSharingMode } from '../util/phoneNumberSharingMode.js'; +import type { RetryItemType } from '../util/retryPlaceholders.js'; +import type { ConfigMapType as RemoteConfigType } from '../RemoteConfig.js'; +import type { ExtendedStorageID, UnknownRecord } from './StorageService.d.ts'; -import type { GroupCredentialType } from '../textsecure/WebAPI'; +import type { GroupCredentialType } from '../textsecure/WebAPI.js'; import type { SessionResetsType, StorageServiceCredentials, -} from '../textsecure/Types.d'; +} from '../textsecure/Types.d.ts'; import type { BackupCredentialWrapperType, BackupsSubscriptionType, BackupStatusType, -} from './backups'; -import type { ServiceIdString } from './ServiceId'; -import type { RegisteredChallengeType } from '../challenge'; -import type { ServerAlertsType } from '../util/handleServerAlerts'; -import type { NotificationProfileOverride } from './NotificationProfile'; +} from './backups.js'; +import type { ServiceIdString } from './ServiceId.js'; +import type { RegisteredChallengeType } from '../challenge.js'; +import type { ServerAlertsType } from '../util/handleServerAlerts.js'; +import type { NotificationProfileOverride } from './NotificationProfile.js'; export type AutoDownloadAttachmentType = { photos: boolean; diff --git a/ts/types/StorageUIKeys.ts b/ts/types/StorageUIKeys.ts index 1e6284aa8ef..d13238b90a3 100644 --- a/ts/types/StorageUIKeys.ts +++ b/ts/types/StorageUIKeys.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { z } from 'zod'; -import type { StorageAccessType } from './Storage.d'; +import type { StorageAccessType } from './Storage.d.ts'; export const themeSettingSchema = z.enum(['system', 'light', 'dark']); export type ThemeSettingType = z.infer; diff --git a/ts/types/Stories.ts b/ts/types/Stories.ts index 1e9cd893252..cdabbb1e71f 100644 --- a/ts/types/Stories.ts +++ b/ts/types/Stories.ts @@ -1,16 +1,16 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AttachmentType } from './Attachment'; -import type { HydratedBodyRangesType } from './BodyRange'; -import type { LocalizerType } from './Util'; -import type { ContactNameColorType } from './Colors'; -import type { ConversationType } from '../state/ducks/conversations'; -import type { ReadStatus } from '../messages/MessageReadStatus'; -import type { SendStatus } from '../messages/MessageSendState'; -import type { StoryDistributionListDataType } from '../state/ducks/storyDistributionLists'; -import type { ServiceIdString } from './ServiceId'; -import type { StoryDistributionIdString } from './StoryDistributionId'; +import type { AttachmentType } from './Attachment.js'; +import type { HydratedBodyRangesType } from './BodyRange.js'; +import type { LocalizerType } from './Util.js'; +import type { ContactNameColorType } from './Colors.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import type { ReadStatus } from '../messages/MessageReadStatus.js'; +import type { SendStatus } from '../messages/MessageSendState.js'; +import type { StoryDistributionListDataType } from '../state/ducks/storyDistributionLists.js'; +import type { ServiceIdString } from './ServiceId.js'; +import type { StoryDistributionIdString } from './StoryDistributionId.js'; export type ReplyType = { author: Pick< diff --git a/ts/types/StoryDistributionId.ts b/ts/types/StoryDistributionId.ts index 05b1f58561c..6902a119dc9 100644 --- a/ts/types/StoryDistributionId.ts +++ b/ts/types/StoryDistributionId.ts @@ -3,9 +3,9 @@ import { v4 as generateUuid } from 'uuid'; -import { isValidUuid } from '../util/isValidUuid'; -import { createLogger } from '../logging/log'; -import type { LoggerType } from './Logging'; +import { isValidUuid } from '../util/isValidUuid.js'; +import { createLogger } from '../logging/log.js'; +import type { LoggerType } from './Logging.js'; const log = createLogger('StoryDistributionId'); diff --git a/ts/types/SystemTraySetting.ts b/ts/types/SystemTraySetting.ts index eda1a435eef..dad12c59737 100644 --- a/ts/types/SystemTraySetting.ts +++ b/ts/types/SystemTraySetting.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { makeEnumParser } from '../util/enum'; +import { makeEnumParser } from '../util/enum.js'; // Be careful when changing these values, as they are persisted. export enum SystemTraySetting { diff --git a/ts/types/Util.ts b/ts/types/Util.ts index e1470ebd834..a62f6921532 100644 --- a/ts/types/Util.ts +++ b/ts/types/Util.ts @@ -2,14 +2,14 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { IntlShape } from 'react-intl'; -import type { AciString } from './ServiceId'; -import type { LocaleDirection } from '../../app/locale'; +import type { AciString } from './ServiceId.js'; +import type { LocaleDirection } from '../../app/locale.js'; import type { ICUJSXMessageParamsByKeyType, ICUStringMessageParamsByKeyType, -} from '../../build/ICUMessageParams.d'; +} from '../../build/ICUMessageParams.d.ts'; -import type { HourCyclePreference, LocaleMessagesType } from './I18N'; +import type { HourCyclePreference, LocaleMessagesType } from './I18N.js'; export type StoryContextType = { authorAci?: AciString; diff --git a/ts/types/VisualAttachment.ts b/ts/types/VisualAttachment.ts index 1e610c5752a..8b3e6196058 100644 --- a/ts/types/VisualAttachment.ts +++ b/ts/types/VisualAttachment.ts @@ -3,16 +3,16 @@ import loadImage from 'blueimp-load-image'; import { blobToArrayBuffer } from 'blob-util'; -import { toLogFormat } from './errors'; -import type { MIMEType } from './MIME'; -import { IMAGE_JPEG, IMAGE_PNG } from './MIME'; -import type { LoggerType } from './Logging'; -import { strictAssert } from '../util/assert'; -import { canvasToBlob } from '../util/canvasToBlob'; -import { KIBIBYTE } from './AttachmentSize'; -import { explodePromise } from '../util/explodePromise'; -import { SECOND } from '../util/durations'; -import { createLogger } from '../logging/log'; +import { toLogFormat } from './errors.js'; +import type { MIMEType } from './MIME.js'; +import { IMAGE_JPEG, IMAGE_PNG } from './MIME.js'; +import type { LoggerType } from './Logging.js'; +import { strictAssert } from '../util/assert.js'; +import { canvasToBlob } from '../util/canvasToBlob.js'; +import { KIBIBYTE } from './AttachmentSize.js'; +import { explodePromise } from '../util/explodePromise.js'; +import { SECOND } from '../util/durations/index.js'; +import { createLogger } from '../logging/log.js'; const logging = createLogger('VisualAttachment'); diff --git a/ts/types/backups.ts b/ts/types/backups.ts index 898a78cb0fa..95c7633a0df 100644 --- a/ts/types/backups.ts +++ b/ts/types/backups.ts @@ -3,7 +3,7 @@ import type { BackupLevel } from '@signalapp/libsignal-client/zkgroup'; import { BackupCredentialType } from '@signalapp/libsignal-client/dist/zkgroup'; -import type { GetBackupCDNCredentialsResponseType } from '../textsecure/WebAPI'; +import type { GetBackupCDNCredentialsResponseType } from '../textsecure/WebAPI.js'; export { BackupCredentialType }; diff --git a/ts/types/errors.ts b/ts/types/errors.ts index 04110faabfd..d9961715dd3 100644 --- a/ts/types/errors.ts +++ b/ts/types/errors.ts @@ -1,7 +1,7 @@ // Copyright 2018 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { HTTPError } from '../textsecure/Errors'; +import { HTTPError } from '../textsecure/Errors.js'; export function toLogFormat(error: unknown): string { let result = ''; diff --git a/ts/types/message/LinkPreviews.ts b/ts/types/message/LinkPreviews.ts index 371ff26cac4..2275a10709d 100644 --- a/ts/types/message/LinkPreviews.ts +++ b/ts/types/message/LinkPreviews.ts @@ -5,7 +5,7 @@ import type { AttachmentType, AttachmentForUIType, AttachmentWithHydratedData, -} from '../Attachment'; +} from '../Attachment.js'; type GenericLinkPreviewType = { title?: string; diff --git a/ts/updateConversationsWithUuidLookup.ts b/ts/updateConversationsWithUuidLookup.ts index 61803803692..80e5543ac4f 100644 --- a/ts/updateConversationsWithUuidLookup.ts +++ b/ts/updateConversationsWithUuidLookup.ts @@ -1,12 +1,12 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationController } from './ConversationController'; -import type { ConversationModel } from './models/conversations'; -import type { WebAPIType } from './textsecure/WebAPI'; -import { assertDev } from './util/assert'; -import { isNotNil } from './util/isNotNil'; -import { getServiceIdsForE164s } from './util/getServiceIdsForE164s'; +import type { ConversationController } from './ConversationController.js'; +import type { ConversationModel } from './models/conversations.js'; +import type { WebAPIType } from './textsecure/WebAPI.js'; +import { assertDev } from './util/assert.js'; +import { isNotNil } from './util/isNotNil.js'; +import { getServiceIdsForE164s } from './util/getServiceIdsForE164s.js'; export async function updateConversationsWithUuidLookup({ conversationController, diff --git a/ts/updater/common.ts b/ts/updater/common.ts index 6b1b2d6a515..a36d4591e0f 100644 --- a/ts/updater/common.ts +++ b/ts/updater/common.ts @@ -2,12 +2,12 @@ // SPDX-License-Identifier: AGPL-3.0-only /* eslint-disable no-console */ -import { createWriteStream } from 'fs'; +import { createWriteStream } from 'node:fs'; import { pathExists } from 'fs-extra'; -import { mkdir, readdir, stat, writeFile } from 'fs/promises'; +import { mkdir, readdir, stat, writeFile } from 'node:fs/promises'; import { throttle } from 'lodash'; -import { release as osRelease, tmpdir } from 'os'; -import { extname, join, normalize } from 'path'; +import { release as osRelease, tmpdir } from 'node:os'; +import { extname, join, normalize } from 'node:path'; import config from 'config'; import type { ParserConfiguration } from 'dashdash'; @@ -19,22 +19,22 @@ import { v4 as getGuid } from 'uuid'; import type { BrowserWindow } from 'electron'; import { app, ipcMain } from 'electron'; -import { missingCaseError } from '../util/missingCaseError'; -import { getTempPath, getUpdateCachePath } from '../../app/attachments'; -import { markShouldNotQuit, markShouldQuit } from '../../app/window_state'; -import { DialogType } from '../types/Dialogs'; -import * as Errors from '../types/errors'; -import { strictAssert } from '../util/assert'; -import { drop } from '../util/drop'; -import * as durations from '../util/durations'; +import { missingCaseError } from '../util/missingCaseError.js'; +import { getTempPath, getUpdateCachePath } from '../../app/attachments.js'; +import { markShouldNotQuit, markShouldQuit } from '../../app/window_state.js'; +import { DialogType } from '../types/Dialogs.js'; +import * as Errors from '../types/errors.js'; +import { strictAssert } from '../util/assert.js'; +import { drop } from '../util/drop.js'; +import * as durations from '../util/durations/index.js'; import { isAlpha, isAxolotl, isBeta, isNotUpdatable, isStaging, -} from '../util/version'; -import { isPathInside } from '../util/isPathInside'; +} from '../util/version.js'; +import { isPathInside } from '../util/isPathInside.js'; import * as packageJson from '../../package.json'; @@ -42,24 +42,24 @@ import { getSignatureFileName, hexToBinary, verifySignature, -} from './signature'; +} from './signature.js'; import { download as downloadDifferentialData, getBlockMapFileName, isValidPreparedData as isValidDifferentialData, prepareDownload as prepareDifferentialDownload, -} from './differential'; -import { getGotOptions } from './got'; +} from './differential.js'; +import { getGotOptions } from './got.js'; import { checkIntegrity, gracefulRename, gracefulRmRecursive, isTimeToUpdate, -} from './util'; +} from './util.js'; -import type { LoggerType } from '../types/Logging'; -import type { PrepareDownloadResultType as DifferentialDownloadDataType } from './differential'; -import type { MainSQL } from '../sql/main'; +import type { LoggerType } from '../types/Logging.js'; +import type { PrepareDownloadResultType as DifferentialDownloadDataType } from './differential.js'; +import type { MainSQL } from '../sql/main.js'; const POLL_INTERVAL = 30 * durations.MINUTE; diff --git a/ts/updater/differential.ts b/ts/updater/differential.ts index fcaf769c330..0636ef7c537 100644 --- a/ts/updater/differential.ts +++ b/ts/updater/differential.ts @@ -1,23 +1,23 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { FileHandle } from 'fs/promises'; -import { readFile, open } from 'fs/promises'; -import type { Readable } from 'stream'; -import { pipeline } from 'stream/promises'; -import { promisify } from 'util'; -import { gunzip as nativeGunzip } from 'zlib'; +import type { FileHandle } from 'node:fs/promises'; +import { readFile, open } from 'node:fs/promises'; +import type { Readable } from 'node:stream'; +import { pipeline } from 'node:stream/promises'; +import { promisify } from 'node:util'; +import { gunzip as nativeGunzip } from 'node:zlib'; import got from 'got'; import { chunk as lodashChunk, noop } from 'lodash'; import pMap from 'p-map'; import Dicer from '@indutny/dicer'; -import { strictAssert } from '../util/assert'; -import { wrapEventEmitterOnce } from '../util/wrapEventEmitterOnce'; -import type { LoggerType } from '../types/Logging'; -import { getGotOptions } from './got'; -import type { GotOptions } from './got'; -import { checkIntegrity } from './util'; +import { strictAssert } from '../util/assert.js'; +import { wrapEventEmitterOnce } from '../util/wrapEventEmitterOnce.js'; +import type { LoggerType } from '../types/Logging.js'; +import { getGotOptions } from './got.js'; +import type { GotOptions } from './got.js'; +import { checkIntegrity } from './util.js'; const gunzip = promisify(nativeGunzip); diff --git a/ts/updater/generateKeyPair.ts b/ts/updater/generateKeyPair.ts index fbfe1dd813c..a32a23bbced 100644 --- a/ts/updater/generateKeyPair.ts +++ b/ts/updater/generateKeyPair.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only /* eslint-disable no-console */ -import * as Errors from '../types/errors'; -import { getCliOptions } from './common'; -import { keyPair } from './curve'; -import { writeHexToPath } from './signature'; +import * as Errors from '../types/errors.js'; +import { getCliOptions } from './common.js'; +import { keyPair } from './curve.js'; +import { writeHexToPath } from './signature.js'; const OPTIONS = [ { diff --git a/ts/updater/generateSignature.ts b/ts/updater/generateSignature.ts index af2e8348529..b64c457ceae 100644 --- a/ts/updater/generateSignature.ts +++ b/ts/updater/generateSignature.ts @@ -2,14 +2,14 @@ // SPDX-License-Identifier: AGPL-3.0-only /* eslint-disable no-console */ -import { join, resolve } from 'path'; -import { readdir as readdirCallback } from 'fs'; +import { join, resolve } from 'node:path'; +import { readdir as readdirCallback } from 'node:fs'; import pify from 'pify'; -import * as Errors from '../types/errors'; -import { getCliOptions } from './common'; -import { writeSignature } from './signature'; +import * as Errors from '../types/errors.js'; +import { getCliOptions } from './common.js'; +import { writeSignature } from './signature.js'; import * as packageJson from '../../package.json'; const readdir = pify(readdirCallback); diff --git a/ts/updater/got.ts b/ts/updater/got.ts index aeaed5abc6c..31b3571d8ea 100644 --- a/ts/updater/got.ts +++ b/ts/updater/got.ts @@ -3,13 +3,13 @@ import type { StrictOptions as GotOptions } from 'got'; import config from 'config'; -import { Agent as HTTPAgent } from 'http'; +import { Agent as HTTPAgent } from 'node:http'; import * as packageJson from '../../package.json'; -import { getUserAgent } from '../util/getUserAgent'; -import * as durations from '../util/durations'; -import { createHTTPSAgent } from '../util/createHTTPSAgent'; -import { createProxyAgent } from '../util/createProxyAgent'; +import { getUserAgent } from '../util/getUserAgent.js'; +import * as durations from '../util/durations/index.js'; +import { createHTTPSAgent } from '../util/createHTTPSAgent.js'; +import { createProxyAgent } from '../util/createProxyAgent.js'; export const GOT_CONNECT_TIMEOUT = durations.MINUTE; export const GOT_LOOKUP_TIMEOUT = durations.MINUTE; diff --git a/ts/updater/index.ts b/ts/updater/index.ts index e9484793afb..cc6a2129404 100644 --- a/ts/updater/index.ts +++ b/ts/updater/index.ts @@ -3,10 +3,10 @@ import config from 'config'; import { app } from 'electron'; -import type { Updater, UpdaterOptionsType } from './common'; -import { MacOSUpdater } from './macos'; -import { WindowsUpdater } from './windows'; -import { initLinux } from './linux'; +import type { Updater, UpdaterOptionsType } from './common.js'; +import { MacOSUpdater } from './macos.js'; +import { WindowsUpdater } from './windows.js'; +import { initLinux } from './linux.js'; let initialized = false; diff --git a/ts/updater/linux.ts b/ts/updater/linux.ts index 9e291de2320..d0cb0004cb3 100644 --- a/ts/updater/linux.ts +++ b/ts/updater/linux.ts @@ -8,11 +8,11 @@ import { app, ipcMain } from 'electron'; import { extractFile } from '@electron/asar'; import z from 'zod'; -import { markShouldQuit } from '../../app/window_state'; -import type { LoggerType } from '../types/Logging'; -import { DialogType } from '../types/Dialogs'; -import * as Errors from '../types/errors'; -import type { UpdaterOptionsType } from './common'; +import { markShouldQuit } from '../../app/window_state.js'; +import type { LoggerType } from '../types/Logging.js'; +import { DialogType } from '../types/Dialogs.js'; +import * as Errors from '../types/errors.js'; +import type { UpdaterOptionsType } from './common.js'; const MIN_UBUNTU_VERSION = '22.04'; diff --git a/ts/updater/macos.ts b/ts/updater/macos.ts index 279f36f71d6..52211603ea3 100644 --- a/ts/updater/macos.ts +++ b/ts/updater/macos.ts @@ -1,15 +1,15 @@ // Copyright 2019 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { pathToFileURL } from 'url'; +import { pathToFileURL } from 'node:url'; import { autoUpdater } from 'electron'; -import { writeFile } from 'fs/promises'; -import { join } from 'path'; +import { writeFile } from 'node:fs/promises'; +import { join } from 'node:path'; -import { Updater, createTempDir, deleteTempDir } from './common'; -import { explodePromise } from '../util/explodePromise'; -import * as Errors from '../types/errors'; -import { DialogType } from '../types/Dialogs'; +import { Updater, createTempDir, deleteTempDir } from './common.js'; +import { explodePromise } from '../util/explodePromise.js'; +import * as Errors from '../types/errors.js'; +import { DialogType } from '../types/Dialogs.js'; export class MacOSUpdater extends Updater { protected async deletePreviousInstallers(): Promise { diff --git a/ts/updater/signature.ts b/ts/updater/signature.ts index a33849d09af..c33e62024c6 100644 --- a/ts/updater/signature.ts +++ b/ts/updater/signature.ts @@ -1,18 +1,18 @@ // Copyright 2019 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createHash } from 'crypto'; +import { createHash } from 'node:crypto'; import { createReadStream, readFile as readFileCallback, writeFile as writeFileCallback, -} from 'fs'; -import { pipeline } from 'stream/promises'; -import { basename, dirname, join, resolve as resolvePath } from 'path'; +} from 'node:fs'; +import { pipeline } from 'node:stream/promises'; +import { basename, dirname, join, resolve as resolvePath } from 'node:path'; import pify from 'pify'; -import { sign, verify } from './curve'; +import { sign, verify } from './curve.js'; const readFile = pify(readFileCallback); const writeFile = pify(writeFileCallback); diff --git a/ts/updater/util.ts b/ts/updater/util.ts index c142991b0c5..0c0c2a40c35 100644 --- a/ts/updater/util.ts +++ b/ts/updater/util.ts @@ -1,16 +1,16 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createHash } from 'crypto'; -import { createReadStream } from 'fs'; -import { rename, rm } from 'fs/promises'; -import { pipeline } from 'stream/promises'; +import { createHash } from 'node:crypto'; +import { createReadStream } from 'node:fs'; +import { rename, rm } from 'node:fs/promises'; +import { pipeline } from 'node:stream/promises'; -import type { LoggerType } from '../types/Logging'; -import * as Errors from '../types/errors'; -import { SECOND, MINUTE, HOUR } from '../util/durations'; -import { sleep } from '../util/sleep'; -import { isOlderThan } from '../util/timestamp'; +import type { LoggerType } from '../types/Logging.js'; +import * as Errors from '../types/errors.js'; +import { SECOND, MINUTE, HOUR } from '../util/durations/index.js'; +import { sleep } from '../util/sleep.js'; +import { isOlderThan } from '../util/timestamp.js'; export type CheckIntegrityResultType = Readonly< | { diff --git a/ts/updater/windows.ts b/ts/updater/windows.ts index eea790c421e..dc4bd0e8f74 100644 --- a/ts/updater/windows.ts +++ b/ts/updater/windows.ts @@ -1,15 +1,15 @@ // Copyright 2019 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { join } from 'path'; -import type { SpawnOptions } from 'child_process'; -import { spawn as spawnEmitter } from 'child_process'; -import { readdir as readdirCallback, unlink as unlinkCallback } from 'fs'; +import { join } from 'node:path'; +import type { SpawnOptions } from 'node:child_process'; +import { spawn as spawnEmitter } from 'node:child_process'; +import { readdir as readdirCallback, unlink as unlinkCallback } from 'node:fs'; import { app } from 'electron'; import pify from 'pify'; -import { Updater } from './common'; +import { Updater } from './common.js'; const readdir = pify(readdirCallback); const unlink = pify(unlinkCallback); diff --git a/ts/util/AbortableProcess.ts b/ts/util/AbortableProcess.ts index cf696386891..0b80926a2cf 100644 --- a/ts/util/AbortableProcess.ts +++ b/ts/util/AbortableProcess.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only /* eslint-disable no-restricted-syntax */ -import { explodePromise } from './explodePromise'; +import { explodePromise } from './explodePromise.js'; export interface IController { abort(): void; diff --git a/ts/util/DelimitedStream.ts b/ts/util/DelimitedStream.ts index b611d85b9cb..849132c289d 100644 --- a/ts/util/DelimitedStream.ts +++ b/ts/util/DelimitedStream.ts @@ -1,9 +1,9 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { Transform } from 'stream'; +import { Transform } from 'node:stream'; -import { missingCaseError } from './missingCaseError'; +import { missingCaseError } from './missingCaseError.js'; enum State { Prefix = 'Prefix', diff --git a/ts/util/GoogleChrome.ts b/ts/util/GoogleChrome.ts index 9534e556887..d501d929182 100644 --- a/ts/util/GoogleChrome.ts +++ b/ts/util/GoogleChrome.ts @@ -1,7 +1,7 @@ // Copyright 2018 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type * as MIME from '../types/MIME'; +import type * as MIME from '../types/MIME.js'; type MIMETypeSupportMap = Record; diff --git a/ts/util/JobQueue.ts b/ts/util/JobQueue.ts index 3ab6d777cc3..93b722188ec 100644 --- a/ts/util/JobQueue.ts +++ b/ts/util/JobQueue.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import PQueue from 'p-queue'; -import createTaskWithTimeout from '../textsecure/TaskWithTimeout'; +import createTaskWithTimeout from '../textsecure/TaskWithTimeout.js'; function createJobQueue(label: string) { const jobQueue = new PQueue({ concurrency: 1 }); diff --git a/ts/util/LatestQueue.ts b/ts/util/LatestQueue.ts index 5da6ce2874f..265a73ac5c5 100644 --- a/ts/util/LatestQueue.ts +++ b/ts/util/LatestQueue.ts @@ -17,7 +17,7 @@ * previously queued task completely. */ -import { drop } from './drop'; +import { drop } from './drop.js'; export class LatestQueue { #isRunning: boolean; diff --git a/ts/util/ServiceId.ts b/ts/util/ServiceId.ts index 083bd141ccb..9e229edfab4 100644 --- a/ts/util/ServiceId.ts +++ b/ts/util/ServiceId.ts @@ -2,7 +2,11 @@ // SPDX-License-Identifier: AGPL-3.0-only import { Aci, Pni, ServiceId } from '@signalapp/libsignal-client'; -import type { AciString, PniString, ServiceIdString } from '../types/ServiceId'; +import type { + AciString, + PniString, + ServiceIdString, +} from '../types/ServiceId.js'; import { normalizeServiceId, normalizePni, @@ -11,9 +15,9 @@ import { fromServiceIdObject, fromAciObject, fromPniObject, -} from '../types/ServiceId'; -import * as Bytes from '../Bytes'; -import { normalizeAci } from './normalizeAci'; +} from '../types/ServiceId.js'; +import * as Bytes from '../Bytes.js'; +import { normalizeAci } from './normalizeAci.js'; export function toServiceIdObject(serviceId: ServiceIdString): ServiceId { return ServiceId.parseFromServiceIdString(serviceId); diff --git a/ts/util/Sound.ts b/ts/util/Sound.ts index 897f3ecd729..497fe58b959 100644 --- a/ts/util/Sound.ts +++ b/ts/util/Sound.ts @@ -1,8 +1,8 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log'; -import { missingCaseError } from './missingCaseError'; +import { createLogger } from '../logging/log.js'; +import { missingCaseError } from './missingCaseError.js'; const log = createLogger('Sound'); diff --git a/ts/util/StartupQueue.ts b/ts/util/StartupQueue.ts index 5d3b6e03625..b09c206e030 100644 --- a/ts/util/StartupQueue.ts +++ b/ts/util/StartupQueue.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import PQueue from 'p-queue'; -import * as Errors from '../types/errors'; -import { createLogger } from '../logging/log'; +import * as Errors from '../types/errors.js'; +import { createLogger } from '../logging/log.js'; const log = createLogger('StartupQueue'); diff --git a/ts/util/Username.ts b/ts/util/Username.ts index 4f2b0b9939f..ee6e271bf8a 100644 --- a/ts/util/Username.ts +++ b/ts/util/Username.ts @@ -1,8 +1,8 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import * as RemoteConfig from '../RemoteConfig'; -import { parseIntWithFallback } from './parseIntWithFallback'; +import * as RemoteConfig from '../RemoteConfig.js'; +import { parseIntWithFallback } from './parseIntWithFallback.js'; export function getMaxNickname(): number { return parseIntWithFallback( diff --git a/ts/util/appendMacStream.ts b/ts/util/appendMacStream.ts index c32943c47f4..f8805e0b687 100644 --- a/ts/util/appendMacStream.ts +++ b/ts/util/appendMacStream.ts @@ -1,11 +1,11 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createHmac } from 'crypto'; -import { Transform } from 'stream'; -import type { Duplex } from 'stream'; +import { createHmac } from 'node:crypto'; +import { Transform } from 'node:stream'; +import type { Duplex } from 'node:stream'; -import { HashType } from '../types/Crypto'; +import { HashType } from '../types/Crypto.js'; export const MAC_KEY_SIZE = 32; diff --git a/ts/util/arePinnedConversationsEqual.ts b/ts/util/arePinnedConversationsEqual.ts index f814402f22d..a3a1376cdf2 100644 --- a/ts/util/arePinnedConversationsEqual.ts +++ b/ts/util/arePinnedConversationsEqual.ts @@ -1,10 +1,10 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import * as Bytes from '../Bytes'; +import * as Bytes from '../Bytes.js'; -import { SignalService as Proto } from '../protobuf'; -import { fromServiceIdBinaryOrString } from './ServiceId'; +import { SignalService as Proto } from '../protobuf/index.js'; +import { fromServiceIdBinaryOrString } from './ServiceId.js'; import PinnedConversation = Proto.AccountRecord.IPinnedConversation; diff --git a/ts/util/areWeAdmin.ts b/ts/util/areWeAdmin.ts index 8238f0ff1ba..aea3db20c5d 100644 --- a/ts/util/areWeAdmin.ts +++ b/ts/util/areWeAdmin.ts @@ -1,9 +1,9 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationAttributesType } from '../model-types'; -import { SignalService as Proto } from '../protobuf'; -import { isGroupV2 } from './whatTypeOfConversation'; +import type { ConversationAttributesType } from '../model-types.js'; +import { SignalService as Proto } from '../protobuf/index.js'; +import { isGroupV2 } from './whatTypeOfConversation.js'; export function areWeAdmin( attributes: Pick< diff --git a/ts/util/arrayBufferToObjectURL.ts b/ts/util/arrayBufferToObjectURL.ts index d2a176edee3..b578a4a12c2 100644 --- a/ts/util/arrayBufferToObjectURL.ts +++ b/ts/util/arrayBufferToObjectURL.ts @@ -1,7 +1,7 @@ // Copyright 2018 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { MIMEType } from '../types/MIME'; +import type { MIMEType } from '../types/MIME.js'; export const arrayBufferToObjectURL = ({ data, diff --git a/ts/util/assert.ts b/ts/util/assert.ts index a5286e3ddf6..9d0f858293a 100644 --- a/ts/util/assert.ts +++ b/ts/util/assert.ts @@ -1,9 +1,9 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { getEnvironment, Environment } from '../environment'; -import { createLogger } from '../logging/log'; -import * as Errors from '../types/errors'; +import { getEnvironment, Environment } from '../environment.js'; +import { createLogger } from '../logging/log.js'; +import * as Errors from '../types/errors.js'; const log = createLogger('assert'); diff --git a/ts/util/attachmentDownloadQueue.ts b/ts/util/attachmentDownloadQueue.ts index c1823a320d0..99fa5119a3b 100644 --- a/ts/util/attachmentDownloadQueue.ts +++ b/ts/util/attachmentDownloadQueue.ts @@ -1,18 +1,18 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { MessageModel } from '../models/messages'; -import type { MessageAttributesType } from '../model-types'; -import type { AttachmentType } from '../types/Attachment'; +import type { MessageModel } from '../models/messages.js'; +import type { MessageAttributesType } from '../model-types.js'; +import type { AttachmentType } from '../types/Attachment.js'; -import { createLogger } from '../logging/log'; -import * as MIME from '../types/MIME'; +import { createLogger } from '../logging/log.js'; +import * as MIME from '../types/MIME.js'; -import { DataWriter } from '../sql/Client'; -import { isMoreRecentThan } from './timestamp'; -import { isNotNil } from './isNotNil'; -import { queueAttachmentDownloads } from './queueAttachmentDownloads'; -import { postSaveUpdates } from './cleanup'; +import { DataWriter } from '../sql/Client.js'; +import { isMoreRecentThan } from './timestamp.js'; +import { isNotNil } from './isNotNil.js'; +import { queueAttachmentDownloads } from './queueAttachmentDownloads.js'; +import { postSaveUpdates } from './cleanup.js'; const log = createLogger('attachmentDownloadQueue'); diff --git a/ts/util/attachmentPath.ts b/ts/util/attachmentPath.ts index 5f013890a31..c3d4a97af2c 100644 --- a/ts/util/attachmentPath.ts +++ b/ts/util/attachmentPath.ts @@ -4,8 +4,8 @@ import { join } from 'node:path'; import { isString } from 'lodash'; -import { getRandomBytes } from '../Crypto'; -import * as Bytes from '../Bytes'; +import { getRandomBytes } from '../Crypto.js'; +import * as Bytes from '../Bytes.js'; export const getRelativePath = (name: string): string => { if (!isString(name)) { diff --git a/ts/util/attachments.ts b/ts/util/attachments.ts index 822dd22dad8..546089862ba 100644 --- a/ts/util/attachments.ts +++ b/ts/util/attachments.ts @@ -3,17 +3,17 @@ import { blobToArrayBuffer } from 'blob-util'; -import { createLogger } from '../logging/log'; -import { scaleImageToLevel } from './scaleImageToLevel'; -import { dropNull } from './dropNull'; -import { getLocalAttachmentUrl } from './getLocalAttachmentUrl'; +import { createLogger } from '../logging/log.js'; +import { scaleImageToLevel } from './scaleImageToLevel.js'; +import { dropNull } from './dropNull.js'; +import { getLocalAttachmentUrl } from './getLocalAttachmentUrl.js'; import type { AttachmentType, UploadedAttachmentType, -} from '../types/Attachment'; -import { canBeTranscoded } from '../types/Attachment'; -import * as Errors from '../types/errors'; -import * as Bytes from '../Bytes'; +} from '../types/Attachment.js'; +import { canBeTranscoded } from '../types/Attachment.js'; +import * as Errors from '../types/errors.js'; +import * as Bytes from '../Bytes.js'; const log = createLogger('attachments'); diff --git a/ts/util/attachments/markAttachmentAsPermanentlyErrored.ts b/ts/util/attachments/markAttachmentAsPermanentlyErrored.ts index 553a860a11e..1c812bb8ead 100644 --- a/ts/util/attachments/markAttachmentAsPermanentlyErrored.ts +++ b/ts/util/attachments/markAttachmentAsPermanentlyErrored.ts @@ -3,7 +3,7 @@ import { omit } from 'lodash'; -import { type AttachmentType } from '../../types/Attachment'; +import { type AttachmentType } from '../../types/Attachment.js'; export function markAttachmentAsPermanentlyErrored( attachment: AttachmentType, diff --git a/ts/util/attachments/migrateDataToFilesystem.ts b/ts/util/attachments/migrateDataToFilesystem.ts index 4d446482c02..bcae78c1c38 100644 --- a/ts/util/attachments/migrateDataToFilesystem.ts +++ b/ts/util/attachments/migrateDataToFilesystem.ts @@ -5,8 +5,8 @@ import { isFunction, isTypedArray, isUndefined, omit } from 'lodash'; import type { AttachmentType, LocalAttachmentV2Type, -} from '../../types/Attachment'; -import type { LoggerType } from '../../types/Logging'; +} from '../../types/Attachment.js'; +import type { LoggerType } from '../../types/Logging.js'; export async function migrateDataToFileSystem( attachment: AttachmentType, diff --git a/ts/util/avatarDataToBytes.ts b/ts/util/avatarDataToBytes.ts index 8a2d657de11..47b8e2cc5dd 100644 --- a/ts/util/avatarDataToBytes.ts +++ b/ts/util/avatarDataToBytes.ts @@ -1,15 +1,15 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AvatarColorType } from '../types/Colors'; -import { AvatarColorMap } from '../types/Colors'; -import type { AvatarDataType } from '../types/Avatar'; -import { canvasToBytes } from './canvasToBytes'; -import { getFittedFontSize } from './avatarTextSizeCalculator'; +import type { AvatarColorType } from '../types/Colors.js'; +import { AvatarColorMap } from '../types/Colors.js'; +import type { AvatarDataType } from '../types/Avatar.js'; +import { canvasToBytes } from './canvasToBytes.js'; +import { getFittedFontSize } from './avatarTextSizeCalculator.js'; import { getLocalAttachmentUrl, AttachmentDisposition, -} from './getLocalAttachmentUrl'; +} from './getLocalAttachmentUrl.js'; const CANVAS_SIZE = 1024; diff --git a/ts/util/avatarTextSizeCalculator.ts b/ts/util/avatarTextSizeCalculator.ts index 853c9557c17..3265617f2dc 100644 --- a/ts/util/avatarTextSizeCalculator.ts +++ b/ts/util/avatarTextSizeCalculator.ts @@ -1,6 +1,6 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { getEmojifyData } from '../components/fun/data/emojis'; +import { getEmojifyData } from '../components/fun/data/emojis.js'; type FontSizes = { diameter: number; diff --git a/ts/util/avatarUtils.ts b/ts/util/avatarUtils.ts index 234627a7ba4..a46a3e80916 100644 --- a/ts/util/avatarUtils.ts +++ b/ts/util/avatarUtils.ts @@ -1,11 +1,11 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationAttributesType } from '../model-types.d'; -import type { ContactAvatarType } from '../types/Avatar'; -import { isMe } from './whatTypeOfConversation'; -import { isSignalConversation } from './isSignalConversation'; -import { getLocalAttachmentUrl } from './getLocalAttachmentUrl'; +import type { ConversationAttributesType } from '../model-types.d.ts'; +import type { ContactAvatarType } from '../types/Avatar.js'; +import { isMe } from './whatTypeOfConversation.js'; +import { isSignalConversation } from './isSignalConversation.js'; +import { getLocalAttachmentUrl } from './getLocalAttachmentUrl.js'; export function hasAvatar( conversationAttrs: ConversationAttributesType diff --git a/ts/util/backupMediaDownload.ts b/ts/util/backupMediaDownload.ts index b23e96da2fe..8b42cdadcef 100644 --- a/ts/util/backupMediaDownload.ts +++ b/ts/util/backupMediaDownload.ts @@ -1,9 +1,9 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { AttachmentDownloadManager } from '../jobs/AttachmentDownloadManager'; -import { createLogger } from '../logging/log'; -import { DataWriter } from '../sql/Client'; +import { AttachmentDownloadManager } from '../jobs/AttachmentDownloadManager.js'; +import { createLogger } from '../logging/log.js'; +import { DataWriter } from '../sql/Client.js'; const log = createLogger('backupMediaDownload'); diff --git a/ts/util/backupSubscriptionData.ts b/ts/util/backupSubscriptionData.ts index 7837e83b955..a41d34a4ee4 100644 --- a/ts/util/backupSubscriptionData.ts +++ b/ts/util/backupSubscriptionData.ts @@ -2,11 +2,11 @@ // SPDX-License-Identifier: AGPL-3.0-only import Long from 'long'; -import type { Backups, SignalService } from '../protobuf'; -import * as Bytes from '../Bytes'; -import { drop } from './drop'; -import { createLogger } from '../logging/log'; -import { resetBackupMediaDownloadStats } from './backupMediaDownload'; +import type { Backups, SignalService } from '../protobuf/index.js'; +import * as Bytes from '../Bytes.js'; +import { drop } from './drop.js'; +import { createLogger } from '../logging/log.js'; +import { resetBackupMediaDownloadStats } from './backupMediaDownload.js'; const log = createLogger('BackupSubscriptionData'); diff --git a/ts/util/batcher.ts b/ts/util/batcher.ts index ff6ada000a8..a7eb2e35221 100644 --- a/ts/util/batcher.ts +++ b/ts/util/batcher.ts @@ -3,12 +3,12 @@ import PQueue from 'p-queue'; -import { sleep } from './sleep'; -import { createLogger } from '../logging/log'; -import * as Errors from '../types/errors'; -import { clearTimeoutIfNecessary } from './clearTimeoutIfNecessary'; -import { MINUTE } from './durations'; -import { drop } from './drop'; +import { sleep } from './sleep.js'; +import { createLogger } from '../logging/log.js'; +import * as Errors from '../types/errors.js'; +import { clearTimeoutIfNecessary } from './clearTimeoutIfNecessary.js'; +import { MINUTE } from './durations/index.js'; +import { drop } from './drop.js'; const log = createLogger('batcher'); diff --git a/ts/util/blockSendUntilConversationsAreVerified.ts b/ts/util/blockSendUntilConversationsAreVerified.ts index fb5c0dfdf1a..9e74a3aa941 100644 --- a/ts/util/blockSendUntilConversationsAreVerified.ts +++ b/ts/util/blockSendUntilConversationsAreVerified.ts @@ -1,16 +1,16 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { SafetyNumberChangeSource } from '../components/SafetyNumberChangeDialog'; -import { createLogger } from '../logging/log'; -import { explodePromise } from './explodePromise'; +import type { SafetyNumberChangeSource } from '../components/SafetyNumberChangeDialog.js'; +import { createLogger } from '../logging/log.js'; +import { explodePromise } from './explodePromise.js'; import type { RecipientsByConversation, RecipientEntry, -} from '../state/ducks/stories'; -import { isNotNil } from './isNotNil'; -import type { ServiceIdString } from '../types/ServiceId'; -import { waitForAll } from './waitForAll'; +} from '../state/ducks/stories.js'; +import { isNotNil } from './isNotNil.js'; +import type { ServiceIdString } from '../types/ServiceId.js'; +import { waitForAll } from './waitForAll.js'; const log = createLogger('blockSendUntilConversationsAreVerified'); diff --git a/ts/util/buildExpiration.ts b/ts/util/buildExpiration.ts index d3594ea208d..ae3f3b34ff0 100644 --- a/ts/util/buildExpiration.ts +++ b/ts/util/buildExpiration.ts @@ -1,11 +1,11 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { Environment, getEnvironment } from '../environment'; -import type { LoggerType } from '../types/Logging'; -import { isNotUpdatable } from './version'; -import { isInPast } from './timestamp'; -import { DAY } from './durations'; +import { Environment, getEnvironment } from '../environment.js'; +import type { LoggerType } from '../types/Logging.js'; +import { isNotUpdatable } from './version.js'; +import { isInPast } from './timestamp.js'; +import { DAY } from './durations/index.js'; const NINETY_ONE_DAYS = 91 * DAY; const THIRTY_ONE_DAYS = 31 * DAY; diff --git a/ts/util/callDisposition.ts b/ts/util/callDisposition.ts index 7d747991e9a..4514e1c5043 100644 --- a/ts/util/callDisposition.ts +++ b/ts/util/callDisposition.ts @@ -13,13 +13,13 @@ import { } from '@signalapp/ringrtc'; import { ContentHint } from '@signalapp/libsignal-client'; import { isEqual } from 'lodash'; -import { strictAssert } from './assert'; -import { DataReader, DataWriter } from '../sql/Client'; -import { SignalService as Proto } from '../protobuf'; -import { bytesToUuid, uuidToBytes } from './uuidToBytes'; -import { missingCaseError } from './missingCaseError'; -import { generateMessageId } from './generateMessageId'; -import { CallEndedReason, GroupCallJoinState } from '../types/Calling'; +import { strictAssert } from './assert.js'; +import { DataReader, DataWriter } from '../sql/Client.js'; +import { SignalService as Proto } from '../protobuf/index.js'; +import { bytesToUuid, uuidToBytes } from './uuidToBytes.js'; +import { missingCaseError } from './missingCaseError.js'; +import { generateMessageId } from './generateMessageId.js'; +import { CallEndedReason, GroupCallJoinState } from '../types/Calling.js'; import { CallMode, DirectCallStatus, @@ -37,20 +37,20 @@ import { callLogEventNormalizeSchema, CallLogEvent, ClearCallHistoryResult, -} from '../types/CallDisposition'; -import type { AciString } from '../types/ServiceId'; -import { isAciString } from './isAciString'; -import { isMe } from './whatTypeOfConversation'; -import { createLogger } from '../logging/log'; -import * as Errors from '../types/errors'; -import { incrementMessageCounter } from './incrementMessageCounter'; -import { ReadStatus } from '../messages/MessageReadStatus'; -import { SeenStatus, maxSeenStatus } from '../MessageSeenStatus'; -import { canConversationBeUnarchived } from './canConversationBeUnarchived'; -import type { ConversationAttributesType } from '../model-types'; -import { singleProtoJobQueue } from '../jobs/singleProtoJobQueue'; -import MessageSender from '../textsecure/SendMessage'; -import * as Bytes from '../Bytes'; +} from '../types/CallDisposition.js'; +import type { AciString } from '../types/ServiceId.js'; +import { isAciString } from './isAciString.js'; +import { isMe } from './whatTypeOfConversation.js'; +import { createLogger } from '../logging/log.js'; +import * as Errors from '../types/errors.js'; +import { incrementMessageCounter } from './incrementMessageCounter.js'; +import { ReadStatus } from '../messages/MessageReadStatus.js'; +import { SeenStatus, maxSeenStatus } from '../MessageSeenStatus.js'; +import { canConversationBeUnarchived } from './canConversationBeUnarchived.js'; +import type { ConversationAttributesType } from '../model-types.js'; +import { singleProtoJobQueue } from '../jobs/singleProtoJobQueue.js'; +import MessageSender from '../textsecure/SendMessage.js'; +import * as Bytes from '../Bytes.js'; import type { CallDetails, CallEvent, @@ -60,17 +60,17 @@ import type { CallLogEventDetails, CallStatus, GroupCallMeta, -} from '../types/CallDisposition'; -import type { ConversationType } from '../state/ducks/conversations'; -import type { ConversationModel } from '../models/conversations'; -import { drop } from './drop'; -import { sendCallLinkUpdateSync } from './sendCallLinkUpdateSync'; -import { storageServiceUploadJob } from '../services/storage'; -import { CallLinkFinalizeDeleteManager } from '../jobs/CallLinkFinalizeDeleteManager'; -import { parsePartial, parseStrict } from './schemas'; -import { calling } from '../services/calling'; -import { cleanupMessages } from './cleanup'; -import { MessageModel } from '../models/messages'; +} from '../types/CallDisposition.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import type { ConversationModel } from '../models/conversations.js'; +import { drop } from './drop.js'; +import { sendCallLinkUpdateSync } from './sendCallLinkUpdateSync.js'; +import { storageServiceUploadJob } from '../services/storage.js'; +import { CallLinkFinalizeDeleteManager } from '../jobs/CallLinkFinalizeDeleteManager.js'; +import { parsePartial, parseStrict } from './schemas.js'; +import { calling } from '../services/calling.js'; +import { cleanupMessages } from './cleanup.js'; +import { MessageModel } from '../models/messages.js'; const log = createLogger('callDisposition'); diff --git a/ts/util/callLinks.ts b/ts/util/callLinks.ts index e1e3de58011..d827ca0cb9a 100644 --- a/ts/util/callLinks.ts +++ b/ts/util/callLinks.ts @@ -1,18 +1,21 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import { v4 as generateUuid } from 'uuid'; -import * as Bytes from '../Bytes'; -import type { CallLinkConversationType, CallLinkType } from '../types/CallLink'; -import { CallLinkRestrictions } from '../types/CallLink'; -import type { LocalizerType } from '../types/Util'; -import { getColorForCallLink } from './getColorForCallLink'; +import * as Bytes from '../Bytes.js'; +import type { + CallLinkConversationType, + CallLinkType, +} from '../types/CallLink.js'; +import { CallLinkRestrictions } from '../types/CallLink.js'; +import type { LocalizerType } from '../types/Util.js'; +import { getColorForCallLink } from './getColorForCallLink.js'; import { AdhocCallStatus, CallDirection, CallType, type CallHistoryDetails, CallMode, -} from '../types/CallDisposition'; +} from '../types/CallDisposition.js'; export const CALL_LINK_DEFAULT_STATE: Pick< CallLinkType, diff --git a/ts/util/callLinksRingrtc.ts b/ts/util/callLinksRingrtc.ts index 94822f88566..84b296d5995 100644 --- a/ts/util/callLinksRingrtc.ts +++ b/ts/util/callLinksRingrtc.ts @@ -9,36 +9,36 @@ import { import type { CallLinkState as RingRTCCallLinkState } from '@signalapp/ringrtc'; import { z } from 'zod'; import { Aci } from '@signalapp/libsignal-client'; +import { + CallLinkNameMaxByteLength, + callLinkRecordSchema, + defunctCallLinkRecordSchema, + toCallLinkRestrictions, +} from '../types/CallLink.js'; import type { CallLinkRecord, CallLinkRestrictions, CallLinkType, DefunctCallLinkRecord, DefunctCallLinkType, -} from '../types/CallLink'; -import { - type CallLinkStateType, - CallLinkNameMaxByteLength, - callLinkRecordSchema, - defunctCallLinkRecordSchema, - toCallLinkRestrictions, -} from '../types/CallLink'; -import { unicodeSlice } from './unicodeSlice'; -import type { CallLinkAuthCredentialPresentation } from './zkgroup'; + CallLinkStateType, +} from '../types/CallLink.js'; +import { unicodeSlice } from './unicodeSlice.js'; +import type { CallLinkAuthCredentialPresentation } from './zkgroup.js'; import { CallLinkAuthCredential, CallLinkSecretParams, GenericServerPublicParams, -} from './zkgroup'; -import { getCheckedCallLinkAuthCredentialsForToday } from '../services/groupCredentialFetcher'; -import * as durations from './durations'; +} from './zkgroup.js'; +import { getCheckedCallLinkAuthCredentialsForToday } from '../services/groupCredentialFetcher.js'; +import * as durations from './durations/index.js'; import { fromAdminKeyBytes, getKeyFromCallLink, toAdminKeyBytes, -} from './callLinks'; -import { parseStrict } from './schemas'; -import * as Bytes from '../Bytes'; +} from './callLinks.js'; +import { parseStrict } from './schemas.js'; +import * as Bytes from '../Bytes.js'; /** * RingRTC conversions diff --git a/ts/util/callingGetParticipantName.ts b/ts/util/callingGetParticipantName.ts index 354cd00aa11..1cff89e95a8 100644 --- a/ts/util/callingGetParticipantName.ts +++ b/ts/util/callingGetParticipantName.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationType } from '../state/ducks/conversations'; +import type { ConversationType } from '../state/ducks/conversations.js'; export function getParticipantName( participant: Readonly< diff --git a/ts/util/callingIsReconnecting.ts b/ts/util/callingIsReconnecting.ts index e172bbd238e..ffa90c06ce6 100644 --- a/ts/util/callingIsReconnecting.ts +++ b/ts/util/callingIsReconnecting.ts @@ -1,10 +1,10 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { CallState, GroupCallConnectionState } from '../types/Calling'; -import { CallMode } from '../types/CallDisposition'; -import type { ActiveCallType } from '../types/Calling'; -import { isGroupOrAdhocActiveCall } from './isGroupOrAdhocCall'; +import { CallState, GroupCallConnectionState } from '../types/Calling.js'; +import { CallMode } from '../types/CallDisposition.js'; +import type { ActiveCallType } from '../types/Calling.js'; +import { isGroupOrAdhocActiveCall } from './isGroupOrAdhocCall.js'; export function isReconnecting(activeCall: ActiveCallType): boolean { return ( diff --git a/ts/util/callingMessageToProto.ts b/ts/util/callingMessageToProto.ts index 5762c16c192..f5d01c7de6e 100644 --- a/ts/util/callingMessageToProto.ts +++ b/ts/util/callingMessageToProto.ts @@ -4,10 +4,10 @@ import type { CallingMessage } from '@signalapp/ringrtc'; import { CallMessageUrgency } from '@signalapp/ringrtc'; import Long from 'long'; -import { SignalService as Proto } from '../protobuf'; -import { createLogger } from '../logging/log'; -import { toLogFormat } from '../types/errors'; -import { missingCaseError } from './missingCaseError'; +import { SignalService as Proto } from '../protobuf/index.js'; +import { createLogger } from '../logging/log.js'; +import { toLogFormat } from '../types/errors.js'; +import { missingCaseError } from './missingCaseError.js'; const log = createLogger('callingMessageToProto'); diff --git a/ts/util/callingNotification.ts b/ts/util/callingNotification.ts index a63e0c42ed2..62f19015644 100644 --- a/ts/util/callingNotification.ts +++ b/ts/util/callingNotification.ts @@ -1,21 +1,23 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { LocalizerType } from '../types/Util'; +import type { LocalizerType } from '../types/Util.js'; import { CallMode, CallDirection, DirectCallStatus, - type CallHistoryDetails, CallType, GroupCallStatus, -} from '../types/CallDisposition'; -import { missingCaseError } from './missingCaseError'; -import type { CallStatus } from '../types/CallDisposition'; -import type { ConversationType } from '../state/ducks/conversations'; -import { strictAssert } from './assert'; -import { isMoreRecentThan } from './timestamp'; -import { MINUTE } from './durations'; +} from '../types/CallDisposition.js'; +import type { + CallStatus, + CallHistoryDetails, +} from '../types/CallDisposition.js'; +import { missingCaseError } from './missingCaseError.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import { strictAssert } from './assert.js'; +import { isMoreRecentThan } from './timestamp.js'; +import { MINUTE } from './durations/index.js'; export type CallingNotificationType = Readonly<{ // In some older calls, we don't have a call id, this hardens against that. diff --git a/ts/util/callingTones.ts b/ts/util/callingTones.ts index bbd1d18f49c..c4cf3bd6251 100644 --- a/ts/util/callingTones.ts +++ b/ts/util/callingTones.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import PQueue from 'p-queue'; -import { MINUTE } from './durations'; -import { Sound, SoundType } from './Sound'; +import { MINUTE } from './durations/index.js'; +import { Sound, SoundType } from './Sound.js'; const ringtoneEventQueue = new PQueue({ concurrency: 1, diff --git a/ts/util/canAddNewMembers.ts b/ts/util/canAddNewMembers.ts index 775c4786597..2965acd80c6 100644 --- a/ts/util/canAddNewMembers.ts +++ b/ts/util/canAddNewMembers.ts @@ -1,10 +1,10 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationAttributesType } from '../model-types.d'; -import { SignalService as Proto } from '../protobuf'; -import { isGroupV2 } from './whatTypeOfConversation'; -import { areWeAdmin } from './areWeAdmin'; +import type { ConversationAttributesType } from '../model-types.d.ts'; +import { SignalService as Proto } from '../protobuf/index.js'; +import { isGroupV2 } from './whatTypeOfConversation.js'; +import { areWeAdmin } from './areWeAdmin.js'; export function canAddNewMembers( conversationAttrs: ConversationAttributesType diff --git a/ts/util/canBeAnnouncementGroup.ts b/ts/util/canBeAnnouncementGroup.ts index c86cc439f87..117ecef6871 100644 --- a/ts/util/canBeAnnouncementGroup.ts +++ b/ts/util/canBeAnnouncementGroup.ts @@ -1,8 +1,8 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationAttributesType } from '../model-types.d'; -import { isGroupV2 } from './whatTypeOfConversation'; +import type { ConversationAttributesType } from '../model-types.d.ts'; +import { isGroupV2 } from './whatTypeOfConversation.js'; export function canBeAnnouncementGroup( conversationAttrs: Pick< diff --git a/ts/util/canChangeTimer.ts b/ts/util/canChangeTimer.ts index b108564cc57..560bb730eee 100644 --- a/ts/util/canChangeTimer.ts +++ b/ts/util/canChangeTimer.ts @@ -1,14 +1,14 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationAttributesType } from '../model-types'; -import { SignalService as Proto } from '../protobuf'; -import { areWeAdmin } from './areWeAdmin'; +import type { ConversationAttributesType } from '../model-types.js'; +import { SignalService as Proto } from '../protobuf/index.js'; +import { areWeAdmin } from './areWeAdmin.js'; import { isDirectConversation, isGroupV1, isGroupV2, -} from './whatTypeOfConversation'; +} from './whatTypeOfConversation.js'; export function canChangeTimer( attributes: ConversationAttributesType diff --git a/ts/util/canConversationBeUnarchived.ts b/ts/util/canConversationBeUnarchived.ts index 7c9643d46eb..348d8693ae5 100644 --- a/ts/util/canConversationBeUnarchived.ts +++ b/ts/util/canConversationBeUnarchived.ts @@ -1,8 +1,8 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationAttributesType } from '../model-types.d'; -import { isConversationMuted } from './isConversationMuted'; +import type { ConversationAttributesType } from '../model-types.d.ts'; +import { isConversationMuted } from './isConversationMuted.js'; export function canConversationBeUnarchived( attrs: ConversationAttributesType diff --git a/ts/util/canEditGroupInfo.ts b/ts/util/canEditGroupInfo.ts index f209140633d..49bdfd42887 100644 --- a/ts/util/canEditGroupInfo.ts +++ b/ts/util/canEditGroupInfo.ts @@ -1,10 +1,10 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationAttributesType } from '../model-types.d'; -import { SignalService as Proto } from '../protobuf'; -import { isGroupV2 } from './whatTypeOfConversation'; -import { areWeAdmin } from './areWeAdmin'; +import type { ConversationAttributesType } from '../model-types.d.ts'; +import { SignalService as Proto } from '../protobuf/index.js'; +import { isGroupV2 } from './whatTypeOfConversation.js'; +import { areWeAdmin } from './areWeAdmin.js'; export function canEditGroupInfo( conversationAttrs: ConversationAttributesType diff --git a/ts/util/canEditMessage.ts b/ts/util/canEditMessage.ts index 51476c4e2e1..d1f20eda94e 100644 --- a/ts/util/canEditMessage.ts +++ b/ts/util/canEditMessage.ts @@ -1,11 +1,11 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ReadonlyMessageAttributesType } from '../model-types.d'; -import { DAY } from './durations'; -import { isMoreRecentThan } from './timestamp'; -import { isOutgoing } from '../messages/helpers'; -import { isMessageNoteToSelf } from './isMessageNoteToSelf'; +import type { ReadonlyMessageAttributesType } from '../model-types.d.ts'; +import { DAY } from './durations/index.js'; +import { isMoreRecentThan } from './timestamp.js'; +import { isOutgoing } from '../messages/helpers.js'; +import { isMessageNoteToSelf } from './isMessageNoteToSelf.js'; export const MESSAGE_MAX_EDIT_COUNT = 10; diff --git a/ts/util/canvasToBlob.ts b/ts/util/canvasToBlob.ts index 20671a69755..3bbecaf3de8 100644 --- a/ts/util/canvasToBlob.ts +++ b/ts/util/canvasToBlob.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { IMAGE_JPEG } from '../types/MIME'; +import { IMAGE_JPEG } from '../types/MIME.js'; /** * Similar to [the built-in `toBlob` method][0], but returns a Promise. diff --git a/ts/util/canvasToBytes.ts b/ts/util/canvasToBytes.ts index a40afc52bfe..1639d6258d9 100644 --- a/ts/util/canvasToBytes.ts +++ b/ts/util/canvasToBytes.ts @@ -1,8 +1,8 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { canvasToBlob } from './canvasToBlob'; -import type { MIMEType } from '../types/MIME'; +import { canvasToBlob } from './canvasToBlob.js'; +import type { MIMEType } from '../types/MIME.js'; export async function canvasToBytes( canvas: HTMLCanvasElement, diff --git a/ts/util/checkFirstEnvelope.ts b/ts/util/checkFirstEnvelope.ts index dfd93aabcde..72daaa9b546 100644 --- a/ts/util/checkFirstEnvelope.ts +++ b/ts/util/checkFirstEnvelope.ts @@ -3,14 +3,14 @@ import { isNumber } from 'lodash'; -import { createLogger } from '../logging/log'; -import { SignalService as Proto } from '../protobuf'; -import { ToastType } from '../types/Toast'; -import { HOUR, SECOND } from './durations'; -import { isOlderThan } from './timestamp'; -import { isProduction } from './version'; +import { createLogger } from '../logging/log.js'; +import { SignalService as Proto } from '../protobuf/index.js'; +import { ToastType } from '../types/Toast.js'; +import { HOUR, SECOND } from './durations/index.js'; +import { isOlderThan } from './timestamp.js'; +import { isProduction } from './version.js'; -import type { IncomingWebSocketRequest } from '../textsecure/WebsocketResources'; +import type { IncomingWebSocketRequest } from '../textsecure/WebsocketResources.js'; const log = createLogger('checkFirstEnvelope'); diff --git a/ts/util/checkOurPniIdentityKey.ts b/ts/util/checkOurPniIdentityKey.ts index 5af465e4556..142894d8cf2 100644 --- a/ts/util/checkOurPniIdentityKey.ts +++ b/ts/util/checkOurPniIdentityKey.ts @@ -1,9 +1,9 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log'; -import { constantTimeEqual } from '../Crypto'; -import { strictAssert } from './assert'; +import { createLogger } from '../logging/log.js'; +import { constantTimeEqual } from '../Crypto.js'; +import { strictAssert } from './assert.js'; const log = createLogger('checkOurPniIdentityKey'); diff --git a/ts/util/cleanup.ts b/ts/util/cleanup.ts index c5e513d78b9..0c002909a7a 100644 --- a/ts/util/cleanup.ts +++ b/ts/util/cleanup.ts @@ -4,30 +4,30 @@ import PQueue from 'p-queue'; import { batch } from 'react-redux'; -import type { MessageAttributesType } from '../model-types.d'; -import { MessageModel } from '../models/messages'; +import type { MessageAttributesType } from '../model-types.d.ts'; +import { MessageModel } from '../models/messages.js'; -import * as Errors from '../types/errors'; -import { createLogger } from '../logging/log'; +import * as Errors from '../types/errors.js'; +import { createLogger } from '../logging/log.js'; -import { DataReader, DataWriter } from '../sql/Client'; -import { deletePackReference } from '../types/Stickers'; -import { isStory } from '../messages/helpers'; -import { isDirectConversation } from './whatTypeOfConversation'; -import { getCallHistorySelector } from '../state/selectors/callHistory'; +import { DataReader, DataWriter } from '../sql/Client.js'; +import { deletePackReference } from '../types/Stickers.js'; +import { isStory } from '../messages/helpers.js'; +import { isDirectConversation } from './whatTypeOfConversation.js'; +import { getCallHistorySelector } from '../state/selectors/callHistory.js'; import { DirectCallStatus, GroupCallStatus, AdhocCallStatus, -} from '../types/CallDisposition'; -import { getMessageIdForLogging } from './idForLogging'; -import { singleProtoJobQueue } from '../jobs/singleProtoJobQueue'; -import { MINUTE } from './durations'; -import { drop } from './drop'; -import { hydrateStoryContext } from './hydrateStoryContext'; -import { update as updateExpiringMessagesService } from '../services/expiringMessagesDeletion'; -import { tapToViewMessagesDeletionService } from '../services/tapToViewMessagesDeletionService'; -import { throttledUpdateBackupMediaDownloadProgress } from './updateBackupMediaDownloadProgress'; +} from '../types/CallDisposition.js'; +import { getMessageIdForLogging } from './idForLogging.js'; +import { singleProtoJobQueue } from '../jobs/singleProtoJobQueue.js'; +import { MINUTE } from './durations/index.js'; +import { drop } from './drop.js'; +import { hydrateStoryContext } from './hydrateStoryContext.js'; +import { update as updateExpiringMessagesService } from '../services/expiringMessagesDeletion.js'; +import { tapToViewMessagesDeletionService } from '../services/tapToViewMessagesDeletionService.js'; +import { throttledUpdateBackupMediaDownloadProgress } from './updateBackupMediaDownloadProgress.js'; const log = createLogger('cleanup'); diff --git a/ts/util/clearConversationDraftAttachments.ts b/ts/util/clearConversationDraftAttachments.ts index bde56e2242c..f05cab52d5e 100644 --- a/ts/util/clearConversationDraftAttachments.ts +++ b/ts/util/clearConversationDraftAttachments.ts @@ -1,10 +1,10 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AttachmentDraftType } from '../types/Attachment'; -import { DataWriter } from '../sql/Client'; -import { strictAssert } from './assert'; -import { deleteDraftAttachment } from './deleteDraftAttachment'; +import type { AttachmentDraftType } from '../types/Attachment.js'; +import { DataWriter } from '../sql/Client.js'; +import { strictAssert } from './assert.js'; +import { deleteDraftAttachment } from './deleteDraftAttachment.js'; export async function clearConversationDraftAttachments( conversationId: string, diff --git a/ts/util/computeBlurHashUrl.ts b/ts/util/computeBlurHashUrl.ts index 7b9252c9be3..d796cbd5650 100644 --- a/ts/util/computeBlurHashUrl.ts +++ b/ts/util/computeBlurHashUrl.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { decode } from 'blurhash'; -import * as Bytes from '../Bytes'; +import * as Bytes from '../Bytes.js'; const BITMAP_HEADER = new Uint8Array([ // Header diff --git a/ts/util/consoleLogger.ts b/ts/util/consoleLogger.ts index b99590de1d9..0d1f93b63ff 100644 --- a/ts/util/consoleLogger.ts +++ b/ts/util/consoleLogger.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { LoggerType } from '../types/Logging'; +import type { LoggerType } from '../types/Logging.js'; /* eslint-disable no-console */ export const consoleLogger: LoggerType = { diff --git a/ts/util/copyDataMessageIntoMessage.ts b/ts/util/copyDataMessageIntoMessage.ts index 5ddf2253a92..452641903d8 100644 --- a/ts/util/copyDataMessageIntoMessage.ts +++ b/ts/util/copyDataMessageIntoMessage.ts @@ -1,8 +1,8 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { MessageAttributesType } from '../model-types.d'; -import type { ProcessedDataMessage } from '../textsecure/Types.d'; +import type { MessageAttributesType } from '../model-types.d.ts'; +import type { ProcessedDataMessage } from '../textsecure/Types.d.ts'; export function copyDataMessageIntoMessage( dataMessage: ProcessedDataMessage, diff --git a/ts/util/copyLinksWithToast.ts b/ts/util/copyLinksWithToast.ts index b5370a53291..bfebbf347e0 100644 --- a/ts/util/copyLinksWithToast.ts +++ b/ts/util/copyLinksWithToast.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { ToastType } from '../types/Toast'; +import { ToastType } from '../types/Toast.js'; export async function copyGroupLink(groupLink: string): Promise { await window.navigator.clipboard.writeText(groupLink); diff --git a/ts/util/countUnreadStats.ts b/ts/util/countUnreadStats.ts index edb4a365fbf..eff06e20f16 100644 --- a/ts/util/countUnreadStats.ts +++ b/ts/util/countUnreadStats.ts @@ -1,8 +1,8 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationType } from '../state/ducks/conversations'; -import { isConversationMuted } from './isConversationMuted'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import { isConversationMuted } from './isConversationMuted.js'; /** * This can be used to describe unread counts of chats, stories, and calls, diff --git a/ts/util/createAvatarData.ts b/ts/util/createAvatarData.ts index 735cb8cdab7..a7a13b27129 100644 --- a/ts/util/createAvatarData.ts +++ b/ts/util/createAvatarData.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { v4 as uuid } from 'uuid'; -import type { AvatarDataType } from '../types/Avatar'; +import type { AvatarDataType } from '../types/Avatar.js'; export function createAvatarData( partialAvatarData: Readonly> diff --git a/ts/util/createHTTPSAgent.ts b/ts/util/createHTTPSAgent.ts index b801d28ecbe..1351d56d829 100644 --- a/ts/util/createHTTPSAgent.ts +++ b/ts/util/createHTTPSAgent.ts @@ -1,26 +1,26 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { Agent as HTTPSAgent } from 'https'; -import type { AgentOptions, RequestOptions } from 'https'; -import type { LookupAddress } from 'dns'; -import type net from 'net'; -import tls from 'tls'; -import type { ConnectionOptions } from 'tls'; -import { callbackify, promisify } from 'util'; +import { Agent as HTTPSAgent } from 'node:https'; +import type { AgentOptions, RequestOptions } from 'node:https'; +import type { LookupAddress } from 'node:dns'; +import type net from 'node:net'; +import tls from 'node:tls'; +import type { ConnectionOptions } from 'node:tls'; +import { callbackify, promisify } from 'node:util'; import pTimeout from 'p-timeout'; -import { createLogger } from '../logging/log'; +import { createLogger } from '../logging/log.js'; import { electronLookup as electronLookupWithCb, interleaveAddresses, -} from './dns'; -import { strictAssert } from './assert'; -import { parseIntOrThrow } from './parseIntOrThrow'; -import { sleep } from './sleep'; -import { SECOND } from './durations'; -import { dropNull } from './dropNull'; -import { explodePromise } from './explodePromise'; +} from './dns.js'; +import { strictAssert } from './assert.js'; +import { parseIntOrThrow } from './parseIntOrThrow.js'; +import { sleep } from './sleep.js'; +import { SECOND } from './durations/index.js'; +import { dropNull } from './dropNull.js'; +import { explodePromise } from './explodePromise.js'; const log = createLogger('createHTTPSAgent'); diff --git a/ts/util/createIPCEvents.ts b/ts/util/createIPCEvents.ts index 21e26970a66..0336894e58e 100644 --- a/ts/util/createIPCEvents.ts +++ b/ts/util/createIPCEvents.ts @@ -5,33 +5,33 @@ import { ipcRenderer } from 'electron'; import type { SystemPreferences } from 'electron'; import { noop } from 'lodash'; -import type { ZoomFactorType } from '../types/Storage.d'; -import * as Errors from '../types/errors'; -import * as Stickers from '../types/Stickers'; -import * as Settings from '../types/Settings'; +import type { ZoomFactorType } from '../types/Storage.d.ts'; +import * as Errors from '../types/errors.js'; +import * as Stickers from '../types/Stickers.js'; +import * as Settings from '../types/Settings.js'; -import { resolveUsernameByLinkBase64 } from '../services/username'; -import { isInCall } from '../state/selectors/calling'; +import { resolveUsernameByLinkBase64 } from '../services/username.js'; +import { isInCall } from '../state/selectors/calling.js'; -import { strictAssert } from './assert'; -import * as Registration from './registration'; -import { lookupConversationWithoutServiceId } from './lookupConversationWithoutServiceId'; -import { createLogger } from '../logging/log'; +import { strictAssert } from './assert.js'; +import * as Registration from './registration.js'; +import { lookupConversationWithoutServiceId } from './lookupConversationWithoutServiceId.js'; +import { createLogger } from '../logging/log.js'; import { type NotificationClickData, notificationService, -} from '../services/notifications'; -import { StoryViewModeType, StoryViewTargetType } from '../types/Stories'; -import { isValidE164 } from './isValidE164'; -import { fromWebSafeBase64 } from './webSafeBase64'; -import { showConfirmationDialog } from './showConfirmationDialog'; +} from '../services/notifications.js'; +import { StoryViewModeType, StoryViewTargetType } from '../types/Stories.js'; +import { isValidE164 } from './isValidE164.js'; +import { fromWebSafeBase64 } from './webSafeBase64.js'; +import { showConfirmationDialog } from './showConfirmationDialog.js'; import type { EphemeralSettings, SettingsValuesType, ThemeType, -} from './preload'; -import { SystemTraySetting } from '../types/SystemTraySetting'; -import OS from './os/osPreload'; +} from './preload.js'; +import { SystemTraySetting } from '../types/SystemTraySetting.js'; +import OS from './os/osPreload.js'; const log = createLogger('createIPCEvents'); diff --git a/ts/util/createIdenticon.tsx b/ts/util/createIdenticon.tsx index cc6bc3f9e0e..e3afb97801e 100644 --- a/ts/util/createIdenticon.tsx +++ b/ts/util/createIdenticon.tsx @@ -4,14 +4,14 @@ import React from 'react'; import loadImage from 'blueimp-load-image'; import { renderToString } from 'react-dom/server'; -import type { AvatarColorType } from '../types/Colors'; -import { AvatarColorMap } from '../types/Colors'; +import type { AvatarColorType } from '../types/Colors.js'; +import { AvatarColorMap } from '../types/Colors.js'; import { IdenticonSVGForCallLink, IdenticonSVGForContact, IdenticonSVGForGroup, -} from '../components/IdenticonSVG'; -import { missingCaseError } from './missingCaseError'; +} from '../components/IdenticonSVG.js'; +import { missingCaseError } from './missingCaseError.js'; const TARGET_MIME = 'image/png'; diff --git a/ts/util/createProxyAgent.ts b/ts/util/createProxyAgent.ts index 6d78b604712..fd0f26e485b 100644 --- a/ts/util/createProxyAgent.ts +++ b/ts/util/createProxyAgent.ts @@ -1,18 +1,18 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import net from 'net'; +import net from 'node:net'; import type { ProxyAgent } from 'proxy-agent'; -import { URL } from 'url'; -import type { LookupOptions, LookupAddress } from 'dns'; -import { lookup } from 'dns/promises'; +import { URL } from 'node:url'; +import type { LookupOptions, LookupAddress } from 'node:dns'; +import { lookup } from 'node:dns/promises'; -import { createLogger } from '../logging/log'; -import { happyEyeballs } from './createHTTPSAgent'; -import type { ConnectOptionsType } from './createHTTPSAgent'; -import { explodePromise } from './explodePromise'; -import { SECOND } from './durations'; -import { drop } from './drop'; +import { createLogger } from '../logging/log.js'; +import { happyEyeballs } from './createHTTPSAgent.js'; +import type { ConnectOptionsType } from './createHTTPSAgent.js'; +import { explodePromise } from './explodePromise.js'; +import { SECOND } from './durations/index.js'; +import { drop } from './drop.js'; const log = createLogger('createProxyAgent'); diff --git a/ts/util/currency.ts b/ts/util/currency.ts index 1b5383a4a0e..b95e4e9e25a 100644 --- a/ts/util/currency.ts +++ b/ts/util/currency.ts @@ -6,13 +6,13 @@ import type { HumanDonationAmount, DonationReceipt, StripeDonationAmount, -} from '../types/Donations'; +} from '../types/Donations.js'; import { humanDonationAmountSchema, stripeDonationAmountSchema, -} from '../types/Donations'; -import { parseStrict, safeParseStrict } from './schemas'; -import { missingCaseError } from './missingCaseError'; +} from '../types/Donations.js'; +import { parseStrict, safeParseStrict } from './schemas.js'; +import { missingCaseError } from './missingCaseError.js'; // See: https://docs.stripe.com/currencies?presentment-currency=US export const ZERO_DECIMAL_CURRENCIES = new Set([ diff --git a/ts/util/decipherWithAesKey.ts b/ts/util/decipherWithAesKey.ts index 0aebef950ac..ad40fee99ef 100644 --- a/ts/util/decipherWithAesKey.ts +++ b/ts/util/decipherWithAesKey.ts @@ -5,8 +5,8 @@ import { createDecipheriv, type Decipher } from 'node:crypto'; import { Buffer } from 'node:buffer'; import { Transform } from 'node:stream'; -import { CipherType, IV_LENGTH } from '../types/Crypto'; -import { strictAssert } from './assert'; +import { CipherType, IV_LENGTH } from '../types/Crypto.js'; +import { strictAssert } from './assert.js'; /** * Gets the IV from the start of the stream and creates a decipher. diff --git a/ts/util/deconstructLookup.ts b/ts/util/deconstructLookup.ts index 1f08bea9c57..778c9b7499b 100644 --- a/ts/util/deconstructLookup.ts +++ b/ts/util/deconstructLookup.ts @@ -1,8 +1,8 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { getOwn } from './getOwn'; -import { assertDev } from './assert'; +import { getOwn } from './getOwn.js'; +import { assertDev } from './assert.js'; export const deconstructLookup = ( lookup: Record, diff --git a/ts/util/deleteAllLogs.ts b/ts/util/deleteAllLogs.ts index 18cd78e2f11..8bb4885d07c 100644 --- a/ts/util/deleteAllLogs.ts +++ b/ts/util/deleteAllLogs.ts @@ -4,8 +4,8 @@ import { ipcRenderer } from 'electron'; import pTimeout from 'p-timeout'; -import { beforeRestart } from '../logging/set_up_renderer_logging'; -import * as durations from './durations'; +import { beforeRestart } from '../logging/set_up_renderer_logging.js'; +import * as durations from './durations/index.js'; export function deleteAllLogs(): Promise { // Restart logging again when the file stream close diff --git a/ts/util/deleteAllMyStories.ts b/ts/util/deleteAllMyStories.ts index 5c0f0fceb0c..3b4c89f130a 100644 --- a/ts/util/deleteAllMyStories.ts +++ b/ts/util/deleteAllMyStories.ts @@ -1,7 +1,7 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { deleteStoryForEveryone } from './deleteStoryForEveryone'; +import { deleteStoryForEveryone } from './deleteStoryForEveryone.js'; export async function deleteAllMyStories(): Promise { const { stories } = window.reduxStore.getState().stories; diff --git a/ts/util/deleteDraftAttachment.ts b/ts/util/deleteDraftAttachment.ts index 328889959a9..f6e0b70c301 100644 --- a/ts/util/deleteDraftAttachment.ts +++ b/ts/util/deleteDraftAttachment.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AttachmentType } from '../types/Attachment'; +import type { AttachmentType } from '../types/Attachment.js'; export async function deleteDraftAttachment( attachment: Pick diff --git a/ts/util/deleteForEveryone.ts b/ts/util/deleteForEveryone.ts index 428c1f57b12..d47feb676b2 100644 --- a/ts/util/deleteForEveryone.ts +++ b/ts/util/deleteForEveryone.ts @@ -1,16 +1,16 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { DeleteAttributesType } from '../messageModifiers/Deletes'; -import type { MessageModel } from '../models/messages'; -import { createLogger } from '../logging/log'; -import { isMe } from './whatTypeOfConversation'; -import { getAuthorId } from '../messages/helpers'; -import { isStory } from '../state/selectors/message'; -import { isTooOldToModifyMessage } from './isTooOldToModifyMessage'; -import { drop } from './drop'; -import { eraseMessageContents } from './cleanup'; -import { notificationService } from '../services/notifications'; +import type { DeleteAttributesType } from '../messageModifiers/Deletes.js'; +import type { MessageModel } from '../models/messages.js'; +import { createLogger } from '../logging/log.js'; +import { isMe } from './whatTypeOfConversation.js'; +import { getAuthorId } from '../messages/helpers.js'; +import { isStory } from '../state/selectors/message.js'; +import { isTooOldToModifyMessage } from './isTooOldToModifyMessage.js'; +import { drop } from './drop.js'; +import { eraseMessageContents } from './cleanup.js'; +import { notificationService } from '../services/notifications.js'; const log = createLogger('deleteForEveryone'); diff --git a/ts/util/deleteForMe.ts b/ts/util/deleteForMe.ts index eb97513a661..da68090a5cb 100644 --- a/ts/util/deleteForMe.ts +++ b/ts/util/deleteForMe.ts @@ -3,20 +3,20 @@ import { last, sortBy } from 'lodash'; -import { createLogger } from '../logging/log'; -import { DataReader, DataWriter, deleteAndCleanup } from '../sql/Client'; -import { deleteData } from '../types/Attachment'; +import { createLogger } from '../logging/log.js'; +import { DataReader, DataWriter, deleteAndCleanup } from '../sql/Client.js'; +import { deleteData } from '../types/Attachment.js'; -import type { MessageAttributesType } from '../model-types'; -import type { ConversationModel } from '../models/conversations'; -import type { AddressableMessage } from '../textsecure/messageReceiverEvents'; -import type { AttachmentType } from '../types/Attachment'; -import { MessageModel } from '../models/messages'; -import { cleanupMessages, postSaveUpdates } from './cleanup'; +import type { MessageAttributesType } from '../model-types.js'; +import type { ConversationModel } from '../models/conversations.js'; +import type { AddressableMessage } from '../textsecure/messageReceiverEvents.js'; +import type { AttachmentType } from '../types/Attachment.js'; +import { MessageModel } from '../models/messages.js'; +import { cleanupMessages, postSaveUpdates } from './cleanup.js'; import { findMatchingMessage, getMessageQueryFromTarget, -} from './syncIdentifiers'; +} from './syncIdentifiers.js'; const log = createLogger('deleteForMe'); diff --git a/ts/util/deleteGroupStoryReplyForEveryone.ts b/ts/util/deleteGroupStoryReplyForEveryone.ts index 6c728a1620f..e6b8d95dec9 100644 --- a/ts/util/deleteGroupStoryReplyForEveryone.ts +++ b/ts/util/deleteGroupStoryReplyForEveryone.ts @@ -1,10 +1,10 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { DAY } from './durations'; -import { sendDeleteForEveryoneMessage } from './sendDeleteForEveryoneMessage'; -import { getMessageById } from '../messages/getMessageById'; -import { createLogger } from '../logging/log'; +import { DAY } from './durations/index.js'; +import { sendDeleteForEveryoneMessage } from './sendDeleteForEveryoneMessage.js'; +import { getMessageById } from '../messages/getMessageById.js'; +import { createLogger } from '../logging/log.js'; const log = createLogger('deleteGroupStoryReplyForEveryone'); diff --git a/ts/util/deleteStoryForEveryone.ts b/ts/util/deleteStoryForEveryone.ts index 3cf1f4de856..138d737fe42 100644 --- a/ts/util/deleteStoryForEveryone.ts +++ b/ts/util/deleteStoryForEveryone.ts @@ -3,26 +3,26 @@ import { noop } from 'lodash'; -import type { ConversationQueueJobData } from '../jobs/conversationJobQueue'; -import type { StoryDataType } from '../state/ducks/stories'; -import * as Errors from '../types/errors'; -import type { StoryMessageRecipientsType } from '../types/Stories'; -import type { StoryDistributionIdString } from '../types/StoryDistributionId'; -import type { ServiceIdString } from '../types/ServiceId'; -import { createLogger } from '../logging/log'; -import { DAY } from './durations'; -import { StoryRecipientUpdateEvent } from '../textsecure/messageReceiverEvents'; +import type { ConversationQueueJobData } from '../jobs/conversationJobQueue.js'; +import type { StoryDataType } from '../state/ducks/stories.js'; +import * as Errors from '../types/errors.js'; +import type { StoryMessageRecipientsType } from '../types/Stories.js'; +import type { StoryDistributionIdString } from '../types/StoryDistributionId.js'; +import type { ServiceIdString } from '../types/ServiceId.js'; +import { createLogger } from '../logging/log.js'; +import { DAY } from './durations/index.js'; +import { StoryRecipientUpdateEvent } from '../textsecure/messageReceiverEvents.js'; import { conversationJobQueue, conversationQueueJobEnum, -} from '../jobs/conversationJobQueue'; -import { onStoryRecipientUpdate } from './onStoryRecipientUpdate'; -import { sendDeleteForEveryoneMessage } from './sendDeleteForEveryoneMessage'; -import { isGroupV2 } from './whatTypeOfConversation'; -import { getMessageById } from '../messages/getMessageById'; -import { strictAssert } from './assert'; -import { repeat, zipObject } from './iterables'; -import { isOlderThan } from './timestamp'; +} from '../jobs/conversationJobQueue.js'; +import { onStoryRecipientUpdate } from './onStoryRecipientUpdate.js'; +import { sendDeleteForEveryoneMessage } from './sendDeleteForEveryoneMessage.js'; +import { isGroupV2 } from './whatTypeOfConversation.js'; +import { getMessageById } from '../messages/getMessageById.js'; +import { strictAssert } from './assert.js'; +import { repeat, zipObject } from './iterables.js'; +import { isOlderThan } from './timestamp.js'; const log = createLogger('deleteStoryForEveryone'); diff --git a/ts/util/denyPendingApprovalRequest.ts b/ts/util/denyPendingApprovalRequest.ts index 8978a8d42ca..6a3bde110d4 100644 --- a/ts/util/denyPendingApprovalRequest.ts +++ b/ts/util/denyPendingApprovalRequest.ts @@ -1,12 +1,12 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationAttributesType } from '../model-types.d'; -import type { SignalService as Proto } from '../protobuf'; -import type { AciString } from '../types/ServiceId'; -import { createLogger } from '../logging/log'; -import { getConversationIdForLogging } from './idForLogging'; -import { isMemberRequestingToJoin } from './groupMembershipUtils'; +import type { ConversationAttributesType } from '../model-types.d.ts'; +import type { SignalService as Proto } from '../protobuf/index.js'; +import type { AciString } from '../types/ServiceId.js'; +import { createLogger } from '../logging/log.js'; +import { getConversationIdForLogging } from './idForLogging.js'; +import { isMemberRequestingToJoin } from './groupMembershipUtils.js'; const log = createLogger('denyPendingApprovalRequest'); diff --git a/ts/util/deprecated.ts b/ts/util/deprecated.ts index 82703063a85..d437412ca72 100644 --- a/ts/util/deprecated.ts +++ b/ts/util/deprecated.ts @@ -1,8 +1,8 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { getEnvironment, Environment } from '../environment'; -import { createLogger } from '../logging/log'; +import { getEnvironment, Environment } from '../environment.js'; +import { createLogger } from '../logging/log.js'; const log = createLogger('deprecated'); diff --git a/ts/util/desktopCapturer.ts b/ts/util/desktopCapturer.ts index 72e8a49b8d0..889dbcbc72f 100644 --- a/ts/util/desktopCapturer.ts +++ b/ts/util/desktopCapturer.ts @@ -5,21 +5,21 @@ import { ipcRenderer, type DesktopCapturerSource } from 'electron'; import type { Stream, StreamOptions } from '@indutny/mac-screen-share'; -import { createLogger } from '../logging/log'; -import * as Errors from '../types/errors'; -import type { PresentableSource } from '../types/Calling'; -import type { LocalizerType } from '../types/Util'; +import { createLogger } from '../logging/log.js'; +import * as Errors from '../types/errors.js'; +import type { PresentableSource } from '../types/Calling.js'; +import type { LocalizerType } from '../types/Util.js'; import { REQUESTED_SCREEN_SHARE_WIDTH, REQUESTED_SCREEN_SHARE_HEIGHT, REQUESTED_SCREEN_SHARE_FRAMERATE, -} from '../calling/constants'; -import { strictAssert } from './assert'; -import { explodePromise } from './explodePromise'; -import { isNotNil } from './isNotNil'; -import { drop } from './drop'; -import { SECOND } from './durations'; -import { isOlderThan } from './timestamp'; +} from '../calling/constants.js'; +import { strictAssert } from './assert.js'; +import { explodePromise } from './explodePromise.js'; +import { isNotNil } from './isNotNil.js'; +import { drop } from './drop.js'; +import { SECOND } from './durations/index.js'; +import { isOlderThan } from './timestamp.js'; const log = createLogger('desktopCapturer'); diff --git a/ts/util/distributionListToSendTarget.ts b/ts/util/distributionListToSendTarget.ts index 2d49c7887a2..ac81fa21ef2 100644 --- a/ts/util/distributionListToSendTarget.ts +++ b/ts/util/distributionListToSendTarget.ts @@ -1,12 +1,12 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ServiceIdString } from '../types/ServiceId'; -import type { SenderKeyInfoType } from '../model-types.d'; -import { DataWriter } from '../sql/Client'; -import type { StoryDistributionType } from '../sql/Interface'; -import type { SenderKeyTargetType } from './sendToGroup'; -import { isNotNil } from './isNotNil'; +import type { ServiceIdString } from '../types/ServiceId.js'; +import type { SenderKeyInfoType } from '../model-types.d.ts'; +import { DataWriter } from '../sql/Client.js'; +import type { StoryDistributionType } from '../sql/Interface.js'; +import type { SenderKeyTargetType } from './sendToGroup.js'; +import { isNotNil } from './isNotNil.js'; export function distributionListToSendTarget( distributionList: StoryDistributionType, diff --git a/ts/util/dns.ts b/ts/util/dns.ts index 4388df9cc96..bb951a18bbd 100644 --- a/ts/util/dns.ts +++ b/ts/util/dns.ts @@ -6,15 +6,15 @@ import type { LookupAllOptions, LookupAddress, lookup as nodeLookup, -} from 'dns'; +} from 'node:dns'; import { ipcRenderer, net } from 'electron'; import type { ResolvedHost, ResolvedEndpoint } from 'electron'; import pTimeout from 'p-timeout'; -import { strictAssert } from './assert'; -import { drop } from './drop'; -import type { DNSFallbackType } from '../types/DNSFallback'; -import { SECOND } from './durations'; +import { strictAssert } from './assert.js'; +import { drop } from './drop.js'; +import type { DNSFallbackType } from '../types/DNSFallback.js'; +import { SECOND } from './durations/index.js'; const LOOKUP_TIMEOUT_MS = 5 * SECOND; const fallbackAddrs = new Map>(); diff --git a/ts/util/donations.ts b/ts/util/donations.ts index 2d867af8daa..66a58b157f5 100644 --- a/ts/util/donations.ts +++ b/ts/util/donations.ts @@ -1,10 +1,16 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { DonationWorkflow, HumanDonationAmount } from '../types/Donations'; -import { donationStateSchema } from '../types/Donations'; -import { brandStripeDonationAmount, toHumanDonationAmount } from './currency'; -import { missingCaseError } from './missingCaseError'; +import type { + DonationWorkflow, + HumanDonationAmount, +} from '../types/Donations.js'; +import { donationStateSchema } from '../types/Donations.js'; +import { + brandStripeDonationAmount, + toHumanDonationAmount, +} from './currency.js'; +import { missingCaseError } from './missingCaseError.js'; // Donation where we started backend processing, but did not redeem a badge yet. // Note we skip workflows in the INTENT state because it requires user confirmation diff --git a/ts/util/doubleCheckMissingQuoteReference.ts b/ts/util/doubleCheckMissingQuoteReference.ts index 7f8c579d493..4623fc15765 100644 --- a/ts/util/doubleCheckMissingQuoteReference.ts +++ b/ts/util/doubleCheckMissingQuoteReference.ts @@ -1,20 +1,20 @@ // Copyright 2019 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { getMessageById } from '../messages/getMessageById'; -import type { MessageModel } from '../models/messages'; +import { getMessageById } from '../messages/getMessageById.js'; +import type { MessageModel } from '../models/messages.js'; -import { hydrateStoryContext } from './hydrateStoryContext'; -import { getMessageIdForLogging } from './idForLogging'; +import { hydrateStoryContext } from './hydrateStoryContext.js'; +import { getMessageIdForLogging } from './idForLogging.js'; -import { createLogger } from '../logging/log'; +import { createLogger } from '../logging/log.js'; import { isQuoteAMatch, shouldTryToCopyFromQuotedMessage, -} from '../messages/helpers'; -import { copyQuoteContentFromOriginal } from '../messages/copyQuote'; -import { queueUpdateMessage } from './messageBatcher'; -import { drop } from './drop'; +} from '../messages/helpers.js'; +import { copyQuoteContentFromOriginal } from '../messages/copyQuote.js'; +import { queueUpdateMessage } from './messageBatcher.js'; +import { drop } from './drop.js'; const log = createLogger('doubleCheckMissingQuoteReference'); diff --git a/ts/util/downloadAttachment.ts b/ts/util/downloadAttachment.ts index 05ac0edac10..dcb31a34a9f 100644 --- a/ts/util/downloadAttachment.ts +++ b/ts/util/downloadAttachment.ts @@ -7,16 +7,16 @@ import { AttachmentPermanentlyUndownloadableError, hasRequiredInformationForBackup, wasImportedFromLocalBackup, -} from '../types/Attachment'; -import { downloadAttachment as doDownloadAttachment } from '../textsecure/downloadAttachment'; -import { downloadAttachmentFromLocalBackup as doDownloadAttachmentFromLocalBackup } from './downloadAttachmentFromLocalBackup'; -import { MediaTier } from '../types/AttachmentDownload'; -import { createLogger } from '../logging/log'; -import { HTTPError } from '../textsecure/Errors'; -import { toLogFormat } from '../types/errors'; -import type { ReencryptedAttachmentV2 } from '../AttachmentCrypto'; -import * as RemoteConfig from '../RemoteConfig'; -import { ToastType } from '../types/Toast'; +} from '../types/Attachment.js'; +import { downloadAttachment as doDownloadAttachment } from '../textsecure/downloadAttachment.js'; +import { downloadAttachmentFromLocalBackup as doDownloadAttachmentFromLocalBackup } from './downloadAttachmentFromLocalBackup.js'; +import { MediaTier } from '../types/AttachmentDownload.js'; +import { createLogger } from '../logging/log.js'; +import { HTTPError } from '../textsecure/Errors.js'; +import { toLogFormat } from '../types/errors.js'; +import type { ReencryptedAttachmentV2 } from '../AttachmentCrypto.js'; +import * as RemoteConfig from '../RemoteConfig.js'; +import { ToastType } from '../types/Toast.js'; const log = createLogger('downloadAttachment'); diff --git a/ts/util/downloadAttachmentFromLocalBackup.ts b/ts/util/downloadAttachmentFromLocalBackup.ts index 7e44d6d501f..3df592f049d 100644 --- a/ts/util/downloadAttachmentFromLocalBackup.ts +++ b/ts/util/downloadAttachmentFromLocalBackup.ts @@ -3,12 +3,12 @@ import { existsSync } from 'node:fs'; import { isNumber } from 'lodash'; -import { type BackupableAttachmentType } from '../types/Attachment'; +import { type BackupableAttachmentType } from '../types/Attachment.js'; import { decryptAndReencryptLocally, type ReencryptedAttachmentV2, -} from '../AttachmentCrypto'; -import { strictAssert } from './assert'; +} from '../AttachmentCrypto.js'; +import { strictAssert } from './assert.js'; export class AttachmentPermanentlyUndownloadableError extends Error {} diff --git a/ts/util/downloadOnboardingStory.ts b/ts/util/downloadOnboardingStory.ts index caffadac161..abcc0078146 100644 --- a/ts/util/downloadOnboardingStory.ts +++ b/ts/util/downloadOnboardingStory.ts @@ -3,16 +3,16 @@ import { v4 as generateUuid } from 'uuid'; -import type { AttachmentType } from '../types/Attachment'; -import { MessageModel } from '../models/messages'; -import { createLogger } from '../logging/log'; -import { IMAGE_JPEG } from '../types/MIME'; -import { ReadStatus } from '../messages/MessageReadStatus'; -import { SeenStatus } from '../MessageSeenStatus'; -import { findAndDeleteOnboardingStoryIfExists } from './findAndDeleteOnboardingStoryIfExists'; -import { saveNewMessageBatcher } from './messageBatcher'; -import { strictAssert } from './assert'; -import { incrementMessageCounter } from './incrementMessageCounter'; +import type { AttachmentType } from '../types/Attachment.js'; +import { MessageModel } from '../models/messages.js'; +import { createLogger } from '../logging/log.js'; +import { IMAGE_JPEG } from '../types/MIME.js'; +import { ReadStatus } from '../messages/MessageReadStatus.js'; +import { SeenStatus } from '../MessageSeenStatus.js'; +import { findAndDeleteOnboardingStoryIfExists } from './findAndDeleteOnboardingStoryIfExists.js'; +import { saveNewMessageBatcher } from './messageBatcher.js'; +import { strictAssert } from './assert.js'; +import { incrementMessageCounter } from './incrementMessageCounter.js'; const log = createLogger('downloadOnboardingStory'); diff --git a/ts/util/durations/duration-in-seconds.ts b/ts/util/durations/duration-in-seconds.ts index 282a9019056..d83ae66d26c 100644 --- a/ts/util/durations/duration-in-seconds.ts +++ b/ts/util/durations/duration-in-seconds.ts @@ -1,7 +1,7 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import * as Constants from './constants'; +import * as Constants from './constants.js'; export type DurationInSeconds = number & { __time_difference_in_seconds: never; diff --git a/ts/util/durations/index.ts b/ts/util/durations/index.ts index 7730408e6c4..611e96e248d 100644 --- a/ts/util/durations/index.ts +++ b/ts/util/durations/index.ts @@ -1,5 +1,5 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -export * from './constants'; -export { DurationInSeconds } from './duration-in-seconds'; +export * from './constants.js'; +export { DurationInSeconds } from './duration-in-seconds.js'; diff --git a/ts/util/editHelpers.ts b/ts/util/editHelpers.ts index 8bd2a3b537e..f4ce8dec683 100644 --- a/ts/util/editHelpers.ts +++ b/ts/util/editHelpers.ts @@ -4,14 +4,14 @@ import { isNumber, sortBy } from 'lodash'; import type { ReadonlyDeep } from 'type-fest'; -import { strictAssert } from './assert'; +import { strictAssert } from './assert.js'; import type { EditHistoryType, MessageAttributesType, ReadonlyMessageAttributesType, -} from '../model-types'; -import type { LoggerType } from '../types/Logging'; +} from '../model-types.js'; +import type { LoggerType } from '../types/Logging.js'; // The tricky bit for this function is if we are on our second+ attempt to send a given // edit, we're still sending that edit. diff --git a/ts/util/emoji.ts b/ts/util/emoji.ts index 30980732cf7..a7f3c79a376 100644 --- a/ts/util/emoji.ts +++ b/ts/util/emoji.ts @@ -3,8 +3,8 @@ import emojiRegex from 'emoji-regex'; -import { assertDev } from './assert'; -import { take } from './iterables'; +import { assertDev } from './assert.js'; +import { take } from './iterables.js'; const REGEXP = emojiRegex(); const MAX_EMOJI_TO_MATCH = 5000; diff --git a/ts/util/encryptConversationAttachments.ts b/ts/util/encryptConversationAttachments.ts index b59cb1962d2..0120bbf470e 100644 --- a/ts/util/encryptConversationAttachments.ts +++ b/ts/util/encryptConversationAttachments.ts @@ -3,14 +3,14 @@ import pMap from 'p-map'; -import { createLogger } from '../logging/log'; -import { DataReader, DataWriter } from '../sql/Client'; -import type { ConversationAttributesType } from '../model-types.d'; -import { encryptLegacyAttachment } from './encryptLegacyAttachment'; -import { AttachmentDisposition } from './getLocalAttachmentUrl'; -import { isNotNil } from './isNotNil'; -import { isSignalConversation } from './isSignalConversation'; -import { getConversationIdForLogging } from './idForLogging'; +import { createLogger } from '../logging/log.js'; +import { DataReader, DataWriter } from '../sql/Client.js'; +import type { ConversationAttributesType } from '../model-types.d.ts'; +import { encryptLegacyAttachment } from './encryptLegacyAttachment.js'; +import { AttachmentDisposition } from './getLocalAttachmentUrl.js'; +import { isNotNil } from './isNotNil.js'; +import { isSignalConversation } from './isSignalConversation.js'; +import { getConversationIdForLogging } from './idForLogging.js'; const log = createLogger('encryptConversationAttachments'); diff --git a/ts/util/encryptLegacyAttachment.ts b/ts/util/encryptLegacyAttachment.ts index 62cf4a10550..f8981cb8b02 100644 --- a/ts/util/encryptLegacyAttachment.ts +++ b/ts/util/encryptLegacyAttachment.ts @@ -6,12 +6,12 @@ import { LRUCache } from 'lru-cache'; import type { AddressableAttachmentType, LocalAttachmentV2Type, -} from '../types/Attachment'; -import { createLogger } from '../logging/log'; -import { DataWriter } from '../sql/Client'; -import { AttachmentDisposition } from './getLocalAttachmentUrl'; -import { drop } from './drop'; -import { MINUTE } from './durations'; +} from '../types/Attachment.js'; +import { createLogger } from '../logging/log.js'; +import { DataWriter } from '../sql/Client.js'; +import { AttachmentDisposition } from './getLocalAttachmentUrl.js'; +import { drop } from './drop.js'; +import { MINUTE } from './durations/index.js'; const log = createLogger('encryptLegacyAttachment'); diff --git a/ts/util/encryptProfileData.ts b/ts/util/encryptProfileData.ts index df81281c6a4..8e1fcd2f112 100644 --- a/ts/util/encryptProfileData.ts +++ b/ts/util/encryptProfileData.ts @@ -1,18 +1,21 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationType } from '../state/ducks/conversations'; -import type { ProfileRequestDataType } from '../textsecure/WebAPI'; -import { assertDev } from './assert'; -import * as Bytes from '../Bytes'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import type { ProfileRequestDataType } from '../textsecure/WebAPI.js'; +import { assertDev } from './assert.js'; +import * as Bytes from '../Bytes.js'; import { PaddedLengths, encryptProfile, encryptProfileItemWithPadding, -} from '../Crypto'; -import type { AvatarUpdateType } from '../types/Avatar'; -import { deriveProfileKeyCommitment, deriveProfileKeyVersion } from './zkgroup'; -import { isSharingPhoneNumberWithEverybody } from './phoneNumberSharingMode'; +} from '../Crypto.js'; +import type { AvatarUpdateType } from '../types/Avatar.js'; +import { + deriveProfileKeyCommitment, + deriveProfileKeyVersion, +} from './zkgroup.js'; +import { isSharingPhoneNumberWithEverybody } from './phoneNumberSharingMode.js'; export async function encryptProfileData( conversation: ConversationType, diff --git a/ts/util/expirationTimer.ts b/ts/util/expirationTimer.ts index 9597fa1a5c7..522cbf8c7a2 100644 --- a/ts/util/expirationTimer.ts +++ b/ts/util/expirationTimer.ts @@ -4,8 +4,8 @@ import humanizeDuration from 'humanize-duration'; import type { Unit } from 'humanize-duration'; import { isNumber } from 'lodash'; -import type { LocalizerType } from '../types/Util'; -import { SECOND, DurationInSeconds } from './durations'; +import type { LocalizerType } from '../types/Util.js'; +import { SECOND, DurationInSeconds } from './durations/index.js'; export const INITIAL_EXPIRE_TIMER_VERSION = 1; diff --git a/ts/util/exponentialBackoff.ts b/ts/util/exponentialBackoff.ts index 96fe15849e6..37cff62c038 100644 --- a/ts/util/exponentialBackoff.ts +++ b/ts/util/exponentialBackoff.ts @@ -1,8 +1,8 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { strictAssert } from './assert'; -import * as durations from './durations'; +import { strictAssert } from './assert.js'; +import * as durations from './durations/index.js'; const BACKOFF_FACTOR = 1.9; const MAX_BACKOFF = 15 * durations.MINUTE; diff --git a/ts/util/filterAndSortConversations.ts b/ts/util/filterAndSortConversations.ts index e5f20a4954d..45b12e69f06 100644 --- a/ts/util/filterAndSortConversations.ts +++ b/ts/util/filterAndSortConversations.ts @@ -2,14 +2,14 @@ // SPDX-License-Identifier: AGPL-3.0-only import type Fuse from 'fuse.js'; -import type { ConversationType } from '../state/ducks/conversations'; -import { parseAndFormatPhoneNumber } from './libphonenumberInstance'; -import { WEEK } from './durations'; -import { fuseGetFnRemoveDiacritics, getCachedFuseIndex } from './fuse'; -import { countConversationUnreadStats, hasUnread } from './countUnreadStats'; -import { getE164 } from './getE164'; -import { removeDiacritics } from './removeDiacritics'; -import { isAciString } from './isAciString'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import { parseAndFormatPhoneNumber } from './libphonenumberInstance.js'; +import { WEEK } from './durations/index.js'; +import { fuseGetFnRemoveDiacritics, getCachedFuseIndex } from './fuse.js'; +import { countConversationUnreadStats, hasUnread } from './countUnreadStats.js'; +import { getE164 } from './getE164.js'; +import { removeDiacritics } from './removeDiacritics.js'; +import { isAciString } from './isAciString.js'; // Fuse.js scores have order of 0.01 const ACTIVE_AT_SCORE_FACTOR = (1 / WEEK) * 0.01; diff --git a/ts/util/filterCallLinks.ts b/ts/util/filterCallLinks.ts index 7344058676f..429cc8ec6f5 100644 --- a/ts/util/filterCallLinks.ts +++ b/ts/util/filterCallLinks.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import type Fuse from 'fuse.js'; -import { fuseGetFnRemoveDiacritics, getCachedFuseIndex } from './fuse'; -import { removeDiacritics } from './removeDiacritics'; -import type { CallLinkType } from '../types/CallLink'; +import { fuseGetFnRemoveDiacritics, getCachedFuseIndex } from './fuse.js'; +import { removeDiacritics } from './removeDiacritics.js'; +import type { CallLinkType } from '../types/CallLink.js'; // Based on parameters in filterAndSortConversations const FUSE_OPTIONS: Fuse.IFuseOptions = { diff --git a/ts/util/findAndDeleteOnboardingStoryIfExists.ts b/ts/util/findAndDeleteOnboardingStoryIfExists.ts index cad50090390..67bf58237d8 100644 --- a/ts/util/findAndDeleteOnboardingStoryIfExists.ts +++ b/ts/util/findAndDeleteOnboardingStoryIfExists.ts @@ -1,12 +1,12 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log'; -import { DataWriter } from '../sql/Client'; -import { calculateExpirationTimestamp } from './expirationTimer'; -import { DAY } from './durations'; -import { cleanupMessages } from './cleanup'; -import { getMessageById } from '../messages/getMessageById'; +import { createLogger } from '../logging/log.js'; +import { DataWriter } from '../sql/Client.js'; +import { calculateExpirationTimestamp } from './expirationTimer.js'; +import { DAY } from './durations/index.js'; +import { cleanupMessages } from './cleanup.js'; +import { getMessageById } from '../messages/getMessageById.js'; const log = createLogger('findAndDeleteOnboardingStoryIfExists'); diff --git a/ts/util/findAndFormatContact.ts b/ts/util/findAndFormatContact.ts index 1d472556fe8..2732b40c8f8 100644 --- a/ts/util/findAndFormatContact.ts +++ b/ts/util/findAndFormatContact.ts @@ -1,9 +1,9 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationType } from '../state/ducks/conversations'; -import { PLACEHOLDER_CONTACT_ID } from '../state/selectors/conversations'; -import { format, isValidNumber } from '../types/PhoneNumber'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import { PLACEHOLDER_CONTACT_ID } from '../state/selectors/conversations.js'; +import { format, isValidNumber } from '../types/PhoneNumber.js'; const PLACEHOLDER_CONTACT: ConversationType = { acceptedMessageRequest: false, diff --git a/ts/util/findStoryMessage.ts b/ts/util/findStoryMessage.ts index 83c33c07726..174ac63f70a 100644 --- a/ts/util/findStoryMessage.ts +++ b/ts/util/findStoryMessage.ts @@ -4,12 +4,12 @@ import type { ReadonlyMessageAttributesType, MessageAttributesType, -} from '../model-types.d'; -import { type AciString } from '../types/ServiceId'; -import { type ProcessedStoryContext } from '../textsecure/Types.d'; -import { DataReader } from '../sql/Client'; -import { createLogger } from '../logging/log'; -import { getAuthorId } from '../messages/helpers'; +} from '../model-types.d.ts'; +import { type AciString } from '../types/ServiceId.js'; +import type { ProcessedStoryContext } from '../textsecure/Types.d.ts'; +import { DataReader } from '../sql/Client.js'; +import { createLogger } from '../logging/log.js'; +import { getAuthorId } from '../messages/helpers.js'; const log = createLogger('findStoryMessage'); diff --git a/ts/util/formatTimestamp.ts b/ts/util/formatTimestamp.ts index 0db88584073..1f37e0c5609 100644 --- a/ts/util/formatTimestamp.ts +++ b/ts/util/formatTimestamp.ts @@ -1,8 +1,8 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { HourCyclePreference } from '../types/I18N'; -import { assertDev } from './assert'; +import { HourCyclePreference } from '../types/I18N.js'; +import { assertDev } from './assert.js'; function getOptionsWithPreferences( options: Intl.DateTimeFormatOptions diff --git a/ts/util/fuse.ts b/ts/util/fuse.ts index 625b87ac0ae..efea18d4831 100644 --- a/ts/util/fuse.ts +++ b/ts/util/fuse.ts @@ -3,7 +3,7 @@ import Fuse from 'fuse.js'; -import { removeDiacritics } from './removeDiacritics'; +import { removeDiacritics } from './removeDiacritics.js'; const cachedIndices: Map< Fuse.IFuseOptions, diff --git a/ts/util/generateDonationReceipt.ts b/ts/util/generateDonationReceipt.ts index f646913249a..2fdc7968771 100644 --- a/ts/util/generateDonationReceipt.ts +++ b/ts/util/generateDonationReceipt.ts @@ -2,12 +2,12 @@ // SPDX-License-Identifier: AGPL-3.0-only import { fabric } from 'fabric'; -import type { DonationReceipt } from '../types/Donations'; -import type { LocalizerType } from '../types/Util'; -import { strictAssert } from './assert'; -import { getDateTimeFormatter } from './formatTimestamp'; -import { isStagingServer } from './isStagingServer'; -import { getHumanDonationAmount, toHumanCurrencyString } from './currency'; +import type { DonationReceipt } from '../types/Donations.js'; +import type { LocalizerType } from '../types/Util.js'; +import { strictAssert } from './assert.js'; +import { getDateTimeFormatter } from './formatTimestamp.js'; +import { isStagingServer } from './isStagingServer.js'; +import { getHumanDonationAmount, toHumanCurrencyString } from './currency.js'; const SCALING_FACTOR = 4.17; diff --git a/ts/util/generateMessageId.ts b/ts/util/generateMessageId.ts index f3ed6a56e47..64d2bcd41d2 100644 --- a/ts/util/generateMessageId.ts +++ b/ts/util/generateMessageId.ts @@ -3,7 +3,7 @@ import { stringify } from 'uuid'; -import { getRandomBytes } from '../Crypto'; +import { getRandomBytes } from '../Crypto.js'; export type GeneratedMessageIdType = Readonly<{ id: string; diff --git a/ts/util/getAboutText.ts b/ts/util/getAboutText.ts index 914039c9e18..ec0573fb631 100644 --- a/ts/util/getAboutText.ts +++ b/ts/util/getAboutText.ts @@ -1,7 +1,7 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationAttributesType } from '../model-types'; +import type { ConversationAttributesType } from '../model-types.js'; export function getAboutText( attributes: Pick diff --git a/ts/util/getAccessControlOptions.ts b/ts/util/getAccessControlOptions.ts index 4e6ab6448f2..1a0bd5d2e85 100644 --- a/ts/util/getAccessControlOptions.ts +++ b/ts/util/getAccessControlOptions.ts @@ -1,8 +1,8 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { LocalizerType } from '../types/Util'; -import { SignalService as Proto } from '../protobuf'; +import type { LocalizerType } from '../types/Util.js'; +import { SignalService as Proto } from '../protobuf/index.js'; const AccessControlEnum = Proto.AccessControl.AccessRequired; diff --git a/ts/util/getAddedByForOurPendingInvitation.ts b/ts/util/getAddedByForOurPendingInvitation.ts index f6ce9406b83..093daff9d81 100644 --- a/ts/util/getAddedByForOurPendingInvitation.ts +++ b/ts/util/getAddedByForOurPendingInvitation.ts @@ -1,6 +1,6 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationType } from '../state/ducks/conversations'; +import type { ConversationType } from '../state/ducks/conversations.js'; export function getAddedByForOurPendingInvitation( conversation: ConversationType diff --git a/ts/util/getAppErrorIcon.ts b/ts/util/getAppErrorIcon.ts index 41187f4d6ea..6d35cd86fca 100644 --- a/ts/util/getAppErrorIcon.ts +++ b/ts/util/getAppErrorIcon.ts @@ -3,7 +3,7 @@ import { nativeImage } from 'electron'; import type { NativeImage } from 'electron'; -import { join } from 'path'; +import { join } from 'node:path'; export function getAppErrorIcon(): NativeImage { const iconPath = join( diff --git a/ts/util/getAvatarData.ts b/ts/util/getAvatarData.ts index 20c6f7d4f16..b025236fa02 100644 --- a/ts/util/getAvatarData.ts +++ b/ts/util/getAvatarData.ts @@ -1,10 +1,10 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AvatarDataType } from '../types/Avatar'; -import { getDefaultAvatars } from '../types/Avatar'; -import { isDirectConversation } from './whatTypeOfConversation'; -import type { ConversationAttributesType } from '../model-types.d'; +import type { AvatarDataType } from '../types/Avatar.js'; +import { getDefaultAvatars } from '../types/Avatar.js'; +import { isDirectConversation } from './whatTypeOfConversation.js'; +import type { ConversationAttributesType } from '../model-types.d.ts'; export function getAvatarData( conversationAttrs: Pick diff --git a/ts/util/getBasicAuth.ts b/ts/util/getBasicAuth.ts index 3957b9e387c..2468d5198e7 100644 --- a/ts/util/getBasicAuth.ts +++ b/ts/util/getBasicAuth.ts @@ -1,7 +1,7 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { fromString, toBase64 } from '../Bytes'; +import { fromString, toBase64 } from '../Bytes.js'; export type GetBasicAuthOptionsType = Readonly<{ username: string; diff --git a/ts/util/getColorForCallLink.ts b/ts/util/getColorForCallLink.ts index 330f8a42d03..825e699c544 100644 --- a/ts/util/getColorForCallLink.ts +++ b/ts/util/getColorForCallLink.ts @@ -1,7 +1,7 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { AVATAR_COLOR_COUNT, AvatarColors } from '../types/Colors'; +import { AVATAR_COLOR_COUNT, AvatarColors } from '../types/Colors.js'; // See https://github.com/signalapp/ringrtc/blob/49b4b8a16f997c7fa9a429e96aa83f80b2065c63/src/rust/src/lite/call_links/base16.rs#L8 const BASE_16_CONSONANT_ALPHABET = 'bcdfghkmnpqrstxz'; diff --git a/ts/util/getConversation.ts b/ts/util/getConversation.ts index d900b5b732b..9a428949c46 100644 --- a/ts/util/getConversation.ts +++ b/ts/util/getConversation.ts @@ -3,31 +3,31 @@ import memoizee from 'memoizee'; import { sortBy } from 'lodash'; -import type { ConversationModel } from '../models/conversations'; -import type { ConversationType } from '../state/ducks/conversations'; -import type { ConversationAttributesType } from '../model-types'; -import type { GroupNameCollisionsWithIdsByTitle } from './groupMemberNameCollisions'; -import { StorySendMode } from '../types/Stories'; -import { areWeAdmin } from './areWeAdmin'; -import { buildGroupLink } from '../groups'; -import { canAddNewMembers } from './canAddNewMembers'; -import { canBeAnnouncementGroup } from './canBeAnnouncementGroup'; -import { canChangeTimer } from './canChangeTimer'; -import { canEditGroupInfo } from './canEditGroupInfo'; -import { dropNull } from './dropNull'; -import { getAboutText } from './getAboutText'; +import type { ConversationModel } from '../models/conversations.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import type { ConversationAttributesType } from '../model-types.js'; +import type { GroupNameCollisionsWithIdsByTitle } from './groupMemberNameCollisions.js'; +import { StorySendMode } from '../types/Stories.js'; +import { areWeAdmin } from './areWeAdmin.js'; +import { buildGroupLink } from '../groups.js'; +import { canAddNewMembers } from './canAddNewMembers.js'; +import { canBeAnnouncementGroup } from './canBeAnnouncementGroup.js'; +import { canChangeTimer } from './canChangeTimer.js'; +import { canEditGroupInfo } from './canEditGroupInfo.js'; +import { dropNull } from './dropNull.js'; +import { getAboutText } from './getAboutText.js'; import { getAvatarHash, getLocalAvatarUrl, getLocalProfileAvatarUrl, getRawAvatarPath, hasAvatar, -} from './avatarUtils'; -import { getAvatarData } from './getAvatarData'; -import { getConversationMembers } from './getConversationMembers'; -import { getCustomColorData, migrateColor } from './migrateColor'; -import { getDraftPreview } from './getDraftPreview'; -import { getLastMessage } from './getLastMessage'; +} from './avatarUtils.js'; +import { getAvatarData } from './getAvatarData.js'; +import { getConversationMembers } from './getConversationMembers.js'; +import { getCustomColorData, migrateColor } from './migrateColor.js'; +import { getDraftPreview } from './getDraftPreview.js'; +import { getLastMessage } from './getLastMessage.js'; import { getNumber, getProfileName, @@ -35,17 +35,17 @@ import { getTitleNoDefault, canHaveUsername, renderNumber, -} from './getTitle'; -import { hasDraft } from './hasDraft'; -import { isAciString } from './isAciString'; -import { isBlocked } from './isBlocked'; -import { isConversationAccepted } from './isConversationAccepted'; +} from './getTitle.js'; +import { hasDraft } from './hasDraft.js'; +import { isAciString } from './isAciString.js'; +import { isBlocked } from './isBlocked.js'; +import { isConversationAccepted } from './isConversationAccepted.js'; import { isDirectConversation, isGroupV1, isGroupV2, isMe, -} from './whatTypeOfConversation'; +} from './whatTypeOfConversation.js'; import { areWePending, getBannedMemberships, @@ -54,10 +54,10 @@ import { getPendingApprovalMemberships, getPendingMemberships, isMemberAwaitingApproval, -} from './groupMembershipUtils'; -import { isNotNil } from './isNotNil'; -import { getIdentifierHash } from '../Crypto'; -import { getAvatarPlaceholderGradient } from '../utils/getAvatarPlaceholderGradient'; +} from './groupMembershipUtils.js'; +import { isNotNil } from './isNotNil.js'; +import { getIdentifierHash } from '../Crypto.js'; +import { getAvatarPlaceholderGradient } from '../utils/getAvatarPlaceholderGradient.js'; const EMPTY_ARRAY: Readonly<[]> = []; const EMPTY_GROUP_COLLISIONS: GroupNameCollisionsWithIdsByTitle = {}; diff --git a/ts/util/getConversationColorAttributes.ts b/ts/util/getConversationColorAttributes.ts index d5166813f3e..5fc698edda0 100644 --- a/ts/util/getConversationColorAttributes.ts +++ b/ts/util/getConversationColorAttributes.ts @@ -5,8 +5,8 @@ import type { ConversationColorType, CustomColorType, DefaultConversationColorType, -} from '../types/Colors'; -import type { ConversationType } from '../state/ducks/conversations'; +} from '../types/Colors.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; export function getConversationColorAttributes( conversationColors: Pick< diff --git a/ts/util/getConversationMembers.ts b/ts/util/getConversationMembers.ts index ace3b9c7333..cc7b5034837 100644 --- a/ts/util/getConversationMembers.ts +++ b/ts/util/getConversationMembers.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import { compact } from 'lodash'; -import type { ConversationAttributesType } from '../model-types.d'; -import type { ServiceIdString } from '../types/ServiceId'; -import { isDirectConversation } from './whatTypeOfConversation'; +import type { ConversationAttributesType } from '../model-types.d.ts'; +import type { ServiceIdString } from '../types/ServiceId.js'; +import { isDirectConversation } from './whatTypeOfConversation.js'; export function getConversationMembers( conversationAttrs: ConversationAttributesType, diff --git a/ts/util/getConversationTitleForPanelType.ts b/ts/util/getConversationTitleForPanelType.ts index 00b1cab43a5..95f46d60ea9 100644 --- a/ts/util/getConversationTitleForPanelType.ts +++ b/ts/util/getConversationTitleForPanelType.ts @@ -1,9 +1,9 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { LocalizerType } from '../types/Util'; -import { createLogger } from '../logging/log'; -import { PanelType } from '../types/Panels'; +import type { LocalizerType } from '../types/Util.js'; +import { createLogger } from '../logging/log.js'; +import { PanelType } from '../types/Panels.js'; const log = createLogger('getConversationTitleForPanelType'); diff --git a/ts/util/getCountryData.ts b/ts/util/getCountryData.ts index b5a08d54ed1..a1703abde1b 100644 --- a/ts/util/getCountryData.ts +++ b/ts/util/getCountryData.ts @@ -3,7 +3,7 @@ import memoizee from 'memoizee'; -import { instance } from './libphonenumberInstance'; +import { instance } from './libphonenumberInstance.js'; export type CountryDataType = Readonly<{ region: string; diff --git a/ts/util/getCustomColorStyle.ts b/ts/util/getCustomColorStyle.ts index 3a7df966a12..ada365b6186 100644 --- a/ts/util/getCustomColorStyle.ts +++ b/ts/util/getCustomColorStyle.ts @@ -1,10 +1,10 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { CustomColorType } from '../types/Colors'; -import { ThemeType } from '../types/Util'; -import { getHSL } from './getHSL'; -import { getUserTheme } from '../shims/getUserTheme'; +import type { CustomColorType } from '../types/Colors.js'; +import { ThemeType } from '../types/Util.js'; +import { getHSL } from './getHSL.js'; +import { getUserTheme } from '../shims/getUserTheme.js'; type ExtraQuotePropsType = { borderInlineStartColor?: string; diff --git a/ts/util/getDraftPreview.ts b/ts/util/getDraftPreview.ts index 985e976b841..d768241327e 100644 --- a/ts/util/getDraftPreview.ts +++ b/ts/util/getDraftPreview.ts @@ -1,12 +1,12 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationAttributesType } from '../model-types'; -import type { DraftPreviewType } from '../state/ducks/conversations'; -import { findAndFormatContact } from './findAndFormatContact'; -import { hydrateRanges } from '../types/BodyRange'; -import { isVoiceMessage } from '../types/Attachment'; -import { stripNewlinesForLeftPane } from './stripNewlinesForLeftPane'; +import type { ConversationAttributesType } from '../model-types.js'; +import type { DraftPreviewType } from '../state/ducks/conversations.js'; +import { findAndFormatContact } from './findAndFormatContact.js'; +import { hydrateRanges } from '../types/BodyRange.js'; +import { isVoiceMessage } from '../types/Attachment.js'; +import { stripNewlinesForLeftPane } from './stripNewlinesForLeftPane.js'; export function getDraftPreview( attributes: ConversationAttributesType diff --git a/ts/util/getE164.ts b/ts/util/getE164.ts index 02f3babdf9f..0efd20bcf58 100644 --- a/ts/util/getE164.ts +++ b/ts/util/getE164.ts @@ -1,9 +1,9 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationAttributesType } from '../model-types.d'; -import type { ConversationType } from '../state/ducks/conversations'; -import { isInSystemContacts } from './isInSystemContacts'; +import type { ConversationAttributesType } from '../model-types.d.ts'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import { isInSystemContacts } from './isInSystemContacts.js'; export function getE164( attributes: Pick< diff --git a/ts/util/getFontNameByTextScript.ts b/ts/util/getFontNameByTextScript.ts index 291b7830d31..48048374f4c 100644 --- a/ts/util/getFontNameByTextScript.ts +++ b/ts/util/getFontNameByTextScript.ts @@ -1,8 +1,8 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { LocalizerType } from '../types/Util'; -import { strictAssert } from './assert'; +import type { LocalizerType } from '../types/Util.js'; +import { strictAssert } from './assert.js'; const FONT_MAP = { base: [ diff --git a/ts/util/getGroupMemberships.ts b/ts/util/getGroupMemberships.ts index fd2275d7fa3..3b1c26775eb 100644 --- a/ts/util/getGroupMemberships.ts +++ b/ts/util/getGroupMemberships.ts @@ -1,14 +1,14 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { GroupV2Membership } from '../components/conversation/conversation-details/ConversationDetailsMembershipList'; +import type { GroupV2Membership } from '../components/conversation/conversation-details/ConversationDetailsMembershipList.js'; import type { GroupV2PendingMembership, GroupV2RequestingMembership, -} from '../components/conversation/conversation-details/PendingInvites'; -import type { ConversationType } from '../state/ducks/conversations'; -import type { ServiceIdString } from '../types/ServiceId'; -import { isConversationUnregistered } from './isConversationUnregistered'; +} from '../components/conversation/conversation-details/PendingInvites.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import type { ServiceIdString } from '../types/ServiceId.js'; +import { isConversationUnregistered } from './isConversationUnregistered.js'; export type GroupMemberships = { memberships: ReadonlyArray; diff --git a/ts/util/getICUMessageParams.ts b/ts/util/getICUMessageParams.ts index fe2b60a5d80..be54730501f 100644 --- a/ts/util/getICUMessageParams.ts +++ b/ts/util/getICUMessageParams.ts @@ -6,7 +6,7 @@ import type { MessageFormatElement, PluralOrSelectOption, } from '@formatjs/icu-messageformat-parser'; -import { missingCaseError } from './missingCaseError'; +import { missingCaseError } from './missingCaseError.js'; export type ICUMessageParamType = Readonly< | { diff --git a/ts/util/getLastMessage.ts b/ts/util/getLastMessage.ts index 54b5273a49e..fb7ef7c7e4b 100644 --- a/ts/util/getLastMessage.ts +++ b/ts/util/getLastMessage.ts @@ -1,12 +1,12 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationAttributesType } from '../model-types.d'; -import type { LastMessageType } from '../state/ducks/conversations'; -import { dropNull } from './dropNull'; -import { findAndFormatContact } from './findAndFormatContact'; -import { hydrateRanges } from '../types/BodyRange'; -import { stripNewlinesForLeftPane } from './stripNewlinesForLeftPane'; +import type { ConversationAttributesType } from '../model-types.d.ts'; +import type { LastMessageType } from '../state/ducks/conversations.js'; +import { dropNull } from './dropNull.js'; +import { findAndFormatContact } from './findAndFormatContact.js'; +import { hydrateRanges } from '../types/BodyRange.js'; +import { stripNewlinesForLeftPane } from './stripNewlinesForLeftPane.js'; export function getLastMessage( conversationAttrs: ConversationAttributesType diff --git a/ts/util/getLocalAttachmentUrl.ts b/ts/util/getLocalAttachmentUrl.ts index ce1ad31889f..cfde98e83d0 100644 --- a/ts/util/getLocalAttachmentUrl.ts +++ b/ts/util/getLocalAttachmentUrl.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import { isNumber } from 'lodash'; -import { strictAssert } from './assert'; +import { strictAssert } from './assert.js'; -import type { AttachmentType } from '../types/Attachment'; +import type { AttachmentType } from '../types/Attachment.js'; export enum AttachmentDisposition { Attachment = 'attachment', diff --git a/ts/util/getMacAndUpdateHmac.ts b/ts/util/getMacAndUpdateHmac.ts index a6d9d3ffa49..3232090fce3 100644 --- a/ts/util/getMacAndUpdateHmac.ts +++ b/ts/util/getMacAndUpdateHmac.ts @@ -5,7 +5,7 @@ import { Buffer } from 'node:buffer'; import { type Hmac } from 'node:crypto'; import { Transform } from 'node:stream'; -import { MAC_LENGTH } from '../types/Crypto'; +import { MAC_LENGTH } from '../types/Crypto.js'; /** * Updates an hmac with the stream except for the last MAC_LENGTH diff --git a/ts/util/getMessageAuthorText.ts b/ts/util/getMessageAuthorText.ts index 95db2068d15..5c0eb3aa935 100644 --- a/ts/util/getMessageAuthorText.ts +++ b/ts/util/getMessageAuthorText.ts @@ -4,9 +4,9 @@ import type { ConversationAttributesType, ReadonlyMessageAttributesType, -} from '../model-types.d'; -import { isIncoming, isOutgoing } from '../state/selectors/message'; -import { getTitle } from './getTitle'; +} from '../model-types.d.ts'; +import { isIncoming, isOutgoing } from '../state/selectors/message.js'; +import { getTitle } from './getTitle.js'; function getIncomingContact( messageAttributes: ReadonlyMessageAttributesType diff --git a/ts/util/getMessageConversation.ts b/ts/util/getMessageConversation.ts index d1db1019dfe..832aaebbdca 100644 --- a/ts/util/getMessageConversation.ts +++ b/ts/util/getMessageConversation.ts @@ -1,8 +1,8 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ReadonlyMessageAttributesType } from '../model-types.d'; -import type { ConversationModel } from '../models/conversations'; +import type { ReadonlyMessageAttributesType } from '../model-types.d.ts'; +import type { ConversationModel } from '../models/conversations.js'; export function getMessageConversation({ conversationId, diff --git a/ts/util/getMessageQueueTime.ts b/ts/util/getMessageQueueTime.ts index bb8b535faa0..d10d6abb860 100644 --- a/ts/util/getMessageQueueTime.ts +++ b/ts/util/getMessageQueueTime.ts @@ -1,9 +1,9 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import * as RemoteConfig from '../RemoteConfig'; -import { MONTH, SECOND } from './durations'; -import { parseIntWithFallback } from './parseIntWithFallback'; +import * as RemoteConfig from '../RemoteConfig.js'; +import { MONTH, SECOND } from './durations/index.js'; +import { parseIntWithFallback } from './parseIntWithFallback.js'; export function getMessageQueueTime(): number { return ( diff --git a/ts/util/getMessageSentTimestamp.ts b/ts/util/getMessageSentTimestamp.ts index 3ced8ede893..84698bf5523 100644 --- a/ts/util/getMessageSentTimestamp.ts +++ b/ts/util/getMessageSentTimestamp.ts @@ -1,9 +1,9 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ReadonlyMessageAttributesType } from '../model-types.d'; -import type { LoggerType } from '../types/Logging'; -import { assertDev } from './assert'; +import type { ReadonlyMessageAttributesType } from '../model-types.d.ts'; +import type { LoggerType } from '../types/Logging.js'; +import { assertDev } from './assert.js'; export type GetMessageSentTimestampOptionsType = Readonly<{ includeEdits?: boolean; diff --git a/ts/util/getMessageSentTimestampSet.ts b/ts/util/getMessageSentTimestampSet.ts index 321fc7d0e97..1fbffec1279 100644 --- a/ts/util/getMessageSentTimestampSet.ts +++ b/ts/util/getMessageSentTimestampSet.ts @@ -1,7 +1,7 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ReadonlyMessageAttributesType } from '../model-types.d'; +import type { ReadonlyMessageAttributesType } from '../model-types.d.ts'; export function getMessageSentTimestampSet({ sent_at: sentAt, diff --git a/ts/util/getMessageTimestamp.ts b/ts/util/getMessageTimestamp.ts index 7aa876c6c3a..4dba6457501 100644 --- a/ts/util/getMessageTimestamp.ts +++ b/ts/util/getMessageTimestamp.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ReadonlyMessageAttributesType } from '../model-types.d'; +import type { ReadonlyMessageAttributesType } from '../model-types.d.ts'; export function getMessageTimestamp( message: Pick diff --git a/ts/util/getMuteOptions.ts b/ts/util/getMuteOptions.ts index ec7244b104a..979b729b421 100644 --- a/ts/util/getMuteOptions.ts +++ b/ts/util/getMuteOptions.ts @@ -1,10 +1,10 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import * as durations from './durations'; -import type { LocalizerType } from '../types/Util'; -import { getMutedUntilText } from './getMutedUntilText'; -import { isConversationMuted } from './isConversationMuted'; +import * as durations from './durations/index.js'; +import type { LocalizerType } from '../types/Util.js'; +import { getMutedUntilText } from './getMutedUntilText.js'; +import { isConversationMuted } from './isConversationMuted.js'; export type MuteOption = { name: string; diff --git a/ts/util/getMutedUntilText.ts b/ts/util/getMutedUntilText.ts index 787f57fea59..1f08249cb6c 100644 --- a/ts/util/getMutedUntilText.ts +++ b/ts/util/getMutedUntilText.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import moment from 'moment'; -import type { LocalizerType } from '../types/Util'; -import { isToday } from './timestamp'; +import type { LocalizerType } from '../types/Util.js'; +import { isToday } from './timestamp.js'; /** * Returns something like "Muted until 6:09 PM", localized. diff --git a/ts/util/getNotificationDataForMessage.ts b/ts/util/getNotificationDataForMessage.ts index 259a56dbc6a..12d0a59f40d 100644 --- a/ts/util/getNotificationDataForMessage.ts +++ b/ts/util/getNotificationDataForMessage.ts @@ -3,32 +3,32 @@ import type { ReadonlyDeep } from 'type-fest'; -import type { RawBodyRange } from '../types/BodyRange'; -import type { ReadonlyMessageAttributesType } from '../model-types.d'; -import type { ICUStringMessageParamsByKeyType } from '../types/Util'; -import * as Attachment from '../types/Attachment'; -import * as EmbeddedContact from '../types/EmbeddedContact'; -import * as GroupChange from '../groupChange'; -import * as MIME from '../types/MIME'; -import * as Stickers from '../types/Stickers'; -import * as expirationTimer from './expirationTimer'; -import { createLogger } from '../logging/log'; -import { GiftBadgeStates } from '../components/conversation/Message'; -import { dropNull } from './dropNull'; -import { getCallHistorySelector } from '../state/selectors/callHistory'; -import { getCallSelector, getActiveCall } from '../state/selectors/calling'; -import { getCallingNotificationText } from './callingNotification'; +import type { RawBodyRange } from '../types/BodyRange.js'; +import type { ReadonlyMessageAttributesType } from '../model-types.d.ts'; +import type { ICUStringMessageParamsByKeyType } from '../types/Util.js'; +import * as Attachment from '../types/Attachment.js'; +import * as EmbeddedContact from '../types/EmbeddedContact.js'; +import * as GroupChange from '../groupChange.js'; +import * as MIME from '../types/MIME.js'; +import * as Stickers from '../types/Stickers.js'; +import * as expirationTimer from './expirationTimer.js'; +import { createLogger } from '../logging/log.js'; +import { GiftBadgeStates } from '../components/conversation/Message.js'; +import { dropNull } from './dropNull.js'; +import { getCallHistorySelector } from '../state/selectors/callHistory.js'; +import { getCallSelector, getActiveCall } from '../state/selectors/calling.js'; +import { getCallingNotificationText } from './callingNotification.js'; import { getConversationSelector, getSelectedMessageIds, getTargetedMessage, -} from '../state/selectors/conversations'; -import { getStringForConversationMerge } from './getStringForConversationMerge'; -import { getStringForProfileChange } from './getStringForProfileChange'; -import { getTitleNoDefault, getNumber } from './getTitle'; -import { findAndFormatContact } from './findAndFormatContact'; -import { isGroup, isMe } from './whatTypeOfConversation'; -import { strictAssert } from './assert'; +} from '../state/selectors/conversations.js'; +import { getStringForConversationMerge } from './getStringForConversationMerge.js'; +import { getStringForProfileChange } from './getStringForProfileChange.js'; +import { getTitleNoDefault, getNumber } from './getTitle.js'; +import { findAndFormatContact } from './findAndFormatContact.js'; +import { isGroup, isMe } from './whatTypeOfConversation.js'; +import { strictAssert } from './assert.js'; import { getPropsForCallHistory, hasErrors, @@ -48,15 +48,15 @@ import { isUnsupportedMessage, isConversationMerge, isMessageRequestResponse, -} from '../state/selectors/message'; +} from '../state/selectors/message.js'; import { getAuthor, messageHasPaymentEvent, getPaymentEventNotificationText, -} from '../messages/helpers'; -import { MessageRequestResponseEvent } from '../types/MessageRequestResponseEvent'; -import { missingCaseError } from './missingCaseError'; -import { getUserConversationId } from '../state/selectors/user'; +} from '../messages/helpers.js'; +import { MessageRequestResponseEvent } from '../types/MessageRequestResponseEvent.js'; +import { missingCaseError } from './missingCaseError.js'; +import { getUserConversationId } from '../state/selectors/user.js'; const log = createLogger('getNotificationDataForMessage'); diff --git a/ts/util/getNotificationTextForMessage.ts b/ts/util/getNotificationTextForMessage.ts index cca536d4876..b25e8f1c668 100644 --- a/ts/util/getNotificationTextForMessage.ts +++ b/ts/util/getNotificationTextForMessage.ts @@ -1,12 +1,12 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ReadonlyMessageAttributesType } from '../model-types.d'; -import { applyRangesToText, hydrateRanges } from '../types/BodyRange'; -import { findAndFormatContact } from './findAndFormatContact'; -import { getNotificationDataForMessage } from './getNotificationDataForMessage'; -import { isConversationAccepted } from './isConversationAccepted'; -import { strictAssert } from './assert'; +import type { ReadonlyMessageAttributesType } from '../model-types.d.ts'; +import { applyRangesToText, hydrateRanges } from '../types/BodyRange.js'; +import { findAndFormatContact } from './findAndFormatContact.js'; +import { getNotificationDataForMessage } from './getNotificationDataForMessage.js'; +import { isConversationAccepted } from './isConversationAccepted.js'; +import { strictAssert } from './assert.js'; export function getNotificationTextForMessage( attributes: ReadonlyMessageAttributesType diff --git a/ts/util/getProfile.ts b/ts/util/getProfile.ts index 1bee40103b9..02104852fd9 100644 --- a/ts/util/getProfile.ts +++ b/ts/util/getProfile.ts @@ -1,9 +1,9 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log'; -import { profileService } from '../services/profiles'; -import type { ServiceIdString } from '../types/ServiceId'; +import { createLogger } from '../logging/log.js'; +import { profileService } from '../services/profiles.js'; +import type { ServiceIdString } from '../types/ServiceId.js'; const log = createLogger('getProfile'); diff --git a/ts/util/getQuoteBodyText.ts b/ts/util/getQuoteBodyText.ts index 6407bf6977e..536525e8445 100644 --- a/ts/util/getQuoteBodyText.ts +++ b/ts/util/getQuoteBodyText.ts @@ -1,8 +1,8 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ReadonlyMessageAttributesType } from '../model-types.d'; -import * as EmbeddedContact from '../types/EmbeddedContact'; +import type { ReadonlyMessageAttributesType } from '../model-types.d.ts'; +import * as EmbeddedContact from '../types/EmbeddedContact.js'; export function getQuoteBodyText( messageAttributes: ReadonlyMessageAttributesType, diff --git a/ts/util/getRecipientConversationIds.ts b/ts/util/getRecipientConversationIds.ts index 67da2483a22..666b8293529 100644 --- a/ts/util/getRecipientConversationIds.ts +++ b/ts/util/getRecipientConversationIds.ts @@ -1,10 +1,10 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationAttributesType } from '../model-types.d'; +import type { ConversationAttributesType } from '../model-types.d.ts'; -import { getRecipients } from './getRecipients'; -import { strictAssert } from './assert'; +import { getRecipients } from './getRecipients.js'; +import { strictAssert } from './assert.js'; // Recipients includes only the people we'll actually send to for this conversation export function getRecipientConversationIds( diff --git a/ts/util/getRecipients.ts b/ts/util/getRecipients.ts index cc9ec4344bc..0aa1a3d11ac 100644 --- a/ts/util/getRecipients.ts +++ b/ts/util/getRecipients.ts @@ -3,13 +3,13 @@ import { compact, uniq } from 'lodash'; -import type { ConversationAttributesType } from '../model-types.d'; +import type { ConversationAttributesType } from '../model-types.d.ts'; -import type { ServiceIdString } from '../types/ServiceId'; -import { getConversationMembers } from './getConversationMembers'; -import { getSendTarget } from './getSendTarget'; -import { isDirectConversation, isMe } from './whatTypeOfConversation'; -import { isNotNil } from './isNotNil'; +import type { ServiceIdString } from '../types/ServiceId.js'; +import { getConversationMembers } from './getConversationMembers.js'; +import { getSendTarget } from './getSendTarget.js'; +import { isDirectConversation, isMe } from './whatTypeOfConversation.js'; +import { isNotNil } from './isNotNil.js'; export function getRecipients( conversationAttributes: ConversationAttributesType, diff --git a/ts/util/getRecipientsByConversation.ts b/ts/util/getRecipientsByConversation.ts index 46d80d789e5..a5df115d7dc 100644 --- a/ts/util/getRecipientsByConversation.ts +++ b/ts/util/getRecipientsByConversation.ts @@ -1,12 +1,12 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationAttributesType } from '../model-types'; -import type { RecipientsByConversation } from '../state/ducks/stories'; -import type { ServiceIdString } from '../types/ServiceId'; +import type { ConversationAttributesType } from '../model-types.js'; +import type { RecipientsByConversation } from '../state/ducks/stories.js'; +import type { ServiceIdString } from '../types/ServiceId.js'; -import { getConversationMembers } from './getConversationMembers'; -import { isNotNil } from './isNotNil'; +import { getConversationMembers } from './getConversationMembers.js'; +import { isNotNil } from './isNotNil.js'; export function getRecipientsByConversation( conversations: Array diff --git a/ts/util/getSendOptions.ts b/ts/util/getSendOptions.ts index aa383db9fa8..84d726395fe 100644 --- a/ts/util/getSendOptions.ts +++ b/ts/util/getSendOptions.ts @@ -1,22 +1,22 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationAttributesType } from '../model-types.d'; +import type { ConversationAttributesType } from '../model-types.d.ts'; import type { SendIdentifierData, SendMetadataType, SendOptionsType, -} from '../textsecure/SendMessage'; -import { getConversationMembers } from './getConversationMembers'; -import { isDirectConversation, isMe } from './whatTypeOfConversation'; -import { senderCertificateService } from '../services/senderCertificate'; -import { shouldSharePhoneNumberWith } from './phoneNumberSharingMode'; -import type { SerializedCertificateType } from '../textsecure/OutgoingMessage'; -import { SenderCertificateMode } from '../textsecure/OutgoingMessage'; -import { ZERO_ACCESS_KEY, SEALED_SENDER } from '../types/SealedSender'; -import { isNotNil } from './isNotNil'; -import { maybeCreateGroupSendEndorsementState } from './groupSendEndorsements'; -import { missingCaseError } from './missingCaseError'; +} from '../textsecure/SendMessage.js'; +import { getConversationMembers } from './getConversationMembers.js'; +import { isDirectConversation, isMe } from './whatTypeOfConversation.js'; +import { senderCertificateService } from '../services/senderCertificate.js'; +import { shouldSharePhoneNumberWith } from './phoneNumberSharingMode.js'; +import type { SerializedCertificateType } from '../textsecure/OutgoingMessage.js'; +import { SenderCertificateMode } from '../textsecure/OutgoingMessage.js'; +import { ZERO_ACCESS_KEY, SEALED_SENDER } from '../types/SealedSender.js'; +import { isNotNil } from './isNotNil.js'; +import { maybeCreateGroupSendEndorsementState } from './groupSendEndorsements.js'; +import { missingCaseError } from './missingCaseError.js'; export async function getSendOptionsForRecipients( recipients: ReadonlyArray, diff --git a/ts/util/getSendTarget.ts b/ts/util/getSendTarget.ts index 66193a2daf1..b72a3504772 100644 --- a/ts/util/getSendTarget.ts +++ b/ts/util/getSendTarget.ts @@ -1,8 +1,8 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationAttributesType } from '../model-types.d'; -import type { ServiceIdString } from '../types/ServiceId'; +import type { ConversationAttributesType } from '../model-types.d.ts'; +import type { ServiceIdString } from '../types/ServiceId.js'; export function getSendTarget({ serviceId, diff --git a/ts/util/getSenderIdentifier.ts b/ts/util/getSenderIdentifier.ts index a269ec923ae..b32a2c4d968 100644 --- a/ts/util/getSenderIdentifier.ts +++ b/ts/util/getSenderIdentifier.ts @@ -1,7 +1,7 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ReadonlyMessageAttributesType } from '../model-types.d'; +import type { ReadonlyMessageAttributesType } from '../model-types.d.ts'; export function getSenderIdentifier({ sent_at: sentAt, diff --git a/ts/util/getServiceIdsForE164s.ts b/ts/util/getServiceIdsForE164s.ts index fe4723baa31..64d25ba2190 100644 --- a/ts/util/getServiceIdsForE164s.ts +++ b/ts/util/getServiceIdsForE164s.ts @@ -1,12 +1,12 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { CDSResponseType } from '../textsecure/cds/Types.d'; -import type { WebAPIType } from '../textsecure/WebAPI'; -import type { AciString } from '../types/ServiceId'; -import { createLogger } from '../logging/log'; -import { isDirectConversation, isMe } from './whatTypeOfConversation'; -import { parseNumber } from './libphonenumberUtil'; +import type { CDSResponseType } from '../textsecure/cds/Types.d.ts'; +import type { WebAPIType } from '../textsecure/WebAPI.js'; +import type { AciString } from '../types/ServiceId.js'; +import { createLogger } from '../logging/log.js'; +import { isDirectConversation, isMe } from './whatTypeOfConversation.js'; +import { parseNumber } from './libphonenumberUtil.js'; const log = createLogger('getServiceIdsForE164s'); diff --git a/ts/util/getSignalConnections.ts b/ts/util/getSignalConnections.ts index 42991770329..0b6bdaff1e7 100644 --- a/ts/util/getSignalConnections.ts +++ b/ts/util/getSignalConnections.ts @@ -1,14 +1,14 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationAttributesType } from '../model-types.d'; -import type { ConversationModel } from '../models/conversations'; -import type { ConversationType } from '../state/ducks/conversations'; -import { isInSystemContacts } from './isInSystemContacts'; -import { isSignalConversation } from './isSignalConversation'; -import { isDirectConversation } from './whatTypeOfConversation'; -import { isConversationEverUnregistered } from './isConversationUnregistered'; -import { isBlocked } from './isBlocked'; +import type { ConversationAttributesType } from '../model-types.d.ts'; +import type { ConversationModel } from '../models/conversations.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import { isInSystemContacts } from './isInSystemContacts.js'; +import { isSignalConversation } from './isSignalConversation.js'; +import { isDirectConversation } from './whatTypeOfConversation.js'; +import { isConversationEverUnregistered } from './isConversationUnregistered.js'; +import { isBlocked } from './isBlocked.js'; export function isSignalConnection( conversation: ConversationType | ConversationAttributesType diff --git a/ts/util/getStoryBackground.ts b/ts/util/getStoryBackground.ts index 051e633354f..ed34979a2ec 100644 --- a/ts/util/getStoryBackground.ts +++ b/ts/util/getStoryBackground.ts @@ -1,7 +1,10 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AttachmentType, TextAttachmentType } from '../types/Attachment'; +import type { + AttachmentType, + TextAttachmentType, +} from '../types/Attachment.js'; const COLOR_BLACK_ALPHA_90 = 'rgba(0, 0, 0, 0.9)'; export const COLOR_BLACK_INT = 4278190080; diff --git a/ts/util/getStoryDuration.ts b/ts/util/getStoryDuration.ts index b357c3d0b51..2cd9a50ce15 100644 --- a/ts/util/getStoryDuration.ts +++ b/ts/util/getStoryDuration.ts @@ -1,18 +1,18 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AttachmentType } from '../types/Attachment'; +import type { AttachmentType } from '../types/Attachment.js'; import { hasFailed, hasNotResolved, isDownloaded, isGIF, isVideo, -} from '../types/Attachment'; -import { count } from './grapheme'; -import { SECOND } from './durations'; -import { createLogger } from '../logging/log'; -import * as Errors from '../types/errors'; +} from '../types/Attachment.js'; +import { count } from './grapheme.js'; +import { SECOND } from './durations/index.js'; +import { createLogger } from '../logging/log.js'; +import * as Errors from '../types/errors.js'; const log = createLogger('getStoryDuration'); diff --git a/ts/util/getStoryReplyText.ts b/ts/util/getStoryReplyText.ts index a39ce414f8d..b39542134ba 100644 --- a/ts/util/getStoryReplyText.ts +++ b/ts/util/getStoryReplyText.ts @@ -1,9 +1,9 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AttachmentType } from '../types/Attachment'; -import type { LocalizerType } from '../types/Util'; -import { isGIF, isImage, isVideo } from '../types/Attachment'; +import type { AttachmentType } from '../types/Attachment.js'; +import type { LocalizerType } from '../types/Util.js'; +import { isGIF, isImage, isVideo } from '../types/Attachment.js'; export function getStoryReplyText( i18n: LocalizerType, diff --git a/ts/util/getStreamWithTimeout.ts b/ts/util/getStreamWithTimeout.ts index 2bc88426cfa..fe7d39072a8 100644 --- a/ts/util/getStreamWithTimeout.ts +++ b/ts/util/getStreamWithTimeout.ts @@ -1,12 +1,12 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { Transform } from 'stream'; -import type { Readable } from 'stream'; +import { Transform } from 'node:stream'; +import type { Readable } from 'node:stream'; -import * as Bytes from '../Bytes'; -import { clearTimeoutIfNecessary } from './clearTimeoutIfNecessary'; -import { explodePromise } from './explodePromise'; +import * as Bytes from '../Bytes.js'; +import { clearTimeoutIfNecessary } from './clearTimeoutIfNecessary.js'; +import { explodePromise } from './explodePromise.js'; export type OptionsType = Readonly<{ name: string; diff --git a/ts/util/getStringForConversationMerge.ts b/ts/util/getStringForConversationMerge.ts index a2a424795e1..ab4914dcc9b 100644 --- a/ts/util/getStringForConversationMerge.ts +++ b/ts/util/getStringForConversationMerge.ts @@ -1,7 +1,7 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { LocalizerType } from '../types/Util'; +import type { LocalizerType } from '../types/Util.js'; export function getStringForConversationMerge({ obsoleteConversationTitle, diff --git a/ts/util/getStringForPhoneNumberDiscovery.ts b/ts/util/getStringForPhoneNumberDiscovery.ts index 4681774a4db..7d3510a95aa 100644 --- a/ts/util/getStringForPhoneNumberDiscovery.ts +++ b/ts/util/getStringForPhoneNumberDiscovery.ts @@ -1,7 +1,7 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { LocalizerType } from '../types/Util'; +import type { LocalizerType } from '../types/Util.js'; export function getStringForPhoneNumberDiscovery({ phoneNumber, diff --git a/ts/util/getStringForProfileChange.ts b/ts/util/getStringForProfileChange.ts index 2b557803897..9a18a6a827a 100644 --- a/ts/util/getStringForProfileChange.ts +++ b/ts/util/getStringForProfileChange.ts @@ -1,7 +1,7 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { LocalizerType } from '../types/Util'; +import type { LocalizerType } from '../types/Util.js'; export type ProfileNameChangeType = { type: 'name'; diff --git a/ts/util/getThemeType.ts b/ts/util/getThemeType.ts index 13fa5018fe1..7072c4080f4 100644 --- a/ts/util/getThemeType.ts +++ b/ts/util/getThemeType.ts @@ -1,8 +1,8 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { SystemThemeType, ThemeType } from '../types/Util'; -import { missingCaseError } from './missingCaseError'; +import { SystemThemeType, ThemeType } from '../types/Util.js'; +import { missingCaseError } from './missingCaseError.js'; export async function getThemeType(): Promise { const themeSetting = await window.Events.getThemeSetting(); diff --git a/ts/util/getTitle.ts b/ts/util/getTitle.ts index bfc2041d09b..bfe6e2f696a 100644 --- a/ts/util/getTitle.ts +++ b/ts/util/getTitle.ts @@ -4,11 +4,11 @@ import type { ConversationAttributesType, ConversationRenderInfoType, -} from '../model-types.d'; -import { combineNames } from './combineNames'; -import { getRegionCodeForNumber } from './libphonenumberUtil'; -import { isDirectConversation } from './whatTypeOfConversation'; -import { getE164 } from './getE164'; +} from '../model-types.d.ts'; +import { combineNames } from './combineNames.js'; +import { getRegionCodeForNumber } from './libphonenumberUtil.js'; +import { isDirectConversation } from './whatTypeOfConversation.js'; +import { getE164 } from './getE164.js'; type TitleOptions = { isShort?: boolean; diff --git a/ts/util/getUserAgent.ts b/ts/util/getUserAgent.ts index 3e7c379d0c1..66999da4504 100644 --- a/ts/util/getUserAgent.ts +++ b/ts/util/getUserAgent.ts @@ -1,9 +1,9 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import os from 'os'; +import os from 'node:os'; -import { getOwn } from './getOwn'; +import { getOwn } from './getOwn.js'; const PLATFORM_STRINGS: { [platform: string]: string } = { win32: 'Windows', diff --git a/ts/util/grapheme.ts b/ts/util/grapheme.ts index dd245e2974b..fa29056833f 100644 --- a/ts/util/grapheme.ts +++ b/ts/util/grapheme.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { map, size, take, join } from './iterables'; +import { map, size, take, join } from './iterables.js'; export function getGraphemes(str: string): Iterable { const segments = new Intl.Segmenter().segment(str); diff --git a/ts/util/groupAndOrderReactions.ts b/ts/util/groupAndOrderReactions.ts index 340e257affd..0d096a222de 100644 --- a/ts/util/groupAndOrderReactions.ts +++ b/ts/util/groupAndOrderReactions.ts @@ -4,7 +4,7 @@ import { groupBy, orderBy } from 'lodash'; import { useMemo } from 'react'; -import type { Reaction } from '../components/conversation/ReactionViewer'; +import type { Reaction } from '../components/conversation/ReactionViewer.js'; import { isEmojiVariantValue, getEmojiVariantKeyByValue, @@ -12,9 +12,9 @@ import { getEmojiVariantByKey, type EmojiVariantKey, type EmojiParentKey, -} from '../components/fun/data/emojis'; -import { isNotNil } from './isNotNil'; -import { useFunEmojiLocalizer } from '../components/fun/useFunEmojiLocalizer'; +} from '../components/fun/data/emojis.js'; +import { isNotNil } from './isNotNil.js'; +import { useFunEmojiLocalizer } from '../components/fun/useFunEmojiLocalizer.js'; type ReactionWithEmojiData = Reaction & { short_name: string | undefined; diff --git a/ts/util/groupMemberNameCollisions.ts b/ts/util/groupMemberNameCollisions.ts index a9ffd9b8afc..57b3de75508 100644 --- a/ts/util/groupMemberNameCollisions.ts +++ b/ts/util/groupMemberNameCollisions.ts @@ -3,11 +3,11 @@ import { mapValues, pickBy } from 'lodash'; import type { ReadonlyDeep } from 'type-fest'; -import { groupBy, map, filter } from './iterables'; -import { getOwn } from './getOwn'; -import type { ConversationType } from '../state/ducks/conversations'; -import { isConversationNameKnown } from './isConversationNameKnown'; -import { isInSystemContacts } from './isInSystemContacts'; +import { groupBy, map, filter } from './iterables.js'; +import { getOwn } from './getOwn.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import { isConversationNameKnown } from './isConversationNameKnown.js'; +import { isInSystemContacts } from './isInSystemContacts.js'; export type GroupNameCollisionsWithIdsByTitle = Readonly< Record> diff --git a/ts/util/groupMembershipUtils.ts b/ts/util/groupMembershipUtils.ts index 7978c9c73f8..338d9b557be 100644 --- a/ts/util/groupMembershipUtils.ts +++ b/ts/util/groupMembershipUtils.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import isNumber from 'lodash/isNumber'; -import type { ConversationAttributesType } from '../model-types.d'; -import type { ServiceIdString, AciString } from '../types/ServiceId'; -import { SignalService as Proto } from '../protobuf'; -import { isDirectConversation, isGroupV2 } from './whatTypeOfConversation'; +import type { ConversationAttributesType } from '../model-types.d.ts'; +import type { ServiceIdString, AciString } from '../types/ServiceId.js'; +import { SignalService as Proto } from '../protobuf/index.js'; +import { isDirectConversation, isGroupV2 } from './whatTypeOfConversation.js'; export function isMemberPending( conversationAttrs: Pick< diff --git a/ts/util/groupSendEndorsements.ts b/ts/util/groupSendEndorsements.ts index dd7252bee00..ac7650d6d4a 100644 --- a/ts/util/groupSendEndorsements.ts +++ b/ts/util/groupSendEndorsements.ts @@ -2,37 +2,37 @@ // SPDX-License-Identifier: AGPL-3.0-only import { Aci } from '@signalapp/libsignal-client'; import { throttle } from 'lodash'; +import { + groupSendEndorsementsDataSchema, + toGroupSendToken, +} from '../types/GroupSendEndorsements.js'; import type { GroupSendCombinedEndorsementRecord, GroupSendMemberEndorsementRecord, GroupSendToken, -} from '../types/GroupSendEndorsements'; -import { - groupSendEndorsementsDataSchema, - toGroupSendToken, - type GroupSendEndorsementsData, -} from '../types/GroupSendEndorsements'; -import { devDebugger, strictAssert } from './assert'; + GroupSendEndorsementsData, +} from '../types/GroupSendEndorsements.js'; +import { devDebugger, strictAssert } from './assert.js'; import { GroupSecretParams, GroupSendEndorsement, GroupSendEndorsementsResponse, ServerPublicParams, -} from './zkgroup'; -import type { ServiceIdString } from '../types/ServiceId'; -import { fromAciObject } from '../types/ServiceId'; -import { createLogger } from '../logging/log'; -import type { GroupV2MemberType } from '../model-types'; -import { DurationInSeconds, MINUTE } from './durations'; -import { ToastType } from '../types/Toast'; -import * as Errors from '../types/errors'; -import { isTestOrMockEnvironment } from '../environment'; -import { isNightly } from './version'; -import { parseStrict } from './schemas'; -import { DataReader } from '../sql/Client'; -import { maybeUpdateGroup } from '../groups'; -import * as Bytes from '../Bytes'; -import { isGroupV2 } from './whatTypeOfConversation'; +} from './zkgroup.js'; +import type { ServiceIdString } from '../types/ServiceId.js'; +import { fromAciObject } from '../types/ServiceId.js'; +import { createLogger } from '../logging/log.js'; +import type { GroupV2MemberType } from '../model-types.js'; +import { DurationInSeconds, MINUTE } from './durations/index.js'; +import { ToastType } from '../types/Toast.js'; +import * as Errors from '../types/errors.js'; +import { isTestOrMockEnvironment } from '../environment.js'; +import { isNightly } from './version.js'; +import { parseStrict } from './schemas.js'; +import { DataReader } from '../sql/Client.js'; +import { maybeUpdateGroup } from '../groups.js'; +import * as Bytes from '../Bytes.js'; +import { isGroupV2 } from './whatTypeOfConversation.js'; const log = createLogger('groupSendEndorsements'); diff --git a/ts/util/handleEditMessage.ts b/ts/util/handleEditMessage.ts index d978fc65484..a802f7f85ea 100644 --- a/ts/util/handleEditMessage.ts +++ b/ts/util/handleEditMessage.ts @@ -1,33 +1,33 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AttachmentType } from '../types/Attachment'; -import type { EditAttributesType } from '../messageModifiers/Edits'; +import type { AttachmentType } from '../types/Attachment.js'; +import type { EditAttributesType } from '../messageModifiers/Edits.js'; import type { EditHistoryType, MessageAttributesType, QuotedMessageType, -} from '../model-types.d'; -import * as Edits from '../messageModifiers/Edits'; -import { createLogger } from '../logging/log'; -import { ReadStatus } from '../messages/MessageReadStatus'; -import { DataWriter } from '../sql/Client'; -import { drop } from './drop'; +} from '../model-types.d.ts'; +import * as Edits from '../messageModifiers/Edits.js'; +import { createLogger } from '../logging/log.js'; +import { ReadStatus } from '../messages/MessageReadStatus.js'; +import { DataWriter } from '../sql/Client.js'; +import { drop } from './drop.js'; import { cacheAttachmentBySignature, getCachedAttachmentBySignature, isVoiceMessage, -} from '../types/Attachment'; -import { isAciString } from './isAciString'; -import { getMessageIdForLogging } from './idForLogging'; -import { hasErrors } from '../state/selectors/message'; -import { isIncoming, isOutgoing } from '../messages/helpers'; -import { isDirectConversation } from './whatTypeOfConversation'; -import { isTooOldToModifyMessage } from './isTooOldToModifyMessage'; -import { queueAttachmentDownloads } from './queueAttachmentDownloads'; -import { modifyTargetMessage } from './modifyTargetMessage'; -import { isMessageNoteToSelf } from './isMessageNoteToSelf'; -import { MessageModel } from '../models/messages'; +} from '../types/Attachment.js'; +import { isAciString } from './isAciString.js'; +import { getMessageIdForLogging } from './idForLogging.js'; +import { hasErrors } from '../state/selectors/message.js'; +import { isIncoming, isOutgoing } from '../messages/helpers.js'; +import { isDirectConversation } from './whatTypeOfConversation.js'; +import { isTooOldToModifyMessage } from './isTooOldToModifyMessage.js'; +import { queueAttachmentDownloads } from './queueAttachmentDownloads.js'; +import { modifyTargetMessage } from './modifyTargetMessage.js'; +import { isMessageNoteToSelf } from './isMessageNoteToSelf.js'; +import { MessageModel } from '../models/messages.js'; const log = createLogger('handleEditMessage'); diff --git a/ts/util/handleImageAttachment.ts b/ts/util/handleImageAttachment.ts index b9bd798ba58..129c1a1d2cd 100644 --- a/ts/util/handleImageAttachment.ts +++ b/ts/util/handleImageAttachment.ts @@ -1,17 +1,17 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import path from 'path'; +import path from 'node:path'; import { ipcRenderer } from 'electron'; import { v4 as genUuid } from 'uuid'; -import { blobToArrayBuffer } from '../types/VisualAttachment'; -import type { MIMEType } from '../types/MIME'; -import { IMAGE_JPEG, isHeic, stringToMIMEType } from '../types/MIME'; -import type { InMemoryAttachmentDraftType } from '../types/Attachment'; -import { canBeTranscoded } from '../types/Attachment'; -import { imageToBlurHash } from './imageToBlurHash'; -import { scaleImageToLevel } from './scaleImageToLevel'; +import { blobToArrayBuffer } from '../types/VisualAttachment.js'; +import type { MIMEType } from '../types/MIME.js'; +import { IMAGE_JPEG, isHeic, stringToMIMEType } from '../types/MIME.js'; +import type { InMemoryAttachmentDraftType } from '../types/Attachment.js'; +import { canBeTranscoded } from '../types/Attachment.js'; +import { imageToBlurHash } from './imageToBlurHash.js'; +import { scaleImageToLevel } from './scaleImageToLevel.js'; export async function handleImageAttachment( file: File diff --git a/ts/util/handleMessageSend.ts b/ts/util/handleMessageSend.ts index 4e8d9629758..6ee80419d4c 100644 --- a/ts/util/handleMessageSend.ts +++ b/ts/util/handleMessageSend.ts @@ -3,18 +3,18 @@ import { z } from 'zod'; import { isBoolean, isNumber } from 'lodash'; -import type { CallbackResultType } from '../textsecure/Types.d'; -import { DataWriter } from '../sql/Client'; -import { createLogger } from '../logging/log'; +import type { CallbackResultType } from '../textsecure/Types.d.ts'; +import { DataWriter } from '../sql/Client.js'; +import { createLogger } from '../logging/log.js'; import { OutgoingMessageError, SendMessageNetworkError, SendMessageProtoError, UnregisteredUserError, -} from '../textsecure/Errors'; -import { SEALED_SENDER } from '../types/SealedSender'; -import type { ServiceIdString } from '../types/ServiceId'; -import { drop } from './drop'; +} from '../textsecure/Errors.js'; +import { SEALED_SENDER } from '../types/SealedSender.js'; +import type { ServiceIdString } from '../types/ServiceId.js'; +import { drop } from './drop.js'; const log = createLogger('handleMessageSend'); diff --git a/ts/util/handleOutsideClick.ts b/ts/util/handleOutsideClick.ts index da902e610a8..97e81fada07 100644 --- a/ts/util/handleOutsideClick.ts +++ b/ts/util/handleOutsideClick.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { RefObject } from 'react'; -import { createLogger } from '../logging/log'; +import { createLogger } from '../logging/log.js'; const log = createLogger('handleOutsideClick'); diff --git a/ts/util/handleRetry.ts b/ts/util/handleRetry.ts index bf68c0ab870..aea864689ca 100644 --- a/ts/util/handleRetry.ts +++ b/ts/util/handleRetry.ts @@ -8,21 +8,21 @@ import { import { isNumber, random } from 'lodash'; import type PQueue from 'p-queue'; -import * as Bytes from '../Bytes'; -import { DataReader, DataWriter } from '../sql/Client'; -import { isProduction } from './version'; -import { strictAssert } from './assert'; -import { isGroupV2 } from './whatTypeOfConversation'; -import { isOlderThan } from './timestamp'; -import { parseIntOrThrow } from './parseIntOrThrow'; -import * as RemoteConfig from '../RemoteConfig'; -import { Address } from '../types/Address'; -import { QualifiedAddress } from '../types/QualifiedAddress'; -import type { AciString, ServiceIdString } from '../types/ServiceId'; -import { ToastType } from '../types/Toast'; -import * as Errors from '../types/errors'; +import * as Bytes from '../Bytes.js'; +import { DataReader, DataWriter } from '../sql/Client.js'; +import { isProduction } from './version.js'; +import { strictAssert } from './assert.js'; +import { isGroupV2 } from './whatTypeOfConversation.js'; +import { isOlderThan } from './timestamp.js'; +import { parseIntOrThrow } from './parseIntOrThrow.js'; +import * as RemoteConfig from '../RemoteConfig.js'; +import { Address } from '../types/Address.js'; +import { QualifiedAddress } from '../types/QualifiedAddress.js'; +import type { AciString, ServiceIdString } from '../types/ServiceId.js'; +import { ToastType } from '../types/Toast.js'; +import * as Errors from '../types/errors.js'; -import type { ConversationModel } from '../models/conversations'; +import type { ConversationModel } from '../models/conversations.js'; import type { DecryptionErrorEvent, DecryptionErrorEventData, @@ -30,17 +30,17 @@ import type { RetryRequestEvent, RetryRequestEventData, SuccessfulDecryptEvent, -} from '../textsecure/messageReceiverEvents'; +} from '../textsecure/messageReceiverEvents.js'; -import { SignalService as Proto } from '../protobuf'; -import { createLogger } from '../logging/log'; -import type MessageSender from '../textsecure/SendMessage'; -import type { StoryDistributionListDataType } from '../state/ducks/storyDistributionLists'; -import { drop } from './drop'; -import { conversationJobQueue } from '../jobs/conversationJobQueue'; -import { incrementMessageCounter } from './incrementMessageCounter'; -import { SECOND } from './durations'; -import { sleep } from './sleep'; +import { SignalService as Proto } from '../protobuf/index.js'; +import { createLogger } from '../logging/log.js'; +import type MessageSender from '../textsecure/SendMessage.js'; +import type { StoryDistributionListDataType } from '../state/ducks/storyDistributionLists.js'; +import { drop } from './drop.js'; +import { conversationJobQueue } from '../jobs/conversationJobQueue.js'; +import { incrementMessageCounter } from './incrementMessageCounter.js'; +import { SECOND } from './durations/index.js'; +import { sleep } from './sleep.js'; const log = createLogger('handleRetry'); diff --git a/ts/util/handleServerAlerts.ts b/ts/util/handleServerAlerts.ts index 525f2836faa..645d1d60a3f 100644 --- a/ts/util/handleServerAlerts.ts +++ b/ts/util/handleServerAlerts.ts @@ -1,12 +1,12 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log'; -import { isMoreRecentThan } from './timestamp'; -import { DAY, WEEK } from './durations'; -import { isNotNil } from './isNotNil'; -import { clearTimeoutIfNecessary } from './clearTimeoutIfNecessary'; -import { safeSetTimeout } from './timeout'; +import { createLogger } from '../logging/log.js'; +import { isMoreRecentThan } from './timestamp.js'; +import { DAY, WEEK } from './durations/index.js'; +import { isNotNil } from './isNotNil.js'; +import { clearTimeoutIfNecessary } from './clearTimeoutIfNecessary.js'; +import { safeSetTimeout } from './timeout.js'; const log = createLogger('handleServerAlerts'); diff --git a/ts/util/handleVideoAttachment.ts b/ts/util/handleVideoAttachment.ts index 960ca3add47..ce79f5c9e9f 100644 --- a/ts/util/handleVideoAttachment.ts +++ b/ts/util/handleVideoAttachment.ts @@ -4,10 +4,10 @@ import { blobToArrayBuffer } from 'blob-util'; import { v4 as generateUuid } from 'uuid'; -import { makeVideoScreenshot } from '../types/VisualAttachment'; -import { IMAGE_PNG, stringToMIMEType } from '../types/MIME'; -import type { InMemoryAttachmentDraftType } from '../types/Attachment'; -import { fileToBytes } from './fileToBytes'; +import { makeVideoScreenshot } from '../types/VisualAttachment.js'; +import { IMAGE_PNG, stringToMIMEType } from '../types/MIME.js'; +import type { InMemoryAttachmentDraftType } from '../types/Attachment.js'; +import { fileToBytes } from './fileToBytes.js'; export async function handleVideoAttachment( file: File, diff --git a/ts/util/hasAttachmentDownloads.ts b/ts/util/hasAttachmentDownloads.ts index 6222f0e624c..98e8bb84a3b 100644 --- a/ts/util/hasAttachmentDownloads.ts +++ b/ts/util/hasAttachmentDownloads.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import { partition } from 'lodash'; -import type { ReadonlyMessageAttributesType } from '../model-types.d'; -import { isLongMessage } from '../types/MIME'; +import type { ReadonlyMessageAttributesType } from '../model-types.d.ts'; +import { isLongMessage } from '../types/MIME.js'; // NOTE: If you're modifying this function then you'll likely also need // to modify ./queueAttachmentDownloads diff --git a/ts/util/hasDraft.ts b/ts/util/hasDraft.ts index 9c3aff6e278..2023e65b7bf 100644 --- a/ts/util/hasDraft.ts +++ b/ts/util/hasDraft.ts @@ -1,7 +1,7 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationAttributesType } from '../model-types'; +import type { ConversationAttributesType } from '../model-types.js'; export function hasDraft(attributes: ConversationAttributesType): boolean { const draftAttachments = attributes.draftAttachments || []; diff --git a/ts/util/hasDraftAttachments.ts b/ts/util/hasDraftAttachments.ts index 2ac7620fd57..e61a45b81b9 100644 --- a/ts/util/hasDraftAttachments.ts +++ b/ts/util/hasDraftAttachments.ts @@ -1,7 +1,7 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AttachmentDraftType } from '../types/Attachment'; +import type { AttachmentDraftType } from '../types/Attachment.js'; export function hasDraftAttachments( draftAttachments: ReadonlyArray | undefined, diff --git a/ts/util/hydrateStoryContext.ts b/ts/util/hydrateStoryContext.ts index ad740b1c3e2..e6bd81669fc 100644 --- a/ts/util/hydrateStoryContext.ts +++ b/ts/util/hydrateStoryContext.ts @@ -2,18 +2,18 @@ // SPDX-License-Identifier: AGPL-3.0-only import omit from 'lodash/omit'; -import { createLogger } from '../logging/log'; -import type { AttachmentType } from '../types/Attachment'; -import type { MessageAttributesType } from '../model-types.d'; -import { getAttachmentsForMessage } from '../state/selectors/message'; -import { isAciString } from './isAciString'; -import { isDirectConversation } from './whatTypeOfConversation'; -import { softAssert, strictAssert } from './assert'; -import { getMessageSentTimestamp } from './getMessageSentTimestamp'; -import { isOlderThan } from './timestamp'; -import { DAY } from './durations'; -import { getMessageById } from '../messages/getMessageById'; -import { MessageModel } from '../models/messages'; +import { createLogger } from '../logging/log.js'; +import type { AttachmentType } from '../types/Attachment.js'; +import type { MessageAttributesType } from '../model-types.d.ts'; +import { getAttachmentsForMessage } from '../state/selectors/message.js'; +import { isAciString } from './isAciString.js'; +import { isDirectConversation } from './whatTypeOfConversation.js'; +import { softAssert, strictAssert } from './assert.js'; +import { getMessageSentTimestamp } from './getMessageSentTimestamp.js'; +import { isOlderThan } from './timestamp.js'; +import { DAY } from './durations/index.js'; +import { getMessageById } from '../messages/getMessageById.js'; +import { MessageModel } from '../models/messages.js'; const log = createLogger('hydrateStoryContext'); diff --git a/ts/util/idForLogging.ts b/ts/util/idForLogging.ts index c3844304cdf..ceb44fe5833 100644 --- a/ts/util/idForLogging.ts +++ b/ts/util/idForLogging.ts @@ -4,15 +4,15 @@ import type { ConversationAttributesType, ReadonlyMessageAttributesType, -} from '../model-types.d'; +} from '../model-types.d.ts'; import { getSource, getSourceDevice, getSourceServiceId, -} from '../messages/helpers'; -import { isDirectConversation, isGroupV2 } from './whatTypeOfConversation'; -import { getE164 } from './getE164'; -import type { ConversationType } from '../state/ducks/conversations'; +} from '../messages/helpers.js'; +import { isDirectConversation, isGroupV2 } from './whatTypeOfConversation.js'; +import { getE164 } from './getE164.js'; +import type { ConversationType } from '../state/ducks/conversations.js'; export function getMessageIdForLogging( message: Pick< diff --git a/ts/util/imagePathToBytes.ts b/ts/util/imagePathToBytes.ts index 817c9bc621d..da2c369b529 100644 --- a/ts/util/imagePathToBytes.ts +++ b/ts/util/imagePathToBytes.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { canvasToBytes } from './canvasToBytes'; +import { canvasToBytes } from './canvasToBytes.js'; export async function imagePathToBytes(src: string): Promise { const image = new Image(); diff --git a/ts/util/incrementMessageCounter.ts b/ts/util/incrementMessageCounter.ts index b0dcd202538..881e4ba76ff 100644 --- a/ts/util/incrementMessageCounter.ts +++ b/ts/util/incrementMessageCounter.ts @@ -3,10 +3,10 @@ import { debounce, isNumber } from 'lodash'; -import { strictAssert } from './assert'; -import { safeParseInteger } from './numbers'; -import { DataReader } from '../sql/Client'; -import { createLogger } from '../logging/log'; +import { strictAssert } from './assert.js'; +import { safeParseInteger } from './numbers.js'; +import { DataReader } from '../sql/Client.js'; +import { createLogger } from '../logging/log.js'; const log = createLogger('incrementMessageCounter'); diff --git a/ts/util/isAciString.ts b/ts/util/isAciString.ts index 4ba88a97601..8fd94e47cdb 100644 --- a/ts/util/isAciString.ts +++ b/ts/util/isAciString.ts @@ -1,8 +1,8 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AciString } from '../types/ServiceId'; -import { isValidUuid } from './isValidUuid'; +import type { AciString } from '../types/ServiceId.js'; +import { isValidUuid } from './isValidUuid.js'; export function isAciString(value?: string | null): value is AciString { return isValidUuid(value); diff --git a/ts/util/isBackupEnabled.ts b/ts/util/isBackupEnabled.ts index febd4bab21b..e9067e38fcf 100644 --- a/ts/util/isBackupEnabled.ts +++ b/ts/util/isBackupEnabled.ts @@ -1,10 +1,10 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import * as RemoteConfig from '../RemoteConfig'; -import { isTestOrMockEnvironment } from '../environment'; -import { isStagingServer } from './isStagingServer'; -import { isBeta, isNightly } from './version'; +import * as RemoteConfig from '../RemoteConfig.js'; +import { isTestOrMockEnvironment } from '../environment.js'; +import { isStagingServer } from './isStagingServer.js'; +import { isBeta, isNightly } from './version.js'; export function areRemoteBackupsTurnedOn(): boolean { return isBackupFeatureEnabled() && window.storage.get('backupTier') != null; diff --git a/ts/util/isBlocked.ts b/ts/util/isBlocked.ts index 27f67e336fe..b1f015a7818 100644 --- a/ts/util/isBlocked.ts +++ b/ts/util/isBlocked.ts @@ -1,8 +1,8 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationAttributesType } from '../model-types'; -import { isAciString } from './isAciString'; +import type { ConversationAttributesType } from '../model-types.js'; +import { isAciString } from './isAciString.js'; export function isBlocked( attributes: Pick diff --git a/ts/util/isCallSafe.ts b/ts/util/isCallSafe.ts index 7b79677213a..0fc2b2158c9 100644 --- a/ts/util/isCallSafe.ts +++ b/ts/util/isCallSafe.ts @@ -1,13 +1,13 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationAttributesType } from '../model-types'; +import type { ConversationAttributesType } from '../model-types.js'; -import { createLogger } from '../logging/log'; -import { blockSendUntilConversationsAreVerified } from './blockSendUntilConversationsAreVerified'; -import { getRecipientsByConversation } from './getRecipientsByConversation'; +import { createLogger } from '../logging/log.js'; +import { blockSendUntilConversationsAreVerified } from './blockSendUntilConversationsAreVerified.js'; +import { getRecipientsByConversation } from './getRecipientsByConversation.js'; -import type { SafetyNumberChangeSource } from '../components/SafetyNumberChangeDialog'; +import type { SafetyNumberChangeSource } from '../components/SafetyNumberChangeDialog.js'; const log = createLogger('isCallSafe'); diff --git a/ts/util/isConversationAccepted.ts b/ts/util/isConversationAccepted.ts index e513a5c7bf7..7b291e0ee4b 100644 --- a/ts/util/isConversationAccepted.ts +++ b/ts/util/isConversationAccepted.ts @@ -1,11 +1,11 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationAttributesType } from '../model-types.d'; -import { SignalService as Proto } from '../protobuf'; -import { isDirectConversation, isMe } from './whatTypeOfConversation'; -import { isInSystemContacts } from './isInSystemContacts'; -import { createLogger } from '../logging/log'; +import type { ConversationAttributesType } from '../model-types.d.ts'; +import { SignalService as Proto } from '../protobuf/index.js'; +import { isDirectConversation, isMe } from './whatTypeOfConversation.js'; +import { isInSystemContacts } from './isInSystemContacts.js'; +import { createLogger } from '../logging/log.js'; export type IsConversationAcceptedOptionsType = { ignoreEmptyConvo: boolean; diff --git a/ts/util/isConversationMuted.ts b/ts/util/isConversationMuted.ts index e778429fec2..d0222706a8a 100644 --- a/ts/util/isConversationMuted.ts +++ b/ts/util/isConversationMuted.ts @@ -1,7 +1,7 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationAttributesType } from '../model-types.d'; +import type { ConversationAttributesType } from '../model-types.d.ts'; export const isConversationMuted = ({ muteExpiresAt, diff --git a/ts/util/isConversationNameKnown.ts b/ts/util/isConversationNameKnown.ts index d72f969a380..ec2297047a6 100644 --- a/ts/util/isConversationNameKnown.ts +++ b/ts/util/isConversationNameKnown.ts @@ -1,8 +1,8 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationType } from '../state/ducks/conversations'; -import { missingCaseError } from './missingCaseError'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import { missingCaseError } from './missingCaseError.js'; export function isConversationNameKnown( conversation: Readonly< diff --git a/ts/util/isConversationSMSOnly.ts b/ts/util/isConversationSMSOnly.ts index 2362f77ce0b..9c28594933a 100644 --- a/ts/util/isConversationSMSOnly.ts +++ b/ts/util/isConversationSMSOnly.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ServiceIdString } from '../types/ServiceId'; +import type { ServiceIdString } from '../types/ServiceId.js'; export type MinimalConversationType = Readonly<{ type?: string; diff --git a/ts/util/isConversationUnregistered.ts b/ts/util/isConversationUnregistered.ts index b7789dd9d33..3f4712bb524 100644 --- a/ts/util/isConversationUnregistered.ts +++ b/ts/util/isConversationUnregistered.ts @@ -1,10 +1,10 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ServiceIdString } from '../types/ServiceId'; -import { isMoreRecentThan, isOlderThan } from './timestamp'; -import { HOUR } from './durations'; -import { getMessageQueueTime } from './getMessageQueueTime'; +import type { ServiceIdString } from '../types/ServiceId.js'; +import { isMoreRecentThan, isOlderThan } from './timestamp.js'; +import { HOUR } from './durations/index.js'; +import { getMessageQueueTime } from './getMessageQueueTime.js'; const SIX_HOURS = 6 * HOUR; diff --git a/ts/util/isGroupInStoryMode.ts b/ts/util/isGroupInStoryMode.ts index a964adb35e3..0ea45bd9888 100644 --- a/ts/util/isGroupInStoryMode.ts +++ b/ts/util/isGroupInStoryMode.ts @@ -1,9 +1,9 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationType } from '../state/ducks/conversations'; -import { StorySendMode } from '../types/Stories'; -import { assertDev } from './assert'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import { StorySendMode } from '../types/Stories.js'; +import { assertDev } from './assert.js'; export function isGroupInStoryMode( { id, type, storySendMode }: ConversationType, diff --git a/ts/util/isGroupOrAdhocCall.ts b/ts/util/isGroupOrAdhocCall.ts index 69faa6d3a91..6c9798971b1 100644 --- a/ts/util/isGroupOrAdhocCall.ts +++ b/ts/util/isGroupOrAdhocCall.ts @@ -1,12 +1,12 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { CallMode } from '../types/CallDisposition'; -import type { ActiveCallType, ActiveGroupCallType } from '../types/Calling'; +import { CallMode } from '../types/CallDisposition.js'; +import type { ActiveCallType, ActiveGroupCallType } from '../types/Calling.js'; import type { DirectCallStateType, GroupCallStateType, -} from '../state/ducks/calling'; +} from '../state/ducks/calling.js'; export function isGroupOrAdhocActiveCall( activeCall: ActiveCallType | undefined diff --git a/ts/util/isLinkAndSyncEnabled.ts b/ts/util/isLinkAndSyncEnabled.ts index fe0beeef6c4..359d8fcd1b1 100644 --- a/ts/util/isLinkAndSyncEnabled.ts +++ b/ts/util/isLinkAndSyncEnabled.ts @@ -1,7 +1,7 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { everDone as wasRegistrationEverDone } from './registration'; +import { everDone as wasRegistrationEverDone } from './registration.js'; export function isLinkAndSyncEnabled(): boolean { // Cannot overwrite existing message history diff --git a/ts/util/isLocalBackupsEnabled.ts b/ts/util/isLocalBackupsEnabled.ts index 29588dbbc13..6d3a5892ea6 100644 --- a/ts/util/isLocalBackupsEnabled.ts +++ b/ts/util/isLocalBackupsEnabled.ts @@ -1,10 +1,10 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import * as RemoteConfig from '../RemoteConfig'; -import { isTestOrMockEnvironment } from '../environment'; -import { isStagingServer } from './isStagingServer'; -import { isNightly } from './version'; +import * as RemoteConfig from '../RemoteConfig.js'; +import { isTestOrMockEnvironment } from '../environment.js'; +import { isStagingServer } from './isStagingServer.js'; +import { isNightly } from './version.js'; export function isLocalBackupsEnabled( reduxConfig?: RemoteConfig.ConfigMapType diff --git a/ts/util/isMessageEmpty.ts b/ts/util/isMessageEmpty.ts index 888b9e5d65a..30d3b6ada33 100644 --- a/ts/util/isMessageEmpty.ts +++ b/ts/util/isMessageEmpty.ts @@ -1,8 +1,8 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { messageHasPaymentEvent } from '../messages/helpers'; -import type { MessageAttributesType } from '../model-types'; +import { messageHasPaymentEvent } from '../messages/helpers.js'; +import type { MessageAttributesType } from '../model-types.js'; import { hasErrors, isCallHistory, @@ -22,7 +22,7 @@ import { isUniversalTimerNotification, isUnsupportedMessage, isVerifiedChange, -} from '../state/selectors/message'; +} from '../state/selectors/message.js'; export function isMessageEmpty(attributes: MessageAttributesType): boolean { // Core message types - we check for all four because they can each stand alone diff --git a/ts/util/isMessageNoteToSelf.ts b/ts/util/isMessageNoteToSelf.ts index 4dc72f6593d..b1581376ea1 100644 --- a/ts/util/isMessageNoteToSelf.ts +++ b/ts/util/isMessageNoteToSelf.ts @@ -1,7 +1,7 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ReadonlyMessageAttributesType } from '../model-types.d'; +import type { ReadonlyMessageAttributesType } from '../model-types.d.ts'; export function isMessageNoteToSelf( message: Pick diff --git a/ts/util/isMessageUnread.ts b/ts/util/isMessageUnread.ts index ae2d56502d9..09c5397dc44 100644 --- a/ts/util/isMessageUnread.ts +++ b/ts/util/isMessageUnread.ts @@ -1,8 +1,8 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { ReadStatus } from '../messages/MessageReadStatus'; -import type { ReadonlyMessageAttributesType } from '../model-types.d'; +import { ReadStatus } from '../messages/MessageReadStatus.js'; +import type { ReadonlyMessageAttributesType } from '../model-types.d.ts'; export const isMessageUnread = ( message: Pick diff --git a/ts/util/isPQRatchetEnabled.ts b/ts/util/isPQRatchetEnabled.ts index 4976bb7ece2..84e100d2911 100644 --- a/ts/util/isPQRatchetEnabled.ts +++ b/ts/util/isPQRatchetEnabled.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { UsePQRatchet } from '@signalapp/libsignal-client'; -import * as RemoteConfig from '../RemoteConfig'; +import * as RemoteConfig from '../RemoteConfig.js'; export const isPQRatchetEnabled = (): UsePQRatchet => { return RemoteConfig.isEnabled('desktop.usePqRatchet') diff --git a/ts/util/isPathInside.ts b/ts/util/isPathInside.ts index 3ee39e2c752..f008eb470f5 100644 --- a/ts/util/isPathInside.ts +++ b/ts/util/isPathInside.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only // This is inspired by the `is-path-inside` module on npm. -import * as path from 'path'; +import * as path from 'node:path'; export function isPathInside(childPath: string, parentPath: string): boolean { const childPathResolved = path.resolve(childPath); diff --git a/ts/util/isProtoBinaryEncodingEnabled.ts b/ts/util/isProtoBinaryEncodingEnabled.ts index 64cb1ddc061..ca3b0a1fa6e 100644 --- a/ts/util/isProtoBinaryEncodingEnabled.ts +++ b/ts/util/isProtoBinaryEncodingEnabled.ts @@ -1,7 +1,7 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { isTestOrMockEnvironment } from '../environment'; +import { isTestOrMockEnvironment } from '../environment.js'; export function isProtoBinaryEncodingEnabled(): boolean { if (isTestOrMockEnvironment()) { diff --git a/ts/util/isSafetyNumberNotAvailable.ts b/ts/util/isSafetyNumberNotAvailable.ts index 0a9dcfe3217..cd418136522 100644 --- a/ts/util/isSafetyNumberNotAvailable.ts +++ b/ts/util/isSafetyNumberNotAvailable.ts @@ -1,8 +1,8 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationType } from '../state/ducks/conversations'; -import { isAciString } from './isAciString'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import { isAciString } from './isAciString.js'; export const isSafetyNumberNotAvailable = ( contact?: ConversationType diff --git a/ts/util/isSameAvatarData.ts b/ts/util/isSameAvatarData.ts index 26ee419c6c5..f83d2bf53ba 100644 --- a/ts/util/isSameAvatarData.ts +++ b/ts/util/isSameAvatarData.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AvatarDataType } from '../types/Avatar'; +import type { AvatarDataType } from '../types/Avatar.js'; export function isSameAvatarData( a?: AvatarDataType, diff --git a/ts/util/isSettingsInternalEnabled.ts b/ts/util/isSettingsInternalEnabled.ts index eb881e4cdb0..fd9fa55b432 100644 --- a/ts/util/isSettingsInternalEnabled.ts +++ b/ts/util/isSettingsInternalEnabled.ts @@ -1,8 +1,8 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import * as RemoteConfig from '../RemoteConfig'; -import { isNightly } from './version'; +import * as RemoteConfig from '../RemoteConfig.js'; +import { isNightly } from './version.js'; export function isSettingsInternalEnabled(): boolean { if (RemoteConfig.isEnabled('desktop.internalUser')) { diff --git a/ts/util/isSignalConversation.ts b/ts/util/isSignalConversation.ts index 0fb0de35f8c..3b6e7b7fd49 100644 --- a/ts/util/isSignalConversation.ts +++ b/ts/util/isSignalConversation.ts @@ -1,8 +1,8 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { SIGNAL_ACI } from '../types/SignalConversation'; -import type { ServiceIdString } from '../types/ServiceId'; +import { SIGNAL_ACI } from '../types/SignalConversation.js'; +import type { ServiceIdString } from '../types/ServiceId.js'; export function isSignalConversation(conversation: { id: string; diff --git a/ts/util/isStagingServer.ts b/ts/util/isStagingServer.ts index d971e1e7e27..1cfd4772819 100644 --- a/ts/util/isStagingServer.ts +++ b/ts/util/isStagingServer.ts @@ -1,8 +1,8 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { Environment, getEnvironment } from '../environment'; -import { isStaging } from './version'; +import { Environment, getEnvironment } from '../environment.js'; +import { isStaging } from './version.js'; export function isStagingServer( serverUrl = window.SignalContext.config.serverUrl diff --git a/ts/util/isTooOldToModifyMessage.ts b/ts/util/isTooOldToModifyMessage.ts index 7650f459a67..b410178f650 100644 --- a/ts/util/isTooOldToModifyMessage.ts +++ b/ts/util/isTooOldToModifyMessage.ts @@ -1,8 +1,8 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ReadonlyMessageAttributesType } from '../model-types.d'; -import { DAY } from './durations'; +import type { ReadonlyMessageAttributesType } from '../model-types.d.ts'; +import { DAY } from './durations/index.js'; export function isTooOldToModifyMessage( serverTimestamp: number, diff --git a/ts/util/isValidTapToView.ts b/ts/util/isValidTapToView.ts index 85bf5dcf652..d33f97ba1ec 100644 --- a/ts/util/isValidTapToView.ts +++ b/ts/util/isValidTapToView.ts @@ -1,8 +1,8 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { MessageAttributesType } from '../model-types'; -import * as GoogleChrome from './GoogleChrome'; +import type { MessageAttributesType } from '../model-types.js'; +import * as GoogleChrome from './GoogleChrome.js'; export function isValidTapToView(message: MessageAttributesType): boolean { const { body } = message; diff --git a/ts/util/isVideoGoodForStories.ts b/ts/util/isVideoGoodForStories.ts index 1c671e5c632..14a64a53a98 100644 --- a/ts/util/isVideoGoodForStories.ts +++ b/ts/util/isVideoGoodForStories.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import MP4Box from 'mp4box'; -import { VIDEO_MP4, isVideo } from '../types/MIME'; -import { KIBIBYTE, getRenderDetailsForLimit } from '../types/AttachmentSize'; -import { explodePromise } from './explodePromise'; +import { VIDEO_MP4, isVideo } from '../types/MIME.js'; +import { KIBIBYTE, getRenderDetailsForLimit } from '../types/AttachmentSize.js'; +import { explodePromise } from './explodePromise.js'; const MAX_VIDEO_DURATION_IN_SEC = 30; diff --git a/ts/util/iterables.ts b/ts/util/iterables.ts index 21e42045557..a2077a7a092 100644 --- a/ts/util/iterables.ts +++ b/ts/util/iterables.ts @@ -3,7 +3,7 @@ /* eslint-disable max-classes-per-file */ -import { getOwn } from './getOwn'; +import { getOwn } from './getOwn.js'; export function isIterable(value: unknown): value is Iterable { return ( diff --git a/ts/util/keyboard.ts b/ts/util/keyboard.ts index 0451cffe9f8..38013961671 100644 --- a/ts/util/keyboard.ts +++ b/ts/util/keyboard.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { LocaleDirection } from '../../app/locale'; +import type { LocaleDirection } from '../../app/locale.js'; export type LogicalDirection = 'start' | 'end'; export type HorizontalArrowKey = 'ArrowLeft' | 'ArrowRight'; diff --git a/ts/util/leftPaneWidth.ts b/ts/util/leftPaneWidth.ts index 587fce0c0bf..d6719ff3208 100644 --- a/ts/util/leftPaneWidth.ts +++ b/ts/util/leftPaneWidth.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import { clamp } from 'lodash'; -import { isSorted } from './isSorted'; -import { strictAssert } from './assert'; +import { isSorted } from './isSorted.js'; +import { strictAssert } from './assert.js'; export const MIN_WIDTH = 97; export const SNAP_WIDTH = 200; diff --git a/ts/util/libphonenumberUtil.ts b/ts/util/libphonenumberUtil.ts index 26115ad65a9..a2c62daefd5 100644 --- a/ts/util/libphonenumberUtil.ts +++ b/ts/util/libphonenumberUtil.ts @@ -4,7 +4,7 @@ import { instance as libphonenumber, PhoneNumberFormat, -} from './libphonenumberInstance'; +} from './libphonenumberInstance.js'; const FALLBACK_REGION_CODE = 'ZZ'; diff --git a/ts/util/lint/analyze_exceptions.ts b/ts/util/lint/analyze_exceptions.ts index a0552d1a124..cc102ec2c0c 100644 --- a/ts/util/lint/analyze_exceptions.ts +++ b/ts/util/lint/analyze_exceptions.ts @@ -1,12 +1,12 @@ // Copyright 2018 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { join } from 'path'; +import { join } from 'node:path'; import { fromPairs, groupBy, map } from 'lodash'; -import type { ExceptionType } from './types'; -import { loadJSON } from './util'; +import type { ExceptionType } from './types.js'; +import { loadJSON } from './util.js'; const exceptionsPath = join(__dirname, 'exceptions.json'); const exceptions: Array = loadJSON(exceptionsPath); diff --git a/ts/util/lint/license_comments.ts b/ts/util/lint/license_comments.ts index 2324cbfd6ba..35aea69e5c5 100644 --- a/ts/util/lint/license_comments.ts +++ b/ts/util/lint/license_comments.ts @@ -4,12 +4,12 @@ // This file doesn't check the format of license files, just the end year. See // `license_comments_test.ts` for those checks, which are meant to be run more often. -import assert from 'assert'; -import * as readline from 'readline'; -import * as path from 'path'; -import * as fs from 'fs'; -import { promisify } from 'util'; -import * as childProcess from 'child_process'; +import assert from 'node:assert'; +import * as readline from 'node:readline'; +import * as path from 'node:path'; +import * as fs from 'node:fs'; +import { promisify } from 'node:util'; +import * as childProcess from 'node:child_process'; import pMap from 'p-map'; // eslint-disable-next-line import/no-extraneous-dependencies import chalk from 'chalk'; diff --git a/ts/util/lint/linter.ts b/ts/util/lint/linter.ts index fd0c8c0aa9e..e61f3dc3f40 100644 --- a/ts/util/lint/linter.ts +++ b/ts/util/lint/linter.ts @@ -2,15 +2,15 @@ // SPDX-License-Identifier: AGPL-3.0-only /* eslint-disable no-console */ -import * as fs from 'fs'; -import { join, relative } from 'path'; +import * as fs from 'node:fs'; +import { join, relative } from 'node:path'; import normalizePath from 'normalize-path'; import pMap from 'p-map'; import FastGlob from 'fast-glob'; -import type { ExceptionType, RuleType } from './types'; -import { REASONS } from './types'; -import { ENCODING, loadJSON, sortExceptions, writeExceptions } from './util'; +import type { ExceptionType, RuleType } from './types.js'; +import { REASONS } from './types.js'; +import { ENCODING, loadJSON, sortExceptions, writeExceptions } from './util.js'; const ALL_REASONS = REASONS.join('|'); diff --git a/ts/util/lint/sort_exceptions.ts b/ts/util/lint/sort_exceptions.ts index 7b481e3ba3d..ea846a99ce9 100644 --- a/ts/util/lint/sort_exceptions.ts +++ b/ts/util/lint/sort_exceptions.ts @@ -1,10 +1,10 @@ // Copyright 2018 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { join } from 'path'; +import { join } from 'node:path'; -import type { ExceptionType } from './types'; -import { loadJSON, writeExceptions } from './util'; +import type { ExceptionType } from './types.js'; +import { loadJSON, writeExceptions } from './util.js'; const exceptionsPath = join(__dirname, 'exceptions.json'); const exceptions: Array = loadJSON(exceptionsPath); diff --git a/ts/util/lint/util.ts b/ts/util/lint/util.ts index 1767715cb17..9fa0ceb94a3 100644 --- a/ts/util/lint/util.ts +++ b/ts/util/lint/util.ts @@ -5,7 +5,7 @@ import { readJsonSync, writeJsonSync } from 'fs-extra'; import { orderBy } from 'lodash'; -import type { ExceptionType } from './types'; +import type { ExceptionType } from './types.js'; export const ENCODING = 'utf8'; diff --git a/ts/util/loadImage.ts b/ts/util/loadImage.ts index a3474159442..fcea2247a38 100644 --- a/ts/util/loadImage.ts +++ b/ts/util/loadImage.ts @@ -1,7 +1,7 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { explodePromise } from './explodePromise'; +import { explodePromise } from './explodePromise.js'; export async function loadImage(src: string): Promise { const { promise, resolve, reject } = explodePromise(); diff --git a/ts/util/loadRecentEmojis.ts b/ts/util/loadRecentEmojis.ts index fa991535de0..f88d37dba19 100644 --- a/ts/util/loadRecentEmojis.ts +++ b/ts/util/loadRecentEmojis.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { take } from 'lodash'; -import { DataReader } from '../sql/Client'; +import { DataReader } from '../sql/Client.js'; export type RecentEmojiObjectType = { recents: Array; diff --git a/ts/util/logPadding.ts b/ts/util/logPadding.ts index fca8aedb0cf..e7444f1e50c 100644 --- a/ts/util/logPadding.ts +++ b/ts/util/logPadding.ts @@ -1,8 +1,8 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { Transform } from 'stream'; -import type { Duplex, Readable } from 'stream'; +import { Transform } from 'node:stream'; +import type { Duplex, Readable } from 'node:stream'; const PADDING_CHUNK_SIZE = 64 * 1024; diff --git a/ts/util/longAttachment.ts b/ts/util/longAttachment.ts index 6ecccd60d03..00652eb36dc 100644 --- a/ts/util/longAttachment.ts +++ b/ts/util/longAttachment.ts @@ -1,7 +1,7 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { unicodeSlice } from './unicodeSlice'; +import { unicodeSlice } from './unicodeSlice.js'; const KIBIBYTE = 1024; const MAX_MESSAGE_BODY_BYTE_LENGTH = 2 * KIBIBYTE; diff --git a/ts/util/longRunningTaskWrapper.tsx b/ts/util/longRunningTaskWrapper.tsx index d377d38fd98..c259f1df57d 100644 --- a/ts/util/longRunningTaskWrapper.tsx +++ b/ts/util/longRunningTaskWrapper.tsx @@ -4,13 +4,13 @@ import React, { StrictMode } from 'react'; import { createRoot, type Root } from 'react-dom/client'; -import * as Errors from '../types/errors'; -import { createLogger } from '../logging/log'; -import { ProgressModal } from '../components/ProgressModal'; -import { clearTimeoutIfNecessary } from './clearTimeoutIfNecessary'; -import { sleep } from './sleep'; -import { FunDefaultEnglishEmojiLocalizationProvider } from '../components/fun/FunEmojiLocalizationProvider'; -import { AxoProvider } from '../axo/AxoProvider'; +import * as Errors from '../types/errors.js'; +import { createLogger } from '../logging/log.js'; +import { ProgressModal } from '../components/ProgressModal.js'; +import { clearTimeoutIfNecessary } from './clearTimeoutIfNecessary.js'; +import { sleep } from './sleep.js'; +import { FunDefaultEnglishEmojiLocalizationProvider } from '../components/fun/FunEmojiLocalizationProvider.js'; +import { AxoProvider } from '../axo/AxoProvider.js'; const log = createLogger('longRunningTaskWrapper'); diff --git a/ts/util/lookupConversationWithoutServiceId.ts b/ts/util/lookupConversationWithoutServiceId.ts index be5c64c430e..e827103e06e 100644 --- a/ts/util/lookupConversationWithoutServiceId.ts +++ b/ts/util/lookupConversationWithoutServiceId.ts @@ -3,15 +3,15 @@ import { usernames, LibSignalErrorBase } from '@signalapp/libsignal-client'; -import type { UserNotFoundModalStateType } from '../state/ducks/globalModals'; -import { createLogger } from '../logging/log'; -import type { AciString } from '../types/ServiceId'; -import * as Errors from '../types/errors'; -import { ToastType } from '../types/Toast'; -import { HTTPError } from '../textsecure/Errors'; -import { strictAssert } from './assert'; -import type { UUIDFetchStateKeyType } from './uuidFetchState'; -import { getServiceIdsForE164s } from './getServiceIdsForE164s'; +import type { UserNotFoundModalStateType } from '../state/ducks/globalModals.js'; +import { createLogger } from '../logging/log.js'; +import type { AciString } from '../types/ServiceId.js'; +import * as Errors from '../types/errors.js'; +import { ToastType } from '../types/Toast.js'; +import { HTTPError } from '../textsecure/Errors.js'; +import { strictAssert } from './assert.js'; +import type { UUIDFetchStateKeyType } from './uuidFetchState.js'; +import { getServiceIdsForE164s } from './getServiceIdsForE164s.js'; const log = createLogger('lookupConversationWithoutServiceId'); diff --git a/ts/util/makeQuote.ts b/ts/util/makeQuote.ts index 6a397fda350..ac9e1e53677 100644 --- a/ts/util/makeQuote.ts +++ b/ts/util/makeQuote.ts @@ -1,24 +1,24 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AttachmentType } from '../types/Attachment'; +import type { AttachmentType } from '../types/Attachment.js'; import type { MessageAttributesType, QuotedAttachmentType, -} from '../model-types.d'; -import type { LinkPreviewType } from '../types/message/LinkPreviews'; -import type { StickerType } from '../types/Stickers'; -import { IMAGE_JPEG, IMAGE_GIF } from '../types/MIME'; -import { getAuthor } from '../messages/helpers'; -import { getQuoteBodyText } from './getQuoteBodyText'; -import { isGIF } from '../types/Attachment'; -import { isGiftBadge, isTapToView } from '../state/selectors/message'; -import { createLogger } from '../logging/log'; -import { map, take, collect } from './iterables'; -import { strictAssert } from './assert'; -import { getMessageSentTimestamp } from './getMessageSentTimestamp'; -import { getLocalAttachmentUrl } from './getLocalAttachmentUrl'; -import type { QuotedMessageForComposerType } from '../state/ducks/composer'; +} from '../model-types.d.ts'; +import type { LinkPreviewType } from '../types/message/LinkPreviews.js'; +import type { StickerType } from '../types/Stickers.js'; +import { IMAGE_JPEG, IMAGE_GIF } from '../types/MIME.js'; +import { getAuthor } from '../messages/helpers.js'; +import { getQuoteBodyText } from './getQuoteBodyText.js'; +import { isGIF } from '../types/Attachment.js'; +import { isGiftBadge, isTapToView } from '../state/selectors/message.js'; +import { createLogger } from '../logging/log.js'; +import { map, take, collect } from './iterables.js'; +import { strictAssert } from './assert.js'; +import { getMessageSentTimestamp } from './getMessageSentTimestamp.js'; +import { getLocalAttachmentUrl } from './getLocalAttachmentUrl.js'; +import type { QuotedMessageForComposerType } from '../state/ducks/composer.js'; const log = createLogger('makeQuote'); diff --git a/ts/util/mapUtil.ts b/ts/util/mapUtil.ts index 8b6c86d2438..acb8d9104c4 100644 --- a/ts/util/mapUtil.ts +++ b/ts/util/mapUtil.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { reduce } from './iterables'; +import { reduce } from './iterables.js'; /** * Like Lodash's `groupBy`, but returns a `Map`. diff --git a/ts/util/markConversationRead.ts b/ts/util/markConversationRead.ts index 149097edb64..be6edb9cdb9 100644 --- a/ts/util/markConversationRead.ts +++ b/ts/util/markConversationRead.ts @@ -3,30 +3,30 @@ import { isNumber, pick } from 'lodash'; -import type { ConversationAttributesType } from '../model-types.d'; -import { DataWriter } from '../sql/Client'; -import { hasErrors } from '../state/selectors/message'; -import { readSyncJobQueue } from '../jobs/readSyncJobQueue'; -import { notificationService } from '../services/notifications'; -import { update as updateExpiringMessagesService } from '../services/expiringMessagesDeletion'; -import { tapToViewMessagesDeletionService } from '../services/tapToViewMessagesDeletionService'; -import { isGroup, isDirectConversation } from './whatTypeOfConversation'; -import { createLogger } from '../logging/log'; -import { getConversationIdForLogging } from './idForLogging'; -import { drop } from './drop'; -import { isNotNil } from './isNotNil'; -import { assertDev } from './assert'; -import { isConversationAccepted } from './isConversationAccepted'; -import { ReadStatus } from '../messages/MessageReadStatus'; +import type { ConversationAttributesType } from '../model-types.d.ts'; +import { DataWriter } from '../sql/Client.js'; +import { hasErrors } from '../state/selectors/message.js'; +import { readSyncJobQueue } from '../jobs/readSyncJobQueue.js'; +import { notificationService } from '../services/notifications.js'; +import { update as updateExpiringMessagesService } from '../services/expiringMessagesDeletion.js'; +import { tapToViewMessagesDeletionService } from '../services/tapToViewMessagesDeletionService.js'; +import { isGroup, isDirectConversation } from './whatTypeOfConversation.js'; +import { createLogger } from '../logging/log.js'; +import { getConversationIdForLogging } from './idForLogging.js'; +import { drop } from './drop.js'; +import { isNotNil } from './isNotNil.js'; +import { assertDev } from './assert.js'; +import { isConversationAccepted } from './isConversationAccepted.js'; +import { ReadStatus } from '../messages/MessageReadStatus.js'; import { conversationJobQueue, conversationQueueJobEnum, -} from '../jobs/conversationJobQueue'; -import { ReceiptType } from '../types/Receipt'; -import type { AciString } from '../types/ServiceId'; -import { isAciString } from './isAciString'; -import type { MessageModel } from '../models/messages'; -import { postSaveUpdates } from './cleanup'; +} from '../jobs/conversationJobQueue.js'; +import { ReceiptType } from '../types/Receipt.js'; +import type { AciString } from '../types/ServiceId.js'; +import { isAciString } from './isAciString.js'; +import type { MessageModel } from '../models/messages.js'; +import { postSaveUpdates } from './cleanup.js'; const log = createLogger('markConversationRead'); diff --git a/ts/util/markOnboardingStoryAsRead.ts b/ts/util/markOnboardingStoryAsRead.ts index 1a487dbe005..4c2476b6850 100644 --- a/ts/util/markOnboardingStoryAsRead.ts +++ b/ts/util/markOnboardingStoryAsRead.ts @@ -1,14 +1,14 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log'; -import { DataWriter } from '../sql/Client'; -import { getMessageById } from '../messages/getMessageById'; -import { isNotNil } from './isNotNil'; -import { DurationInSeconds } from './durations'; -import { markViewed } from '../services/MessageUpdater'; -import { storageServiceUploadJob } from '../services/storage'; -import { postSaveUpdates } from './cleanup'; +import { createLogger } from '../logging/log.js'; +import { DataWriter } from '../sql/Client.js'; +import { getMessageById } from '../messages/getMessageById.js'; +import { isNotNil } from './isNotNil.js'; +import { DurationInSeconds } from './durations/index.js'; +import { markViewed } from '../services/MessageUpdater.js'; +import { storageServiceUploadJob } from '../services/storage.js'; +import { postSaveUpdates } from './cleanup.js'; const log = createLogger('markOnboardingStoryAsRead'); diff --git a/ts/util/maybeForwardMessages.ts b/ts/util/maybeForwardMessages.ts index adb68f9991f..4bfcc970475 100644 --- a/ts/util/maybeForwardMessages.ts +++ b/ts/util/maybeForwardMessages.ts @@ -1,29 +1,29 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AttachmentType } from '../types/Attachment'; -import type { LinkPreviewWithHydratedData } from '../types/message/LinkPreviews'; -import type { QuotedMessageType } from '../model-types'; -import { createLogger } from '../logging/log'; -import { SafetyNumberChangeSource } from '../components/SafetyNumberChangeDialog'; -import { blockSendUntilConversationsAreVerified } from './blockSendUntilConversationsAreVerified'; +import type { AttachmentType } from '../types/Attachment.js'; +import type { LinkPreviewWithHydratedData } from '../types/message/LinkPreviews.js'; +import type { QuotedMessageType } from '../model-types.js'; +import { createLogger } from '../logging/log.js'; +import { SafetyNumberChangeSource } from '../components/SafetyNumberChangeDialog.js'; +import { blockSendUntilConversationsAreVerified } from './blockSendUntilConversationsAreVerified.js'; import { getMessageIdForLogging, getConversationIdForLogging, -} from './idForLogging'; -import { isNotNil } from './isNotNil'; -import { resetLinkPreview } from '../services/LinkPreview'; -import { getRecipientsByConversation } from './getRecipientsByConversation'; -import type { EmbeddedContactWithHydratedAvatar } from '../types/EmbeddedContact'; -import type { DraftBodyRanges } from '../types/BodyRange'; -import type { StickerWithHydratedData } from '../types/Stickers'; -import { drop } from './drop'; -import { toLogFormat } from '../types/errors'; +} from './idForLogging.js'; +import { isNotNil } from './isNotNil.js'; +import { resetLinkPreview } from '../services/LinkPreview.js'; +import { getRecipientsByConversation } from './getRecipientsByConversation.js'; +import type { EmbeddedContactWithHydratedAvatar } from '../types/EmbeddedContact.js'; +import type { DraftBodyRanges } from '../types/BodyRange.js'; +import type { StickerWithHydratedData } from '../types/Stickers.js'; +import { drop } from './drop.js'; +import { toLogFormat } from '../types/errors.js'; import { sortByMessageOrder, type ForwardMessageData, -} from '../types/ForwardDraft'; -import { canForward } from '../state/selectors/message'; +} from '../types/ForwardDraft.js'; +import { canForward } from '../state/selectors/message.js'; const log = createLogger('maybeForwardMessages'); diff --git a/ts/util/messageBatcher.ts b/ts/util/messageBatcher.ts index f754e2a27b9..82fb51593a5 100644 --- a/ts/util/messageBatcher.ts +++ b/ts/util/messageBatcher.ts @@ -1,12 +1,12 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ReadonlyMessageAttributesType } from '../model-types.d'; -import { createWaitBatcher } from './waitBatcher'; -import { DataWriter } from '../sql/Client'; -import { createLogger } from '../logging/log'; -import { postSaveUpdates } from './cleanup'; -import { MessageModel } from '../models/messages'; +import type { ReadonlyMessageAttributesType } from '../model-types.d.ts'; +import { createWaitBatcher } from './waitBatcher.js'; +import { DataWriter } from '../sql/Client.js'; +import { createLogger } from '../logging/log.js'; +import { postSaveUpdates } from './cleanup.js'; +import { MessageModel } from '../models/messages.js'; const log = createLogger('messageBatcher'); diff --git a/ts/util/migrateColor.ts b/ts/util/migrateColor.ts index 72f084d7b99..c5ffa7d38fc 100644 --- a/ts/util/migrateColor.ts +++ b/ts/util/migrateColor.ts @@ -1,10 +1,10 @@ // Copyright 2018 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { AvatarColors } from '../types/Colors'; -import type { ConversationAttributesType } from '../model-types'; -import type { AvatarColorType, CustomColorType } from '../types/Colors'; -import { generateAvatarColor } from '../Crypto'; +import { AvatarColors } from '../types/Colors.js'; +import type { ConversationAttributesType } from '../model-types.js'; +import type { AvatarColorType, CustomColorType } from '../types/Colors.js'; +import { generateAvatarColor } from '../Crypto.js'; const NEW_COLOR_NAMES = new Set(AvatarColors); diff --git a/ts/util/missingCaseError.ts b/ts/util/missingCaseError.ts index bad120b2935..62093f666e7 100644 --- a/ts/util/missingCaseError.ts +++ b/ts/util/missingCaseError.ts @@ -1,7 +1,7 @@ // Copyright 2018 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { reallyJsonStringify } from './reallyJsonStringify'; +import { reallyJsonStringify } from './reallyJsonStringify.js'; // `missingCaseError` is useful for compile-time checking that all `case`s in // a `switch` statement have been handled, e.g. diff --git a/ts/util/modifyTargetMessage.ts b/ts/util/modifyTargetMessage.ts index d11895a2156..7d063e50e7c 100644 --- a/ts/util/modifyTargetMessage.ts +++ b/ts/util/modifyTargetMessage.ts @@ -3,40 +3,43 @@ import { isEqual } from 'lodash'; import PQueue from 'p-queue'; -import type { ConversationModel } from '../models/conversations'; -import type { MessageModel } from '../models/messages'; -import type { SendStateByConversationId } from '../messages/MessageSendState'; +import type { ConversationModel } from '../models/conversations.js'; +import type { MessageModel } from '../models/messages.js'; +import type { SendStateByConversationId } from '../messages/MessageSendState.js'; -import * as Edits from '../messageModifiers/Edits'; -import { createLogger } from '../logging/log'; -import * as Deletes from '../messageModifiers/Deletes'; -import * as DeletesForMe from '../messageModifiers/DeletesForMe'; -import * as MessageReceipts from '../messageModifiers/MessageReceipts'; -import * as Reactions from '../messageModifiers/Reactions'; -import * as ReadSyncs from '../messageModifiers/ReadSyncs'; -import * as ViewOnceOpenSyncs from '../messageModifiers/ViewOnceOpenSyncs'; -import * as ViewSyncs from '../messageModifiers/ViewSyncs'; -import { ReadStatus } from '../messages/MessageReadStatus'; -import { SeenStatus } from '../MessageSeenStatus'; -import { SendActionType, sendStateReducer } from '../messages/MessageSendState'; -import { canConversationBeUnarchived } from './canConversationBeUnarchived'; -import { deleteForEveryone } from './deleteForEveryone'; -import { drop } from './drop'; -import { handleEditMessage } from './handleEditMessage'; -import { isGroup } from './whatTypeOfConversation'; -import { isStory, isTapToView } from '../state/selectors/message'; -import { getOwn } from './getOwn'; -import { getSourceServiceId } from '../messages/helpers'; -import { missingCaseError } from './missingCaseError'; -import { reduce } from './iterables'; -import { strictAssert } from './assert'; +import * as Edits from '../messageModifiers/Edits.js'; +import { createLogger } from '../logging/log.js'; +import * as Deletes from '../messageModifiers/Deletes.js'; +import * as DeletesForMe from '../messageModifiers/DeletesForMe.js'; +import * as MessageReceipts from '../messageModifiers/MessageReceipts.js'; +import * as Reactions from '../messageModifiers/Reactions.js'; +import * as ReadSyncs from '../messageModifiers/ReadSyncs.js'; +import * as ViewOnceOpenSyncs from '../messageModifiers/ViewOnceOpenSyncs.js'; +import * as ViewSyncs from '../messageModifiers/ViewSyncs.js'; +import { ReadStatus } from '../messages/MessageReadStatus.js'; +import { SeenStatus } from '../MessageSeenStatus.js'; +import { + SendActionType, + sendStateReducer, +} from '../messages/MessageSendState.js'; +import { canConversationBeUnarchived } from './canConversationBeUnarchived.js'; +import { deleteForEveryone } from './deleteForEveryone.js'; +import { drop } from './drop.js'; +import { handleEditMessage } from './handleEditMessage.js'; +import { isGroup } from './whatTypeOfConversation.js'; +import { isStory, isTapToView } from '../state/selectors/message.js'; +import { getOwn } from './getOwn.js'; +import { getSourceServiceId } from '../messages/helpers.js'; +import { missingCaseError } from './missingCaseError.js'; +import { reduce } from './iterables.js'; +import { strictAssert } from './assert.js'; import { applyDeleteAttachmentFromMessage, applyDeleteMessage, -} from './deleteForMe'; -import { getMessageIdForLogging } from './idForLogging'; -import { markViewOnceMessageViewed } from '../services/MessageUpdater'; -import { handleReaction } from '../messageModifiers/Reactions'; +} from './deleteForMe.js'; +import { getMessageIdForLogging } from './idForLogging.js'; +import { markViewOnceMessageViewed } from '../services/MessageUpdater.js'; +import { handleReaction } from '../messageModifiers/Reactions.js'; const log = createLogger('modifyTargetMessage'); diff --git a/ts/util/nicknames.ts b/ts/util/nicknames.ts index 3e7ceed361a..6f2f54523e3 100644 --- a/ts/util/nicknames.ts +++ b/ts/util/nicknames.ts @@ -1,8 +1,8 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationType } from '../state/ducks/conversations'; -import { isSignalConversation } from './isSignalConversation'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import { isSignalConversation } from './isSignalConversation.js'; export function canHaveNicknameAndNote( conversation: ConversationType diff --git a/ts/util/normalizeAci.ts b/ts/util/normalizeAci.ts index 9b4bd72cecf..685d09bc7b6 100644 --- a/ts/util/normalizeAci.ts +++ b/ts/util/normalizeAci.ts @@ -1,11 +1,11 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AciString } from '../types/ServiceId'; -import type { LoggerType } from '../types/Logging'; -import { createLogger } from '../logging/log'; -import { isAciString } from './isAciString'; -import { strictAssert } from './assert'; +import type { AciString } from '../types/ServiceId.js'; +import type { LoggerType } from '../types/Logging.js'; +import { createLogger } from '../logging/log.js'; +import { isAciString } from './isAciString.js'; +import { strictAssert } from './assert.js'; const log = createLogger('normalizeAci'); diff --git a/ts/util/numbers.ts b/ts/util/numbers.ts index 67185d5839c..aca02c0461b 100644 --- a/ts/util/numbers.ts +++ b/ts/util/numbers.ts @@ -1,6 +1,6 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { strictAssert } from './assert'; +import { strictAssert } from './assert.js'; export function safeParseNumber(value: number | string): number | null { if (typeof value === 'number') { diff --git a/ts/util/onCallEventSync.ts b/ts/util/onCallEventSync.ts index 88d347e5818..a8099bde22b 100644 --- a/ts/util/onCallEventSync.ts +++ b/ts/util/onCallEventSync.ts @@ -1,13 +1,13 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { CallEventSyncEvent } from '../textsecure/messageReceiverEvents'; -import { createLogger } from '../logging/log'; +import type { CallEventSyncEvent } from '../textsecure/messageReceiverEvents.js'; +import { createLogger } from '../logging/log.js'; import { peerIdToLog, updateCallHistoryFromRemoteEvent, -} from './callDisposition'; -import { CallMode } from '../types/CallDisposition'; +} from './callDisposition.js'; +import { CallMode } from '../types/CallDisposition.js'; const log = createLogger('onCallEventSync'); diff --git a/ts/util/onCallLinkUpdateSync.ts b/ts/util/onCallLinkUpdateSync.ts index 9dc115c4077..4a11b0195fb 100644 --- a/ts/util/onCallLinkUpdateSync.ts +++ b/ts/util/onCallLinkUpdateSync.ts @@ -2,14 +2,14 @@ // SPDX-License-Identifier: AGPL-3.0-only import { CallLinkRootKey } from '@signalapp/ringrtc'; -import type { CallLinkUpdateSyncEvent } from '../textsecure/messageReceiverEvents'; -import { createLogger } from '../logging/log'; -import * as Errors from '../types/errors'; -import { fromAdminKeyBytes } from './callLinks'; -import { fromEpochBytes, getRoomIdFromRootKey } from './callLinksRingrtc'; -import { strictAssert } from './assert'; -import { CallLinkUpdateSyncType } from '../types/CallLink'; -import { DataWriter } from '../sql/Client'; +import type { CallLinkUpdateSyncEvent } from '../textsecure/messageReceiverEvents.js'; +import { createLogger } from '../logging/log.js'; +import * as Errors from '../types/errors.js'; +import { fromAdminKeyBytes } from './callLinks.js'; +import { fromEpochBytes, getRoomIdFromRootKey } from './callLinksRingrtc.js'; +import { strictAssert } from './assert.js'; +import { CallLinkUpdateSyncType } from '../types/CallLink.js'; +import { DataWriter } from '../sql/Client.js'; const log = createLogger('onCallLinkUpdateSync'); diff --git a/ts/util/onCallLogEventSync.ts b/ts/util/onCallLogEventSync.ts index 018ebf1e0f5..ba82629d6fb 100644 --- a/ts/util/onCallLogEventSync.ts +++ b/ts/util/onCallLogEventSync.ts @@ -1,14 +1,14 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { CallLogEventSyncEvent } from '../textsecure/messageReceiverEvents'; -import { createLogger } from '../logging/log'; -import { DataWriter } from '../sql/Client'; -import type { CallLogEventTarget } from '../types/CallDisposition'; -import { CallLogEvent } from '../types/CallDisposition'; -import { missingCaseError } from './missingCaseError'; -import { strictAssert } from './assert'; -import { updateDeletedMessages } from './callDisposition'; +import type { CallLogEventSyncEvent } from '../textsecure/messageReceiverEvents.js'; +import { createLogger } from '../logging/log.js'; +import { DataWriter } from '../sql/Client.js'; +import type { CallLogEventTarget } from '../types/CallDisposition.js'; +import { CallLogEvent } from '../types/CallDisposition.js'; +import { missingCaseError } from './missingCaseError.js'; +import { strictAssert } from './assert.js'; +import { updateDeletedMessages } from './callDisposition.js'; const log = createLogger('onCallLogEventSync'); diff --git a/ts/util/onDeviceNameChangeSync.ts b/ts/util/onDeviceNameChangeSync.ts index 60e3098fff9..58964ec5e17 100644 --- a/ts/util/onDeviceNameChangeSync.ts +++ b/ts/util/onDeviceNameChangeSync.ts @@ -2,13 +2,13 @@ // SPDX-License-Identifier: AGPL-3.0-only import PQueue from 'p-queue'; -import type { DeviceNameChangeSyncEvent } from '../textsecure/messageReceiverEvents'; -import { MINUTE } from './durations'; -import { strictAssert } from './assert'; -import { parseIntOrThrow } from './parseIntOrThrow'; -import { createLogger } from '../logging/log'; -import { toLogFormat } from '../types/errors'; -import { drop } from './drop'; +import type { DeviceNameChangeSyncEvent } from '../textsecure/messageReceiverEvents.js'; +import { MINUTE } from './durations/index.js'; +import { strictAssert } from './assert.js'; +import { parseIntOrThrow } from './parseIntOrThrow.js'; +import { createLogger } from '../logging/log.js'; +import { toLogFormat } from '../types/errors.js'; +import { drop } from './drop.js'; const log = createLogger('onDeviceNameChangeSync'); diff --git a/ts/util/onStoryRecipientUpdate.ts b/ts/util/onStoryRecipientUpdate.ts index 65681292245..e794d9d86de 100644 --- a/ts/util/onStoryRecipientUpdate.ts +++ b/ts/util/onStoryRecipientUpdate.ts @@ -2,19 +2,19 @@ // SPDX-License-Identifier: AGPL-3.0-only import { isEqual } from 'lodash'; -import { DataReader } from '../sql/Client'; -import type { StoryRecipientUpdateEvent } from '../textsecure/messageReceiverEvents'; -import { normalizeStoryDistributionId } from '../types/StoryDistributionId'; -import { createLogger } from '../logging/log'; -import { SendStatus } from '../messages/MessageSendState'; -import { getConversationIdForLogging } from './idForLogging'; -import { isStory } from '../state/selectors/message'; -import { queueUpdateMessage } from './messageBatcher'; -import { isMe } from './whatTypeOfConversation'; -import { drop } from './drop'; -import { fromServiceIdBinaryOrString } from './ServiceId'; -import { handleDeleteForEveryone } from './deleteForEveryone'; -import { MessageModel } from '../models/messages'; +import { DataReader } from '../sql/Client.js'; +import type { StoryRecipientUpdateEvent } from '../textsecure/messageReceiverEvents.js'; +import { normalizeStoryDistributionId } from '../types/StoryDistributionId.js'; +import { createLogger } from '../logging/log.js'; +import { SendStatus } from '../messages/MessageSendState.js'; +import { getConversationIdForLogging } from './idForLogging.js'; +import { isStory } from '../state/selectors/message.js'; +import { queueUpdateMessage } from './messageBatcher.js'; +import { isMe } from './whatTypeOfConversation.js'; +import { drop } from './drop.js'; +import { fromServiceIdBinaryOrString } from './ServiceId.js'; +import { handleDeleteForEveryone } from './deleteForEveryone.js'; +import { MessageModel } from '../models/messages.js'; const log = createLogger('onStoryRecipientUpdate'); diff --git a/ts/util/openLinkInWebBrowser.ts b/ts/util/openLinkInWebBrowser.ts index 6915590cb13..39c760efa6f 100644 --- a/ts/util/openLinkInWebBrowser.ts +++ b/ts/util/openLinkInWebBrowser.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { isValidLink } from '../types/LinkPreview'; +import { isValidLink } from '../types/LinkPreview.js'; export function openLinkInWebBrowser(url: string): void { if (!isValidLink(url)) { diff --git a/ts/util/os/osMain.ts b/ts/util/os/osMain.ts index faef69100a0..5aaebec1935 100644 --- a/ts/util/os/osMain.ts +++ b/ts/util/os/osMain.ts @@ -1,9 +1,9 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import os from 'os'; +import os from 'node:os'; import { readFileSync } from 'fs-extra'; -import { getOSFunctions } from './shared'; +import { getOSFunctions } from './shared.js'; function getLinuxName(): string | undefined { if (os.platform() !== 'linux') { diff --git a/ts/util/os/osPreload.ts b/ts/util/os/osPreload.ts index c57454e8002..efa066f0999 100644 --- a/ts/util/os/osPreload.ts +++ b/ts/util/os/osPreload.ts @@ -1,8 +1,8 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { config } from '../../context/config'; -import { getOSFunctions } from './shared'; +import { config } from '../../context/config.js'; +import { getOSFunctions } from './shared.js'; const OS = getOSFunctions(config.osRelease); diff --git a/ts/util/os/promptOSAuthMain.ts b/ts/util/os/promptOSAuthMain.ts index f26656ceb5c..e99a23fdbf3 100644 --- a/ts/util/os/promptOSAuthMain.ts +++ b/ts/util/os/promptOSAuthMain.ts @@ -2,15 +2,15 @@ // SPDX-License-Identifier: AGPL-3.0-only import { systemPreferences } from 'electron'; -import { exec } from 'child_process'; +import { exec } from 'node:child_process'; import { checkAvailability as checkAvailabilityWindowsUcv, requestVerification as requestVerificationWindowsUcv, } from '@signalapp/windows-ucv'; -import { createLogger } from '../../logging/log'; -import OS from './osMain'; -import { missingCaseError } from '../missingCaseError'; +import { createLogger } from '../../logging/log.js'; +import OS from './osMain.js'; +import { missingCaseError } from '../missingCaseError.js'; const log = createLogger('promptOSAuthMain'); diff --git a/ts/util/parseIntWithFallback.ts b/ts/util/parseIntWithFallback.ts index 2978bd47206..2caf7ec921f 100644 --- a/ts/util/parseIntWithFallback.ts +++ b/ts/util/parseIntWithFallback.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { parseIntOrThrow } from './parseIntOrThrow'; +import { parseIntOrThrow } from './parseIntOrThrow.js'; export function parseIntWithFallback(value: unknown, fallback: number): number { try { diff --git a/ts/util/parseRetryAfter.ts b/ts/util/parseRetryAfter.ts index 19aa9319b8a..a4322606b33 100644 --- a/ts/util/parseRetryAfter.ts +++ b/ts/util/parseRetryAfter.ts @@ -1,8 +1,8 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { SECOND, MINUTE } from './durations'; -import { isNormalNumber } from './isNormalNumber'; +import { SECOND, MINUTE } from './durations/index.js'; +import { isNormalNumber } from './isNormalNumber.js'; const DEFAULT_RETRY_AFTER = MINUTE; const MINIMAL_RETRY_AFTER = SECOND; diff --git a/ts/util/pemToDer.ts b/ts/util/pemToDer.ts index 40c9126c61b..e3cc866e3cd 100644 --- a/ts/util/pemToDer.ts +++ b/ts/util/pemToDer.ts @@ -1,7 +1,7 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import * as Bytes from '../Bytes'; +import * as Bytes from '../Bytes.js'; export function pemToDer(pem: string): Uint8Array { const pemContent = pem diff --git a/ts/util/phoneNumberDiscoverability.ts b/ts/util/phoneNumberDiscoverability.ts index 1a14edd55d7..b2b57248b2f 100644 --- a/ts/util/phoneNumberDiscoverability.ts +++ b/ts/util/phoneNumberDiscoverability.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { makeEnumParser } from './enum'; +import { makeEnumParser } from './enum.js'; // These strings are saved to disk, so be careful when changing them. export enum PhoneNumberDiscoverability { diff --git a/ts/util/phoneNumberSharingMode.ts b/ts/util/phoneNumberSharingMode.ts index e7d250aa0b8..762dfffacb8 100644 --- a/ts/util/phoneNumberSharingMode.ts +++ b/ts/util/phoneNumberSharingMode.ts @@ -1,11 +1,11 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationAttributesType } from '../model-types.d'; +import type { ConversationAttributesType } from '../model-types.d.ts'; -import { makeEnumParser } from './enum'; -import { missingCaseError } from './missingCaseError'; -import { isDirectConversation, isMe } from './whatTypeOfConversation'; +import { makeEnumParser } from './enum.js'; +import { missingCaseError } from './missingCaseError.js'; +import { isDirectConversation, isMe } from './whatTypeOfConversation.js'; // These strings are saved to disk, so be careful when changing them. export enum PhoneNumberSharingMode { diff --git a/ts/util/preload.ts b/ts/util/preload.ts index 36df6cfed06..a1cd5b68e68 100644 --- a/ts/util/preload.ts +++ b/ts/util/preload.ts @@ -3,14 +3,14 @@ import { ipcRenderer } from 'electron'; -import { strictAssert } from './assert'; -import * as Errors from '../types/errors'; -import type { UnwrapPromise } from '../types/Util'; +import { strictAssert } from './assert.js'; +import * as Errors from '../types/errors.js'; +import type { UnwrapPromise } from '../types/Util.js'; import type { IPCEventsCallbacksType, IPCEventsValuesType, -} from './createIPCEvents'; -import type { SystemTraySetting } from '../types/SystemTraySetting'; +} from './createIPCEvents.js'; +import type { SystemTraySetting } from '../types/SystemTraySetting.js'; type SettingOptionsType = { getter?: boolean; diff --git a/ts/util/prependStream.ts b/ts/util/prependStream.ts index ffa3f6677b5..3e92771bf54 100644 --- a/ts/util/prependStream.ts +++ b/ts/util/prependStream.ts @@ -1,8 +1,8 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { Transform } from 'stream'; -import type { Duplex } from 'stream'; +import { Transform } from 'node:stream'; +import type { Duplex } from 'node:stream'; export function prependStream(data: Uint8Array): Duplex { return new Transform({ diff --git a/ts/util/privacy.ts b/ts/util/privacy.ts index 7e06be2449c..43a3be5f829 100644 --- a/ts/util/privacy.ts +++ b/ts/util/privacy.ts @@ -3,13 +3,13 @@ /* eslint-env node */ -import path from 'path'; +import path from 'node:path'; import { compose } from 'lodash/fp'; import { escapeRegExp, isString, isRegExp } from 'lodash'; -import type { ExtendedStorageID } from '../types/StorageService.d'; -import type { ConversationModel } from '../models/conversations'; +import type { ExtendedStorageID } from '../types/StorageService.d.ts'; +import type { ConversationModel } from '../models/conversations.js'; export const APP_ROOT_PATH = path.join(__dirname, '..', '..'); diff --git a/ts/util/processAttachment.ts b/ts/util/processAttachment.ts index 44c3af432a2..4e2149c88f7 100644 --- a/ts/util/processAttachment.ts +++ b/ts/util/processAttachment.ts @@ -3,25 +3,25 @@ import { v4 as generateUuid } from 'uuid'; -import { createLogger } from '../logging/log'; +import { createLogger } from '../logging/log.js'; import type { AttachmentType, InMemoryAttachmentDraftType, -} from '../types/Attachment'; +} from '../types/Attachment.js'; import { getMaximumOutgoingAttachmentSizeInKb, getRenderDetailsForLimit, KIBIBYTE, -} from '../types/AttachmentSize'; -import * as Errors from '../types/errors'; -import { getValue as getRemoteConfigValue } from '../RemoteConfig'; -import { fileToBytes } from './fileToBytes'; -import { handleImageAttachment } from './handleImageAttachment'; -import { handleVideoAttachment } from './handleVideoAttachment'; -import { isHeic, stringToMIMEType } from '../types/MIME'; -import { ToastType } from '../types/Toast'; -import { isImageTypeSupported, isVideoTypeSupported } from './GoogleChrome'; -import { getAttachmentCiphertextLength } from '../AttachmentCrypto'; +} from '../types/AttachmentSize.js'; +import * as Errors from '../types/errors.js'; +import { getValue as getRemoteConfigValue } from '../RemoteConfig.js'; +import { fileToBytes } from './fileToBytes.js'; +import { handleImageAttachment } from './handleImageAttachment.js'; +import { handleVideoAttachment } from './handleVideoAttachment.js'; +import { isHeic, stringToMIMEType } from '../types/MIME.js'; +import { ToastType } from '../types/Toast.js'; +import { isImageTypeSupported, isVideoTypeSupported } from './GoogleChrome.js'; +import { getAttachmentCiphertextLength } from '../AttachmentCrypto.js'; const log = createLogger('processAttachment'); diff --git a/ts/util/processImageFile.ts b/ts/util/processImageFile.ts index 7a659d80ab2..9f77eb9a660 100644 --- a/ts/util/processImageFile.ts +++ b/ts/util/processImageFile.ts @@ -3,7 +3,7 @@ import type { LoadImageOptions } from 'blueimp-load-image'; import loadImage from 'blueimp-load-image'; -import { canvasToBytes } from './canvasToBytes'; +import { canvasToBytes } from './canvasToBytes.js'; export async function processImageFile(file: File): Promise { const { image } = await loadImage(file, { diff --git a/ts/util/promptOSAuth.ts b/ts/util/promptOSAuth.ts index cc89c8f4218..3c90dec0c89 100644 --- a/ts/util/promptOSAuth.ts +++ b/ts/util/promptOSAuth.ts @@ -5,7 +5,7 @@ import { ipcRenderer } from 'electron'; import type { PromptOSAuthReasonType, PromptOSAuthResultType, -} from './os/promptOSAuthMain'; +} from './os/promptOSAuthMain.js'; export async function promptOSAuth( reason: PromptOSAuthReasonType diff --git a/ts/util/queueAttachmentDownloads.ts b/ts/util/queueAttachmentDownloads.ts index 288a41c8638..dbb04a3e67b 100644 --- a/ts/util/queueAttachmentDownloads.ts +++ b/ts/util/queueAttachmentDownloads.ts @@ -1,24 +1,24 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log'; -import { isAudio, isImage, isLongMessage, isVideo } from '../types/MIME'; -import { getMessageIdForLogging } from './idForLogging'; +import { createLogger } from '../logging/log.js'; +import { isAudio, isImage, isLongMessage, isVideo } from '../types/MIME.js'; +import { getMessageIdForLogging } from './idForLogging.js'; import { copyStickerToAttachments, savePackMetadata, getStickerPackStatus, -} from '../types/Stickers'; -import { DataWriter } from '../sql/Client'; +} from '../types/Stickers.js'; +import { DataWriter } from '../sql/Client.js'; -import type { AttachmentType, ThumbnailType } from '../types/Attachment'; -import type { EmbeddedContactType } from '../types/EmbeddedContact'; +import type { AttachmentType, ThumbnailType } from '../types/Attachment.js'; +import type { EmbeddedContactType } from '../types/EmbeddedContact.js'; import type { EditHistoryType, MessageAttributesType, QuotedMessageType, -} from '../model-types.d'; -import * as Errors from '../types/errors'; +} from '../model-types.d.ts'; +import * as Errors from '../types/errors.js'; import { isDownloading, isDownloaded, @@ -27,26 +27,26 @@ import { getCachedAttachmentBySignature, cacheAttachmentBySignature, getUndownloadedAttachmentSignature, -} from '../types/Attachment'; -import { AttachmentDownloadUrgency } from '../types/AttachmentDownload'; -import type { StickerType } from '../types/Stickers'; -import type { LinkPreviewType } from '../types/message/LinkPreviews'; -import { strictAssert } from './assert'; -import { isNotNil } from './isNotNil'; -import { AttachmentDownloadManager } from '../jobs/AttachmentDownloadManager'; -import { AttachmentDownloadSource } from '../sql/Interface'; -import type { MessageModel } from '../models/messages'; -import type { ConversationModel } from '../models/conversations'; -import { isOutgoing, isStory } from '../messages/helpers'; -import { shouldDownloadStory } from './shouldDownloadStory'; -import { hasAttachmentDownloads } from './hasAttachmentDownloads'; +} from '../types/Attachment.js'; +import { AttachmentDownloadUrgency } from '../types/AttachmentDownload.js'; +import type { StickerType } from '../types/Stickers.js'; +import type { LinkPreviewType } from '../types/message/LinkPreviews.js'; +import { strictAssert } from './assert.js'; +import { isNotNil } from './isNotNil.js'; +import { AttachmentDownloadManager } from '../jobs/AttachmentDownloadManager.js'; +import { AttachmentDownloadSource } from '../sql/Interface.js'; +import type { MessageModel } from '../models/messages.js'; +import type { ConversationModel } from '../models/conversations.js'; +import { isOutgoing, isStory } from '../messages/helpers.js'; +import { shouldDownloadStory } from './shouldDownloadStory.js'; +import { hasAttachmentDownloads } from './hasAttachmentDownloads.js'; import { addToAttachmentDownloadQueue, shouldUseAttachmentDownloadQueue, -} from './attachmentDownloadQueue'; -import { queueUpdateMessage } from './messageBatcher'; -import type { LoggerType } from '../types/Logging'; -import { DEFAULT_AUTO_DOWNLOAD_ATTACHMENT } from '../textsecure/Storage'; +} from './attachmentDownloadQueue.js'; +import { queueUpdateMessage } from './messageBatcher.js'; +import type { LoggerType } from '../types/Logging.js'; +import { DEFAULT_AUTO_DOWNLOAD_ATTACHMENT } from '../textsecure/Storage.js'; const defaultLogger = createLogger('queueAttachmentDownloads'); diff --git a/ts/util/randomBlurHash.ts b/ts/util/randomBlurHash.ts index b763d7082b2..67b9e49e013 100644 --- a/ts/util/randomBlurHash.ts +++ b/ts/util/randomBlurHash.ts @@ -3,7 +3,7 @@ import { encode } from 'blurhash'; -import { hslToRGB } from './hslToRGB'; +import { hslToRGB } from './hslToRGB.js'; export function randomBlurHash(): string { const data = new Uint8ClampedArray(2 * 2 * 4); diff --git a/ts/util/removePendingMember.ts b/ts/util/removePendingMember.ts index 763b6992218..c94d2b8e25b 100644 --- a/ts/util/removePendingMember.ts +++ b/ts/util/removePendingMember.ts @@ -1,13 +1,13 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationAttributesType } from '../model-types.d'; -import type { SignalService as Proto } from '../protobuf'; -import type { ServiceIdString } from '../types/ServiceId'; -import { createLogger } from '../logging/log'; -import { getConversationIdForLogging } from './idForLogging'; -import { isMemberPending } from './groupMembershipUtils'; -import { isNotNil } from './isNotNil'; +import type { ConversationAttributesType } from '../model-types.d.ts'; +import type { SignalService as Proto } from '../protobuf/index.js'; +import type { ServiceIdString } from '../types/ServiceId.js'; +import { createLogger } from '../logging/log.js'; +import { getConversationIdForLogging } from './idForLogging.js'; +import { isMemberPending } from './groupMembershipUtils.js'; +import { isNotNil } from './isNotNil.js'; const log = createLogger('removePendingMember'); diff --git a/ts/util/resolveAttachmentDraftData.ts b/ts/util/resolveAttachmentDraftData.ts index cf01ff272e6..28ad3bf201e 100644 --- a/ts/util/resolveAttachmentDraftData.ts +++ b/ts/util/resolveAttachmentDraftData.ts @@ -1,8 +1,8 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log'; -import type { AttachmentType } from '../types/Attachment'; +import { createLogger } from '../logging/log.js'; +import type { AttachmentType } from '../types/Attachment.js'; const log = createLogger('resolveAttachmentDraftData'); diff --git a/ts/util/resolveDraftAttachmentOnDisk.ts b/ts/util/resolveDraftAttachmentOnDisk.ts index cd53b4583f7..eb8e34f0f68 100644 --- a/ts/util/resolveDraftAttachmentOnDisk.ts +++ b/ts/util/resolveDraftAttachmentOnDisk.ts @@ -1,13 +1,13 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log'; -import type { AttachmentDraftType } from '../types/Attachment'; -import { isVideoAttachment } from '../types/Attachment'; +import { createLogger } from '../logging/log.js'; +import type { AttachmentDraftType } from '../types/Attachment.js'; +import { isVideoAttachment } from '../types/Attachment.js'; import { getLocalAttachmentUrl, AttachmentDisposition, -} from './getLocalAttachmentUrl'; +} from './getLocalAttachmentUrl.js'; const log = createLogger('resolveDraftAttachmentOnDisk'); diff --git a/ts/util/resolveStorySendStatus.ts b/ts/util/resolveStorySendStatus.ts index 9650ffbbb2a..bd691b54e30 100644 --- a/ts/util/resolveStorySendStatus.ts +++ b/ts/util/resolveStorySendStatus.ts @@ -1,10 +1,10 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { StorySendStateType } from '../types/Stories'; -import { ResolvedSendStatus } from '../types/Stories'; -import { isFailed, isPending, isSent } from '../messages/MessageSendState'; -import { softAssert } from './assert'; +import type { StorySendStateType } from '../types/Stories.js'; +import { ResolvedSendStatus } from '../types/Stories.js'; +import { isFailed, isPending, isSent } from '../messages/MessageSendState.js'; +import { softAssert } from './assert.js'; export function resolveStorySendStatus( sendStates: Array diff --git a/ts/util/retryPlaceholders.ts b/ts/util/retryPlaceholders.ts index 2e6f7814293..62712adcad0 100644 --- a/ts/util/retryPlaceholders.ts +++ b/ts/util/retryPlaceholders.ts @@ -3,9 +3,9 @@ import { z } from 'zod'; import { groupBy } from 'lodash'; -import { createLogger } from '../logging/log'; -import { aciSchema } from '../types/ServiceId'; -import { safeParseStrict } from './schemas'; +import { createLogger } from '../logging/log.js'; +import { aciSchema } from '../types/ServiceId.js'; +import { safeParseStrict } from './schemas.js'; const log = createLogger('retryPlaceholders'); diff --git a/ts/util/ringrtc/nonRenderedRemoteParticipant.ts b/ts/util/ringrtc/nonRenderedRemoteParticipant.ts index 4f2ae27a612..e2b2a0ac509 100644 --- a/ts/util/ringrtc/nonRenderedRemoteParticipant.ts +++ b/ts/util/ringrtc/nonRenderedRemoteParticipant.ts @@ -1,7 +1,7 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { GroupCallVideoRequest } from '../../types/Calling'; +import type { GroupCallVideoRequest } from '../../types/Calling.js'; export const nonRenderedRemoteParticipant = ({ demuxId, diff --git a/ts/util/rotatingPinoDest.ts b/ts/util/rotatingPinoDest.ts index 02f74ec928b..5c2ae8adb06 100644 --- a/ts/util/rotatingPinoDest.ts +++ b/ts/util/rotatingPinoDest.ts @@ -1,11 +1,11 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import fs from 'fs'; +import fs from 'node:fs'; import pino from 'pino'; -import { DAY, SECOND } from './durations'; -import { isMoreRecentThan } from './timestamp'; +import { DAY, SECOND } from './durations/index.js'; +import { isMoreRecentThan } from './timestamp.js'; export const DEFAULT_MAX_ROTATIONS = 3; diff --git a/ts/util/safetyNumber.ts b/ts/util/safetyNumber.ts index a9b4d839e3f..d635b036caf 100644 --- a/ts/util/safetyNumber.ts +++ b/ts/util/safetyNumber.ts @@ -2,13 +2,13 @@ // SPDX-License-Identifier: AGPL-3.0-only import { PublicKey, Fingerprint } from '@signalapp/libsignal-client'; -import type { ConversationType } from '../state/ducks/conversations'; +import type { ConversationType } from '../state/ducks/conversations.js'; -import { assertDev } from './assert'; -import { uuidToBytes } from './uuidToBytes'; -import { createLogger } from '../logging/log'; -import type { SafetyNumberType } from '../types/safetyNumber'; -import { isAciString } from './isAciString'; +import { assertDev } from './assert.js'; +import { uuidToBytes } from './uuidToBytes.js'; +import { createLogger } from '../logging/log.js'; +import type { SafetyNumberType } from '../types/safetyNumber.js'; +import { isAciString } from './isAciString.js'; const log = createLogger('safetyNumber'); diff --git a/ts/util/scaleImageToLevel.ts b/ts/util/scaleImageToLevel.ts index 4c6ac51212c..e4fdbd8623d 100644 --- a/ts/util/scaleImageToLevel.ts +++ b/ts/util/scaleImageToLevel.ts @@ -4,11 +4,11 @@ import type { LoadImageResult } from 'blueimp-load-image'; import loadImage from 'blueimp-load-image'; -import type { MIMEType } from '../types/MIME'; -import { IMAGE_JPEG } from '../types/MIME'; -import { canvasToBlob } from './canvasToBlob'; -import { getValue } from '../RemoteConfig'; -import { parseNumber } from './libphonenumberUtil'; +import type { MIMEType } from '../types/MIME.js'; +import { IMAGE_JPEG } from '../types/MIME.js'; +import { canvasToBlob } from './canvasToBlob.js'; +import { getValue } from '../RemoteConfig.js'; +import { parseNumber } from './libphonenumberUtil.js'; enum MediaQualityLevels { One = 1, diff --git a/ts/util/searchConversationTitles.ts b/ts/util/searchConversationTitles.ts index 1d2477f2e56..6e0bce14a02 100644 --- a/ts/util/searchConversationTitles.ts +++ b/ts/util/searchConversationTitles.ts @@ -3,8 +3,8 @@ import type Fuse from 'fuse.js'; -import type { ConversationType } from '../state/ducks/conversations'; -import { fuseGetFnRemoveDiacritics, getCachedFuseIndex } from './fuse'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import { fuseGetFnRemoveDiacritics, getCachedFuseIndex } from './fuse.js'; const CONVERSATION_TITLE = 'title'; const MIN_SEARCH_TERM_LENGTH = 2; diff --git a/ts/util/sendCallLinkUpdateSync.ts b/ts/util/sendCallLinkUpdateSync.ts index 6e07e42ed53..def4da78533 100644 --- a/ts/util/sendCallLinkUpdateSync.ts +++ b/ts/util/sendCallLinkUpdateSync.ts @@ -3,15 +3,15 @@ import { ContentHint } from '@signalapp/libsignal-client'; -import * as Bytes from '../Bytes'; -import { CallLinkUpdateSyncType } from '../types/CallLink'; -import { createLogger } from '../logging/log'; -import * as Errors from '../types/errors'; -import { SignalService as Proto } from '../protobuf'; -import { singleProtoJobQueue } from '../jobs/singleProtoJobQueue'; -import MessageSender from '../textsecure/SendMessage'; -import { toAdminKeyBytes } from './callLinks'; -import { toEpochBytes, toRootKeyBytes } from './callLinksRingrtc'; +import * as Bytes from '../Bytes.js'; +import { CallLinkUpdateSyncType } from '../types/CallLink.js'; +import { createLogger } from '../logging/log.js'; +import * as Errors from '../types/errors.js'; +import { SignalService as Proto } from '../protobuf/index.js'; +import { singleProtoJobQueue } from '../jobs/singleProtoJobQueue.js'; +import MessageSender from '../textsecure/SendMessage.js'; +import { toAdminKeyBytes } from './callLinks.js'; +import { toEpochBytes, toRootKeyBytes } from './callLinksRingrtc.js'; const log = createLogger('sendCallLinkUpdateSync'); diff --git a/ts/util/sendDeleteForEveryoneMessage.ts b/ts/util/sendDeleteForEveryoneMessage.ts index 1d4530f19c3..49bdadef59b 100644 --- a/ts/util/sendDeleteForEveryoneMessage.ts +++ b/ts/util/sendDeleteForEveryoneMessage.ts @@ -1,25 +1,25 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationAttributesType } from '../model-types.d'; -import type { ConversationQueueJobData } from '../jobs/conversationJobQueue'; -import * as Errors from '../types/errors'; -import { DAY } from './durations'; -import { createLogger } from '../logging/log'; +import type { ConversationAttributesType } from '../model-types.d.ts'; +import type { ConversationQueueJobData } from '../jobs/conversationJobQueue.js'; +import * as Errors from '../types/errors.js'; +import { DAY } from './durations/index.js'; +import { createLogger } from '../logging/log.js'; import { conversationJobQueue, conversationQueueJobEnum, -} from '../jobs/conversationJobQueue'; -import { deleteForEveryone } from './deleteForEveryone'; +} from '../jobs/conversationJobQueue.js'; +import { deleteForEveryone } from './deleteForEveryone.js'; import { getConversationIdForLogging, getMessageIdForLogging, -} from './idForLogging'; -import { getMessageById } from '../messages/getMessageById'; -import { getRecipientConversationIds } from './getRecipientConversationIds'; -import { getRecipients } from './getRecipients'; -import { repeat, zipObject } from './iterables'; -import { isMe } from './whatTypeOfConversation'; +} from './idForLogging.js'; +import { getMessageById } from '../messages/getMessageById.js'; +import { getRecipientConversationIds } from './getRecipientConversationIds.js'; +import { getRecipients } from './getRecipients.js'; +import { repeat, zipObject } from './iterables.js'; +import { isMe } from './whatTypeOfConversation.js'; const log = createLogger('sendDeleteForEveryoneMessage'); diff --git a/ts/util/sendEditedMessage.ts b/ts/util/sendEditedMessage.ts index 6152b3c2dfc..206905f3f1d 100644 --- a/ts/util/sendEditedMessage.ts +++ b/ts/util/sendEditedMessage.ts @@ -3,37 +3,37 @@ import { v4 as generateUuid } from 'uuid'; -import type { DraftBodyRanges } from '../types/BodyRange'; -import type { LinkPreviewType } from '../types/message/LinkPreviews'; +import type { DraftBodyRanges } from '../types/BodyRange.js'; +import type { LinkPreviewType } from '../types/message/LinkPreviews.js'; import type { MessageAttributesType, QuotedMessageType, -} from '../model-types.d'; -import { createLogger } from '../logging/log'; -import { DataReader, DataWriter } from '../sql/Client'; -import type { AttachmentType } from '../types/Attachment'; -import { ErrorWithToast } from '../types/ErrorWithToast'; -import { SendStatus } from '../messages/MessageSendState'; -import { ToastType } from '../types/Toast'; -import type { AciString } from '../types/ServiceId'; -import { canEditMessage, isWithinMaxEdits } from './canEditMessage'; +} from '../model-types.d.ts'; +import { createLogger } from '../logging/log.js'; +import { DataReader, DataWriter } from '../sql/Client.js'; +import type { AttachmentType } from '../types/Attachment.js'; +import { ErrorWithToast } from '../types/ErrorWithToast.js'; +import { SendStatus } from '../messages/MessageSendState.js'; +import { ToastType } from '../types/Toast.js'; +import type { AciString } from '../types/ServiceId.js'; +import { canEditMessage, isWithinMaxEdits } from './canEditMessage.js'; import { conversationJobQueue, conversationQueueJobEnum, -} from '../jobs/conversationJobQueue'; -import { concat, filter, map, repeat, zipObject, find } from './iterables'; -import { getConversationIdForLogging } from './idForLogging'; -import { isQuoteAMatch } from '../messages/helpers'; -import { getMessageById } from '../messages/getMessageById'; -import { handleEditMessage } from './handleEditMessage'; -import { incrementMessageCounter } from './incrementMessageCounter'; -import { isGroupV1 } from './whatTypeOfConversation'; -import { isNotNil } from './isNotNil'; -import { isSignalConversation } from './isSignalConversation'; -import { strictAssert } from './assert'; -import { timeAndLogIfTooLong } from './timeAndLogIfTooLong'; -import { makeQuote } from './makeQuote'; -import { getMessageSentTimestamp } from './getMessageSentTimestamp'; +} from '../jobs/conversationJobQueue.js'; +import { concat, filter, map, repeat, zipObject, find } from './iterables.js'; +import { getConversationIdForLogging } from './idForLogging.js'; +import { isQuoteAMatch } from '../messages/helpers.js'; +import { getMessageById } from '../messages/getMessageById.js'; +import { handleEditMessage } from './handleEditMessage.js'; +import { incrementMessageCounter } from './incrementMessageCounter.js'; +import { isGroupV1 } from './whatTypeOfConversation.js'; +import { isNotNil } from './isNotNil.js'; +import { isSignalConversation } from './isSignalConversation.js'; +import { strictAssert } from './assert.js'; +import { timeAndLogIfTooLong } from './timeAndLogIfTooLong.js'; +import { makeQuote } from './makeQuote.js'; +import { getMessageSentTimestamp } from './getMessageSentTimestamp.js'; const log = createLogger('sendEditedMessage'); diff --git a/ts/util/sendReceipts.ts b/ts/util/sendReceipts.ts index bcfcc00ba59..7b1dc57a9e6 100644 --- a/ts/util/sendReceipts.ts +++ b/ts/util/sendReceipts.ts @@ -2,17 +2,17 @@ // SPDX-License-Identifier: AGPL-3.0-only import { chunk, map } from 'lodash'; -import type { LoggerType } from '../types/Logging'; -import type { Receipt } from '../types/Receipt'; -import { ReceiptType } from '../types/Receipt'; -import { getSendOptions } from './getSendOptions'; -import { handleMessageSend } from './handleMessageSend'; -import { isConversationAccepted } from './isConversationAccepted'; -import { isConversationUnregistered } from './isConversationUnregistered'; -import { missingCaseError } from './missingCaseError'; -import type { ConversationModel } from '../models/conversations'; -import { mapEmplace } from './mapEmplace'; -import { isSignalConversation } from './isSignalConversation'; +import type { LoggerType } from '../types/Logging.js'; +import type { Receipt } from '../types/Receipt.js'; +import { ReceiptType } from '../types/Receipt.js'; +import { getSendOptions } from './getSendOptions.js'; +import { handleMessageSend } from './handleMessageSend.js'; +import { isConversationAccepted } from './isConversationAccepted.js'; +import { isConversationUnregistered } from './isConversationUnregistered.js'; +import { missingCaseError } from './missingCaseError.js'; +import type { ConversationModel } from '../models/conversations.js'; +import { mapEmplace } from './mapEmplace.js'; +import { isSignalConversation } from './isSignalConversation.js'; const CHUNK_SIZE = 100; diff --git a/ts/util/sendStoryMessage.ts b/ts/util/sendStoryMessage.ts index df93910b895..0d1b90b7bd6 100644 --- a/ts/util/sendStoryMessage.ts +++ b/ts/util/sendStoryMessage.ts @@ -3,35 +3,35 @@ import { v4 as generateUuid } from 'uuid'; -import type { AttachmentType } from '../types/Attachment'; -import type { MessageAttributesType } from '../model-types.d'; +import type { AttachmentType } from '../types/Attachment.js'; +import type { MessageAttributesType } from '../model-types.d.ts'; import type { SendState, SendStateByConversationId, -} from '../messages/MessageSendState'; -import type { StoryDistributionIdString } from '../types/StoryDistributionId'; -import type { ServiceIdString } from '../types/ServiceId'; -import { createLogger } from '../logging/log'; -import { DataReader, DataWriter } from '../sql/Client'; -import { MY_STORY_ID, StorySendMode } from '../types/Stories'; -import { getStoriesBlocked } from './stories'; -import { ReadStatus } from '../messages/MessageReadStatus'; -import { SeenStatus } from '../MessageSeenStatus'; -import { SendStatus } from '../messages/MessageSendState'; +} from '../messages/MessageSendState.js'; +import type { StoryDistributionIdString } from '../types/StoryDistributionId.js'; +import type { ServiceIdString } from '../types/ServiceId.js'; +import { createLogger } from '../logging/log.js'; +import { DataReader, DataWriter } from '../sql/Client.js'; +import { MY_STORY_ID, StorySendMode } from '../types/Stories.js'; +import { getStoriesBlocked } from './stories.js'; +import { ReadStatus } from '../messages/MessageReadStatus.js'; +import { SeenStatus } from '../MessageSeenStatus.js'; +import { SendStatus } from '../messages/MessageSendState.js'; import { conversationJobQueue, conversationQueueJobEnum, -} from '../jobs/conversationJobQueue'; -import { getRecipients } from './getRecipients'; -import { getSignalConnections } from './getSignalConnections'; -import { incrementMessageCounter } from './incrementMessageCounter'; -import { isGroupV2 } from './whatTypeOfConversation'; -import { isNotNil } from './isNotNil'; -import { collect } from './iterables'; -import { DurationInSeconds } from './durations'; -import { sanitizeLinkPreview } from '../services/LinkPreview'; -import type { DraftBodyRanges } from '../types/BodyRange'; -import { MessageModel } from '../models/messages'; +} from '../jobs/conversationJobQueue.js'; +import { getRecipients } from './getRecipients.js'; +import { getSignalConnections } from './getSignalConnections.js'; +import { incrementMessageCounter } from './incrementMessageCounter.js'; +import { isGroupV2 } from './whatTypeOfConversation.js'; +import { isNotNil } from './isNotNil.js'; +import { collect } from './iterables.js'; +import { DurationInSeconds } from './durations/index.js'; +import { sanitizeLinkPreview } from '../services/LinkPreview.js'; +import type { DraftBodyRanges } from '../types/BodyRange.js'; +import { MessageModel } from '../models/messages.js'; const log = createLogger('sendStoryMessage'); diff --git a/ts/util/sendToGroup.ts b/ts/util/sendToGroup.ts index 3803f1747fd..34ae3bf540d 100644 --- a/ts/util/sendToGroup.ts +++ b/ts/util/sendToGroup.ts @@ -14,27 +14,27 @@ import { SenderCertificate, UnidentifiedSenderMessageContent, } from '@signalapp/libsignal-client'; -import { senderCertificateService } from '../services/senderCertificate'; -import type { SendLogCallbackType } from '../textsecure/OutgoingMessage'; +import { senderCertificateService } from '../services/senderCertificate.js'; +import type { SendLogCallbackType } from '../textsecure/OutgoingMessage.js'; import { padMessage, SenderCertificateMode, -} from '../textsecure/OutgoingMessage'; -import { Address } from '../types/Address'; -import { QualifiedAddress } from '../types/QualifiedAddress'; -import * as Errors from '../types/errors'; -import { DataWriter } from '../sql/Client'; -import { getValue } from '../RemoteConfig'; -import type { ServiceIdString } from '../types/ServiceId'; -import { ServiceIdKind } from '../types/ServiceId'; -import * as Bytes from '../Bytes'; -import { isRecord } from './isRecord'; +} from '../textsecure/OutgoingMessage.js'; +import { Address } from '../types/Address.js'; +import { QualifiedAddress } from '../types/QualifiedAddress.js'; +import * as Errors from '../types/errors.js'; +import { DataWriter } from '../sql/Client.js'; +import { getValue } from '../RemoteConfig.js'; +import type { ServiceIdString } from '../types/ServiceId.js'; +import { ServiceIdKind } from '../types/ServiceId.js'; +import * as Bytes from '../Bytes.js'; +import { isRecord } from './isRecord.js'; -import { isOlderThan } from './timestamp'; +import { isOlderThan } from './timestamp.js'; import type { GroupSendOptionsType, SendOptionsType, -} from '../textsecure/SendMessage'; +} from '../textsecure/SendMessage.js'; import { ConnectTimeoutError, IncorrectSenderKeyAuthError, @@ -43,38 +43,38 @@ import { UnknownRecipientError, UnregisteredUserError, HTTPError, -} from '../textsecure/Errors'; -import { IdentityKeys, SenderKeys, Sessions } from '../LibSignalStores'; -import type { ConversationModel } from '../models/conversations'; -import type { DeviceType, CallbackResultType } from '../textsecure/Types.d'; -import { getKeysForServiceId } from '../textsecure/getKeysForServiceId'; +} from '../textsecure/Errors.js'; +import { IdentityKeys, SenderKeys, Sessions } from '../LibSignalStores.js'; +import type { ConversationModel } from '../models/conversations.js'; +import type { DeviceType, CallbackResultType } from '../textsecure/Types.d.ts'; +import { getKeysForServiceId } from '../textsecure/getKeysForServiceId.js'; import type { ConversationAttributesType, SenderKeyInfoType, -} from '../model-types.d'; -import type { SendTypesType } from './handleMessageSend'; -import { handleMessageSend, shouldSaveProto } from './handleMessageSend'; -import { SEALED_SENDER, ZERO_ACCESS_KEY } from '../types/SealedSender'; -import { parseIntOrThrow } from './parseIntOrThrow'; +} from '../model-types.d.ts'; +import type { SendTypesType } from './handleMessageSend.js'; +import { handleMessageSend, shouldSaveProto } from './handleMessageSend.js'; +import { SEALED_SENDER, ZERO_ACCESS_KEY } from '../types/SealedSender.js'; +import { parseIntOrThrow } from './parseIntOrThrow.js'; import { multiRecipient200ResponseSchema, multiRecipient409ResponseSchema, multiRecipient410ResponseSchema, -} from '../textsecure/WebAPI'; -import { SignalService as Proto } from '../protobuf'; +} from '../textsecure/WebAPI.js'; +import { SignalService as Proto } from '../protobuf/index.js'; -import { strictAssert } from './assert'; -import { createLogger } from '../logging/log'; -import { GLOBAL_ZONE } from '../SignalProtocolStore'; -import { waitForAll } from './waitForAll'; -import type { GroupSendEndorsementState } from './groupSendEndorsements'; +import { strictAssert } from './assert.js'; +import { createLogger } from '../logging/log.js'; +import { GLOBAL_ZONE } from '../SignalProtocolStore.js'; +import { waitForAll } from './waitForAll.js'; +import type { GroupSendEndorsementState } from './groupSendEndorsements.js'; import { maybeCreateGroupSendEndorsementState, onFailedToSendWithEndorsements, -} from './groupSendEndorsements'; -import type { GroupSendToken } from '../types/GroupSendEndorsements'; -import { isAciString } from './isAciString'; -import { safeParseStrict, safeParseUnknown } from './schemas'; +} from './groupSendEndorsements.js'; +import type { GroupSendToken } from '../types/GroupSendEndorsements.js'; +import { isAciString } from './isAciString.js'; +import { safeParseStrict, safeParseUnknown } from './schemas.js'; const log = createLogger('sendToGroup'); diff --git a/ts/util/sessionTranslation.ts b/ts/util/sessionTranslation.ts index 8a1a4fc7434..873e8b4dd50 100644 --- a/ts/util/sessionTranslation.ts +++ b/ts/util/sessionTranslation.ts @@ -3,9 +3,9 @@ import { get, isFinite, isInteger, isString } from 'lodash'; -import { signal } from '../protobuf/compiled'; -import * as Bytes from '../Bytes'; -import { deriveSecrets } from '../Crypto'; +import { signal } from '../protobuf/compiled.js'; +import * as Bytes from '../Bytes.js'; +import { deriveSecrets } from '../Crypto.js'; const { RecordStructure, SessionStructure } = signal.proto.storage; const { Chain } = SessionStructure; diff --git a/ts/util/setUtil.ts b/ts/util/setUtil.ts index 9d0d361a180..15b8249acee 100644 --- a/ts/util/setUtil.ts +++ b/ts/util/setUtil.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { every } from './iterables'; +import { every } from './iterables.js'; const add = (set: Readonly>, item: T): Set => new Set(set).add(item); diff --git a/ts/util/setupI18n.tsx b/ts/util/setupI18n.tsx index c18a92785a0..06b8ab0b73e 100644 --- a/ts/util/setupI18n.tsx +++ b/ts/util/setupI18n.tsx @@ -3,17 +3,17 @@ import type { IntlShape } from 'react-intl'; import React from 'react'; -import type { LocaleMessagesType } from '../types/I18N'; -import type { LocalizerType } from '../types/Util'; -import { Emojify } from '../components/conversation/Emojify'; +import type { LocaleMessagesType } from '../types/I18N.js'; +import type { LocalizerType } from '../types/Util.js'; +import { Emojify } from '../components/conversation/Emojify.js'; import { createCachedIntl as createCachedIntlMain, setupI18n as setupI18nMain, -} from './setupI18nMain'; -import type { SetupI18nOptionsType } from './setupI18nMain'; -import { strictAssert } from './assert'; +} from './setupI18nMain.js'; +import type { SetupI18nOptionsType } from './setupI18nMain.js'; +import { strictAssert } from './assert.js'; -export { isLocaleMessageType } from './setupI18nMain'; +export { isLocaleMessageType } from './setupI18nMain.js'; export function renderEmojify(parts: ReadonlyArray): JSX.Element { strictAssert(parts.length === 1, ' must contain only one child'); diff --git a/ts/util/setupI18nMain.ts b/ts/util/setupI18nMain.ts index f8822915b24..4bde6057579 100644 --- a/ts/util/setupI18nMain.ts +++ b/ts/util/setupI18nMain.ts @@ -4,17 +4,17 @@ import type { IntlShape } from 'react-intl'; import { createIntl, createIntlCache } from 'react-intl'; import type { ReactNode } from 'react'; -import type { LocaleMessageType, LocaleMessagesType } from '../types/I18N'; +import type { LocaleMessageType, LocaleMessagesType } from '../types/I18N.js'; import type { LocalizerType, ICUStringMessageParamsByKeyType, LocalizerOptions, -} from '../types/Util'; -import { strictAssert } from './assert'; -import { createLogger } from '../logging/log'; -import * as Errors from '../types/errors'; -import { Environment, getEnvironment } from '../environment'; -import { bidiIsolate, bidiStrip } from './unicodeBidi'; +} from '../types/Util.js'; +import { strictAssert } from './assert.js'; +import { createLogger } from '../logging/log.js'; +import * as Errors from '../types/errors.js'; +import { Environment, getEnvironment } from '../environment.js'; +import { bidiIsolate, bidiStrip } from './unicodeBidi.js'; const log = createLogger('setupI18nMain'); diff --git a/ts/util/shouldDownloadStory.ts b/ts/util/shouldDownloadStory.ts index 1b8578cb264..84318155237 100644 --- a/ts/util/shouldDownloadStory.ts +++ b/ts/util/shouldDownloadStory.ts @@ -1,10 +1,10 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationAttributesType } from '../model-types.d'; +import type { ConversationAttributesType } from '../model-types.d.ts'; -import { DataReader } from '../sql/Client'; -import { isMe } from './whatTypeOfConversation'; +import { DataReader } from '../sql/Client.js'; +import { isMe } from './whatTypeOfConversation.js'; const MAX_NUM_STORIES_TO_PREFETCH = 5; diff --git a/ts/util/shouldNeverBeCalled.ts b/ts/util/shouldNeverBeCalled.ts index 9532c4405ed..f5f4b89d42d 100644 --- a/ts/util/shouldNeverBeCalled.ts +++ b/ts/util/shouldNeverBeCalled.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { assertDev } from './assert'; +import { assertDev } from './assert.js'; export function shouldNeverBeCalled(..._args: ReadonlyArray): never { assertDev(false, 'This should never be called. Doing nothing'); diff --git a/ts/util/shouldRespondWithProfileKey.ts b/ts/util/shouldRespondWithProfileKey.ts index 6cdb746059d..8ea9b8fe421 100644 --- a/ts/util/shouldRespondWithProfileKey.ts +++ b/ts/util/shouldRespondWithProfileKey.ts @@ -1,8 +1,8 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationModel } from '../models/conversations'; -import { isMe } from './whatTypeOfConversation'; +import type { ConversationModel } from '../models/conversations.js'; +import { isMe } from './whatTypeOfConversation.js'; export async function shouldRespondWithProfileKey( sender: ConversationModel diff --git a/ts/util/shouldShowInvalidMessageToast.ts b/ts/util/shouldShowInvalidMessageToast.ts index 384d79e6f7b..4f5a83d4163 100644 --- a/ts/util/shouldShowInvalidMessageToast.ts +++ b/ts/util/shouldShowInvalidMessageToast.ts @@ -1,17 +1,17 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationAttributesType } from '../model-types'; -import { hasExpired } from '../state/selectors/expiration'; -import { isOSUnsupported } from '../state/selectors/updates'; +import type { ConversationAttributesType } from '../model-types.js'; +import { hasExpired } from '../state/selectors/expiration.js'; +import { isOSUnsupported } from '../state/selectors/updates.js'; -import type { AnyToast } from '../types/Toast'; -import { ToastType } from '../types/Toast'; +import type { AnyToast } from '../types/Toast.js'; +import { ToastType } from '../types/Toast.js'; import { isDirectConversation, isGroupV1, isGroupV2, -} from './whatTypeOfConversation'; +} from './whatTypeOfConversation.js'; const MAX_MESSAGE_BODY_LENGTH = 64 * 1024; diff --git a/ts/util/shouldStoryReplyNotifyUser.ts b/ts/util/shouldStoryReplyNotifyUser.ts index 564c98941b4..f49b752743c 100644 --- a/ts/util/shouldStoryReplyNotifyUser.ts +++ b/ts/util/shouldStoryReplyNotifyUser.ts @@ -1,12 +1,12 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationModel } from '../models/conversations'; -import type { ReadonlyMessageAttributesType } from '../model-types.d'; -import { createLogger } from '../logging/log'; -import { DataReader } from '../sql/Client'; -import { isGroup } from './whatTypeOfConversation'; -import { isMessageUnread } from './isMessageUnread'; +import type { ConversationModel } from '../models/conversations.js'; +import type { ReadonlyMessageAttributesType } from '../model-types.d.ts'; +import { createLogger } from '../logging/log.js'; +import { DataReader } from '../sql/Client.js'; +import { isGroup } from './whatTypeOfConversation.js'; +import { isMessageUnread } from './isMessageUnread.js'; const log = createLogger('shouldStoryReplyNotifyUser'); diff --git a/ts/util/showConfirmationDialog.tsx b/ts/util/showConfirmationDialog.tsx index 700f5f35cf6..0faa9afa541 100644 --- a/ts/util/showConfirmationDialog.tsx +++ b/ts/util/showConfirmationDialog.tsx @@ -3,9 +3,9 @@ import React, { StrictMode } from 'react'; import { createRoot, type Root } from 'react-dom/client'; -import { ConfirmationDialog } from '../components/ConfirmationDialog'; -import { FunDefaultEnglishEmojiLocalizationProvider } from '../components/fun/FunEmojiLocalizationProvider'; -import { AxoProvider } from '../axo/AxoProvider'; +import { ConfirmationDialog } from '../components/ConfirmationDialog.js'; +import { FunDefaultEnglishEmojiLocalizationProvider } from '../components/fun/FunEmojiLocalizationProvider.js'; +import { AxoProvider } from '../axo/AxoProvider.js'; type ConfirmationDialogViewProps = { onTopOfEverything?: boolean; diff --git a/ts/util/showDownloadFailedToast.ts b/ts/util/showDownloadFailedToast.ts index f4c01126cc5..444ca3cbd32 100644 --- a/ts/util/showDownloadFailedToast.ts +++ b/ts/util/showDownloadFailedToast.ts @@ -1,9 +1,9 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { ToastType } from '../types/Toast'; -import { SECOND } from './durations'; -import { isOlderThan } from './timestamp'; +import { ToastType } from '../types/Toast.js'; +import { SECOND } from './durations/index.js'; +import { isOlderThan } from './timestamp.js'; const DOWNLOAD_FAILED_TIMESTAMP_REST = 10 * SECOND; diff --git a/ts/util/signalRoutes.ts b/ts/util/signalRoutes.ts index 03377e41d12..14e3b3fb39a 100644 --- a/ts/util/signalRoutes.ts +++ b/ts/util/signalRoutes.ts @@ -1,14 +1,17 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import 'urlpattern-polyfill'; +// This file gets imported into renderer that does not have access to Node.js +// builtins, use an `npm` package. // We need to use the Node.js version of `URL` because chromium's `URL` doesn't // support custom protocols correctly. +// eslint-disable-next-line import/enforce-node-protocol-usage import { URL as NodeURL } from 'url'; import { z } from 'zod'; -import { strictAssert } from './assert'; -import { createLogger } from '../logging/log'; -import * as Errors from '../types/errors'; -import { parsePartial, parseUnknown, safeParseUnknown } from './schemas'; +import { strictAssert } from './assert.js'; +import { createLogger } from '../logging/log.js'; +import * as Errors from '../types/errors.js'; +import { parsePartial, parseUnknown, safeParseUnknown } from './schemas.js'; const log = createLogger('signalRoutes'); diff --git a/ts/util/sleeper.ts b/ts/util/sleeper.ts index 70baefcd57a..d28b8b85aac 100644 --- a/ts/util/sleeper.ts +++ b/ts/util/sleeper.ts @@ -1,8 +1,8 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log'; -import * as Errors from '../types/errors'; +import { createLogger } from '../logging/log.js'; +import * as Errors from '../types/errors.js'; const log = createLogger('sleeper'); diff --git a/ts/util/smartling.ts b/ts/util/smartling.ts index 60f2f8019e5..3e2b9c97f7e 100644 --- a/ts/util/smartling.ts +++ b/ts/util/smartling.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import * as packageJson from '../../package.json'; -import { getUserAgent } from './getUserAgent'; +import { getUserAgent } from './getUserAgent.js'; type AuthenticateOptionsType = Readonly<{ userIdentifier: string; diff --git a/ts/util/sniffImageMimeType.ts b/ts/util/sniffImageMimeType.ts index 95ab76bc21c..f5f7b33a128 100644 --- a/ts/util/sniffImageMimeType.ts +++ b/ts/util/sniffImageMimeType.ts @@ -1,7 +1,7 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { MIMEType } from '../types/MIME'; +import type { MIMEType } from '../types/MIME.js'; import { IMAGE_BMP, IMAGE_GIF, @@ -9,7 +9,7 @@ import { IMAGE_JPEG, IMAGE_PNG, IMAGE_WEBP, -} from '../types/MIME'; +} from '../types/MIME.js'; /** * This follows the [MIME Sniffing Standard for images][0]. diff --git a/ts/util/startConversation.ts b/ts/util/startConversation.ts index 24cb16a3b37..4356369262f 100644 --- a/ts/util/startConversation.ts +++ b/ts/util/startConversation.ts @@ -1,8 +1,8 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ServiceIdString } from '../types/ServiceId'; -import { strictAssert } from './assert'; +import type { ServiceIdString } from '../types/ServiceId.js'; +import { strictAssert } from './assert.js'; export function startConversation( e164: string, diff --git a/ts/util/subscriptionConfiguration.ts b/ts/util/subscriptionConfiguration.ts index 0a6f1a42f77..134d3102bd2 100644 --- a/ts/util/subscriptionConfiguration.ts +++ b/ts/util/subscriptionConfiguration.ts @@ -1,10 +1,10 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { SubscriptionConfigurationResultType } from '../textsecure/WebAPI'; -import type { OneTimeDonationHumanAmounts } from '../types/Donations'; -import { HOUR } from './durations'; -import { isInPast } from './timestamp'; +import type { SubscriptionConfigurationResultType } from '../textsecure/WebAPI.js'; +import type { OneTimeDonationHumanAmounts } from '../types/Donations.js'; +import { HOUR } from './durations/index.js'; +import { isInPast } from './timestamp.js'; const SUBSCRIPTION_CONFIG_CACHE_TIME = HOUR; diff --git a/ts/util/syncIdentifiers.ts b/ts/util/syncIdentifiers.ts index 7a391154b9b..f8fd2b20333 100644 --- a/ts/util/syncIdentifiers.ts +++ b/ts/util/syncIdentifiers.ts @@ -4,26 +4,26 @@ import type { ConversationIdentifier, AddressableMessage, -} from '../textsecure/messageReceiverEvents'; +} from '../textsecure/messageReceiverEvents.js'; import type { ConversationAttributesType, ReadonlyMessageAttributesType, MessageAttributesType, -} from '../model-types'; -import type { AciString, PniString } from '../types/ServiceId'; -import { isPniString } from '../types/ServiceId'; -import { getAuthor } from '../messages/helpers'; -import { createLogger } from '../logging/log'; -import type { ConversationModel } from '../models/conversations'; -import { DataReader } from '../sql/Client'; +} from '../model-types.js'; +import type { AciString, PniString } from '../types/ServiceId.js'; +import { isPniString } from '../types/ServiceId.js'; +import { getAuthor } from '../messages/helpers.js'; +import { createLogger } from '../logging/log.js'; +import type { ConversationModel } from '../models/conversations.js'; +import { DataReader } from '../sql/Client.js'; import { getConversationIdForLogging, getMessageIdForLogging, -} from './idForLogging'; -import { isGroup, isGroupV2 } from './whatTypeOfConversation'; -import { getMessageSentTimestampSet } from './getMessageSentTimestampSet'; -import { isAciString } from './isAciString'; -import { missingCaseError } from './missingCaseError'; +} from './idForLogging.js'; +import { isGroup, isGroupV2 } from './whatTypeOfConversation.js'; +import { getMessageSentTimestampSet } from './getMessageSentTimestampSet.js'; +import { isAciString } from './isAciString.js'; +import { missingCaseError } from './missingCaseError.js'; const log = createLogger('syncIdentifiers'); diff --git a/ts/util/syncTasks.ts b/ts/util/syncTasks.ts index e898ff7a5c6..564514001c9 100644 --- a/ts/util/syncTasks.ts +++ b/ts/util/syncTasks.ts @@ -4,31 +4,34 @@ import { z } from 'zod'; import type { ZodSchema } from 'zod'; -import { drop } from './drop'; -import { createLogger } from '../logging/log'; -import * as DeletesForMe from '../messageModifiers/DeletesForMe'; +import { drop } from './drop.js'; +import { createLogger } from '../logging/log.js'; +import * as DeletesForMe from '../messageModifiers/DeletesForMe.js'; import { deleteMessageSchema, deleteConversationSchema, deleteLocalConversationSchema, deleteAttachmentSchema, -} from '../textsecure/messageReceiverEvents'; +} from '../textsecure/messageReceiverEvents.js'; import { receiptSyncTaskSchema, onReceipt, -} from '../messageModifiers/MessageReceipts'; -import { deleteConversation, deleteLocalOnlyConversation } from './deleteForMe'; -import { getConversationFromTarget } from './syncIdentifiers'; +} from '../messageModifiers/MessageReceipts.js'; +import { + deleteConversation, + deleteLocalOnlyConversation, +} from './deleteForMe.js'; +import { getConversationFromTarget } from './syncIdentifiers.js'; import { onSync as onReadSync, readSyncTaskSchema, -} from '../messageModifiers/ReadSyncs'; +} from '../messageModifiers/ReadSyncs.js'; import { onSync as onViewSync, viewSyncTaskSchema, -} from '../messageModifiers/ViewSyncs'; -import { safeParseUnknown } from './schemas'; -import { DataWriter } from '../sql/Client'; +} from '../messageModifiers/ViewSyncs.js'; +import { safeParseUnknown } from './schemas.js'; +import { DataWriter } from '../sql/Client.js'; const log = createLogger('syncTasks'); diff --git a/ts/util/theme.ts b/ts/util/theme.ts index 13a633b10c5..45bdd7e84c9 100644 --- a/ts/util/theme.ts +++ b/ts/util/theme.ts @@ -1,8 +1,8 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { missingCaseError } from './missingCaseError'; -import { ThemeType } from '../types/Util'; +import { missingCaseError } from './missingCaseError.js'; +import { ThemeType } from '../types/Util.js'; export enum Theme { Light, diff --git a/ts/util/timeAndLogIfTooLong.ts b/ts/util/timeAndLogIfTooLong.ts index 6795f028aa2..0bbf837b89a 100644 --- a/ts/util/timeAndLogIfTooLong.ts +++ b/ts/util/timeAndLogIfTooLong.ts @@ -1,7 +1,7 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log'; +import { createLogger } from '../logging/log.js'; const log = createLogger('timeAndLogIfTooLong'); diff --git a/ts/util/timelineUtil.ts b/ts/util/timelineUtil.ts index 1da59d579fe..5ab37f2aade 100644 --- a/ts/util/timelineUtil.ts +++ b/ts/util/timelineUtil.ts @@ -2,15 +2,15 @@ // SPDX-License-Identifier: AGPL-3.0-only import { isNumber } from 'lodash'; -import { createLogger } from '../logging/log'; -import type { PropsType as TimelinePropsType } from '../components/conversation/Timeline'; -import type { TimelineItemType } from '../components/conversation/TimelineItem'; -import { WidthBreakpoint } from '../components/_util'; -import { toLogFormat } from '../types/errors'; -import { MINUTE } from './durations'; -import { missingCaseError } from './missingCaseError'; -import { isSameDay } from './timestamp'; -import type { LastMessageStatus } from '../model-types.d'; +import { createLogger } from '../logging/log.js'; +import type { PropsType as TimelinePropsType } from '../components/conversation/Timeline.js'; +import type { TimelineItemType } from '../components/conversation/TimelineItem.js'; +import { WidthBreakpoint } from '../components/_util.js'; +import { toLogFormat } from '../types/errors.js'; +import { MINUTE } from './durations/index.js'; +import { missingCaseError } from './missingCaseError.js'; +import { isSameDay } from './timestamp.js'; +import type { LastMessageStatus } from '../model-types.d.ts'; const log = createLogger('timelineUtil'); diff --git a/ts/util/timeout.ts b/ts/util/timeout.ts index 7b316b7f525..7364f2ddbcb 100644 --- a/ts/util/timeout.ts +++ b/ts/util/timeout.ts @@ -1,6 +1,6 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log'; +import { createLogger } from '../logging/log.js'; const logging = createLogger('timeout'); diff --git a/ts/util/timestamp.ts b/ts/util/timestamp.ts index e1629f1a0e6..dab109d16fd 100644 --- a/ts/util/timestamp.ts +++ b/ts/util/timestamp.ts @@ -3,9 +3,9 @@ import type { Moment } from 'moment'; import moment from 'moment'; -import type { LocalizerType } from '../types/Util'; -import { DAY, HOUR, MINUTE, MONTH, WEEK } from './durations'; -import { formatTimestamp } from './formatTimestamp'; +import type { LocalizerType } from '../types/Util.js'; +import { DAY, HOUR, MINUTE, MONTH, WEEK } from './durations/index.js'; +import { formatTimestamp } from './formatTimestamp.js'; type RawTimestamp = Readonly; diff --git a/ts/util/timestampLongUtils.ts b/ts/util/timestampLongUtils.ts index 7bc386b0fbd..bf149afa22a 100644 --- a/ts/util/timestampLongUtils.ts +++ b/ts/util/timestampLongUtils.ts @@ -3,7 +3,7 @@ import Long from 'long'; -import { MAX_SAFE_DATE } from './timestamp'; +import { MAX_SAFE_DATE } from './timestamp.js'; export function getSafeLongFromTimestamp( timestamp = 0, diff --git a/ts/util/trimPadding.ts b/ts/util/trimPadding.ts index 3944377b0bb..53a2ec2f56d 100644 --- a/ts/util/trimPadding.ts +++ b/ts/util/trimPadding.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { Transform } from 'node:stream'; -import { strictAssert } from './assert'; +import { strictAssert } from './assert.js'; /** * Truncates the stream to the target size and analyzes padding type. diff --git a/ts/util/unicodeBidi.ts b/ts/util/unicodeBidi.ts index e7d841f6740..5c9394e3d1b 100644 --- a/ts/util/unicodeBidi.ts +++ b/ts/util/unicodeBidi.ts @@ -1,7 +1,7 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { isTestOrMockEnvironment } from '../environment'; +import { isTestOrMockEnvironment } from '../environment.js'; /** * Left-to-Right Isolate diff --git a/ts/util/universalExpireTimer.ts b/ts/util/universalExpireTimer.ts index a2fbfa600ec..f0179ffcde9 100644 --- a/ts/util/universalExpireTimer.ts +++ b/ts/util/universalExpireTimer.ts @@ -1,8 +1,8 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { DurationInSeconds } from './durations'; -import type { ItemsStateType } from '../state/ducks/items'; +import { DurationInSeconds } from './durations/index.js'; +import type { ItemsStateType } from '../state/ducks/items.js'; export const ITEM_NAME = 'universalExpireTimer'; diff --git a/ts/util/updateBackupMediaDownloadProgress.ts b/ts/util/updateBackupMediaDownloadProgress.ts index bd69f7ae719..c62003f5055 100644 --- a/ts/util/updateBackupMediaDownloadProgress.ts +++ b/ts/util/updateBackupMediaDownloadProgress.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { throttle } from 'lodash'; -import type { BackupAttachmentDownloadProgress } from '../sql/Interface'; +import type { BackupAttachmentDownloadProgress } from '../sql/Interface.js'; export async function updateBackupMediaDownloadProgress( getBackupAttachmentDownloadProgress: () => Promise diff --git a/ts/util/uploadAttachment.ts b/ts/util/uploadAttachment.ts index 8d27c10cd9a..7ad7bc8c8ac 100644 --- a/ts/util/uploadAttachment.ts +++ b/ts/util/uploadAttachment.ts @@ -1,27 +1,27 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import Long from 'long'; -import { createReadStream } from 'fs'; +import { createReadStream } from 'node:fs'; import type { AttachmentWithHydratedData, UploadedAttachmentType, -} from '../types/Attachment'; -import { MIMETypeToString, supportsIncrementalMac } from '../types/MIME'; -import { getRandomBytes } from '../Crypto'; -import { strictAssert } from './assert'; -import { backupsService } from '../services/backups'; -import { tusUpload } from './uploads/tusProtocol'; -import { defaultFileReader } from './uploads/uploads'; -import type { AttachmentUploadFormResponseType } from '../textsecure/WebAPI'; +} from '../types/Attachment.js'; +import { MIMETypeToString, supportsIncrementalMac } from '../types/MIME.js'; +import { getRandomBytes } from '../Crypto.js'; +import { strictAssert } from './assert.js'; +import { backupsService } from '../services/backups/index.js'; +import { tusUpload } from './uploads/tusProtocol.js'; +import { defaultFileReader } from './uploads/uploads.js'; +import type { AttachmentUploadFormResponseType } from '../textsecure/WebAPI.js'; import { type EncryptedAttachmentV2, encryptAttachmentV2ToDisk, safeUnlink, type PlaintextSourceType, -} from '../AttachmentCrypto'; -import { missingCaseError } from './missingCaseError'; -import { uuidToBytes } from './uuidToBytes'; -import { isVisualMedia } from '../types/Attachment'; +} from '../AttachmentCrypto.js'; +import { missingCaseError } from './missingCaseError.js'; +import { uuidToBytes } from './uuidToBytes.js'; +import { isVisualMedia } from '../types/Attachment.js'; const CDNS_SUPPORTING_TUS = new Set([3]); diff --git a/ts/util/uploads/tusProtocol.ts b/ts/util/uploads/tusProtocol.ts index 3ceea470b0b..834eb5c4fda 100644 --- a/ts/util/uploads/tusProtocol.ts +++ b/ts/util/uploads/tusProtocol.ts @@ -3,11 +3,11 @@ import { type Readable } from 'node:stream'; import fetch, { type RequestInit, type Response } from 'node-fetch'; -import { HTTPError } from '../../textsecure/Errors'; -import { createLogger } from '../../logging/log'; -import * as Errors from '../../types/errors'; -import { sleep } from '../sleep'; -import { FIBONACCI_TIMEOUTS, BackOff } from '../BackOff'; +import { HTTPError } from '../../textsecure/Errors.js'; +import { createLogger } from '../../logging/log.js'; +import * as Errors from '../../types/errors.js'; +import { sleep } from '../sleep.js'; +import { FIBONACCI_TIMEOUTS, BackOff } from '../BackOff.js'; const log = createLogger('tusProtocol'); diff --git a/ts/util/uploads/uploads.ts b/ts/util/uploads/uploads.ts index 76f6c011354..c449daedaa9 100644 --- a/ts/util/uploads/uploads.ts +++ b/ts/util/uploads/uploads.ts @@ -3,9 +3,9 @@ import fetch from 'node-fetch'; import { createReadStream, createWriteStream } from 'node:fs'; import { pipeline } from 'node:stream/promises'; -import type { TusFileReader, FetchFunctionType } from './tusProtocol'; -import { tusResumeUpload, tusUpload } from './tusProtocol'; -import { HTTPError } from '../../textsecure/Errors'; +import type { TusFileReader, FetchFunctionType } from './tusProtocol.js'; +import { tusResumeUpload, tusUpload } from './tusProtocol.js'; +import { HTTPError } from '../../textsecure/Errors.js'; export const defaultFileReader: TusFileReader = (filePath, offset) => { return createReadStream(filePath, { start: offset }); diff --git a/ts/util/uuidToBytes.ts b/ts/util/uuidToBytes.ts index 82ab7fbba27..d54e5aa9360 100644 --- a/ts/util/uuidToBytes.ts +++ b/ts/util/uuidToBytes.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import { chunk } from 'lodash'; -import { UUID_BYTE_SIZE } from '../types/Crypto'; -import { createLogger } from '../logging/log'; -import * as Bytes from '../Bytes'; +import { UUID_BYTE_SIZE } from '../types/Crypto.js'; +import { createLogger } from '../logging/log.js'; +import * as Bytes from '../Bytes.js'; const log = createLogger('uuidToBytes'); diff --git a/ts/util/validateConversation.ts b/ts/util/validateConversation.ts index 99339bb4b89..e06cb6d6cf7 100644 --- a/ts/util/validateConversation.ts +++ b/ts/util/validateConversation.ts @@ -1,13 +1,13 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ValidateConversationType } from '../model-types.d'; +import type { ValidateConversationType } from '../model-types.d.ts'; import { isDirectConversation, isGroupV1, isGroupV2, -} from './whatTypeOfConversation'; -import { isServiceIdString } from '../types/ServiceId'; +} from './whatTypeOfConversation.js'; +import { isServiceIdString } from '../types/ServiceId.js'; export function validateConversation( attributes: ValidateConversationType diff --git a/ts/util/verifyStoryListMembers.ts b/ts/util/verifyStoryListMembers.ts index 45bcc91af27..053412af2f9 100644 --- a/ts/util/verifyStoryListMembers.ts +++ b/ts/util/verifyStoryListMembers.ts @@ -1,11 +1,11 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log'; -import { isNotNil } from './isNotNil'; -import { updateIdentityKey } from '../services/profiles'; -import type { ServiceIdString } from '../types/ServiceId'; -import * as Bytes from '../Bytes'; +import { createLogger } from '../logging/log.js'; +import { isNotNil } from './isNotNil.js'; +import { updateIdentityKey } from '../services/profiles.js'; +import type { ServiceIdString } from '../types/ServiceId.js'; +import * as Bytes from '../Bytes.js'; const log = createLogger('verifyStoryListMembers'); diff --git a/ts/util/waitBatcher.ts b/ts/util/waitBatcher.ts index b9dd53e1c59..1debdf2b31a 100644 --- a/ts/util/waitBatcher.ts +++ b/ts/util/waitBatcher.ts @@ -3,13 +3,13 @@ import PQueue from 'p-queue'; -import { sleep } from './sleep'; -import { createLogger } from '../logging/log'; -import * as Errors from '../types/errors'; -import { clearTimeoutIfNecessary } from './clearTimeoutIfNecessary'; -import { MINUTE } from './durations'; -import { drop } from './drop'; -import { explodePromise } from './explodePromise'; +import { sleep } from './sleep.js'; +import { createLogger } from '../logging/log.js'; +import * as Errors from '../types/errors.js'; +import { clearTimeoutIfNecessary } from './clearTimeoutIfNecessary.js'; +import { MINUTE } from './durations/index.js'; +import { drop } from './drop.js'; +import { explodePromise } from './explodePromise.js'; const log = createLogger('waitBatcher'); diff --git a/ts/util/waitForAll.ts b/ts/util/waitForAll.ts index c775021616b..c31f0fa0509 100644 --- a/ts/util/waitForAll.ts +++ b/ts/util/waitForAll.ts @@ -3,7 +3,7 @@ import PQueue from 'p-queue'; -import { MINUTE } from './durations'; +import { MINUTE } from './durations/index.js'; const MAX_CONCURRENCY = 5; diff --git a/ts/util/waitForOnline.ts b/ts/util/waitForOnline.ts index 42c552b317d..97127faaba0 100644 --- a/ts/util/waitForOnline.ts +++ b/ts/util/waitForOnline.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { clearTimeoutIfNecessary } from './clearTimeoutIfNecessary'; +import { clearTimeoutIfNecessary } from './clearTimeoutIfNecessary.js'; export type WaitForOnlineOptionsType = Readonly<{ server?: Readonly<{ isOnline: () => boolean | undefined }>; diff --git a/ts/util/whatTypeOfConversation.ts b/ts/util/whatTypeOfConversation.ts index 63f40468147..225bacdbece 100644 --- a/ts/util/whatTypeOfConversation.ts +++ b/ts/util/whatTypeOfConversation.ts @@ -1,10 +1,10 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationAttributesType } from '../model-types.d'; -import type { ConversationType } from '../state/ducks/conversations'; -import * as Bytes from '../Bytes'; -import { createLogger } from '../logging/log'; +import type { ConversationAttributesType } from '../model-types.d.ts'; +import type { ConversationType } from '../state/ducks/conversations.js'; +import * as Bytes from '../Bytes.js'; +import { createLogger } from '../logging/log.js'; const log = createLogger('whatTypeOfConversation'); diff --git a/ts/util/windowsZoneIdentifier.ts b/ts/util/windowsZoneIdentifier.ts index a51db87095d..601ac13ecce 100644 --- a/ts/util/windowsZoneIdentifier.ts +++ b/ts/util/windowsZoneIdentifier.ts @@ -1,8 +1,8 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import * as fs from 'fs'; -import OS from './os/osMain'; +import * as fs from 'node:fs'; +import OS from './os/osMain.js'; const ZONE_IDENTIFIER_CONTENTS = Buffer.from('[ZoneTransfer]\r\nZoneId=3'); diff --git a/ts/util/wrapEventEmitterOnce.ts b/ts/util/wrapEventEmitterOnce.ts index bd88810685d..af3743a2acb 100644 --- a/ts/util/wrapEventEmitterOnce.ts +++ b/ts/util/wrapEventEmitterOnce.ts @@ -1,8 +1,8 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { EventEmitter } from 'events'; -import { once } from 'events'; +import type { EventEmitter } from 'node:events'; +import { once } from 'node:events'; export async function wrapEventEmitterOnce( emitter: EventEmitter, diff --git a/ts/util/wrapWithSyncMessageSend.ts b/ts/util/wrapWithSyncMessageSend.ts index 88024a109bb..8cab9497e21 100644 --- a/ts/util/wrapWithSyncMessageSend.ts +++ b/ts/util/wrapWithSyncMessageSend.ts @@ -1,17 +1,17 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log'; +import { createLogger } from '../logging/log.js'; -import { SendMessageProtoError } from '../textsecure/Errors'; -import { getSendOptions } from './getSendOptions'; -import { handleMessageSend } from './handleMessageSend'; +import { SendMessageProtoError } from '../textsecure/Errors.js'; +import { getSendOptions } from './getSendOptions.js'; +import { handleMessageSend } from './handleMessageSend.js'; -import type { CallbackResultType } from '../textsecure/Types.d'; -import type { ConversationModel } from '../models/conversations'; -import type { SendTypesType } from './handleMessageSend'; -import type MessageSender from '../textsecure/SendMessage'; -import { areAllErrorsUnregistered } from '../jobs/helpers/areAllErrorsUnregistered'; +import type { CallbackResultType } from '../textsecure/Types.d.ts'; +import type { ConversationModel } from '../models/conversations.js'; +import type { SendTypesType } from './handleMessageSend.js'; +import type MessageSender from '../textsecure/SendMessage.js'; +import { areAllErrorsUnregistered } from '../jobs/helpers/areAllErrorsUnregistered.js'; const log = createLogger('wrapWithSyncMessageSend'); diff --git a/ts/util/writeDraftAttachment.ts b/ts/util/writeDraftAttachment.ts index 37cd1e32d0a..cb219e80de0 100644 --- a/ts/util/writeDraftAttachment.ts +++ b/ts/util/writeDraftAttachment.ts @@ -5,16 +5,16 @@ import { omit } from 'lodash'; import type { InMemoryAttachmentDraftType, AttachmentDraftType, -} from '../types/Attachment'; -import { isImageAttachment } from '../types/Attachment'; -import { getImageDimensions } from '../types/VisualAttachment'; -import { IMAGE_PNG } from '../types/MIME'; -import * as Errors from '../types/errors'; +} from '../types/Attachment.js'; +import { isImageAttachment } from '../types/Attachment.js'; +import { getImageDimensions } from '../types/VisualAttachment.js'; +import { IMAGE_PNG } from '../types/MIME.js'; +import * as Errors from '../types/errors.js'; import { getLocalAttachmentUrl, AttachmentDisposition, -} from './getLocalAttachmentUrl'; -import { createLogger } from '../logging/log'; +} from './getLocalAttachmentUrl.js'; +import { createLogger } from '../logging/log.js'; const logger = createLogger('writeDraftAttachment'); diff --git a/ts/util/zkgroup.ts b/ts/util/zkgroup.ts index f1aa13160b0..d07138e21e0 100644 --- a/ts/util/zkgroup.ts +++ b/ts/util/zkgroup.ts @@ -19,15 +19,19 @@ import { NotarySignature, } from '@signalapp/libsignal-client/zkgroup'; import { Aci, Pni, type ServiceId } from '@signalapp/libsignal-client'; -import type { ServiceIdString, AciString, PniString } from '../types/ServiceId'; +import type { + ServiceIdString, + AciString, + PniString, +} from '../types/ServiceId.js'; import { fromServiceIdObject, fromAciObject, fromPniObject, -} from '../types/ServiceId'; -import * as Bytes from '../Bytes'; -import { toServiceIdObject } from './ServiceId'; -import { strictAssert } from './assert'; +} from '../types/ServiceId.js'; +import * as Bytes from '../Bytes.js'; +import { toServiceIdObject } from './ServiceId.js'; +import { strictAssert } from './assert.js'; export * from '@signalapp/libsignal-client/zkgroup'; diff --git a/ts/window.d.ts b/ts/window.d.ts index 8540a2c7078..1e524226b2e 100644 --- a/ts/window.d.ts +++ b/ts/window.d.ts @@ -11,48 +11,52 @@ import type { assert } from 'chai'; import type { PhoneNumber, PhoneNumberFormat } from 'google-libphonenumber'; import type { MochaOptions } from 'mocha'; -import type { textsecure } from './textsecure'; -import type { Storage } from './textsecure/Storage'; +import type { textsecure } from './textsecure/index.js'; +import type { Storage } from './textsecure/Storage.js'; import type { ChallengeHandler, IPCRequest as IPCChallengeRequest, -} from './challenge'; -import type AccountManager from './textsecure/AccountManager'; -import type { WebAPIConnectType } from './textsecure/WebAPI'; -import type { CallingClass } from './services/calling'; -import type * as Donations from './services/donations'; -import type * as StorageService from './services/storage'; -import type { BackupsService } from './services/backups'; -import type * as Groups from './groups'; -import type * as Crypto from './Crypto'; -import type * as Curve from './Curve'; -import type * as RemoteConfig from './RemoteConfig'; -import type { OSType } from './util/os/shared'; -import type { LocalizerType, SystemThemeType, ThemeType } from './types/Util'; -import type { Receipt } from './types/Receipt'; -import type { ConversationController } from './ConversationController'; -import type { ReduxActions } from './state/types'; -import type { createApp } from './state/roots/createApp'; -import type { BatcherType } from './util/batcher'; -import type { ConfirmationDialog } from './components/ConfirmationDialog'; -import type { SignalProtocolStore } from './SignalProtocolStore'; -import type { SocketStatus } from './types/SocketStatus'; -import type { ScreenShareStatus } from './types/Calling'; -import type { MessageCache } from './services/MessageCache'; -import type { StateType } from './state/reducer'; -import type { Address } from './types/Address'; -import type { QualifiedAddress } from './types/QualifiedAddress'; -import type { CIType } from './CI'; -import type { IPCEventsType } from './util/createIPCEvents'; -import type { SignalContextType } from './windows/context'; -import type * as Message2 from './types/Message2'; -import type { initializeMigrations } from './signal'; -import type { RetryPlaceholders } from './util/retryPlaceholders'; -import type { PropsPreloadType as PreferencesPropsType } from './components/Preferences'; -import type { WindowsNotificationData } from './services/notifications'; -import type { QueryStatsOptions } from './sql/main'; -import type { SocketStatuses } from './textsecure/SocketManager'; -import type { BeforeNavigateService } from './services/BeforeNavigate'; +} from './challenge.js'; +import type AccountManager from './textsecure/AccountManager.js'; +import type { WebAPIConnectType } from './textsecure/WebAPI.js'; +import type { CallingClass } from './services/calling.js'; +import type * as Donations from './services/donations.js'; +import type * as StorageService from './services/storage.js'; +import type { BackupsService } from './services/backups/index.js'; +import type * as Groups from './groups.js'; +import type * as Crypto from './Crypto.js'; +import type * as Curve from './Curve.js'; +import type * as RemoteConfig from './RemoteConfig.js'; +import type { OSType } from './util/os/shared.js'; +import type { + LocalizerType, + SystemThemeType, + ThemeType, +} from './types/Util.js'; +import type { Receipt } from './types/Receipt.js'; +import type { ConversationController } from './ConversationController.js'; +import type { ReduxActions } from './state/types.js'; +import type { createApp } from './state/roots/createApp.js'; +import type { BatcherType } from './util/batcher.js'; +import type { ConfirmationDialog } from './components/ConfirmationDialog.js'; +import type { SignalProtocolStore } from './SignalProtocolStore.js'; +import type { SocketStatus } from './types/SocketStatus.js'; +import type { ScreenShareStatus } from './types/Calling.js'; +import type { MessageCache } from './services/MessageCache.js'; +import type { StateType } from './state/reducer.js'; +import type { Address } from './types/Address.js'; +import type { QualifiedAddress } from './types/QualifiedAddress.js'; +import type { CIType } from './CI.js'; +import type { IPCEventsType } from './util/createIPCEvents.js'; +import type { SignalContextType } from './windows/context.js'; +import type * as Message2 from './types/Message2.js'; +import type { initializeMigrations } from './signal.js'; +import type { RetryPlaceholders } from './util/retryPlaceholders.js'; +import type { PropsPreloadType as PreferencesPropsType } from './components/Preferences.js'; +import type { WindowsNotificationData } from './services/notifications.js'; +import type { QueryStatsOptions } from './sql/main.js'; +import type { SocketStatuses } from './textsecure/SocketManager.js'; +import type { BeforeNavigateService } from './services/BeforeNavigate.js'; export { Long } from 'long'; diff --git a/ts/windows/about/app.tsx b/ts/windows/about/app.tsx index 70a32cd8cd0..6a402a3a4f4 100644 --- a/ts/windows/about/app.tsx +++ b/ts/windows/about/app.tsx @@ -4,11 +4,11 @@ import React, { StrictMode } from 'react'; import { createRoot } from 'react-dom/client'; -import { About } from '../../components/About'; -import { i18n } from '../sandboxedInit'; -import { strictAssert } from '../../util/assert'; -import { FunDefaultEnglishEmojiLocalizationProvider } from '../../components/fun/FunEmojiLocalizationProvider'; -import { AxoProvider } from '../../axo/AxoProvider'; +import { About } from '../../components/About.js'; +import { i18n } from '../sandboxedInit.js'; +import { strictAssert } from '../../util/assert.js'; +import { FunDefaultEnglishEmojiLocalizationProvider } from '../../components/fun/FunEmojiLocalizationProvider.js'; +import { AxoProvider } from '../../axo/AxoProvider.js'; const { AboutWindowProps } = window.Signal; diff --git a/ts/windows/about/preload.ts b/ts/windows/about/preload.ts index 17ccde3b13b..255b00c3e41 100644 --- a/ts/windows/about/preload.ts +++ b/ts/windows/about/preload.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import { contextBridge } from 'electron'; -import { MinimalSignalContext } from '../minimalContext'; -import { config } from '../../context/config'; -import { environment } from '../../context/environment'; +import { MinimalSignalContext } from '../minimalContext.js'; +import { config } from '../../context/config.js'; +import { environment } from '../../context/environment.js'; const environments: Array = [environment]; diff --git a/ts/windows/calling-tools/preload.ts b/ts/windows/calling-tools/preload.ts index fa1ebd0a5d3..49647f8764c 100644 --- a/ts/windows/calling-tools/preload.ts +++ b/ts/windows/calling-tools/preload.ts @@ -3,7 +3,7 @@ import { contextBridge, ipcRenderer } from 'electron'; import type { Event } from 'electron/renderer'; -import { MinimalSignalContext } from '../minimalContext'; +import { MinimalSignalContext } from '../minimalContext.js'; type RtcStatsReport = { conversationId: string; diff --git a/ts/windows/calling-tools/webrtc_internals.ts b/ts/windows/calling-tools/webrtc_internals.ts index 4ec88d5347a..e604f0dbb1a 100644 --- a/ts/windows/calling-tools/webrtc_internals.ts +++ b/ts/windows/calling-tools/webrtc_internals.ts @@ -1,5 +1,4 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -// eslint-disable-next-line import/extensions import '../../../js/calling-tools/webrtc_internals.js'; diff --git a/ts/windows/context.ts b/ts/windows/context.ts index 8137bf49eed..6c300ff5ea2 100644 --- a/ts/windows/context.ts +++ b/ts/windows/context.ts @@ -4,22 +4,22 @@ import type { MenuItemConstructorOptions } from 'electron'; import { ipcRenderer } from 'electron'; -import type { NativeThemeType } from '../context/createNativeThemeListener'; -import type { MenuOptionsType } from '../types/menu'; -import type { RendererConfigType } from '../types/RendererConfig'; -import type { LocalizerType } from '../types/Util'; -import type { SettingType, SettingsValuesType } from '../util/preload'; +import type { NativeThemeType } from '../context/createNativeThemeListener.js'; +import type { MenuOptionsType } from '../types/menu.js'; +import type { RendererConfigType } from '../types/RendererConfig.js'; +import type { LocalizerType } from '../types/Util.js'; +import type { SettingType, SettingsValuesType } from '../util/preload.js'; -import { Bytes } from '../context/Bytes'; -import { Crypto } from '../context/Crypto'; -import { Timers } from '../context/Timers'; +import { Bytes } from '../context/Bytes.js'; +import { Crypto } from '../context/Crypto.js'; +import { Timers } from '../context/Timers.js'; -import type { LocaleDirection } from '../../app/locale'; -import { i18n } from '../context/i18n'; -import type { ActiveWindowServiceType } from '../services/ActiveWindowService'; -import type { LocaleEmojiListType } from '../types/emoji'; -import type { HourCyclePreference } from '../types/I18N'; -import { MinimalSignalContext } from './minimalContext'; +import type { LocaleDirection } from '../../app/locale.js'; +import { i18n } from '../context/i18n.js'; +import type { ActiveWindowServiceType } from '../services/ActiveWindowService.js'; +import type { LocaleEmojiListType } from '../types/emoji.js'; +import type { HourCyclePreference } from '../types/I18N.js'; +import { MinimalSignalContext } from './minimalContext.js'; export type MainWindowStatsType = Readonly<{ isMaximized: boolean; diff --git a/ts/windows/debuglog/app.tsx b/ts/windows/debuglog/app.tsx index 2a62fbc4cc4..91590c05281 100644 --- a/ts/windows/debuglog/app.tsx +++ b/ts/windows/debuglog/app.tsx @@ -3,11 +3,11 @@ import React, { StrictMode } from 'react'; import { createRoot } from 'react-dom/client'; -import { DebugLogWindow } from '../../components/DebugLogWindow'; -import { FunDefaultEnglishEmojiLocalizationProvider } from '../../components/fun/FunEmojiLocalizationProvider'; -import { i18n } from '../sandboxedInit'; -import { strictAssert } from '../../util/assert'; -import { AxoProvider } from '../../axo/AxoProvider'; +import { DebugLogWindow } from '../../components/DebugLogWindow.js'; +import { FunDefaultEnglishEmojiLocalizationProvider } from '../../components/fun/FunEmojiLocalizationProvider.js'; +import { i18n } from '../sandboxedInit.js'; +import { strictAssert } from '../../util/assert.js'; +import { AxoProvider } from '../../axo/AxoProvider.js'; const { DebugLogWindowProps } = window.Signal; diff --git a/ts/windows/debuglog/preload.ts b/ts/windows/debuglog/preload.ts index e81e0d61fd1..2034741cec0 100644 --- a/ts/windows/debuglog/preload.ts +++ b/ts/windows/debuglog/preload.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { contextBridge, ipcRenderer } from 'electron'; -import { MinimalSignalContext } from '../minimalContext'; +import { MinimalSignalContext } from '../minimalContext.js'; function downloadLog(logText: string) { ipcRenderer.send('show-debug-log-save-dialog', logText); diff --git a/ts/windows/loading/preload.ts b/ts/windows/loading/preload.ts index 7c106328030..959bb15e313 100644 --- a/ts/windows/loading/preload.ts +++ b/ts/windows/loading/preload.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import { contextBridge } from 'electron'; -import { config } from '../../context/config'; -import { localeMessages } from '../../context/localeMessages'; +import { config } from '../../context/config.js'; +import { localeMessages } from '../../context/localeMessages.js'; contextBridge.exposeInMainWorld('SignalContext', { getI18nLocale: () => config.resolvedTranslationsLocale, diff --git a/ts/windows/loading/start.ts b/ts/windows/loading/start.ts index 87803a7b710..c6208adda2a 100644 --- a/ts/windows/loading/start.ts +++ b/ts/windows/loading/start.ts @@ -1,7 +1,7 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { setupI18n } from '../../util/setupI18n'; +import { setupI18n } from '../../util/setupI18n.js'; window.i18n = setupI18n( window.SignalContext.getI18nLocale(), diff --git a/ts/windows/main/attachments.ts b/ts/windows/main/attachments.ts index 860388999e7..3c34b36af52 100644 --- a/ts/windows/main/attachments.ts +++ b/ts/windows/main/attachments.ts @@ -3,22 +3,22 @@ import { ipcRenderer } from 'electron'; import { isString, isTypedArray } from 'lodash'; -import { join, normalize, basename, parse as pathParse } from 'path'; -import { existsSync } from 'fs'; +import { join, normalize, basename, parse as pathParse } from 'node:path'; +import { existsSync } from 'node:fs'; import fse from 'fs-extra'; import { v4 as getGuid } from 'uuid'; -import { isPathInside } from '../../util/isPathInside'; -import { writeWindowsZoneIdentifier } from '../../util/windowsZoneIdentifier'; -import OS from '../../util/os/osMain'; -import { getRelativePath, createName } from '../../util/attachmentPath'; -import { toHex } from '../../Bytes'; -import { getRandomBytes } from '../../Crypto'; -import { createLogger } from '../../logging/log'; +import { isPathInside } from '../../util/isPathInside.js'; +import { writeWindowsZoneIdentifier } from '../../util/windowsZoneIdentifier.js'; +import OS from '../../util/os/osMain.js'; +import { getRelativePath, createName } from '../../util/attachmentPath.js'; +import { toHex } from '../../Bytes.js'; +import { getRandomBytes } from '../../Crypto.js'; +import { createLogger } from '../../logging/log.js'; const log = createLogger('attachments'); -export * from '../../../app/attachments'; +export * from '../../../app/attachments.js'; type FSAttrType = { set: (path: string, attribute: string, value: string) => Promise; diff --git a/ts/windows/main/phase0-devtools.ts b/ts/windows/main/phase0-devtools.ts index 3dd2f88a21e..5d3337c620c 100644 --- a/ts/windows/main/phase0-devtools.ts +++ b/ts/windows/main/phase0-devtools.ts @@ -1,9 +1,10 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { Environment, getEnvironment } from '../../environment'; +import { Environment, getEnvironment } from '../../environment.js'; if ( + process.env.NODE_ENV !== 'production' && getEnvironment() === Environment.Development && Boolean(process.env.REACT_DEVTOOLS) ) { diff --git a/ts/windows/main/phase1-ipc.ts b/ts/windows/main/phase1-ipc.ts index e521d7b8ce7..19e6d87fbba 100644 --- a/ts/windows/main/phase1-ipc.ts +++ b/ts/windows/main/phase1-ipc.ts @@ -7,34 +7,34 @@ import * as semver from 'semver'; import { groupBy, mapValues } from 'lodash'; import PQueue from 'p-queue'; -import type { IPCType } from '../../window.d'; -import { parseIntWithFallback } from '../../util/parseIntWithFallback'; -import { getSignalConnections } from '../../util/getSignalConnections'; -import { ThemeType } from '../../types/Util'; -import { Environment } from '../../environment'; -import { SignalContext } from '../context'; -import { createLogger } from '../../logging/log'; -import { formatCountForLogging } from '../../logging/formatCountForLogging'; -import * as Errors from '../../types/errors'; +import type { IPCType } from '../../window.d.ts'; +import { parseIntWithFallback } from '../../util/parseIntWithFallback.js'; +import { getSignalConnections } from '../../util/getSignalConnections.js'; +import { ThemeType } from '../../types/Util.js'; +import { Environment } from '../../environment.js'; +import { SignalContext } from '../context.js'; +import { createLogger } from '../../logging/log.js'; +import { formatCountForLogging } from '../../logging/formatCountForLogging.js'; +import * as Errors from '../../types/errors.js'; -import { strictAssert } from '../../util/assert'; -import { drop } from '../../util/drop'; -import { explodePromise } from '../../util/explodePromise'; -import { DataReader } from '../../sql/Client'; -import type { WindowsNotificationData } from '../../services/notifications'; -import { AggregatedStats } from '../../textsecure/WebsocketResources'; -import { UNAUTHENTICATED_CHANNEL_NAME } from '../../textsecure/SocketManager'; -import { isProduction } from '../../util/version'; -import { ToastType } from '../../types/Toast'; -import { ConversationController } from '../../ConversationController'; -import { createBatcher } from '../../util/batcher'; -import { ReceiptType } from '../../types/Receipt'; -import type { Receipt } from '../../types/Receipt'; -import { MINUTE } from '../../util/durations'; +import { strictAssert } from '../../util/assert.js'; +import { drop } from '../../util/drop.js'; +import { explodePromise } from '../../util/explodePromise.js'; +import { DataReader } from '../../sql/Client.js'; +import type { WindowsNotificationData } from '../../services/notifications.js'; +import { AggregatedStats } from '../../textsecure/WebsocketResources.js'; +import { UNAUTHENTICATED_CHANNEL_NAME } from '../../textsecure/SocketManager.js'; +import { isProduction } from '../../util/version.js'; +import { ToastType } from '../../types/Toast.js'; +import { ConversationController } from '../../ConversationController.js'; +import { createBatcher } from '../../util/batcher.js'; +import { ReceiptType } from '../../types/Receipt.js'; +import type { Receipt } from '../../types/Receipt.js'; +import { MINUTE } from '../../util/durations/index.js'; import { conversationJobQueue, conversationQueueJobEnum, -} from '../../jobs/conversationJobQueue'; +} from '../../jobs/conversationJobQueue.js'; const log = createLogger('phase1-ipc'); diff --git a/ts/windows/main/phase2-dependencies.ts b/ts/windows/main/phase2-dependencies.ts index 77ed1f9631d..cb64df7ca6d 100644 --- a/ts/windows/main/phase2-dependencies.ts +++ b/ts/windows/main/phase2-dependencies.ts @@ -6,14 +6,14 @@ import * as moment from 'moment'; // @ts-expect-error -- no types import 'moment/min/locales.min'; -import { textsecure } from '../../textsecure'; -import { initialize as initializeLogging } from '../../logging/set_up_renderer_logging'; -import { setup } from '../../signal'; -import { addSensitivePath } from '../../util/privacy'; -import * as dns from '../../util/dns'; -import { createLogger } from '../../logging/log'; -import { SignalContext } from '../context'; -import * as Attachments from './attachments'; +import { textsecure } from '../../textsecure/index.js'; +import { initialize as initializeLogging } from '../../logging/set_up_renderer_logging.js'; +import { setup } from '../../signal.js'; +import { addSensitivePath } from '../../util/privacy.js'; +import * as dns from '../../util/dns.js'; +import { createLogger } from '../../logging/log.js'; +import { SignalContext } from '../context.js'; +import * as Attachments from './attachments.js'; const log = createLogger('phase2-dependencies'); diff --git a/ts/windows/main/phase3-post-signal.ts b/ts/windows/main/phase3-post-signal.ts index 38922de1fc2..d291cf27b69 100644 --- a/ts/windows/main/phase3-post-signal.ts +++ b/ts/windows/main/phase3-post-signal.ts @@ -3,8 +3,8 @@ // These all need access to window.Signal: -import '../../models/messages'; -import '../../models/conversations'; +import '../../models/messages.js'; +import '../../models/conversations.js'; -import '../../SignalProtocolStore'; -import '../../background'; +import '../../SignalProtocolStore.js'; +import '../../background.js'; diff --git a/ts/windows/main/phase4-test.ts b/ts/windows/main/phase4-test.ts index 2cda6457bd0..a77a0c71b84 100644 --- a/ts/windows/main/phase4-test.ts +++ b/ts/windows/main/phase4-test.ts @@ -9,14 +9,14 @@ const { config } = window.SignalContext; if (config.environment === 'test') { console.log('Importing test infrastructure...'); - require('./preload_test'); + require('./preload_test.js'); } if (config.ciMode) { console.log( `Importing CI infrastructure; enabled in config, mode: ${config.ciMode}` ); - const { getCI } = require('../../CI'); + const { getCI } = require('../../CI.js'); window.SignalCI = getCI({ deviceName: window.getTitle(), forceUnprocessed: config.ciForceUnprocessed, diff --git a/ts/windows/main/preload.ts b/ts/windows/main/preload.ts index 2e7d599f9bd..026d3a24e9e 100644 --- a/ts/windows/main/preload.ts +++ b/ts/windows/main/preload.ts @@ -3,14 +3,14 @@ /* eslint-disable global-require */ -import { createLogger } from '../../logging/log'; +import { createLogger } from '../../logging/log.js'; const log = createLogger('preload'); window.preloadStartTime = Date.now(); try { - require('./start'); + require('./start.js'); } catch (error) { /* eslint-disable no-console */ console.log('preload error!', error.stack); diff --git a/ts/windows/main/preload_test.ts b/ts/windows/main/preload_test.ts index c120cac8547..d68d415f298 100644 --- a/ts/windows/main/preload_test.ts +++ b/ts/windows/main/preload_test.ts @@ -14,12 +14,12 @@ import chaiAsPromised from 'chai-as-promised'; // eslint-disable-next-line import/no-extraneous-dependencies import { reporters, type MochaOptions } from 'mocha'; -import { getSignalProtocolStore } from '../../SignalProtocolStore'; -import { initMessageCleanup } from '../../services/messageStateCleanup'; -import { initializeMessageCounter } from '../../util/incrementMessageCounter'; -import { initializeRedux } from '../../state/initializeRedux'; -import * as Stickers from '../../types/Stickers'; -import { ThemeType } from '../../types/Util'; +import { getSignalProtocolStore } from '../../SignalProtocolStore.js'; +import { initMessageCleanup } from '../../services/messageStateCleanup.js'; +import { initializeMessageCounter } from '../../util/incrementMessageCounter.js'; +import { initializeRedux } from '../../state/initializeRedux.js'; +import * as Stickers from '../../types/Stickers.js'; +import { ThemeType } from '../../types/Util.js'; chai.use(chaiAsPromised); diff --git a/ts/windows/main/start.ts b/ts/windows/main/start.ts index 34d6ab4d22b..6a0a22df886 100644 --- a/ts/windows/main/start.ts +++ b/ts/windows/main/start.ts @@ -4,30 +4,30 @@ import { has } from 'lodash'; import { contextBridge } from 'electron'; -import { createLogger } from '../../logging/log'; +import { createLogger } from '../../logging/log.js'; -import '../context'; +import '../context.js'; // Connect websocket early -import '../../textsecure/preconnect'; +import '../../textsecure/preconnect.js'; -import './phase0-devtools'; -import './phase1-ipc'; -import '../preload'; -import './phase2-dependencies'; -import './phase3-post-signal'; -import './phase4-test'; +import './phase0-devtools.js'; +import './phase1-ipc.js'; +import '../preload.js'; +import './phase2-dependencies.js'; +import './phase3-post-signal.js'; +import './phase4-test.js'; import type { CdsLookupOptionsType, GetIceServersResultType, -} from '../../textsecure/WebAPI'; -import type { FeatureFlagType } from '../../window.d'; -import type { StorageAccessType } from '../../types/Storage.d'; -import { initMessageCleanup } from '../../services/messageStateCleanup'; -import { Environment, getEnvironment } from '../../environment'; -import { isProduction } from '../../util/version'; -import { benchmarkConversationOpen } from '../../CI/benchmarkConversationOpen'; +} from '../../textsecure/WebAPI.js'; +import type { FeatureFlagType } from '../../window.d.ts'; +import type { StorageAccessType } from '../../types/Storage.d.ts'; +import { initMessageCleanup } from '../../services/messageStateCleanup.js'; +import { Environment, getEnvironment } from '../../environment.js'; +import { isProduction } from '../../util/version.js'; +import { benchmarkConversationOpen } from '../../CI/benchmarkConversationOpen.js'; const log = createLogger('start'); diff --git a/ts/windows/minimalContext.ts b/ts/windows/minimalContext.ts index 0301f7e3f7b..a821a784484 100644 --- a/ts/windows/minimalContext.ts +++ b/ts/windows/minimalContext.ts @@ -4,23 +4,26 @@ import type { MenuItemConstructorOptions } from 'electron'; import { ipcRenderer } from 'electron'; -import type { MenuOptionsType } from '../types/menu'; -import type { LocaleEmojiListType } from '../types/emoji'; -import { LocaleEmojiListSchema } from '../types/emoji'; -import type { MainWindowStatsType, MinimalSignalContextType } from './context'; -import { activeWindowService } from '../context/activeWindowService'; -import { config } from '../context/config'; -import { createNativeThemeListener } from '../context/createNativeThemeListener'; -import { createSetting } from '../util/preload'; -import { environment } from '../context/environment'; +import type { MenuOptionsType } from '../types/menu.js'; +import type { LocaleEmojiListType } from '../types/emoji.js'; +import { LocaleEmojiListSchema } from '../types/emoji.js'; +import type { + MainWindowStatsType, + MinimalSignalContextType, +} from './context.js'; +import { activeWindowService } from '../context/activeWindowService.js'; +import { config } from '../context/config.js'; +import { createNativeThemeListener } from '../context/createNativeThemeListener.js'; +import { createSetting } from '../util/preload.js'; +import { environment } from '../context/environment.js'; import { localeDisplayNames, countryDisplayNames, localeMessages, -} from '../context/localeMessages'; -import { waitForSettingsChange } from '../context/waitForSettingsChange'; -import { isTestOrMockEnvironment } from '../environment'; -import { parseUnknown } from '../util/schemas'; +} from '../context/localeMessages.js'; +import { waitForSettingsChange } from '../context/waitForSettingsChange.js'; +import { isTestOrMockEnvironment } from '../environment.js'; +import { parseUnknown } from '../util/schemas.js'; const emojiListCache = new Map(); diff --git a/ts/windows/permissions/app.tsx b/ts/windows/permissions/app.tsx index 00964a1c76d..c0ae315ddc9 100644 --- a/ts/windows/permissions/app.tsx +++ b/ts/windows/permissions/app.tsx @@ -4,11 +4,11 @@ import React, { StrictMode } from 'react'; import { createRoot } from 'react-dom/client'; -import { PermissionsPopup } from '../../components/PermissionsPopup'; -import { i18n } from '../sandboxedInit'; -import { strictAssert } from '../../util/assert'; -import { FunDefaultEnglishEmojiLocalizationProvider } from '../../components/fun/FunEmojiLocalizationProvider'; -import { AxoProvider } from '../../axo/AxoProvider'; +import { PermissionsPopup } from '../../components/PermissionsPopup.js'; +import { i18n } from '../sandboxedInit.js'; +import { strictAssert } from '../../util/assert.js'; +import { FunDefaultEnglishEmojiLocalizationProvider } from '../../components/fun/FunEmojiLocalizationProvider.js'; +import { AxoProvider } from '../../axo/AxoProvider.js'; const { PermissionsWindowProps } = window.Signal; diff --git a/ts/windows/permissions/preload.ts b/ts/windows/permissions/preload.ts index b258f3f0bfa..9e47be71859 100644 --- a/ts/windows/permissions/preload.ts +++ b/ts/windows/permissions/preload.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import { contextBridge } from 'electron'; -import { MinimalSignalContext } from '../minimalContext'; -import { createSetting } from '../../util/preload'; -import { drop } from '../../util/drop'; +import { MinimalSignalContext } from '../minimalContext.js'; +import { createSetting } from '../../util/preload.js'; +import { drop } from '../../util/drop.js'; const mediaCameraPermissions = createSetting('mediaCameraPermissions', { getter: false, diff --git a/ts/windows/preload.ts b/ts/windows/preload.ts index a04b015b123..74f2aab5bce 100644 --- a/ts/windows/preload.ts +++ b/ts/windows/preload.ts @@ -1,7 +1,7 @@ // Copyright 2017 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { installEphemeralSetting } from '../util/preload'; +import { installEphemeralSetting } from '../util/preload.js'; installEphemeralSetting('contentProtection'); installEphemeralSetting('localeOverride'); diff --git a/ts/windows/sandboxedInit.ts b/ts/windows/sandboxedInit.ts index 2d72091db29..6ee93d555c0 100644 --- a/ts/windows/sandboxedInit.ts +++ b/ts/windows/sandboxedInit.ts @@ -1,8 +1,8 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import './applyTheme'; -import { setupI18n } from '../util/setupI18n'; +import './applyTheme.js'; +import { setupI18n } from '../util/setupI18n.js'; document.body.classList.add(window.SignalContext.OS.getClassName()); diff --git a/ts/windows/screenShare/app.tsx b/ts/windows/screenShare/app.tsx index 59f75278a10..95de7d89d01 100644 --- a/ts/windows/screenShare/app.tsx +++ b/ts/windows/screenShare/app.tsx @@ -4,13 +4,13 @@ import React, { StrictMode } from 'react'; import { createRoot } from 'react-dom/client'; -import { CallingScreenSharingController } from '../../components/CallingScreenSharingController'; -import { i18n } from '../sandboxedInit'; -import { strictAssert } from '../../util/assert'; -import { drop } from '../../util/drop'; -import { parseEnvironment, setEnvironment } from '../../environment'; -import { FunDefaultEnglishEmojiLocalizationProvider } from '../../components/fun/FunEmojiLocalizationProvider'; -import { AxoProvider } from '../../axo/AxoProvider'; +import { CallingScreenSharingController } from '../../components/CallingScreenSharingController.js'; +import { i18n } from '../sandboxedInit.js'; +import { strictAssert } from '../../util/assert.js'; +import { drop } from '../../util/drop.js'; +import { parseEnvironment, setEnvironment } from '../../environment.js'; +import { FunDefaultEnglishEmojiLocalizationProvider } from '../../components/fun/FunEmojiLocalizationProvider.js'; +import { AxoProvider } from '../../axo/AxoProvider.js'; const { ScreenShareWindowProps } = window.Signal; diff --git a/ts/windows/screenShare/preload.ts b/ts/windows/screenShare/preload.ts index 17baface682..874f6ea6ac6 100644 --- a/ts/windows/screenShare/preload.ts +++ b/ts/windows/screenShare/preload.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import { contextBridge, ipcRenderer } from 'electron'; -import { ScreenShareStatus } from '../../types/Calling'; -import { MinimalSignalContext } from '../minimalContext'; +import { ScreenShareStatus } from '../../types/Calling.js'; +import { MinimalSignalContext } from '../minimalContext.js'; const params = new URLSearchParams(document.location.search); diff --git a/ts/workers/heicConverterMain.ts b/ts/workers/heicConverterMain.ts index 9bd91d0d50c..e96003bb56c 100644 --- a/ts/workers/heicConverterMain.ts +++ b/ts/workers/heicConverterMain.ts @@ -1,8 +1,8 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { join } from 'path'; -import { Worker } from 'worker_threads'; +import { join } from 'node:path'; +import { Worker } from 'node:worker_threads'; import { app } from 'electron'; export type WrappedWorkerRequest = { diff --git a/ts/workers/heicConverterWorker.ts b/ts/workers/heicConverterWorker.ts index dfc807b2935..92b306b7dc5 100644 --- a/ts/workers/heicConverterWorker.ts +++ b/ts/workers/heicConverterWorker.ts @@ -2,12 +2,12 @@ // SPDX-License-Identifier: AGPL-3.0-only import heicConvert from 'heic-convert'; -import { parentPort } from 'worker_threads'; +import { parentPort } from 'node:worker_threads'; import type { WrappedWorkerRequest, WrappedWorkerResponse, -} from './heicConverterMain'; +} from './heicConverterMain.js'; if (!parentPort) { throw new Error('Must run as a worker thread');