@novu/js 2.0.1 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{chunk-PMLVIUWC.cjs → chunk-D7P7KCZI.js} +342 -255
- package/dist/cjs/index.d.ts +8 -0
- package/dist/cjs/index.js +58 -0
- package/dist/cjs/novu-04KlkBy4.d.ts +528 -0
- package/dist/cjs/ui/index.d.ts +145 -0
- package/dist/cjs/ui/{index.cjs → index.js} +218 -141
- package/dist/esm/{chunk-LDGUT6MH.mjs → chunk-APRCCICD.mjs} +342 -256
- package/dist/esm/index.d.mts +8 -0
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/novu-04KlkBy4.d.mts +528 -0
- package/dist/esm/ui/index.d.mts +145 -0
- package/dist/esm/ui/index.mjs +131 -54
- package/dist/novu.min.js +10 -10
- package/dist/novu.min.js.gz +0 -0
- package/package.json +24 -16
- package/ui/package.json +5 -0
- package/dist/cjs/index.cjs +0 -50
- package/dist/types/api/inbox-service.d.ts +0 -65
- package/dist/types/api/inbox-service.d.ts.map +0 -1
- package/dist/types/api/index.d.ts +0 -2
- package/dist/types/api/index.d.ts.map +0 -1
- package/dist/types/base-module.d.ts +0 -13
- package/dist/types/base-module.d.ts.map +0 -1
- package/dist/types/cache/in-memory-cache.d.ts +0 -13
- package/dist/types/cache/in-memory-cache.d.ts.map +0 -1
- package/dist/types/cache/index.d.ts +0 -2
- package/dist/types/cache/index.d.ts.map +0 -1
- package/dist/types/cache/notifications-cache.d.ts +0 -22
- package/dist/types/cache/notifications-cache.d.ts.map +0 -1
- package/dist/types/cache/preferences-cache.d.ts +0 -11
- package/dist/types/cache/preferences-cache.d.ts.map +0 -1
- package/dist/types/cache/types.d.ts +0 -10
- package/dist/types/cache/types.d.ts.map +0 -1
- package/dist/types/event-emitter/index.d.ts +0 -3
- package/dist/types/event-emitter/index.d.ts.map +0 -1
- package/dist/types/event-emitter/novu-event-emitter.d.ts +0 -14
- package/dist/types/event-emitter/novu-event-emitter.d.ts.map +0 -1
- package/dist/types/event-emitter/types.d.ts +0 -85
- package/dist/types/event-emitter/types.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -3
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/notifications/helpers.d.ts +0 -57
- package/dist/types/notifications/helpers.d.ts.map +0 -1
- package/dist/types/notifications/index.d.ts +0 -4
- package/dist/types/notifications/index.d.ts.map +0 -1
- package/dist/types/notifications/notification.d.ts +0 -33
- package/dist/types/notifications/notification.d.ts.map +0 -1
- package/dist/types/notifications/notifications.d.ts +0 -44
- package/dist/types/notifications/notifications.d.ts.map +0 -1
- package/dist/types/notifications/types.d.ts +0 -55
- package/dist/types/notifications/types.d.ts.map +0 -1
- package/dist/types/novu.d.ts +0 -14
- package/dist/types/novu.d.ts.map +0 -1
- package/dist/types/preferences/helpers.d.ts +0 -11
- package/dist/types/preferences/helpers.d.ts.map +0 -1
- package/dist/types/preferences/index.d.ts +0 -2
- package/dist/types/preferences/index.d.ts.map +0 -1
- package/dist/types/preferences/preference.d.ts +0 -15
- package/dist/types/preferences/preference.d.ts.map +0 -1
- package/dist/types/preferences/preferences.d.ts +0 -15
- package/dist/types/preferences/preferences.d.ts.map +0 -1
- package/dist/types/preferences/types.d.ts +0 -15
- package/dist/types/preferences/types.d.ts.map +0 -1
- package/dist/types/session/index.d.ts +0 -3
- package/dist/types/session/index.d.ts.map +0 -1
- package/dist/types/session/session.d.ts +0 -7
- package/dist/types/session/session.d.ts.map +0 -1
- package/dist/types/session/types.d.ts +0 -6
- package/dist/types/session/types.d.ts.map +0 -1
- package/dist/types/types.d.ts +0 -150
- package/dist/types/types.d.ts.map +0 -1
- package/dist/types/ui/api/hooks/index.d.ts +0 -6
- package/dist/types/ui/api/hooks/index.d.ts.map +0 -1
- package/dist/types/ui/api/hooks/useArchiveAll.d.ts +0 -10
- package/dist/types/ui/api/hooks/useArchiveAll.d.ts.map +0 -1
- package/dist/types/ui/api/hooks/useArchiveAllRead.d.ts +0 -10
- package/dist/types/ui/api/hooks/useArchiveAllRead.d.ts.map +0 -1
- package/dist/types/ui/api/hooks/useNotifications.d.ts +0 -17
- package/dist/types/ui/api/hooks/useNotifications.d.ts.map +0 -1
- package/dist/types/ui/api/hooks/usePreferences.d.ts +0 -9
- package/dist/types/ui/api/hooks/usePreferences.d.ts.map +0 -1
- package/dist/types/ui/api/hooks/useReadAll.d.ts +0 -10
- package/dist/types/ui/api/hooks/useReadAll.d.ts.map +0 -1
- package/dist/types/ui/api/index.d.ts +0 -2
- package/dist/types/ui/api/index.d.ts.map +0 -1
- package/dist/types/ui/components/ExternalElementRenderer.d.ts +0 -7
- package/dist/types/ui/components/ExternalElementRenderer.d.ts.map +0 -1
- package/dist/types/ui/components/Inbox.d.ts +0 -24
- package/dist/types/ui/components/Inbox.d.ts.map +0 -1
- package/dist/types/ui/components/InboxTabs/InboxTab.d.ts +0 -16
- package/dist/types/ui/components/InboxTabs/InboxTab.d.ts.map +0 -1
- package/dist/types/ui/components/InboxTabs/InboxTabs.d.ts +0 -11
- package/dist/types/ui/components/InboxTabs/InboxTabs.d.ts.map +0 -1
- package/dist/types/ui/components/InboxTabs/index.d.ts +0 -2
- package/dist/types/ui/components/InboxTabs/index.d.ts.map +0 -1
- package/dist/types/ui/components/InboxTabs/useTabsDropdown.d.ts +0 -11
- package/dist/types/ui/components/InboxTabs/useTabsDropdown.d.ts.map +0 -1
- package/dist/types/ui/components/Notification/DefaultNotification.d.ts +0 -12
- package/dist/types/ui/components/Notification/DefaultNotification.d.ts.map +0 -1
- package/dist/types/ui/components/Notification/NewMessagesCta.d.ts +0 -6
- package/dist/types/ui/components/Notification/NewMessagesCta.d.ts.map +0 -1
- package/dist/types/ui/components/Notification/Notification.d.ts +0 -12
- package/dist/types/ui/components/Notification/Notification.d.ts.map +0 -1
- package/dist/types/ui/components/Notification/NotificationList.d.ts +0 -14
- package/dist/types/ui/components/Notification/NotificationList.d.ts.map +0 -1
- package/dist/types/ui/components/Notification/NotificationListSkeleton.d.ts +0 -7
- package/dist/types/ui/components/Notification/NotificationListSkeleton.d.ts.map +0 -1
- package/dist/types/ui/components/Notification/index.d.ts +0 -3
- package/dist/types/ui/components/Notification/index.d.ts.map +0 -1
- package/dist/types/ui/components/Renderer.d.ts +0 -44
- package/dist/types/ui/components/Renderer.d.ts.map +0 -1
- package/dist/types/ui/components/elements/Bell/Bell.d.ts +0 -8
- package/dist/types/ui/components/elements/Bell/Bell.d.ts.map +0 -1
- package/dist/types/ui/components/elements/Bell/DefaultBellContainer.d.ts +0 -6
- package/dist/types/ui/components/elements/Bell/DefaultBellContainer.d.ts.map +0 -1
- package/dist/types/ui/components/elements/Bell/index.d.ts +0 -2
- package/dist/types/ui/components/elements/Bell/index.d.ts.map +0 -1
- package/dist/types/ui/components/elements/Footer.d.ts +0 -2
- package/dist/types/ui/components/elements/Footer.d.ts.map +0 -1
- package/dist/types/ui/components/elements/Header/ActionsContainer.d.ts +0 -6
- package/dist/types/ui/components/elements/Header/ActionsContainer.d.ts.map +0 -1
- package/dist/types/ui/components/elements/Header/Header.d.ts +0 -6
- package/dist/types/ui/components/elements/Header/Header.d.ts.map +0 -1
- package/dist/types/ui/components/elements/Header/MoreActionsDropdown.d.ts +0 -2
- package/dist/types/ui/components/elements/Header/MoreActionsDropdown.d.ts.map +0 -1
- package/dist/types/ui/components/elements/Header/MoreActionsOptions.d.ts +0 -9
- package/dist/types/ui/components/elements/Header/MoreActionsOptions.d.ts.map +0 -1
- package/dist/types/ui/components/elements/Header/PreferencesHeader.d.ts +0 -6
- package/dist/types/ui/components/elements/Header/PreferencesHeader.d.ts.map +0 -1
- package/dist/types/ui/components/elements/Header/index.d.ts +0 -3
- package/dist/types/ui/components/elements/Header/index.d.ts.map +0 -1
- package/dist/types/ui/components/elements/InboxStatus/InboxStatusDropdown.d.ts +0 -2
- package/dist/types/ui/components/elements/InboxStatus/InboxStatusDropdown.d.ts.map +0 -1
- package/dist/types/ui/components/elements/InboxStatus/InboxStatusOptions.d.ts +0 -14
- package/dist/types/ui/components/elements/InboxStatus/InboxStatusOptions.d.ts.map +0 -1
- package/dist/types/ui/components/elements/InboxStatus/constants.d.ts +0 -11
- package/dist/types/ui/components/elements/InboxStatus/constants.d.ts.map +0 -1
- package/dist/types/ui/components/elements/Preferences/ChannelRow.d.ts +0 -18
- package/dist/types/ui/components/elements/Preferences/ChannelRow.d.ts.map +0 -1
- package/dist/types/ui/components/elements/Preferences/LoadingScreen.d.ts +0 -2
- package/dist/types/ui/components/elements/Preferences/LoadingScreen.d.ts.map +0 -1
- package/dist/types/ui/components/elements/Preferences/Preferences.d.ts +0 -2
- package/dist/types/ui/components/elements/Preferences/Preferences.d.ts.map +0 -1
- package/dist/types/ui/components/elements/Preferences/Switch.d.ts +0 -8
- package/dist/types/ui/components/elements/Preferences/Switch.d.ts.map +0 -1
- package/dist/types/ui/components/elements/Preferences/index.d.ts +0 -2
- package/dist/types/ui/components/elements/Preferences/index.d.ts.map +0 -1
- package/dist/types/ui/components/elements/Root.d.ts +0 -3
- package/dist/types/ui/components/elements/Root.d.ts.map +0 -1
- package/dist/types/ui/components/elements/index.d.ts +0 -6
- package/dist/types/ui/components/elements/index.d.ts.map +0 -1
- package/dist/types/ui/components/index.d.ts +0 -4
- package/dist/types/ui/components/index.d.ts.map +0 -1
- package/dist/types/ui/components/primitives/Button.d.ts +0 -13
- package/dist/types/ui/components/primitives/Button.d.ts.map +0 -1
- package/dist/types/ui/components/primitives/Dropdown/DropdownContent.d.ts +0 -8
- package/dist/types/ui/components/primitives/Dropdown/DropdownContent.d.ts.map +0 -1
- package/dist/types/ui/components/primitives/Dropdown/DropdownItem.d.ts +0 -9
- package/dist/types/ui/components/primitives/Dropdown/DropdownItem.d.ts.map +0 -1
- package/dist/types/ui/components/primitives/Dropdown/DropdownRoot.d.ts +0 -4
- package/dist/types/ui/components/primitives/Dropdown/DropdownRoot.d.ts.map +0 -1
- package/dist/types/ui/components/primitives/Dropdown/DropdownTrigger.d.ts +0 -8
- package/dist/types/ui/components/primitives/Dropdown/DropdownTrigger.d.ts.map +0 -1
- package/dist/types/ui/components/primitives/Dropdown/index.d.ts +0 -44
- package/dist/types/ui/components/primitives/Dropdown/index.d.ts.map +0 -1
- package/dist/types/ui/components/primitives/Popover/PopoverClose.d.ts +0 -7
- package/dist/types/ui/components/primitives/Popover/PopoverClose.d.ts.map +0 -1
- package/dist/types/ui/components/primitives/Popover/PopoverContent.d.ts +0 -9
- package/dist/types/ui/components/primitives/Popover/PopoverContent.d.ts.map +0 -1
- package/dist/types/ui/components/primitives/Popover/PopoverRoot.d.ts +0 -23
- package/dist/types/ui/components/primitives/Popover/PopoverRoot.d.ts.map +0 -1
- package/dist/types/ui/components/primitives/Popover/PopoverTrigger.d.ts +0 -9
- package/dist/types/ui/components/primitives/Popover/PopoverTrigger.d.ts.map +0 -1
- package/dist/types/ui/components/primitives/Popover/index.d.ts +0 -28
- package/dist/types/ui/components/primitives/Popover/index.d.ts.map +0 -1
- package/dist/types/ui/components/primitives/Skeleton.d.ts +0 -14
- package/dist/types/ui/components/primitives/Skeleton.d.ts.map +0 -1
- package/dist/types/ui/components/primitives/Tabs/TabsContent.d.ts +0 -10
- package/dist/types/ui/components/primitives/Tabs/TabsContent.d.ts.map +0 -1
- package/dist/types/ui/components/primitives/Tabs/TabsList.d.ts +0 -11
- package/dist/types/ui/components/primitives/Tabs/TabsList.d.ts.map +0 -1
- package/dist/types/ui/components/primitives/Tabs/TabsRoot.d.ts +0 -20
- package/dist/types/ui/components/primitives/Tabs/TabsRoot.d.ts.map +0 -1
- package/dist/types/ui/components/primitives/Tabs/TabsTrigger.d.ts +0 -13
- package/dist/types/ui/components/primitives/Tabs/TabsTrigger.d.ts.map +0 -1
- package/dist/types/ui/components/primitives/Tabs/index.d.ts +0 -35
- package/dist/types/ui/components/primitives/Tabs/index.d.ts.map +0 -1
- package/dist/types/ui/components/primitives/Tabs/useKeyboardNavigation.d.ts +0 -7
- package/dist/types/ui/components/primitives/Tabs/useKeyboardNavigation.d.ts.map +0 -1
- package/dist/types/ui/components/primitives/Tooltip/TooltipContent.d.ts +0 -9
- package/dist/types/ui/components/primitives/Tooltip/TooltipContent.d.ts.map +0 -1
- package/dist/types/ui/components/primitives/Tooltip/TooltipRoot.d.ts +0 -21
- package/dist/types/ui/components/primitives/Tooltip/TooltipRoot.d.ts.map +0 -1
- package/dist/types/ui/components/primitives/Tooltip/TooltipTrigger.d.ts +0 -9
- package/dist/types/ui/components/primitives/Tooltip/TooltipTrigger.d.ts.map +0 -1
- package/dist/types/ui/components/primitives/Tooltip/index.d.ts +0 -21
- package/dist/types/ui/components/primitives/Tooltip/index.d.ts.map +0 -1
- package/dist/types/ui/components/primitives/index.d.ts +0 -5
- package/dist/types/ui/components/primitives/index.d.ts.map +0 -1
- package/dist/types/ui/config/appearanceKeys.d.ts +0 -2
- package/dist/types/ui/config/appearanceKeys.d.ts.map +0 -1
- package/dist/types/ui/config/defaultLocalization.d.ts +0 -26
- package/dist/types/ui/config/defaultLocalization.d.ts.map +0 -1
- package/dist/types/ui/config/defaultVariables.d.ts +0 -3
- package/dist/types/ui/config/defaultVariables.d.ts.map +0 -1
- package/dist/types/ui/config/index.d.ts +0 -4
- package/dist/types/ui/config/index.d.ts.map +0 -1
- package/dist/types/ui/context/AppearanceContext.d.ts +0 -17
- package/dist/types/ui/context/AppearanceContext.d.ts.map +0 -1
- package/dist/types/ui/context/CountContext.d.ts +0 -23
- package/dist/types/ui/context/CountContext.d.ts.map +0 -1
- package/dist/types/ui/context/FocusManagerContext.d.ts +0 -12
- package/dist/types/ui/context/FocusManagerContext.d.ts.map +0 -1
- package/dist/types/ui/context/InboxContext.d.ts +0 -25
- package/dist/types/ui/context/InboxContext.d.ts.map +0 -1
- package/dist/types/ui/context/LocalizationContext.d.ts +0 -24
- package/dist/types/ui/context/LocalizationContext.d.ts.map +0 -1
- package/dist/types/ui/context/NovuContext.d.ts +0 -11
- package/dist/types/ui/context/NovuContext.d.ts.map +0 -1
- package/dist/types/ui/context/index.d.ts +0 -7
- package/dist/types/ui/context/index.d.ts.map +0 -1
- package/dist/types/ui/helpers/browser.d.ts +0 -2
- package/dist/types/ui/helpers/browser.d.ts.map +0 -1
- package/dist/types/ui/helpers/constants.d.ts +0 -5
- package/dist/types/ui/helpers/constants.d.ts.map +0 -1
- package/dist/types/ui/helpers/createDelayedLoading.d.ts +0 -3
- package/dist/types/ui/helpers/createDelayedLoading.d.ts.map +0 -1
- package/dist/types/ui/helpers/createInfiniteScroll.d.ts +0 -19
- package/dist/types/ui/helpers/createInfiniteScroll.d.ts.map +0 -1
- package/dist/types/ui/helpers/formatToRelativeTime.d.ts +0 -6
- package/dist/types/ui/helpers/formatToRelativeTime.d.ts.map +0 -1
- package/dist/types/ui/helpers/index.d.ts +0 -7
- package/dist/types/ui/helpers/index.d.ts.map +0 -1
- package/dist/types/ui/helpers/types.d.ts +0 -4
- package/dist/types/ui/helpers/types.d.ts.map +0 -1
- package/dist/types/ui/helpers/useBrowserTabsChannel.d.ts +0 -7
- package/dist/types/ui/helpers/useBrowserTabsChannel.d.ts.map +0 -1
- package/dist/types/ui/helpers/useFocusTrap.d.ts +0 -7
- package/dist/types/ui/helpers/useFocusTrap.d.ts.map +0 -1
- package/dist/types/ui/helpers/useNovuEvent.d.ts +0 -6
- package/dist/types/ui/helpers/useNovuEvent.d.ts.map +0 -1
- package/dist/types/ui/helpers/useStyle.d.ts +0 -3
- package/dist/types/ui/helpers/useStyle.d.ts.map +0 -1
- package/dist/types/ui/helpers/useUncontrolledState.d.ts +0 -9
- package/dist/types/ui/helpers/useUncontrolledState.d.ts.map +0 -1
- package/dist/types/ui/helpers/useWebSocketEvent.d.ts +0 -6
- package/dist/types/ui/helpers/useWebSocketEvent.d.ts.map +0 -1
- package/dist/types/ui/helpers/utils.d.ts +0 -33
- package/dist/types/ui/helpers/utils.d.ts.map +0 -1
- package/dist/types/ui/icons/Archive.d.ts +0 -3
- package/dist/types/ui/icons/Archive.d.ts.map +0 -1
- package/dist/types/ui/icons/ArchiveRead.d.ts +0 -3
- package/dist/types/ui/icons/ArchiveRead.d.ts.map +0 -1
- package/dist/types/ui/icons/ArrowDropDown.d.ts +0 -3
- package/dist/types/ui/icons/ArrowDropDown.d.ts.map +0 -1
- package/dist/types/ui/icons/ArrowLeft.d.ts +0 -3
- package/dist/types/ui/icons/ArrowLeft.d.ts.map +0 -1
- package/dist/types/ui/icons/BellIcon.d.ts +0 -3
- package/dist/types/ui/icons/BellIcon.d.ts.map +0 -1
- package/dist/types/ui/icons/Chat.d.ts +0 -3
- package/dist/types/ui/icons/Chat.d.ts.map +0 -1
- package/dist/types/ui/icons/Check.d.ts +0 -3
- package/dist/types/ui/icons/Check.d.ts.map +0 -1
- package/dist/types/ui/icons/Dots.d.ts +0 -3
- package/dist/types/ui/icons/Dots.d.ts.map +0 -1
- package/dist/types/ui/icons/Email.d.ts +0 -3
- package/dist/types/ui/icons/Email.d.ts.map +0 -1
- package/dist/types/ui/icons/EmptyIcon.d.ts +0 -3
- package/dist/types/ui/icons/EmptyIcon.d.ts.map +0 -1
- package/dist/types/ui/icons/InApp.d.ts +0 -3
- package/dist/types/ui/icons/InApp.d.ts.map +0 -1
- package/dist/types/ui/icons/Inbox.d.ts +0 -3
- package/dist/types/ui/icons/Inbox.d.ts.map +0 -1
- package/dist/types/ui/icons/Lock.d.ts +0 -2
- package/dist/types/ui/icons/Lock.d.ts.map +0 -1
- package/dist/types/ui/icons/Novu.d.ts +0 -3
- package/dist/types/ui/icons/Novu.d.ts.map +0 -1
- package/dist/types/ui/icons/Push.d.ts +0 -3
- package/dist/types/ui/icons/Push.d.ts.map +0 -1
- package/dist/types/ui/icons/ReadAll.d.ts +0 -3
- package/dist/types/ui/icons/ReadAll.d.ts.map +0 -1
- package/dist/types/ui/icons/Settings.d.ts +0 -3
- package/dist/types/ui/icons/Settings.d.ts.map +0 -1
- package/dist/types/ui/icons/Sms.d.ts +0 -3
- package/dist/types/ui/icons/Sms.d.ts.map +0 -1
- package/dist/types/ui/icons/Unarchive.d.ts +0 -3
- package/dist/types/ui/icons/Unarchive.d.ts.map +0 -1
- package/dist/types/ui/icons/Unread.d.ts +0 -3
- package/dist/types/ui/icons/Unread.d.ts.map +0 -1
- package/dist/types/ui/icons/index.d.ts +0 -20
- package/dist/types/ui/icons/index.d.ts.map +0 -1
- package/dist/types/ui/index.d.ts +0 -6
- package/dist/types/ui/index.d.ts.map +0 -1
- package/dist/types/ui/novuUI.d.ts +0 -25
- package/dist/types/ui/novuUI.d.ts.map +0 -1
- package/dist/types/ui/themes/dark.d.ts +0 -3
- package/dist/types/ui/themes/dark.d.ts.map +0 -1
- package/dist/types/ui/themes/index.d.ts +0 -2
- package/dist/types/ui/themes/index.d.ts.map +0 -1
- package/dist/types/ui/types.d.ts +0 -57
- package/dist/types/ui/types.d.ts.map +0 -1
- package/dist/types/umd.d.ts +0 -2
- package/dist/types/umd.d.ts.map +0 -1
- package/dist/types/utils/arrays.d.ts +0 -2
- package/dist/types/utils/arrays.d.ts.map +0 -1
- package/dist/types/utils/config.d.ts +0 -2
- package/dist/types/utils/config.d.ts.map +0 -1
- package/dist/types/utils/errors.d.ts +0 -5
- package/dist/types/utils/errors.d.ts.map +0 -1
- package/dist/types/utils/inbox-service-singleton.d.ts +0 -6
- package/dist/types/utils/inbox-service-singleton.d.ts.map +0 -1
- package/dist/types/utils/notification-utils.d.ts +0 -6
- package/dist/types/utils/notification-utils.d.ts.map +0 -1
- package/dist/types/ws/index.d.ts +0 -2
- package/dist/types/ws/index.d.ts.map +0 -1
- package/dist/types/ws/socket.d.ts +0 -13
- package/dist/types/ws/socket.d.ts.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var mitt = require('mitt');
|
|
4
|
-
var client = require('@novu/client');
|
|
5
4
|
var io = require('socket.io-client');
|
|
5
|
+
var client = require('@novu/client');
|
|
6
6
|
|
|
7
7
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
8
|
|
|
@@ -127,18 +127,32 @@ var PreferenceOverrideSourceEnum = /* @__PURE__ */ ((PreferenceOverrideSourceEnu
|
|
|
127
127
|
PreferenceOverrideSourceEnum2["WORKFLOW_OVERRIDE"] = "workflowOverride";
|
|
128
128
|
return PreferenceOverrideSourceEnum2;
|
|
129
129
|
})(PreferenceOverrideSourceEnum || {});
|
|
130
|
-
|
|
131
|
-
|
|
130
|
+
|
|
131
|
+
// src/utils/arrays.ts
|
|
132
|
+
var arrayValuesEqual = (arr1, arr2) => {
|
|
133
|
+
if (arr1 === arr2) {
|
|
134
|
+
return true;
|
|
135
|
+
}
|
|
136
|
+
if (!arr1 || !arr2) {
|
|
137
|
+
return false;
|
|
138
|
+
}
|
|
139
|
+
if (arr1.length !== arr2.length) {
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
return arr1.every((value, index) => value === arr2[index]);
|
|
143
|
+
};
|
|
144
|
+
var areTagsEqual = (tags1, tags2) => {
|
|
145
|
+
return arrayValuesEqual(tags1, tags2) || !tags1 && (tags2 == null ? void 0 : tags2.length) === 0 || (tags1 == null ? void 0 : tags1.length) === 0 && !tags2;
|
|
146
|
+
};
|
|
147
|
+
var isSameFilter = (filter1, filter2) => {
|
|
148
|
+
return areTagsEqual(filter1.tags, filter2.tags) && filter1.read === filter2.read && filter1.archived === filter2.archived;
|
|
149
|
+
};
|
|
150
|
+
var _mittEmitter;
|
|
151
|
+
var NovuEventEmitter = class {
|
|
132
152
|
constructor() {
|
|
133
153
|
__privateAdd(this, _mittEmitter);
|
|
134
154
|
__privateSet(this, _mittEmitter, mitt__default.default());
|
|
135
155
|
}
|
|
136
|
-
static getInstance(options) {
|
|
137
|
-
if (options == null ? void 0 : options.recreate) {
|
|
138
|
-
__privateSet(_NovuEventEmitter, _instance, new _NovuEventEmitter());
|
|
139
|
-
}
|
|
140
|
-
return __privateGet(_NovuEventEmitter, _instance);
|
|
141
|
-
}
|
|
142
156
|
on(eventName, listener) {
|
|
143
157
|
__privateGet(this, _mittEmitter).on(eventName, listener);
|
|
144
158
|
}
|
|
@@ -149,10 +163,7 @@ var _NovuEventEmitter = class _NovuEventEmitter {
|
|
|
149
163
|
__privateGet(this, _mittEmitter).emit(type, event);
|
|
150
164
|
}
|
|
151
165
|
};
|
|
152
|
-
_instance = new WeakMap();
|
|
153
166
|
_mittEmitter = new WeakMap();
|
|
154
|
-
__privateAdd(_NovuEventEmitter, _instance);
|
|
155
|
-
var NovuEventEmitter = _NovuEventEmitter;
|
|
156
167
|
|
|
157
168
|
// src/utils/errors.ts
|
|
158
169
|
var NovuError = class extends Error {
|
|
@@ -161,139 +172,18 @@ var NovuError = class extends Error {
|
|
|
161
172
|
this.originalError = originalError;
|
|
162
173
|
}
|
|
163
174
|
};
|
|
164
|
-
var NOVU_API_VERSION = "2024-06-26";
|
|
165
|
-
var INBOX_ROUTE = "/inbox";
|
|
166
|
-
var INBOX_NOTIFICATIONS_ROUTE = `${INBOX_ROUTE}/notifications`;
|
|
167
|
-
var _httpClient;
|
|
168
|
-
var InboxService = class {
|
|
169
|
-
constructor(options = {}) {
|
|
170
|
-
this.isSessionInitialized = false;
|
|
171
|
-
__privateAdd(this, _httpClient);
|
|
172
|
-
__privateSet(this, _httpClient, new client.HttpClient(options));
|
|
173
|
-
__privateGet(this, _httpClient).updateHeaders({
|
|
174
|
-
"Novu-API-Version": NOVU_API_VERSION
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
initializeSession(_0) {
|
|
178
|
-
return __async(this, arguments, function* ({
|
|
179
|
-
applicationIdentifier,
|
|
180
|
-
subscriberId,
|
|
181
|
-
subscriberHash
|
|
182
|
-
}) {
|
|
183
|
-
const response = yield __privateGet(this, _httpClient).post(`${INBOX_ROUTE}/session`, {
|
|
184
|
-
applicationIdentifier,
|
|
185
|
-
subscriberId,
|
|
186
|
-
subscriberHash
|
|
187
|
-
});
|
|
188
|
-
__privateGet(this, _httpClient).setAuthorizationToken(response.token);
|
|
189
|
-
this.isSessionInitialized = true;
|
|
190
|
-
return response;
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
fetchNotifications({
|
|
194
|
-
after,
|
|
195
|
-
archived,
|
|
196
|
-
limit = 10,
|
|
197
|
-
offset,
|
|
198
|
-
read: read2,
|
|
199
|
-
tags
|
|
200
|
-
}) {
|
|
201
|
-
const queryParams = new URLSearchParams(`limit=${limit}`);
|
|
202
|
-
if (after) {
|
|
203
|
-
queryParams.append("after", after);
|
|
204
|
-
}
|
|
205
|
-
if (offset) {
|
|
206
|
-
queryParams.append("offset", `${offset}`);
|
|
207
|
-
}
|
|
208
|
-
if (tags) {
|
|
209
|
-
tags.forEach((tag) => queryParams.append("tags[]", tag));
|
|
210
|
-
}
|
|
211
|
-
if (read2 !== void 0) {
|
|
212
|
-
queryParams.append("read", `${read2}`);
|
|
213
|
-
}
|
|
214
|
-
if (archived !== void 0) {
|
|
215
|
-
queryParams.append("archived", `${archived}`);
|
|
216
|
-
}
|
|
217
|
-
return __privateGet(this, _httpClient).getFullResponse(`${INBOX_NOTIFICATIONS_ROUTE}?${queryParams.toString()}`);
|
|
218
|
-
}
|
|
219
|
-
count({ filters }) {
|
|
220
|
-
return __privateGet(this, _httpClient).getFullResponse(`${INBOX_NOTIFICATIONS_ROUTE}/count?filters=${JSON.stringify(filters)}`);
|
|
221
|
-
}
|
|
222
|
-
read(notificationId) {
|
|
223
|
-
return __privateGet(this, _httpClient).patch(`${INBOX_NOTIFICATIONS_ROUTE}/${notificationId}/read`);
|
|
224
|
-
}
|
|
225
|
-
unread(notificationId) {
|
|
226
|
-
return __privateGet(this, _httpClient).patch(`${INBOX_NOTIFICATIONS_ROUTE}/${notificationId}/unread`);
|
|
227
|
-
}
|
|
228
|
-
archive(notificationId) {
|
|
229
|
-
return __privateGet(this, _httpClient).patch(`${INBOX_NOTIFICATIONS_ROUTE}/${notificationId}/archive`);
|
|
230
|
-
}
|
|
231
|
-
unarchive(notificationId) {
|
|
232
|
-
return __privateGet(this, _httpClient).patch(`${INBOX_NOTIFICATIONS_ROUTE}/${notificationId}/unarchive`);
|
|
233
|
-
}
|
|
234
|
-
readAll({ tags }) {
|
|
235
|
-
return __privateGet(this, _httpClient).post(`${INBOX_NOTIFICATIONS_ROUTE}/read`, { tags });
|
|
236
|
-
}
|
|
237
|
-
archiveAll({ tags }) {
|
|
238
|
-
return __privateGet(this, _httpClient).post(`${INBOX_NOTIFICATIONS_ROUTE}/archive`, { tags });
|
|
239
|
-
}
|
|
240
|
-
archiveAllRead({ tags }) {
|
|
241
|
-
return __privateGet(this, _httpClient).post(`${INBOX_NOTIFICATIONS_ROUTE}/read-archive`, { tags });
|
|
242
|
-
}
|
|
243
|
-
completeAction({
|
|
244
|
-
actionType,
|
|
245
|
-
notificationId
|
|
246
|
-
}) {
|
|
247
|
-
return __privateGet(this, _httpClient).patch(`${INBOX_NOTIFICATIONS_ROUTE}/${notificationId}/complete`, {
|
|
248
|
-
actionType
|
|
249
|
-
});
|
|
250
|
-
}
|
|
251
|
-
revertAction({
|
|
252
|
-
actionType,
|
|
253
|
-
notificationId
|
|
254
|
-
}) {
|
|
255
|
-
return __privateGet(this, _httpClient).patch(`${INBOX_NOTIFICATIONS_ROUTE}/${notificationId}/revert`, {
|
|
256
|
-
actionType
|
|
257
|
-
});
|
|
258
|
-
}
|
|
259
|
-
fetchPreferences() {
|
|
260
|
-
return __privateGet(this, _httpClient).get(`${INBOX_ROUTE}/preferences`);
|
|
261
|
-
}
|
|
262
|
-
updateGlobalPreferences(channelPreferences) {
|
|
263
|
-
return __privateGet(this, _httpClient).patch(`${INBOX_ROUTE}/preferences`, channelPreferences);
|
|
264
|
-
}
|
|
265
|
-
updateWorkflowPreferences({
|
|
266
|
-
workflowId,
|
|
267
|
-
channelPreferences
|
|
268
|
-
}) {
|
|
269
|
-
return __privateGet(this, _httpClient).patch(`${INBOX_ROUTE}/preferences/${workflowId}`, channelPreferences);
|
|
270
|
-
}
|
|
271
|
-
};
|
|
272
|
-
_httpClient = new WeakMap();
|
|
273
|
-
|
|
274
|
-
// src/utils/inbox-service-singleton.ts
|
|
275
|
-
var _instance2;
|
|
276
|
-
var _InboxServiceSingleton = class _InboxServiceSingleton {
|
|
277
|
-
static getInstance(options) {
|
|
278
|
-
const isNeedsToRecreate = !!options;
|
|
279
|
-
if (isNeedsToRecreate) {
|
|
280
|
-
__privateSet(_InboxServiceSingleton, _instance2, new InboxService(options));
|
|
281
|
-
}
|
|
282
|
-
return __privateGet(_InboxServiceSingleton, _instance2);
|
|
283
|
-
}
|
|
284
|
-
};
|
|
285
|
-
_instance2 = new WeakMap();
|
|
286
|
-
__privateAdd(_InboxServiceSingleton, _instance2);
|
|
287
|
-
var InboxServiceSingleton = _InboxServiceSingleton;
|
|
288
175
|
|
|
289
176
|
// src/base-module.ts
|
|
290
177
|
var _callsQueue, _sessionError;
|
|
291
178
|
var BaseModule = class {
|
|
292
|
-
constructor(
|
|
179
|
+
constructor({
|
|
180
|
+
inboxServiceInstance,
|
|
181
|
+
eventEmitterInstance
|
|
182
|
+
}) {
|
|
293
183
|
__privateAdd(this, _callsQueue, []);
|
|
294
184
|
__privateAdd(this, _sessionError);
|
|
295
|
-
this._emitter =
|
|
296
|
-
this._inboxService =
|
|
185
|
+
this._emitter = eventEmitterInstance;
|
|
186
|
+
this._inboxService = inboxServiceInstance;
|
|
297
187
|
this._emitter.on("session.initialize.resolved", ({ error, data }) => {
|
|
298
188
|
if (data) {
|
|
299
189
|
this.onSessionSuccess(data);
|
|
@@ -337,11 +227,11 @@ _sessionError = new WeakMap();
|
|
|
337
227
|
// src/notifications/notification.ts
|
|
338
228
|
var _emitter, _inboxService;
|
|
339
229
|
var Notification = class {
|
|
340
|
-
constructor(notification) {
|
|
230
|
+
constructor(notification, emitter, inboxService) {
|
|
341
231
|
__privateAdd(this, _emitter);
|
|
342
232
|
__privateAdd(this, _inboxService);
|
|
343
|
-
__privateSet(this, _emitter,
|
|
344
|
-
__privateSet(this, _inboxService,
|
|
233
|
+
__privateSet(this, _emitter, emitter);
|
|
234
|
+
__privateSet(this, _inboxService, inboxService);
|
|
345
235
|
this.id = notification.id;
|
|
346
236
|
this.subject = notification.subject;
|
|
347
237
|
this.body = notification.body;
|
|
@@ -463,19 +353,26 @@ var read = (_0) => __async(void 0, [_0], function* ({
|
|
|
463
353
|
apiService,
|
|
464
354
|
args
|
|
465
355
|
}) {
|
|
466
|
-
const { notificationId, optimisticValue } = getNotificationDetails(
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
356
|
+
const { notificationId, optimisticValue } = getNotificationDetails(
|
|
357
|
+
args,
|
|
358
|
+
{
|
|
359
|
+
isRead: true,
|
|
360
|
+
readAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
361
|
+
isArchived: false,
|
|
362
|
+
archivedAt: void 0
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
emitter,
|
|
366
|
+
apiService
|
|
367
|
+
}
|
|
368
|
+
);
|
|
472
369
|
try {
|
|
473
370
|
emitter.emit("notification.read.pending", {
|
|
474
371
|
args,
|
|
475
372
|
data: optimisticValue
|
|
476
373
|
});
|
|
477
374
|
const response = yield apiService.read(notificationId);
|
|
478
|
-
const updatedNotification = new Notification(response);
|
|
375
|
+
const updatedNotification = new Notification(response, emitter, apiService);
|
|
479
376
|
emitter.emit("notification.read.resolved", { args, data: updatedNotification });
|
|
480
377
|
return { data: updatedNotification };
|
|
481
378
|
} catch (error) {
|
|
@@ -488,19 +385,26 @@ var unread = (_0) => __async(void 0, [_0], function* ({
|
|
|
488
385
|
apiService,
|
|
489
386
|
args
|
|
490
387
|
}) {
|
|
491
|
-
const { notificationId, optimisticValue } = getNotificationDetails(
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
388
|
+
const { notificationId, optimisticValue } = getNotificationDetails(
|
|
389
|
+
args,
|
|
390
|
+
{
|
|
391
|
+
isRead: false,
|
|
392
|
+
readAt: null,
|
|
393
|
+
isArchived: false,
|
|
394
|
+
archivedAt: void 0
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
emitter,
|
|
398
|
+
apiService
|
|
399
|
+
}
|
|
400
|
+
);
|
|
497
401
|
try {
|
|
498
402
|
emitter.emit("notification.unread.pending", {
|
|
499
403
|
args,
|
|
500
404
|
data: optimisticValue
|
|
501
405
|
});
|
|
502
406
|
const response = yield apiService.unread(notificationId);
|
|
503
|
-
const updatedNotification = new Notification(response);
|
|
407
|
+
const updatedNotification = new Notification(response, emitter, apiService);
|
|
504
408
|
emitter.emit("notification.unread.resolved", { args, data: updatedNotification });
|
|
505
409
|
return { data: updatedNotification };
|
|
506
410
|
} catch (error) {
|
|
@@ -513,19 +417,26 @@ var archive = (_0) => __async(void 0, [_0], function* ({
|
|
|
513
417
|
apiService,
|
|
514
418
|
args
|
|
515
419
|
}) {
|
|
516
|
-
const { notificationId, optimisticValue } = getNotificationDetails(
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
420
|
+
const { notificationId, optimisticValue } = getNotificationDetails(
|
|
421
|
+
args,
|
|
422
|
+
{
|
|
423
|
+
isArchived: true,
|
|
424
|
+
archivedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
425
|
+
isRead: true,
|
|
426
|
+
readAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
emitter,
|
|
430
|
+
apiService
|
|
431
|
+
}
|
|
432
|
+
);
|
|
522
433
|
try {
|
|
523
434
|
emitter.emit("notification.archive.pending", {
|
|
524
435
|
args,
|
|
525
436
|
data: optimisticValue
|
|
526
437
|
});
|
|
527
438
|
const response = yield apiService.archive(notificationId);
|
|
528
|
-
const updatedNotification = new Notification(response);
|
|
439
|
+
const updatedNotification = new Notification(response, emitter, apiService);
|
|
529
440
|
emitter.emit("notification.archive.resolved", { args, data: updatedNotification });
|
|
530
441
|
return { data: updatedNotification };
|
|
531
442
|
} catch (error) {
|
|
@@ -538,19 +449,26 @@ var unarchive = (_0) => __async(void 0, [_0], function* ({
|
|
|
538
449
|
apiService,
|
|
539
450
|
args
|
|
540
451
|
}) {
|
|
541
|
-
const { notificationId, optimisticValue } = getNotificationDetails(
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
452
|
+
const { notificationId, optimisticValue } = getNotificationDetails(
|
|
453
|
+
args,
|
|
454
|
+
{
|
|
455
|
+
isArchived: false,
|
|
456
|
+
archivedAt: null,
|
|
457
|
+
isRead: true,
|
|
458
|
+
readAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
emitter,
|
|
462
|
+
apiService
|
|
463
|
+
}
|
|
464
|
+
);
|
|
547
465
|
try {
|
|
548
466
|
emitter.emit("notification.unarchive.pending", {
|
|
549
467
|
args,
|
|
550
468
|
data: optimisticValue
|
|
551
469
|
});
|
|
552
470
|
const response = yield apiService.unarchive(notificationId);
|
|
553
|
-
const updatedNotification = new Notification(response);
|
|
471
|
+
const updatedNotification = new Notification(response, emitter, apiService);
|
|
554
472
|
emitter.emit("notification.unarchive.resolved", { args, data: updatedNotification });
|
|
555
473
|
return { data: updatedNotification };
|
|
556
474
|
} catch (error) {
|
|
@@ -573,14 +491,17 @@ var completeAction = (_0) => __async(void 0, [_0], function* ({
|
|
|
573
491
|
isCompleted: true
|
|
574
492
|
})
|
|
575
493
|
};
|
|
576
|
-
const { notificationId, optimisticValue } = getNotificationDetails(args, optimisticUpdate
|
|
494
|
+
const { notificationId, optimisticValue } = getNotificationDetails(args, optimisticUpdate, {
|
|
495
|
+
emitter,
|
|
496
|
+
apiService
|
|
497
|
+
});
|
|
577
498
|
try {
|
|
578
499
|
emitter.emit("notification.complete_action.pending", {
|
|
579
500
|
args,
|
|
580
501
|
data: optimisticValue
|
|
581
502
|
});
|
|
582
503
|
const response = yield apiService.completeAction({ actionType, notificationId });
|
|
583
|
-
const updatedNotification = new Notification(response);
|
|
504
|
+
const updatedNotification = new Notification(response, emitter, apiService);
|
|
584
505
|
emitter.emit("notification.complete_action.resolved", { args, data: updatedNotification });
|
|
585
506
|
return { data: updatedNotification };
|
|
586
507
|
} catch (error) {
|
|
@@ -603,14 +524,17 @@ var revertAction = (_0) => __async(void 0, [_0], function* ({
|
|
|
603
524
|
isCompleted: false
|
|
604
525
|
})
|
|
605
526
|
};
|
|
606
|
-
const { notificationId, optimisticValue } = getNotificationDetails(args, optimisticUpdate
|
|
527
|
+
const { notificationId, optimisticValue } = getNotificationDetails(args, optimisticUpdate, {
|
|
528
|
+
emitter,
|
|
529
|
+
apiService
|
|
530
|
+
});
|
|
607
531
|
try {
|
|
608
532
|
emitter.emit("notification.revert_action.pending", {
|
|
609
533
|
args,
|
|
610
534
|
data: optimisticValue
|
|
611
535
|
});
|
|
612
536
|
const response = yield apiService.revertAction({ actionType, notificationId });
|
|
613
|
-
const updatedNotification = new Notification(response);
|
|
537
|
+
const updatedNotification = new Notification(response, emitter, apiService);
|
|
614
538
|
emitter.emit("notification.revert_action.resolved", { args, data: updatedNotification });
|
|
615
539
|
return { data: updatedNotification };
|
|
616
540
|
} catch (error) {
|
|
@@ -618,11 +542,15 @@ var revertAction = (_0) => __async(void 0, [_0], function* ({
|
|
|
618
542
|
return { error: new NovuError("Failed to fetch notifications", error) };
|
|
619
543
|
}
|
|
620
544
|
});
|
|
621
|
-
var getNotificationDetails = (args, update) => {
|
|
545
|
+
var getNotificationDetails = (args, update, dependencies) => {
|
|
622
546
|
if ("notification" in args) {
|
|
623
547
|
return {
|
|
624
548
|
notificationId: args.notification.id,
|
|
625
|
-
optimisticValue: new Notification(
|
|
549
|
+
optimisticValue: new Notification(
|
|
550
|
+
__spreadValues(__spreadValues({}, args.notification), update),
|
|
551
|
+
dependencies.emitter,
|
|
552
|
+
dependencies.apiService
|
|
553
|
+
)
|
|
626
554
|
};
|
|
627
555
|
} else {
|
|
628
556
|
return {
|
|
@@ -639,12 +567,16 @@ var readAll = (_0) => __async(void 0, [_0], function* ({
|
|
|
639
567
|
try {
|
|
640
568
|
const notifications = notificationsCache.getUniqueNotifications({ tags });
|
|
641
569
|
const optimisticNotifications = notifications.map(
|
|
642
|
-
(notification) => new Notification(
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
570
|
+
(notification) => new Notification(
|
|
571
|
+
__spreadProps(__spreadValues({}, notification), {
|
|
572
|
+
isRead: true,
|
|
573
|
+
readAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
574
|
+
isArchived: false,
|
|
575
|
+
archivedAt: void 0
|
|
576
|
+
}),
|
|
577
|
+
emitter,
|
|
578
|
+
inboxService
|
|
579
|
+
)
|
|
648
580
|
);
|
|
649
581
|
emitter.emit("notifications.read_all.pending", { args: { tags }, data: optimisticNotifications });
|
|
650
582
|
yield inboxService.readAll({ tags });
|
|
@@ -664,12 +596,16 @@ var archiveAll = (_0) => __async(void 0, [_0], function* ({
|
|
|
664
596
|
try {
|
|
665
597
|
const notifications = notificationsCache.getUniqueNotifications({ tags });
|
|
666
598
|
const optimisticNotifications = notifications.map(
|
|
667
|
-
(notification) => new Notification(
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
599
|
+
(notification) => new Notification(
|
|
600
|
+
__spreadProps(__spreadValues({}, notification), {
|
|
601
|
+
isRead: true,
|
|
602
|
+
readAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
603
|
+
isArchived: true,
|
|
604
|
+
archivedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
605
|
+
}),
|
|
606
|
+
emitter,
|
|
607
|
+
inboxService
|
|
608
|
+
)
|
|
673
609
|
);
|
|
674
610
|
emitter.emit("notifications.archive_all.pending", { args: { tags }, data: optimisticNotifications });
|
|
675
611
|
yield inboxService.archiveAll({ tags });
|
|
@@ -689,7 +625,11 @@ var archiveAllRead = (_0) => __async(void 0, [_0], function* ({
|
|
|
689
625
|
try {
|
|
690
626
|
const notifications = notificationsCache.getUniqueNotifications({ tags, read: true });
|
|
691
627
|
const optimisticNotifications = notifications.map(
|
|
692
|
-
(notification) => new Notification(
|
|
628
|
+
(notification) => new Notification(
|
|
629
|
+
__spreadProps(__spreadValues({}, notification), { isArchived: true, archivedAt: (/* @__PURE__ */ new Date()).toISOString() }),
|
|
630
|
+
emitter,
|
|
631
|
+
inboxService
|
|
632
|
+
)
|
|
693
633
|
);
|
|
694
634
|
emitter.emit("notifications.archive_all_read.pending", { args: { tags }, data: optimisticNotifications });
|
|
695
635
|
yield inboxService.archiveAllRead({ tags });
|
|
@@ -732,26 +672,6 @@ var InMemoryCache = class {
|
|
|
732
672
|
};
|
|
733
673
|
_cache = new WeakMap();
|
|
734
674
|
|
|
735
|
-
// src/utils/arrays.ts
|
|
736
|
-
var arrayValuesEqual = (arr1, arr2) => {
|
|
737
|
-
if (arr1 === arr2) {
|
|
738
|
-
return true;
|
|
739
|
-
}
|
|
740
|
-
if (!arr1 || !arr2) {
|
|
741
|
-
return false;
|
|
742
|
-
}
|
|
743
|
-
if (arr1.length !== arr2.length) {
|
|
744
|
-
return false;
|
|
745
|
-
}
|
|
746
|
-
return arr1.every((value, index) => value === arr2[index]);
|
|
747
|
-
};
|
|
748
|
-
var areTagsEqual = (tags1, tags2) => {
|
|
749
|
-
return arrayValuesEqual(tags1, tags2) || !tags1 && (tags2 == null ? void 0 : tags2.length) === 0 || (tags1 == null ? void 0 : tags1.length) === 0 && !tags2;
|
|
750
|
-
};
|
|
751
|
-
var isSameFilter = (filter1, filter2) => {
|
|
752
|
-
return areTagsEqual(filter1.tags, filter2.tags) && filter1.read === filter2.read && filter1.archived === filter2.archived;
|
|
753
|
-
};
|
|
754
|
-
|
|
755
675
|
// src/cache/notifications-cache.ts
|
|
756
676
|
var excludeEmpty = ({ tags, read: read2, archived, limit, offset, after }) => Object.entries({ tags, read: read2, archived, limit, offset, after }).filter(([_, value]) => value !== null && value !== void 0 && !(Array.isArray(value) && value.length === 0)).reduce((acc, [key, value]) => {
|
|
757
677
|
acc[key] = value;
|
|
@@ -786,7 +706,7 @@ var removeEvents = [
|
|
|
786
706
|
];
|
|
787
707
|
var _emitter2, _cache2;
|
|
788
708
|
var NotificationsCache = class {
|
|
789
|
-
constructor() {
|
|
709
|
+
constructor({ emitter }) {
|
|
790
710
|
__privateAdd(this, _emitter2);
|
|
791
711
|
/**
|
|
792
712
|
* The key is the stringified notifications filter, the values are the paginated notifications.
|
|
@@ -848,7 +768,7 @@ var NotificationsCache = class {
|
|
|
848
768
|
});
|
|
849
769
|
});
|
|
850
770
|
};
|
|
851
|
-
__privateSet(this, _emitter2,
|
|
771
|
+
__privateSet(this, _emitter2, emitter);
|
|
852
772
|
updateEvents.forEach((event) => {
|
|
853
773
|
__privateGet(this, _emitter2).on(event, this.handleNotificationEvent());
|
|
854
774
|
});
|
|
@@ -931,10 +851,19 @@ _cache2 = new WeakMap();
|
|
|
931
851
|
// src/notifications/notifications.ts
|
|
932
852
|
var _useCache;
|
|
933
853
|
var Notifications = class extends BaseModule {
|
|
934
|
-
constructor({
|
|
935
|
-
|
|
854
|
+
constructor({
|
|
855
|
+
useCache,
|
|
856
|
+
inboxServiceInstance,
|
|
857
|
+
eventEmitterInstance
|
|
858
|
+
}) {
|
|
859
|
+
super({
|
|
860
|
+
eventEmitterInstance,
|
|
861
|
+
inboxServiceInstance
|
|
862
|
+
});
|
|
936
863
|
__privateAdd(this, _useCache);
|
|
937
|
-
this.cache = new NotificationsCache(
|
|
864
|
+
this.cache = new NotificationsCache({
|
|
865
|
+
emitter: eventEmitterInstance
|
|
866
|
+
});
|
|
938
867
|
__privateSet(this, _useCache, useCache);
|
|
939
868
|
}
|
|
940
869
|
list() {
|
|
@@ -952,7 +881,7 @@ var Notifications = class extends BaseModule {
|
|
|
952
881
|
data = {
|
|
953
882
|
hasMore: response.hasMore,
|
|
954
883
|
filter: response.filter,
|
|
955
|
-
notifications: response.data.map((el) => new Notification(el))
|
|
884
|
+
notifications: response.data.map((el) => new Notification(el, this._emitter, this._inboxService))
|
|
956
885
|
};
|
|
957
886
|
if (__privateGet(this, _useCache)) {
|
|
958
887
|
this.cache.set(args, data);
|
|
@@ -1152,12 +1081,12 @@ _useCache = new WeakMap();
|
|
|
1152
1081
|
// src/session/session.ts
|
|
1153
1082
|
var _emitter3, _inboxService2, _options;
|
|
1154
1083
|
var Session = class {
|
|
1155
|
-
constructor(options) {
|
|
1084
|
+
constructor(options, inboxServiceInstance, eventEmitterInstance) {
|
|
1156
1085
|
__privateAdd(this, _emitter3);
|
|
1157
1086
|
__privateAdd(this, _inboxService2);
|
|
1158
1087
|
__privateAdd(this, _options);
|
|
1159
|
-
__privateSet(this, _emitter3,
|
|
1160
|
-
__privateSet(this, _inboxService2,
|
|
1088
|
+
__privateSet(this, _emitter3, eventEmitterInstance);
|
|
1089
|
+
__privateSet(this, _inboxService2, inboxServiceInstance);
|
|
1161
1090
|
__privateSet(this, _options, options);
|
|
1162
1091
|
}
|
|
1163
1092
|
initialize() {
|
|
@@ -1184,11 +1113,11 @@ _options = new WeakMap();
|
|
|
1184
1113
|
// src/preferences/preference.ts
|
|
1185
1114
|
var _emitter4, _apiService;
|
|
1186
1115
|
var Preference = class {
|
|
1187
|
-
constructor(preference) {
|
|
1116
|
+
constructor(preference, { emitterInstance, inboxServiceInstance }) {
|
|
1188
1117
|
__privateAdd(this, _emitter4);
|
|
1189
1118
|
__privateAdd(this, _apiService);
|
|
1190
|
-
__privateSet(this, _emitter4,
|
|
1191
|
-
__privateSet(this, _apiService,
|
|
1119
|
+
__privateSet(this, _emitter4, emitterInstance);
|
|
1120
|
+
__privateSet(this, _apiService, inboxServiceInstance);
|
|
1192
1121
|
this.level = preference.level;
|
|
1193
1122
|
this.enabled = preference.enabled;
|
|
1194
1123
|
this.channels = preference.channels;
|
|
@@ -1225,9 +1154,15 @@ var updatePreference = (_0) => __async(void 0, [_0], function* ({
|
|
|
1225
1154
|
try {
|
|
1226
1155
|
emitter.emit("preference.update.pending", {
|
|
1227
1156
|
args,
|
|
1228
|
-
data: args.preference ? new Preference(
|
|
1229
|
-
|
|
1230
|
-
|
|
1157
|
+
data: args.preference ? new Preference(
|
|
1158
|
+
__spreadProps(__spreadValues({}, args.preference), {
|
|
1159
|
+
channels: __spreadValues(__spreadValues({}, args.preference.channels), channelPreferences)
|
|
1160
|
+
}),
|
|
1161
|
+
{
|
|
1162
|
+
emitterInstance: emitter,
|
|
1163
|
+
inboxServiceInstance: apiService
|
|
1164
|
+
}
|
|
1165
|
+
) : void 0
|
|
1231
1166
|
});
|
|
1232
1167
|
let response;
|
|
1233
1168
|
if (workflowId) {
|
|
@@ -1235,7 +1170,10 @@ var updatePreference = (_0) => __async(void 0, [_0], function* ({
|
|
|
1235
1170
|
} else {
|
|
1236
1171
|
response = yield apiService.updateGlobalPreferences(channelPreferences);
|
|
1237
1172
|
}
|
|
1238
|
-
const preference = new Preference(response
|
|
1173
|
+
const preference = new Preference(response, {
|
|
1174
|
+
emitterInstance: emitter,
|
|
1175
|
+
inboxServiceInstance: apiService
|
|
1176
|
+
});
|
|
1239
1177
|
emitter.emit("preference.update.resolved", { args, data: preference });
|
|
1240
1178
|
return { data: preference };
|
|
1241
1179
|
} catch (error) {
|
|
@@ -1249,7 +1187,7 @@ var updateEvents2 = ["preference.update.pending", "preference.update.resolved"];
|
|
|
1249
1187
|
var DEFAULT_KEY = "default";
|
|
1250
1188
|
var _emitter5, _cache3;
|
|
1251
1189
|
var PreferencesCache = class {
|
|
1252
|
-
constructor() {
|
|
1190
|
+
constructor({ emitterInstance }) {
|
|
1253
1191
|
__privateAdd(this, _emitter5);
|
|
1254
1192
|
__privateAdd(this, _cache3);
|
|
1255
1193
|
this.updatePreference = (key, data) => {
|
|
@@ -1286,7 +1224,7 @@ var PreferencesCache = class {
|
|
|
1286
1224
|
});
|
|
1287
1225
|
});
|
|
1288
1226
|
};
|
|
1289
|
-
__privateSet(this, _emitter5,
|
|
1227
|
+
__privateSet(this, _emitter5, emitterInstance);
|
|
1290
1228
|
updateEvents2.forEach((event) => {
|
|
1291
1229
|
__privateGet(this, _emitter5).on(event, this.handlePreferenceEvent);
|
|
1292
1230
|
});
|
|
@@ -1308,10 +1246,19 @@ _cache3 = new WeakMap();
|
|
|
1308
1246
|
// src/preferences/preferences.ts
|
|
1309
1247
|
var _useCache2;
|
|
1310
1248
|
var Preferences = class extends BaseModule {
|
|
1311
|
-
constructor({
|
|
1312
|
-
|
|
1249
|
+
constructor({
|
|
1250
|
+
useCache,
|
|
1251
|
+
inboxServiceInstance,
|
|
1252
|
+
eventEmitterInstance
|
|
1253
|
+
}) {
|
|
1254
|
+
super({
|
|
1255
|
+
eventEmitterInstance,
|
|
1256
|
+
inboxServiceInstance
|
|
1257
|
+
});
|
|
1313
1258
|
__privateAdd(this, _useCache2);
|
|
1314
|
-
this.cache = new PreferencesCache(
|
|
1259
|
+
this.cache = new PreferencesCache({
|
|
1260
|
+
emitterInstance: this._emitter
|
|
1261
|
+
});
|
|
1315
1262
|
__privateSet(this, _useCache2, useCache);
|
|
1316
1263
|
}
|
|
1317
1264
|
list() {
|
|
@@ -1322,7 +1269,12 @@ var Preferences = class extends BaseModule {
|
|
|
1322
1269
|
this._emitter.emit("preferences.list.pending", { args: void 0, data });
|
|
1323
1270
|
if (!data) {
|
|
1324
1271
|
const response = yield this._inboxService.fetchPreferences();
|
|
1325
|
-
data = response.map(
|
|
1272
|
+
data = response.map(
|
|
1273
|
+
(el) => new Preference(el, {
|
|
1274
|
+
emitterInstance: this._emitter,
|
|
1275
|
+
inboxServiceInstance: this._inboxService
|
|
1276
|
+
})
|
|
1277
|
+
);
|
|
1326
1278
|
if (__privateGet(this, _useCache2)) {
|
|
1327
1279
|
this.cache.set(data);
|
|
1328
1280
|
}
|
|
@@ -1417,8 +1369,15 @@ var mapToNotification = ({
|
|
|
1417
1369
|
};
|
|
1418
1370
|
var _token, _emitter6, _socketIo, _socketUrl, _notificationReceived, _unseenCountChanged, _unreadCountChanged, _Socket_instances, initializeSocket_fn;
|
|
1419
1371
|
var Socket = class extends BaseModule {
|
|
1420
|
-
constructor({
|
|
1421
|
-
|
|
1372
|
+
constructor({
|
|
1373
|
+
socketUrl,
|
|
1374
|
+
inboxServiceInstance,
|
|
1375
|
+
eventEmitterInstance
|
|
1376
|
+
}) {
|
|
1377
|
+
super({
|
|
1378
|
+
eventEmitterInstance,
|
|
1379
|
+
inboxServiceInstance
|
|
1380
|
+
});
|
|
1422
1381
|
__privateAdd(this, _Socket_instances);
|
|
1423
1382
|
__privateAdd(this, _token);
|
|
1424
1383
|
__privateAdd(this, _emitter6);
|
|
@@ -1426,7 +1385,7 @@ var Socket = class extends BaseModule {
|
|
|
1426
1385
|
__privateAdd(this, _socketUrl);
|
|
1427
1386
|
__privateAdd(this, _notificationReceived, ({ message }) => {
|
|
1428
1387
|
__privateGet(this, _emitter6).emit(NOTIFICATION_RECEIVED, {
|
|
1429
|
-
result: new Notification(mapToNotification(message))
|
|
1388
|
+
result: new Notification(mapToNotification(message), __privateGet(this, _emitter6), this._inboxService)
|
|
1430
1389
|
});
|
|
1431
1390
|
});
|
|
1432
1391
|
__privateAdd(this, _unseenCountChanged, ({ unseenCount }) => {
|
|
@@ -1439,7 +1398,7 @@ var Socket = class extends BaseModule {
|
|
|
1439
1398
|
result: unreadCount
|
|
1440
1399
|
});
|
|
1441
1400
|
});
|
|
1442
|
-
__privateSet(this, _emitter6,
|
|
1401
|
+
__privateSet(this, _emitter6, eventEmitterInstance);
|
|
1443
1402
|
__privateSet(this, _socketUrl, socketUrl != null ? socketUrl : PRODUCTION_SOCKET_URL);
|
|
1444
1403
|
}
|
|
1445
1404
|
onSessionSuccess({ token }) {
|
|
@@ -1500,40 +1459,167 @@ initializeSocket_fn = function() {
|
|
|
1500
1459
|
|
|
1501
1460
|
// src/utils/config.ts
|
|
1502
1461
|
var PRODUCTION_BACKEND_URL = "https://api.novu.co";
|
|
1462
|
+
var NOVU_API_VERSION = "2024-06-26";
|
|
1463
|
+
var INBOX_ROUTE = "/inbox";
|
|
1464
|
+
var INBOX_NOTIFICATIONS_ROUTE = `${INBOX_ROUTE}/notifications`;
|
|
1465
|
+
var _httpClient;
|
|
1466
|
+
var InboxService = class {
|
|
1467
|
+
constructor(options = {}) {
|
|
1468
|
+
this.isSessionInitialized = false;
|
|
1469
|
+
__privateAdd(this, _httpClient);
|
|
1470
|
+
__privateSet(this, _httpClient, new client.HttpClient(options));
|
|
1471
|
+
__privateGet(this, _httpClient).updateHeaders({
|
|
1472
|
+
"Novu-API-Version": NOVU_API_VERSION
|
|
1473
|
+
});
|
|
1474
|
+
}
|
|
1475
|
+
initializeSession(_0) {
|
|
1476
|
+
return __async(this, arguments, function* ({
|
|
1477
|
+
applicationIdentifier,
|
|
1478
|
+
subscriberId,
|
|
1479
|
+
subscriberHash
|
|
1480
|
+
}) {
|
|
1481
|
+
const response = yield __privateGet(this, _httpClient).post(`${INBOX_ROUTE}/session`, {
|
|
1482
|
+
applicationIdentifier,
|
|
1483
|
+
subscriberId,
|
|
1484
|
+
subscriberHash
|
|
1485
|
+
});
|
|
1486
|
+
__privateGet(this, _httpClient).setAuthorizationToken(response.token);
|
|
1487
|
+
this.isSessionInitialized = true;
|
|
1488
|
+
return response;
|
|
1489
|
+
});
|
|
1490
|
+
}
|
|
1491
|
+
fetchNotifications({
|
|
1492
|
+
after,
|
|
1493
|
+
archived,
|
|
1494
|
+
limit = 10,
|
|
1495
|
+
offset,
|
|
1496
|
+
read: read2,
|
|
1497
|
+
tags
|
|
1498
|
+
}) {
|
|
1499
|
+
const queryParams = new URLSearchParams(`limit=${limit}`);
|
|
1500
|
+
if (after) {
|
|
1501
|
+
queryParams.append("after", after);
|
|
1502
|
+
}
|
|
1503
|
+
if (offset) {
|
|
1504
|
+
queryParams.append("offset", `${offset}`);
|
|
1505
|
+
}
|
|
1506
|
+
if (tags) {
|
|
1507
|
+
tags.forEach((tag) => queryParams.append("tags[]", tag));
|
|
1508
|
+
}
|
|
1509
|
+
if (read2 !== void 0) {
|
|
1510
|
+
queryParams.append("read", `${read2}`);
|
|
1511
|
+
}
|
|
1512
|
+
if (archived !== void 0) {
|
|
1513
|
+
queryParams.append("archived", `${archived}`);
|
|
1514
|
+
}
|
|
1515
|
+
return __privateGet(this, _httpClient).getFullResponse(`${INBOX_NOTIFICATIONS_ROUTE}?${queryParams.toString()}`);
|
|
1516
|
+
}
|
|
1517
|
+
count({ filters }) {
|
|
1518
|
+
return __privateGet(this, _httpClient).getFullResponse(`${INBOX_NOTIFICATIONS_ROUTE}/count?filters=${JSON.stringify(filters)}`);
|
|
1519
|
+
}
|
|
1520
|
+
read(notificationId) {
|
|
1521
|
+
return __privateGet(this, _httpClient).patch(`${INBOX_NOTIFICATIONS_ROUTE}/${notificationId}/read`);
|
|
1522
|
+
}
|
|
1523
|
+
unread(notificationId) {
|
|
1524
|
+
return __privateGet(this, _httpClient).patch(`${INBOX_NOTIFICATIONS_ROUTE}/${notificationId}/unread`);
|
|
1525
|
+
}
|
|
1526
|
+
archive(notificationId) {
|
|
1527
|
+
return __privateGet(this, _httpClient).patch(`${INBOX_NOTIFICATIONS_ROUTE}/${notificationId}/archive`);
|
|
1528
|
+
}
|
|
1529
|
+
unarchive(notificationId) {
|
|
1530
|
+
return __privateGet(this, _httpClient).patch(`${INBOX_NOTIFICATIONS_ROUTE}/${notificationId}/unarchive`);
|
|
1531
|
+
}
|
|
1532
|
+
readAll({ tags }) {
|
|
1533
|
+
return __privateGet(this, _httpClient).post(`${INBOX_NOTIFICATIONS_ROUTE}/read`, { tags });
|
|
1534
|
+
}
|
|
1535
|
+
archiveAll({ tags }) {
|
|
1536
|
+
return __privateGet(this, _httpClient).post(`${INBOX_NOTIFICATIONS_ROUTE}/archive`, { tags });
|
|
1537
|
+
}
|
|
1538
|
+
archiveAllRead({ tags }) {
|
|
1539
|
+
return __privateGet(this, _httpClient).post(`${INBOX_NOTIFICATIONS_ROUTE}/read-archive`, { tags });
|
|
1540
|
+
}
|
|
1541
|
+
completeAction({
|
|
1542
|
+
actionType,
|
|
1543
|
+
notificationId
|
|
1544
|
+
}) {
|
|
1545
|
+
return __privateGet(this, _httpClient).patch(`${INBOX_NOTIFICATIONS_ROUTE}/${notificationId}/complete`, {
|
|
1546
|
+
actionType
|
|
1547
|
+
});
|
|
1548
|
+
}
|
|
1549
|
+
revertAction({
|
|
1550
|
+
actionType,
|
|
1551
|
+
notificationId
|
|
1552
|
+
}) {
|
|
1553
|
+
return __privateGet(this, _httpClient).patch(`${INBOX_NOTIFICATIONS_ROUTE}/${notificationId}/revert`, {
|
|
1554
|
+
actionType
|
|
1555
|
+
});
|
|
1556
|
+
}
|
|
1557
|
+
fetchPreferences() {
|
|
1558
|
+
return __privateGet(this, _httpClient).get(`${INBOX_ROUTE}/preferences`);
|
|
1559
|
+
}
|
|
1560
|
+
updateGlobalPreferences(channelPreferences) {
|
|
1561
|
+
return __privateGet(this, _httpClient).patch(`${INBOX_ROUTE}/preferences`, channelPreferences);
|
|
1562
|
+
}
|
|
1563
|
+
updateWorkflowPreferences({
|
|
1564
|
+
workflowId,
|
|
1565
|
+
channelPreferences
|
|
1566
|
+
}) {
|
|
1567
|
+
return __privateGet(this, _httpClient).patch(`${INBOX_ROUTE}/preferences/${workflowId}`, channelPreferences);
|
|
1568
|
+
}
|
|
1569
|
+
};
|
|
1570
|
+
_httpClient = new WeakMap();
|
|
1503
1571
|
|
|
1504
1572
|
// src/novu.ts
|
|
1505
|
-
var _emitter7, _session, _socket;
|
|
1573
|
+
var _emitter7, _session, _socket, _inboxService3;
|
|
1506
1574
|
var Novu = class {
|
|
1507
1575
|
constructor(options) {
|
|
1508
1576
|
__privateAdd(this, _emitter7);
|
|
1509
1577
|
__privateAdd(this, _session);
|
|
1510
1578
|
__privateAdd(this, _socket);
|
|
1579
|
+
__privateAdd(this, _inboxService3);
|
|
1511
1580
|
var _a, _b, _c;
|
|
1512
|
-
|
|
1513
|
-
__privateSet(this, _emitter7, NovuEventEmitter
|
|
1514
|
-
__privateSet(this, _session, new Session(
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1581
|
+
__privateSet(this, _inboxService3, new InboxService({ backendUrl: (_a = options.backendUrl) != null ? _a : PRODUCTION_BACKEND_URL }));
|
|
1582
|
+
__privateSet(this, _emitter7, new NovuEventEmitter());
|
|
1583
|
+
__privateSet(this, _session, new Session(
|
|
1584
|
+
{
|
|
1585
|
+
applicationIdentifier: options.applicationIdentifier,
|
|
1586
|
+
subscriberId: options.subscriberId,
|
|
1587
|
+
subscriberHash: options.subscriberHash
|
|
1588
|
+
},
|
|
1589
|
+
__privateGet(this, _inboxService3),
|
|
1590
|
+
__privateGet(this, _emitter7)
|
|
1591
|
+
));
|
|
1519
1592
|
__privateGet(this, _session).initialize();
|
|
1520
|
-
this.notifications = new Notifications({
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1593
|
+
this.notifications = new Notifications({
|
|
1594
|
+
useCache: (_b = options.useCache) != null ? _b : true,
|
|
1595
|
+
inboxServiceInstance: __privateGet(this, _inboxService3),
|
|
1596
|
+
eventEmitterInstance: __privateGet(this, _emitter7)
|
|
1597
|
+
});
|
|
1598
|
+
this.preferences = new Preferences({
|
|
1599
|
+
useCache: (_c = options.useCache) != null ? _c : true,
|
|
1600
|
+
inboxServiceInstance: __privateGet(this, _inboxService3),
|
|
1601
|
+
eventEmitterInstance: __privateGet(this, _emitter7)
|
|
1602
|
+
});
|
|
1603
|
+
__privateSet(this, _socket, new Socket({
|
|
1604
|
+
socketUrl: options.socketUrl,
|
|
1605
|
+
eventEmitterInstance: __privateGet(this, _emitter7),
|
|
1606
|
+
inboxServiceInstance: __privateGet(this, _inboxService3)
|
|
1607
|
+
}));
|
|
1608
|
+
this.on = (eventName, listener) => {
|
|
1609
|
+
if (__privateGet(this, _socket).isSocketEvent(eventName)) {
|
|
1610
|
+
__privateGet(this, _socket).initialize();
|
|
1611
|
+
}
|
|
1612
|
+
__privateGet(this, _emitter7).on(eventName, listener);
|
|
1613
|
+
};
|
|
1614
|
+
this.off = (eventName, listener) => {
|
|
1615
|
+
__privateGet(this, _emitter7).off(eventName, listener);
|
|
1616
|
+
};
|
|
1532
1617
|
}
|
|
1533
1618
|
};
|
|
1534
1619
|
_emitter7 = new WeakMap();
|
|
1535
1620
|
_session = new WeakMap();
|
|
1536
1621
|
_socket = new WeakMap();
|
|
1622
|
+
_inboxService3 = new WeakMap();
|
|
1537
1623
|
|
|
1538
1624
|
exports.ActionTypeEnum = ActionTypeEnum;
|
|
1539
1625
|
exports.ChannelType = ChannelType;
|
|
@@ -1554,4 +1640,5 @@ exports.__privateMethod = __privateMethod;
|
|
|
1554
1640
|
exports.__privateSet = __privateSet;
|
|
1555
1641
|
exports.__spreadProps = __spreadProps;
|
|
1556
1642
|
exports.__spreadValues = __spreadValues;
|
|
1643
|
+
exports.areTagsEqual = areTagsEqual;
|
|
1557
1644
|
exports.isSameFilter = isSameFilter;
|