@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
package/dist/novu.min.js.gz
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,34 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@novu/js",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"repository": "https://github.com/novuhq/novu",
|
|
5
5
|
"description": "Novu's JavaScript SDK for building custom inbox notification experiences",
|
|
6
6
|
"author": "",
|
|
7
7
|
"license": "ISC",
|
|
8
|
-
"main": "dist/cjs/index.
|
|
8
|
+
"main": "dist/cjs/index.js",
|
|
9
9
|
"module": "dist/esm/index.mjs",
|
|
10
|
-
"types": "dist/
|
|
10
|
+
"types": "dist/cjs/index.d.ts",
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
"import": {
|
|
14
|
+
"types": "./dist/esm/index.d.mts",
|
|
15
|
+
"default": "./dist/esm/index.mjs"
|
|
16
|
+
},
|
|
17
|
+
"require": {
|
|
18
|
+
"types": "./dist/cjs/index.js",
|
|
19
|
+
"default": "./dist/cjs/index.d.ts"
|
|
20
|
+
}
|
|
17
21
|
},
|
|
18
22
|
"./ui": {
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
"import": {
|
|
24
|
+
"types": "./dist/esm/ui/index.d.mts",
|
|
25
|
+
"default": "./dist/esm/ui/index.mjs"
|
|
26
|
+
},
|
|
27
|
+
"require": {
|
|
28
|
+
"types": "./dist/cjs/ui/index.js",
|
|
29
|
+
"default": "./dist/cjs/ui/index.d.ts"
|
|
30
|
+
}
|
|
23
31
|
}
|
|
24
32
|
},
|
|
25
33
|
"files": [
|
|
26
34
|
"dist/cjs",
|
|
27
35
|
"dist/esm",
|
|
28
|
-
"dist/types",
|
|
29
36
|
"dist/index.css",
|
|
30
37
|
"dist/novu.min.js",
|
|
31
|
-
"dist/novu.min.js.gz"
|
|
38
|
+
"dist/novu.min.js.gz",
|
|
39
|
+
"ui/**/*"
|
|
32
40
|
],
|
|
33
41
|
"sideEffects": false,
|
|
34
42
|
"private": false,
|
|
@@ -39,11 +47,11 @@
|
|
|
39
47
|
"clean": "rimraf ./dist",
|
|
40
48
|
"start:server": "http-server ./dist -p 4010",
|
|
41
49
|
"build": "pnpm run clean && NODE_ENV=production tsup && pnpm run post:build",
|
|
42
|
-
"build:declarations": "tsc -p tsconfig.declarations.json",
|
|
43
50
|
"build:umd": "webpack --config webpack.config.cjs",
|
|
44
51
|
"build:watch": "concurrently \"pnpm run tsup:watch\" \"pnpm run start:server\"",
|
|
45
52
|
"tsup:watch": "tsup --watch && pnpm run post:build",
|
|
46
|
-
"post:build": "node scripts/size-limit.mjs",
|
|
53
|
+
"post:build": "node scripts/size-limit.mjs && pnpm run check-exports",
|
|
54
|
+
"check-exports": "attw --pack .",
|
|
47
55
|
"lint": "eslint src",
|
|
48
56
|
"lint:fix": "pnpm lint -- --fix",
|
|
49
57
|
"test": "jest"
|
|
@@ -61,7 +69,7 @@
|
|
|
61
69
|
]
|
|
62
70
|
},
|
|
63
71
|
"devDependencies": {
|
|
64
|
-
"@
|
|
72
|
+
"@arethetypeswrong/cli": "^0.15.4",
|
|
65
73
|
"@types/jest": "^29.2.3",
|
|
66
74
|
"@types/node": "^20.14.10",
|
|
67
75
|
"autoprefixer": "^10.4.0",
|
package/ui/package.json
ADDED
package/dist/cjs/index.cjs
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunkPMLVIUWC_cjs = require('./chunk-PMLVIUWC.cjs');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "ActionTypeEnum", {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: function () { return chunkPMLVIUWC_cjs.ActionTypeEnum; }
|
|
10
|
-
});
|
|
11
|
-
Object.defineProperty(exports, "ChannelType", {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
get: function () { return chunkPMLVIUWC_cjs.ChannelType; }
|
|
14
|
-
});
|
|
15
|
-
Object.defineProperty(exports, "CtaType", {
|
|
16
|
-
enumerable: true,
|
|
17
|
-
get: function () { return chunkPMLVIUWC_cjs.CtaType; }
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports, "NotificationActionStatus", {
|
|
20
|
-
enumerable: true,
|
|
21
|
-
get: function () { return chunkPMLVIUWC_cjs.NotificationActionStatus; }
|
|
22
|
-
});
|
|
23
|
-
Object.defineProperty(exports, "NotificationButton", {
|
|
24
|
-
enumerable: true,
|
|
25
|
-
get: function () { return chunkPMLVIUWC_cjs.NotificationButton; }
|
|
26
|
-
});
|
|
27
|
-
Object.defineProperty(exports, "NotificationStatus", {
|
|
28
|
-
enumerable: true,
|
|
29
|
-
get: function () { return chunkPMLVIUWC_cjs.NotificationStatus; }
|
|
30
|
-
});
|
|
31
|
-
Object.defineProperty(exports, "Novu", {
|
|
32
|
-
enumerable: true,
|
|
33
|
-
get: function () { return chunkPMLVIUWC_cjs.Novu; }
|
|
34
|
-
});
|
|
35
|
-
Object.defineProperty(exports, "PreferenceLevel", {
|
|
36
|
-
enumerable: true,
|
|
37
|
-
get: function () { return chunkPMLVIUWC_cjs.PreferenceLevel; }
|
|
38
|
-
});
|
|
39
|
-
Object.defineProperty(exports, "PreferenceOverrideSource", {
|
|
40
|
-
enumerable: true,
|
|
41
|
-
get: function () { return chunkPMLVIUWC_cjs.PreferenceOverrideSource; }
|
|
42
|
-
});
|
|
43
|
-
Object.defineProperty(exports, "PreferenceOverrideSourceEnum", {
|
|
44
|
-
enumerable: true,
|
|
45
|
-
get: function () { return chunkPMLVIUWC_cjs.PreferenceOverrideSourceEnum; }
|
|
46
|
-
});
|
|
47
|
-
Object.defineProperty(exports, "WebSocketEvent", {
|
|
48
|
-
enumerable: true,
|
|
49
|
-
get: function () { return chunkPMLVIUWC_cjs.WebSocketEvent; }
|
|
50
|
-
});
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { ApiOptions } from '@novu/client';
|
|
2
|
-
import type { ActionTypeEnum, ChannelPreference, InboxNotification, NotificationFilter, PreferencesResponse, Session } from '../types';
|
|
3
|
-
export type InboxServiceOptions = ApiOptions;
|
|
4
|
-
export declare class InboxService {
|
|
5
|
-
#private;
|
|
6
|
-
isSessionInitialized: boolean;
|
|
7
|
-
constructor(options?: InboxServiceOptions);
|
|
8
|
-
initializeSession({ applicationIdentifier, subscriberId, subscriberHash, }: {
|
|
9
|
-
applicationIdentifier: string;
|
|
10
|
-
subscriberId: string;
|
|
11
|
-
subscriberHash?: string;
|
|
12
|
-
}): Promise<Session>;
|
|
13
|
-
fetchNotifications({ after, archived, limit, offset, read, tags, }: {
|
|
14
|
-
tags?: string[];
|
|
15
|
-
read?: boolean;
|
|
16
|
-
archived?: boolean;
|
|
17
|
-
limit?: number;
|
|
18
|
-
after?: string;
|
|
19
|
-
offset?: number;
|
|
20
|
-
}): Promise<{
|
|
21
|
-
data: InboxNotification[];
|
|
22
|
-
hasMore: boolean;
|
|
23
|
-
filter: NotificationFilter;
|
|
24
|
-
}>;
|
|
25
|
-
count({ filters }: {
|
|
26
|
-
filters: Array<{
|
|
27
|
-
tags?: string[];
|
|
28
|
-
read?: boolean;
|
|
29
|
-
archived?: boolean;
|
|
30
|
-
}>;
|
|
31
|
-
}): Promise<{
|
|
32
|
-
data: Array<{
|
|
33
|
-
count: number;
|
|
34
|
-
filter: NotificationFilter;
|
|
35
|
-
}>;
|
|
36
|
-
}>;
|
|
37
|
-
read(notificationId: string): Promise<InboxNotification>;
|
|
38
|
-
unread(notificationId: string): Promise<InboxNotification>;
|
|
39
|
-
archive(notificationId: string): Promise<InboxNotification>;
|
|
40
|
-
unarchive(notificationId: string): Promise<InboxNotification>;
|
|
41
|
-
readAll({ tags }: {
|
|
42
|
-
tags?: string[];
|
|
43
|
-
}): Promise<void>;
|
|
44
|
-
archiveAll({ tags }: {
|
|
45
|
-
tags?: string[];
|
|
46
|
-
}): Promise<void>;
|
|
47
|
-
archiveAllRead({ tags }: {
|
|
48
|
-
tags?: string[];
|
|
49
|
-
}): Promise<void>;
|
|
50
|
-
completeAction({ actionType, notificationId, }: {
|
|
51
|
-
notificationId: string;
|
|
52
|
-
actionType: ActionTypeEnum;
|
|
53
|
-
}): Promise<InboxNotification>;
|
|
54
|
-
revertAction({ actionType, notificationId, }: {
|
|
55
|
-
notificationId: string;
|
|
56
|
-
actionType: ActionTypeEnum;
|
|
57
|
-
}): Promise<InboxNotification>;
|
|
58
|
-
fetchPreferences(): Promise<PreferencesResponse[]>;
|
|
59
|
-
updateGlobalPreferences(channelPreferences: ChannelPreference): Promise<PreferencesResponse>;
|
|
60
|
-
updateWorkflowPreferences({ workflowId, channelPreferences, }: {
|
|
61
|
-
workflowId: string;
|
|
62
|
-
channelPreferences: ChannelPreference;
|
|
63
|
-
}): Promise<PreferencesResponse>;
|
|
64
|
-
}
|
|
65
|
-
//# sourceMappingURL=inbox-service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inbox-service.d.ts","sourceRoot":"","sources":["../../../src/api/inbox-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAc,MAAM,cAAc,CAAC;AACtD,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,OAAO,EACR,MAAM,UAAU,CAAC;AAElB,MAAM,MAAM,mBAAmB,GAAG,UAAU,CAAC;AAM7C,qBAAa,YAAY;;IACvB,oBAAoB,UAAS;gBAGjB,OAAO,GAAE,mBAAwB;IAOvC,iBAAiB,CAAC,EACtB,qBAAqB,EACrB,YAAY,EACZ,cAAc,GACf,EAAE;QACD,qBAAqB,EAAE,MAAM,CAAC;QAC9B,YAAY,EAAE,MAAM,CAAC;QACrB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,GAAG,OAAO,CAAC,OAAO,CAAC;IAYpB,kBAAkB,CAAC,EACjB,KAAK,EACL,QAAQ,EACR,KAAU,EACV,MAAM,EACN,IAAI,EACJ,IAAI,GACL,EAAE;QACD,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;QAChB,IAAI,CAAC,EAAE,OAAO,CAAC;QACf,QAAQ,CAAC,EAAE,O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CAAC,IAAI,CAAC;IAI5D,cAAc,CAAC,EACb,UAAU,EACV,cAAc,GACf,EAAE;QACD,cAAc,EAAE,MAAM,CAAC;QACvB,UAAU,EAAE,cAAc,CAAC;KAC5B,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAM9B,YAAY,CAAC,EACX,UAAU,EACV,cAAc,GACf,EAAE;QACD,cAAc,EAAE,MAAM,CAAC;QACvB,UAAU,EAAE,cAAc,CAAC;KAC5B,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAM9B,gBAAgB,IAAI,OAAO,CAAC,mBAAmB,EAAE,CAAC;IAIlD,uBAAuB,CAAC,kBAAkB,EAAE,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAI5F,yBAAyB,CAAC,EACxB,UAAU,EACV,kBAAkB,GACnB,EAAE;QACD,UAAU,EAAE,MAAM,CAAC;QACnB,kBAAkB,EAAE,iBAAiB,CAAC;KACvC,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAGjC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { InboxService } from './api';
|
|
2
|
-
import { NovuEventEmitter } from './event-emitter';
|
|
3
|
-
import { Result, Session } from './types';
|
|
4
|
-
export declare class BaseModule {
|
|
5
|
-
#private;
|
|
6
|
-
_inboxService: InboxService;
|
|
7
|
-
_emitter: NovuEventEmitter;
|
|
8
|
-
constructor();
|
|
9
|
-
protected onSessionSuccess(_: Session): void;
|
|
10
|
-
protected onSessionError(_: unknown): void;
|
|
11
|
-
callWithSession<T>(fn: () => Result<T>): Result<T>;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=base-module.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base-module.d.ts","sourceRoot":"","sources":["../../src/base-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAErC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAW1C,qBAAa,UAAU;;IACrB,aAAa,EAAE,YAAY,CAAC;IAC5B,QAAQ,EAAE,gBAAgB,CAAC;;IAyB3B,SAAS,CAAC,gBAAgB,CAAC,CAAC,EAAE,OAAO,GAAG,IAAI;IAE5C,SAAS,CAAC,cAAc,CAAC,CAAC,EAAE,OAAO,GAAG,IAAI;IAEpC,eAAe,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;CAezD"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Cache } from './types';
|
|
2
|
-
export declare class InMemoryCache<T> implements Cache<T> {
|
|
3
|
-
#private;
|
|
4
|
-
constructor();
|
|
5
|
-
get(key: string): T | undefined;
|
|
6
|
-
getValues(): T[];
|
|
7
|
-
entries(): [string, T][];
|
|
8
|
-
keys(): string[];
|
|
9
|
-
set(key: string, value: T): void;
|
|
10
|
-
remove(key: string): void;
|
|
11
|
-
clear(): void;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=in-memory-cache.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"in-memory-cache.d.ts","sourceRoot":"","sources":["../../../src/cache/in-memory-cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC,qBAAa,aAAa,CAAC,CAAC,CAAE,YAAW,KAAK,CAAC,CAAC,CAAC;;;IAO/C,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;IAI/B,SAAS,IAAI,CAAC,EAAE;IAIhB,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE;IAIxB,IAAI,IAAI,MAAM,EAAE;IAIhB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI;IAIhC,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAIzB,KAAK,IAAI,IAAI;CAGd"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cache/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { ListNotificationsArgs, ListNotificationsResponse, Notification } from '../notifications';
|
|
2
|
-
import type { NotificationFilter } from '../types';
|
|
3
|
-
export declare class NotificationsCache {
|
|
4
|
-
#private;
|
|
5
|
-
constructor();
|
|
6
|
-
private updateNotification;
|
|
7
|
-
private removeNotification;
|
|
8
|
-
private handleNotificationEvent;
|
|
9
|
-
private getAggregated;
|
|
10
|
-
has(args: ListNotificationsArgs): boolean;
|
|
11
|
-
set(args: ListNotificationsArgs, data: ListNotificationsResponse): void;
|
|
12
|
-
update(args: ListNotificationsArgs, data: ListNotificationsResponse): void;
|
|
13
|
-
getAll(args: ListNotificationsArgs): ListNotificationsResponse | undefined;
|
|
14
|
-
/**
|
|
15
|
-
* Get unique notifications based on specified filter fields.
|
|
16
|
-
* The same tags can be applied to multiple filters which means that the same notification can be duplicated.
|
|
17
|
-
*/
|
|
18
|
-
getUniqueNotifications({ tags, read }: Pick<ListNotificationsArgs, 'tags' | 'read'>): Array<Notification>;
|
|
19
|
-
clear(filter: NotificationFilter): void;
|
|
20
|
-
clearAll(): void;
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=notifications-cache.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"notifications-cache.d.ts","sourceRoot":"","sources":["../../../src/cache/notifications-cache.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEvG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AA8CnD,qBAAa,kBAAkB;;;IAkB7B,OAAO,CAAC,kBAAkB,CAiBxB;IAEF,OAAO,CAAC,kBAAkB,CAoBxB;IAEF,OAAO,CAAC,uBAAuB,CA+B3B;IAEJ,OAAO,CAAC,aAAa;IAyBrB,GAAG,CAAC,IAAI,EAAE,qBAAqB,GAAG,OAAO;IAIzC,GAAG,CAAC,IAAI,EAAE,qBAAqB,EAAE,IAAI,EAAE,yBAAyB,GAAG,IAAI;IAIvE,MAAM,CAAC,IAAI,EAAE,qBAAqB,EAAE,IAAI,EAAE,yBAAyB,GAAG,IAAI;IAQ1E,MAAM,CAAC,IAAI,EAAE,qBAAqB,GAAG,yBAAyB,GAAG,SAAS;IAM1E;;;OAGG;IACH,sBAAsB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,IAAI,CAAC,qBAAqB,EAAE,MAAM,GAAG,MAAM,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC;IAqBzG,KAAK,CAAC,MAAM,EAAE,kBAAkB,GAAG,IAAI;IASvC,QAAQ,IAAI,IAAI;CAGjB"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Preference } from '../preferences/preference';
|
|
2
|
-
export declare class PreferencesCache {
|
|
3
|
-
#private;
|
|
4
|
-
constructor();
|
|
5
|
-
private updatePreference;
|
|
6
|
-
private handlePreferenceEvent;
|
|
7
|
-
set(data: Preference[]): void;
|
|
8
|
-
getAll(): Preference[] | undefined;
|
|
9
|
-
clearAll(): void;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=preferences-cache.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"preferences-cache.d.ts","sourceRoot":"","sources":["../../../src/cache/preferences-cache.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAOvD,qBAAa,gBAAgB;;;IAY3B,OAAO,CAAC,gBAAgB,CAoBtB;IAEF,OAAO,CAAC,qBAAqB,CAiB3B;IAEF,GAAG,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,IAAI;IAI7B,MAAM,IAAI,UAAU,EAAE,GAAG,SAAS;IAIlC,QAAQ,IAAI,IAAI;CAGjB"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export type Cache<T = unknown> = {
|
|
2
|
-
get: (key: string) => T | undefined;
|
|
3
|
-
getValues: () => T[];
|
|
4
|
-
entries: () => [string, T][];
|
|
5
|
-
keys: () => string[];
|
|
6
|
-
set: (key: string, value: T) => void;
|
|
7
|
-
remove: (key: string) => void;
|
|
8
|
-
clear: () => void;
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/cache/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,CAAC,CAAC,GAAG,OAAO,IAAI;IAC/B,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,CAAC,GAAG,SAAS,CAAC;IACpC,SAAS,EAAE,MAAM,CAAC,EAAE,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC;IAC7B,IAAI,EAAE,MAAM,MAAM,EAAE,CAAC;IACrB,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IACrC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9B,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/event-emitter/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,SAAS,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { EventHandler, Events, EventNames } from './types';
|
|
2
|
-
type SingletonOptions = {
|
|
3
|
-
recreate: true;
|
|
4
|
-
};
|
|
5
|
-
export declare class NovuEventEmitter {
|
|
6
|
-
#private;
|
|
7
|
-
static getInstance(options?: SingletonOptions): NovuEventEmitter;
|
|
8
|
-
private constructor();
|
|
9
|
-
on<Key extends EventNames>(eventName: Key, listener: EventHandler<Events[Key]>): void;
|
|
10
|
-
off<Key extends EventNames>(eventName: Key, listener: EventHandler<Events[Key]>): void;
|
|
11
|
-
emit<Key extends EventNames>(type: Key, event?: Events[Key]): void;
|
|
12
|
-
}
|
|
13
|
-
export {};
|
|
14
|
-
//# sourceMappingURL=novu-event-emitter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"novu-event-emitter.d.ts","sourceRoot":"","sources":["../../../src/event-emitter/novu-event-emitter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE3D,KAAK,gBAAgB,GAAG;IAAE,QAAQ,EAAE,IAAI,CAAA;CAAE,CAAC;AAE3C,qBAAa,gBAAgB;;IAI3B,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,gBAAgB;IAQhE,OAAO;IAIP,EAAE,CAAC,GAAG,SAAS,UAAU,EAAE,SAAS,EAAE,GAAG,EAAE,QAAQ,EAAE,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI;IAIrF,GAAG,CAAC,GAAG,SAAS,UAAU,EAAE,SAAS,EAAE,GAAG,EAAE,QAAQ,EAAE,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI;IAItF,IAAI,CAAC,GAAG,SAAS,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI;CAGnE"}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import type { CountArgs, ListNotificationsArgs, Notification, ListNotificationsResponse, CountResponse, ReadArgs, ArchivedArgs, CompleteArgs, RevertArgs, UnarchivedArgs, UnreadArgs } from '../notifications';
|
|
2
|
-
import { Preference } from '../preferences/preference';
|
|
3
|
-
import { UpdatePreferencesArgs } from '../preferences/types';
|
|
4
|
-
import type { InitializeSessionArgs } from '../session';
|
|
5
|
-
import { Session, WebSocketEvent } from '../types';
|
|
6
|
-
type NovuPendingEvent<A, D = undefined> = {
|
|
7
|
-
args: A;
|
|
8
|
-
data?: D;
|
|
9
|
-
};
|
|
10
|
-
type NovuResolvedEvent<A, D> = NovuPendingEvent<A, D> & {
|
|
11
|
-
error?: unknown;
|
|
12
|
-
};
|
|
13
|
-
type EventName<T extends string> = `${T}.pending` | `${T}.resolved`;
|
|
14
|
-
type EventStatus<T extends string> = `${T extends `${infer _}.${infer __}.${infer V}` ? V : never}`;
|
|
15
|
-
type EventObject<K extends string, ARGS, DATA, EVENT_STATUS = EventStatus<K>> = EVENT_STATUS extends 'pending' ? NovuPendingEvent<ARGS, DATA> : NovuResolvedEvent<ARGS, DATA>;
|
|
16
|
-
type BaseEvents<T extends string, ARGS, DATA> = {
|
|
17
|
-
[key in `${EventName<T>}`]: EventObject<key, ARGS, DATA>;
|
|
18
|
-
};
|
|
19
|
-
type SessionInitializeEvents = BaseEvents<'session.initialize', InitializeSessionArgs, Session>;
|
|
20
|
-
type NotificationsFetchEvents = BaseEvents<'notifications.list', ListNotificationsArgs, ListNotificationsResponse>;
|
|
21
|
-
type NotificationsFetchCountEvents = BaseEvents<'notifications.count', CountArgs, CountResponse>;
|
|
22
|
-
type NotificationReadEvents = BaseEvents<'notification.read', ReadArgs, Notification>;
|
|
23
|
-
type NotificationUnreadEvents = BaseEvents<'notification.unread', UnreadArgs, Notification>;
|
|
24
|
-
type NotificationArchiveEvents = BaseEvents<'notification.archive', ArchivedArgs, Notification>;
|
|
25
|
-
type NotificationUnarchiveEvents = BaseEvents<'notification.unarchive', UnarchivedArgs, Notification>;
|
|
26
|
-
type NotificationCompleteActionEvents = BaseEvents<'notification.complete_action', CompleteArgs, Notification>;
|
|
27
|
-
type NotificationRevertActionEvents = BaseEvents<'notification.revert_action', RevertArgs, Notification>;
|
|
28
|
-
type NotificationsReadAllEvents = BaseEvents<'notifications.read_all', {
|
|
29
|
-
tags?: string[];
|
|
30
|
-
}, Notification[]>;
|
|
31
|
-
type NotificationsArchivedAllEvents = BaseEvents<'notifications.archive_all', {
|
|
32
|
-
tags?: string[];
|
|
33
|
-
}, Notification[]>;
|
|
34
|
-
type NotificationsReadArchivedAllEvents = BaseEvents<'notifications.archive_all_read', {
|
|
35
|
-
tags?: string[];
|
|
36
|
-
}, Notification[]>;
|
|
37
|
-
type PreferencesFetchEvents = BaseEvents<'preferences.list', undefined, Preference[]>;
|
|
38
|
-
type PreferenceUpdateEvents = BaseEvents<'preference.update', UpdatePreferencesArgs, Preference>;
|
|
39
|
-
type SocketConnectEvents = BaseEvents<'socket.connect', {
|
|
40
|
-
socketUrl: string;
|
|
41
|
-
}, undefined>;
|
|
42
|
-
export type NotificationReceivedEvent = `notifications.${WebSocketEvent.RECEIVED}`;
|
|
43
|
-
export type NotificationUnseenEvent = `notifications.${WebSocketEvent.UNSEEN}`;
|
|
44
|
-
export type NotificationUnreadEvent = `notifications.${WebSocketEvent.UNREAD}`;
|
|
45
|
-
type SocketEvents = {
|
|
46
|
-
[key in NotificationReceivedEvent]: {
|
|
47
|
-
result: Notification;
|
|
48
|
-
};
|
|
49
|
-
} & {
|
|
50
|
-
[key in NotificationUnseenEvent]: {
|
|
51
|
-
result: number;
|
|
52
|
-
};
|
|
53
|
-
} & {
|
|
54
|
-
[key in NotificationUnreadEvent]: {
|
|
55
|
-
result: number;
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
/**
|
|
59
|
-
* Events that are emitted by Novu Event Emitter.
|
|
60
|
-
*
|
|
61
|
-
* The event name consists of second pattern: module.action.status
|
|
62
|
-
* - module: the name of the module
|
|
63
|
-
* - action: the action that is being performed
|
|
64
|
-
* - status: the status of the action, could be pending or resolved
|
|
65
|
-
*
|
|
66
|
-
* Each event has a corresponding payload that is associated with the event:
|
|
67
|
-
* - pending: the args that are passed to the action and the optional optimistic value
|
|
68
|
-
* - resolved: the args that are passed to the action and the result of the action or the error that is thrown
|
|
69
|
-
*/
|
|
70
|
-
export type Events = SessionInitializeEvents & NotificationsFetchEvents & {
|
|
71
|
-
'notifications.list.updated': {
|
|
72
|
-
data: ListNotificationsResponse;
|
|
73
|
-
};
|
|
74
|
-
} & NotificationsFetchCountEvents & PreferencesFetchEvents & {
|
|
75
|
-
'preferences.list.updated': {
|
|
76
|
-
data: Preference[];
|
|
77
|
-
};
|
|
78
|
-
} & PreferenceUpdateEvents & SocketConnectEvents & SocketEvents & NotificationReadEvents & NotificationUnreadEvents & NotificationArchiveEvents & NotificationUnarchiveEvents & NotificationCompleteActionEvents & NotificationRevertActionEvents & NotificationsReadAllEvents & NotificationsArchivedAllEvents & NotificationsReadArchivedAllEvents;
|
|
79
|
-
export type EventNames = keyof Events;
|
|
80
|
-
export type SocketEventNames = keyof SocketEvents;
|
|
81
|
-
export type NotificationEvents = keyof (NotificationReadEvents & NotificationUnreadEvents & NotificationArchiveEvents & NotificationUnarchiveEvents & NotificationCompleteActionEvents & NotificationRevertActionEvents & NotificationsReadAllEvents & NotificationsArchivedAllEvents & NotificationsReadArchivedAllEvents);
|
|
82
|
-
export type PreferenceEvents = keyof PreferenceUpdateEvents;
|
|
83
|
-
export type EventHandler<T = unknown> = (event: T) => void;
|
|
84
|
-
export {};
|
|
85
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","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GAC3B,gCAAgC,GAChC,8BAA8B,GAC9B,0BAA0B,GAC1B,8BAA8B,GAC9B,kCAAkC,CAAC;AAErC,MAAM,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC;AACtC,MAAM,MAAM,gBAAgB,GAAG,MAAM,YAAY,CAAC;AAClD,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,sBAAsB,GAC5D,wBAAwB,GACxB,yBAAyB,GACzB,2BAA2B,GAC3B,gCAAgC,GAChC,8BAA8B,GAC9B,0BAA0B,GAC1B,8BAA8B,GAC9B,kCAAkC,CAAC,CAAC;AACtC,MAAM,MAAM,gBAAgB,GAAG,MAAM,sBAAsB,CAAC;AAE5D,MAAM,MAAM,YAAY,CAAC,CAAC,GAAG,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC"}
|
package/dist/types/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,cAAc,SAAS,CAAC"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { ActionTypeEnum, NotificationFilter, Result } from '../types';
|
|
2
|
-
import type { InboxService } from '../api';
|
|
3
|
-
import type { NovuEventEmitter } from '../event-emitter';
|
|
4
|
-
import { Notification } from './notification';
|
|
5
|
-
import type { ArchivedArgs, CompleteArgs, ReadArgs, RevertArgs, UnarchivedArgs, UnreadArgs } from './types';
|
|
6
|
-
import type { NotificationsCache } from '../cache';
|
|
7
|
-
export declare const read: ({ emitter, apiService, args, }: {
|
|
8
|
-
emitter: NovuEventEmitter;
|
|
9
|
-
apiService: InboxService;
|
|
10
|
-
args: ReadArgs;
|
|
11
|
-
}) => Result<Notification>;
|
|
12
|
-
export declare const unread: ({ emitter, apiService, args, }: {
|
|
13
|
-
emitter: NovuEventEmitter;
|
|
14
|
-
apiService: InboxService;
|
|
15
|
-
args: UnreadArgs;
|
|
16
|
-
}) => Result<Notification>;
|
|
17
|
-
export declare const archive: ({ emitter, apiService, args, }: {
|
|
18
|
-
emitter: NovuEventEmitter;
|
|
19
|
-
apiService: InboxService;
|
|
20
|
-
args: ArchivedArgs;
|
|
21
|
-
}) => Result<Notification>;
|
|
22
|
-
export declare const unarchive: ({ emitter, apiService, args, }: {
|
|
23
|
-
emitter: NovuEventEmitter;
|
|
24
|
-
apiService: InboxService;
|
|
25
|
-
args: UnarchivedArgs;
|
|
26
|
-
}) => Result<Notification>;
|
|
27
|
-
export declare const completeAction: ({ emitter, apiService, args, actionType, }: {
|
|
28
|
-
emitter: NovuEventEmitter;
|
|
29
|
-
apiService: InboxService;
|
|
30
|
-
args: CompleteArgs;
|
|
31
|
-
actionType: ActionTypeEnum;
|
|
32
|
-
}) => Result<Notification>;
|
|
33
|
-
export declare const revertAction: ({ emitter, apiService, args, actionType, }: {
|
|
34
|
-
emitter: NovuEventEmitter;
|
|
35
|
-
apiService: InboxService;
|
|
36
|
-
args: RevertArgs;
|
|
37
|
-
actionType: ActionTypeEnum;
|
|
38
|
-
}) => Result<Notification>;
|
|
39
|
-
export declare const readAll: ({ emitter, inboxService, notificationsCache, tags, }: {
|
|
40
|
-
emitter: NovuEventEmitter;
|
|
41
|
-
inboxService: InboxService;
|
|
42
|
-
notificationsCache: NotificationsCache;
|
|
43
|
-
tags?: NotificationFilter['tags'];
|
|
44
|
-
}) => Result<void>;
|
|
45
|
-
export declare const archiveAll: ({ emitter, inboxService, notificationsCache, tags, }: {
|
|
46
|
-
emitter: NovuEventEmitter;
|
|
47
|
-
inboxService: InboxService;
|
|
48
|
-
notificationsCache: NotificationsCache;
|
|
49
|
-
tags?: NotificationFilter['tags'];
|
|
50
|
-
}) => Result<void>;
|
|
51
|
-
export declare const archiveAllRead: ({ emitter, inboxService, notificationsCache, tags, }: {
|
|
52
|
-
emitter: NovuEventEmitter;
|
|
53
|
-
inboxService: InboxService;
|
|
54
|
-
notificationsCache: NotificationsCache;
|
|
55
|
-
tags?: NotificationFilter['tags'];
|
|
56
|
-
}) => Result<void>;
|
|
57
|
-
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/notifications/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,cAAc,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAC9E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE5G,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAEnD,eAAO,MAAM,IAAI;aAKN,gBAAgB;gBACb,YAAY;UAClB,QAAQ;MACZ,OAAO,YAAY,CAyBtB,CAAC;AAEF,eAAO,MAAM,MAAM;aAKR,gBAAgB;gBACb,YAAY;UAClB,UAAU;MACd,OAAO,YAAY,CAwBtB,CAAC;AAEF,eAAO,MAAM,OAAO;aAKT,gBAAgB;gBACb,YAAY;UAClB,YAAY;MAChB,OAAO,YAAY,CAyBtB,CAAC;AAEF,eAAO,MAAM,SAAS;aAKX,gBAAgB;gBACb,YAAY;UAClB,cAAc;MAClB,OAAO,YAAY,CAyBtB,CAAC;AAEF,eAAO,MAAM,cAAc;aAMhB,gBAAgB;gBACb,YAAY;UAClB,YAAY;gBACN,cAAc;MACxB,OAAO,YAAY,CAkCtB,CAAC;AAEF,eAAO,MAAM,YAAY;aAMd,gBAAgB;gBACb,YAAY;UAClB,UAAU;gBACJ,cAAc;MACxB,OAAO,YAAY,CAmCtB,CAAC;AAkBF,eAAO,MAAM,OAAO;aAMT,gBAAgB;kBACX,YAAY;wBACN,kBAAkB;WAC/B,kBAAkB,CAAC,MAAM,CAAC;MAC/B,OAAO,IAAI,CAyBd,CAAC;AAEF,eAAO,MAAM,UAAU;aAMZ,gBAAgB;kBACX,YAAY;wBACN,kBAAkB;WAC/B,kBAAkB,CAAC,MAAM,CAAC;MAC/B,OAAO,IAAI,CAyBd,CAAC;AAEF,eAAO,MAAM,cAAc;aAMhB,gBAAgB;kBACX,YAAY;wBACN,kBAAkB;WAC/B,kBAAkB,CAAC,MAAM,CAAC;MAC/B,OAAO,IAAI,CAkBd,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/notifications/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { EventHandler, EventNames, Events, NovuEventEmitter } from '../event-emitter';
|
|
2
|
-
import { InboxNotification, Result } from '../types';
|
|
3
|
-
export declare class Notification implements Pick<NovuEventEmitter, 'on' | 'off'>, InboxNotification {
|
|
4
|
-
#private;
|
|
5
|
-
readonly id: InboxNotification['id'];
|
|
6
|
-
readonly subject?: InboxNotification['subject'];
|
|
7
|
-
readonly body: InboxNotification['body'];
|
|
8
|
-
readonly to: InboxNotification['to'];
|
|
9
|
-
readonly isRead: InboxNotification['isRead'];
|
|
10
|
-
readonly isArchived: InboxNotification['isArchived'];
|
|
11
|
-
readonly createdAt: InboxNotification['createdAt'];
|
|
12
|
-
readonly readAt?: InboxNotification['readAt'];
|
|
13
|
-
readonly archivedAt?: InboxNotification['archivedAt'];
|
|
14
|
-
readonly avatar?: InboxNotification['avatar'];
|
|
15
|
-
readonly primaryAction?: InboxNotification['primaryAction'];
|
|
16
|
-
readonly secondaryAction?: InboxNotification['secondaryAction'];
|
|
17
|
-
readonly channelType: InboxNotification['channelType'];
|
|
18
|
-
readonly tags: InboxNotification['tags'];
|
|
19
|
-
readonly redirect: InboxNotification['redirect'];
|
|
20
|
-
readonly data?: InboxNotification['data'];
|
|
21
|
-
constructor(notification: InboxNotification);
|
|
22
|
-
read(): Result<Notification>;
|
|
23
|
-
unread(): Result<Notification>;
|
|
24
|
-
archive(): Result<Notification>;
|
|
25
|
-
unarchive(): Result<Notification>;
|
|
26
|
-
completePrimary(): Result<Notification>;
|
|
27
|
-
completeSecondary(): Result<Notification>;
|
|
28
|
-
revertPrimary(): Result<Notification>;
|
|
29
|
-
revertSecondary(): Result<Notification>;
|
|
30
|
-
on<Key extends EventNames>(eventName: Key, listener: EventHandler<Events[Key]>): void;
|
|
31
|
-
off<Key extends EventNames>(eventName: Key, listener: EventHandler<Events[Key]>): void;
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=notification.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"notification.d.ts","sourceRoot":"","sources":["../../../src/notifications/notification.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACtF,OAAO,EAAkB,iBAAiB,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGrE,qBAAa,YAAa,YAAW,IAAI,CAAC,gBAAgB,EAAE,IAAI,GAAG,KAAK,CAAC,EAAE,iBAAiB;;IAI1F,QAAQ,CAAC,EAAE,EAAE,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACrC,QAAQ,CAAC,OAAO,CAAC,EAAE,iBAAiB,CAAC,SAAS,CAAC,CAAC;IAChD,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;IACzC,QAAQ,CAAC,EAAE,EAAE,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACrC,QAAQ,CAAC,MAAM,EAAE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EAAE,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI;IAIrF,GAAG,CAAC,GAAG,SAAS,UAAU,EAAE,SAAS,EAAE,GAAG,EAAE,QAAQ,EAAE,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI;CAGvF"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { BaseModule } from '../base-module';
|
|
2
|
-
import { NotificationFilter, Result } from '../types';
|
|
3
|
-
import { Notification } from './notification';
|
|
4
|
-
import type { FiltersCountResponse, ListNotificationsArgs, ListNotificationsResponse, InstanceArgs, FilterCountArgs, FilterCountResponse, FiltersCountArgs, BaseArgs } from './types';
|
|
5
|
-
import { NotificationsCache } from '../cache';
|
|
6
|
-
export declare class Notifications extends BaseModule {
|
|
7
|
-
#private;
|
|
8
|
-
readonly cache: NotificationsCache;
|
|
9
|
-
constructor({ useCache }: {
|
|
10
|
-
useCache: boolean;
|
|
11
|
-
});
|
|
12
|
-
list({ limit, ...restOptions }?: ListNotificationsArgs): Result<ListNotificationsResponse>;
|
|
13
|
-
count(args?: FilterCountArgs): Result<FilterCountResponse>;
|
|
14
|
-
count(args?: FiltersCountArgs): Result<FiltersCountResponse>;
|
|
15
|
-
read(args: BaseArgs): Result<Notification>;
|
|
16
|
-
read(args: InstanceArgs): Result<Notification>;
|
|
17
|
-
unread(args: BaseArgs): Result<Notification>;
|
|
18
|
-
unread(args: InstanceArgs): Result<Notification>;
|
|
19
|
-
archive(args: BaseArgs): Result<Notification>;
|
|
20
|
-
archive(args: InstanceArgs): Result<Notification>;
|
|
21
|
-
unarchive(args: BaseArgs): Result<Notification>;
|
|
22
|
-
unarchive(args: InstanceArgs): Result<Notification>;
|
|
23
|
-
completePrimary(args: BaseArgs): Result<Notification>;
|
|
24
|
-
completePrimary(args: InstanceArgs): Result<Notification>;
|
|
25
|
-
completeSecondary(args: BaseArgs): Result<Notification>;
|
|
26
|
-
completeSecondary(args: InstanceArgs): Result<Notification>;
|
|
27
|
-
revertPrimary(args: BaseArgs): Result<Notification>;
|
|
28
|
-
revertPrimary(args: InstanceArgs): Result<Notification>;
|
|
29
|
-
revertSecondary(args: BaseArgs): Result<Notification>;
|
|
30
|
-
revertSecondary(args: InstanceArgs): Result<Notification>;
|
|
31
|
-
readAll({ tags }?: {
|
|
32
|
-
tags?: NotificationFilter['tags'];
|
|
33
|
-
}): Result<void>;
|
|
34
|
-
archiveAll({ tags }?: {
|
|
35
|
-
tags?: NotificationFilter['tags'];
|
|
36
|
-
}): Result<void>;
|
|
37
|
-
archiveAllRead({ tags }?: {
|
|
38
|
-
tags?: NotificationFilter['tags'];
|
|
39
|
-
}): Result<void>;
|
|
40
|
-
clearCache({ filter }?: {
|
|
41
|
-
filter?: NotificationFilter;
|
|
42
|
-
}): void;
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=notifications.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../../src/notifications/notifications.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAkB,kBAAkB,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAYtE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EAGV,oBAAoB,EACpB,qBAAqB,EACrB,yBAAyB,EACzB,YAAY,EAKZ,eAAe,EAEf,mBAAmB,EACnB,gBAAgB,EAEhB,QAAQ,EACT,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAE9C,qBAAa,aAAc,SAAQ,UAAU;;IAG3C,QAAQ,CAAC,KAAK,EAAE,kBAAkB,CAAC;gBAEvB,EAAE,QAAQ,EAAE,EAAE;QAAE,QAAQ,EAAE,OAAO,CAAA;KAAE;IAMzC,IAAI,CAAC,EAAE,KAAU,EAAE,G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