@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.
Files changed (317) hide show
  1. package/dist/cjs/{chunk-PMLVIUWC.cjs → chunk-D7P7KCZI.js} +342 -255
  2. package/dist/cjs/index.d.ts +8 -0
  3. package/dist/cjs/index.js +58 -0
  4. package/dist/cjs/novu-04KlkBy4.d.ts +528 -0
  5. package/dist/cjs/ui/index.d.ts +145 -0
  6. package/dist/cjs/ui/{index.cjs → index.js} +218 -141
  7. package/dist/esm/{chunk-LDGUT6MH.mjs → chunk-APRCCICD.mjs} +342 -256
  8. package/dist/esm/index.d.mts +8 -0
  9. package/dist/esm/index.mjs +1 -1
  10. package/dist/esm/novu-04KlkBy4.d.mts +528 -0
  11. package/dist/esm/ui/index.d.mts +145 -0
  12. package/dist/esm/ui/index.mjs +131 -54
  13. package/dist/novu.min.js +10 -10
  14. package/dist/novu.min.js.gz +0 -0
  15. package/package.json +24 -16
  16. package/ui/package.json +5 -0
  17. package/dist/cjs/index.cjs +0 -50
  18. package/dist/types/api/inbox-service.d.ts +0 -65
  19. package/dist/types/api/inbox-service.d.ts.map +0 -1
  20. package/dist/types/api/index.d.ts +0 -2
  21. package/dist/types/api/index.d.ts.map +0 -1
  22. package/dist/types/base-module.d.ts +0 -13
  23. package/dist/types/base-module.d.ts.map +0 -1
  24. package/dist/types/cache/in-memory-cache.d.ts +0 -13
  25. package/dist/types/cache/in-memory-cache.d.ts.map +0 -1
  26. package/dist/types/cache/index.d.ts +0 -2
  27. package/dist/types/cache/index.d.ts.map +0 -1
  28. package/dist/types/cache/notifications-cache.d.ts +0 -22
  29. package/dist/types/cache/notifications-cache.d.ts.map +0 -1
  30. package/dist/types/cache/preferences-cache.d.ts +0 -11
  31. package/dist/types/cache/preferences-cache.d.ts.map +0 -1
  32. package/dist/types/cache/types.d.ts +0 -10
  33. package/dist/types/cache/types.d.ts.map +0 -1
  34. package/dist/types/event-emitter/index.d.ts +0 -3
  35. package/dist/types/event-emitter/index.d.ts.map +0 -1
  36. package/dist/types/event-emitter/novu-event-emitter.d.ts +0 -14
  37. package/dist/types/event-emitter/novu-event-emitter.d.ts.map +0 -1
  38. package/dist/types/event-emitter/types.d.ts +0 -85
  39. package/dist/types/event-emitter/types.d.ts.map +0 -1
  40. package/dist/types/index.d.ts +0 -3
  41. package/dist/types/index.d.ts.map +0 -1
  42. package/dist/types/notifications/helpers.d.ts +0 -57
  43. package/dist/types/notifications/helpers.d.ts.map +0 -1
  44. package/dist/types/notifications/index.d.ts +0 -4
  45. package/dist/types/notifications/index.d.ts.map +0 -1
  46. package/dist/types/notifications/notification.d.ts +0 -33
  47. package/dist/types/notifications/notification.d.ts.map +0 -1
  48. package/dist/types/notifications/notifications.d.ts +0 -44
  49. package/dist/types/notifications/notifications.d.ts.map +0 -1
  50. package/dist/types/notifications/types.d.ts +0 -55
  51. package/dist/types/notifications/types.d.ts.map +0 -1
  52. package/dist/types/novu.d.ts +0 -14
  53. package/dist/types/novu.d.ts.map +0 -1
  54. package/dist/types/preferences/helpers.d.ts +0 -11
  55. package/dist/types/preferences/helpers.d.ts.map +0 -1
  56. package/dist/types/preferences/index.d.ts +0 -2
  57. package/dist/types/preferences/index.d.ts.map +0 -1
  58. package/dist/types/preferences/preference.d.ts +0 -15
  59. package/dist/types/preferences/preference.d.ts.map +0 -1
  60. package/dist/types/preferences/preferences.d.ts +0 -15
  61. package/dist/types/preferences/preferences.d.ts.map +0 -1
  62. package/dist/types/preferences/types.d.ts +0 -15
  63. package/dist/types/preferences/types.d.ts.map +0 -1
  64. package/dist/types/session/index.d.ts +0 -3
  65. package/dist/types/session/index.d.ts.map +0 -1
  66. package/dist/types/session/session.d.ts +0 -7
  67. package/dist/types/session/session.d.ts.map +0 -1
  68. package/dist/types/session/types.d.ts +0 -6
  69. package/dist/types/session/types.d.ts.map +0 -1
  70. package/dist/types/types.d.ts +0 -150
  71. package/dist/types/types.d.ts.map +0 -1
  72. package/dist/types/ui/api/hooks/index.d.ts +0 -6
  73. package/dist/types/ui/api/hooks/index.d.ts.map +0 -1
  74. package/dist/types/ui/api/hooks/useArchiveAll.d.ts +0 -10
  75. package/dist/types/ui/api/hooks/useArchiveAll.d.ts.map +0 -1
  76. package/dist/types/ui/api/hooks/useArchiveAllRead.d.ts +0 -10
  77. package/dist/types/ui/api/hooks/useArchiveAllRead.d.ts.map +0 -1
  78. package/dist/types/ui/api/hooks/useNotifications.d.ts +0 -17
  79. package/dist/types/ui/api/hooks/useNotifications.d.ts.map +0 -1
  80. package/dist/types/ui/api/hooks/usePreferences.d.ts +0 -9
  81. package/dist/types/ui/api/hooks/usePreferences.d.ts.map +0 -1
  82. package/dist/types/ui/api/hooks/useReadAll.d.ts +0 -10
  83. package/dist/types/ui/api/hooks/useReadAll.d.ts.map +0 -1
  84. package/dist/types/ui/api/index.d.ts +0 -2
  85. package/dist/types/ui/api/index.d.ts.map +0 -1
  86. package/dist/types/ui/components/ExternalElementRenderer.d.ts +0 -7
  87. package/dist/types/ui/components/ExternalElementRenderer.d.ts.map +0 -1
  88. package/dist/types/ui/components/Inbox.d.ts +0 -24
  89. package/dist/types/ui/components/Inbox.d.ts.map +0 -1
  90. package/dist/types/ui/components/InboxTabs/InboxTab.d.ts +0 -16
  91. package/dist/types/ui/components/InboxTabs/InboxTab.d.ts.map +0 -1
  92. package/dist/types/ui/components/InboxTabs/InboxTabs.d.ts +0 -11
  93. package/dist/types/ui/components/InboxTabs/InboxTabs.d.ts.map +0 -1
  94. package/dist/types/ui/components/InboxTabs/index.d.ts +0 -2
  95. package/dist/types/ui/components/InboxTabs/index.d.ts.map +0 -1
  96. package/dist/types/ui/components/InboxTabs/useTabsDropdown.d.ts +0 -11
  97. package/dist/types/ui/components/InboxTabs/useTabsDropdown.d.ts.map +0 -1
  98. package/dist/types/ui/components/Notification/DefaultNotification.d.ts +0 -12
  99. package/dist/types/ui/components/Notification/DefaultNotification.d.ts.map +0 -1
  100. package/dist/types/ui/components/Notification/NewMessagesCta.d.ts +0 -6
  101. package/dist/types/ui/components/Notification/NewMessagesCta.d.ts.map +0 -1
  102. package/dist/types/ui/components/Notification/Notification.d.ts +0 -12
  103. package/dist/types/ui/components/Notification/Notification.d.ts.map +0 -1
  104. package/dist/types/ui/components/Notification/NotificationList.d.ts +0 -14
  105. package/dist/types/ui/components/Notification/NotificationList.d.ts.map +0 -1
  106. package/dist/types/ui/components/Notification/NotificationListSkeleton.d.ts +0 -7
  107. package/dist/types/ui/components/Notification/NotificationListSkeleton.d.ts.map +0 -1
  108. package/dist/types/ui/components/Notification/index.d.ts +0 -3
  109. package/dist/types/ui/components/Notification/index.d.ts.map +0 -1
  110. package/dist/types/ui/components/Renderer.d.ts +0 -44
  111. package/dist/types/ui/components/Renderer.d.ts.map +0 -1
  112. package/dist/types/ui/components/elements/Bell/Bell.d.ts +0 -8
  113. package/dist/types/ui/components/elements/Bell/Bell.d.ts.map +0 -1
  114. package/dist/types/ui/components/elements/Bell/DefaultBellContainer.d.ts +0 -6
  115. package/dist/types/ui/components/elements/Bell/DefaultBellContainer.d.ts.map +0 -1
  116. package/dist/types/ui/components/elements/Bell/index.d.ts +0 -2
  117. package/dist/types/ui/components/elements/Bell/index.d.ts.map +0 -1
  118. package/dist/types/ui/components/elements/Footer.d.ts +0 -2
  119. package/dist/types/ui/components/elements/Footer.d.ts.map +0 -1
  120. package/dist/types/ui/components/elements/Header/ActionsContainer.d.ts +0 -6
  121. package/dist/types/ui/components/elements/Header/ActionsContainer.d.ts.map +0 -1
  122. package/dist/types/ui/components/elements/Header/Header.d.ts +0 -6
  123. package/dist/types/ui/components/elements/Header/Header.d.ts.map +0 -1
  124. package/dist/types/ui/components/elements/Header/MoreActionsDropdown.d.ts +0 -2
  125. package/dist/types/ui/components/elements/Header/MoreActionsDropdown.d.ts.map +0 -1
  126. package/dist/types/ui/components/elements/Header/MoreActionsOptions.d.ts +0 -9
  127. package/dist/types/ui/components/elements/Header/MoreActionsOptions.d.ts.map +0 -1
  128. package/dist/types/ui/components/elements/Header/PreferencesHeader.d.ts +0 -6
  129. package/dist/types/ui/components/elements/Header/PreferencesHeader.d.ts.map +0 -1
  130. package/dist/types/ui/components/elements/Header/index.d.ts +0 -3
  131. package/dist/types/ui/components/elements/Header/index.d.ts.map +0 -1
  132. package/dist/types/ui/components/elements/InboxStatus/InboxStatusDropdown.d.ts +0 -2
  133. package/dist/types/ui/components/elements/InboxStatus/InboxStatusDropdown.d.ts.map +0 -1
  134. package/dist/types/ui/components/elements/InboxStatus/InboxStatusOptions.d.ts +0 -14
  135. package/dist/types/ui/components/elements/InboxStatus/InboxStatusOptions.d.ts.map +0 -1
  136. package/dist/types/ui/components/elements/InboxStatus/constants.d.ts +0 -11
  137. package/dist/types/ui/components/elements/InboxStatus/constants.d.ts.map +0 -1
  138. package/dist/types/ui/components/elements/Preferences/ChannelRow.d.ts +0 -18
  139. package/dist/types/ui/components/elements/Preferences/ChannelRow.d.ts.map +0 -1
  140. package/dist/types/ui/components/elements/Preferences/LoadingScreen.d.ts +0 -2
  141. package/dist/types/ui/components/elements/Preferences/LoadingScreen.d.ts.map +0 -1
  142. package/dist/types/ui/components/elements/Preferences/Preferences.d.ts +0 -2
  143. package/dist/types/ui/components/elements/Preferences/Preferences.d.ts.map +0 -1
  144. package/dist/types/ui/components/elements/Preferences/Switch.d.ts +0 -8
  145. package/dist/types/ui/components/elements/Preferences/Switch.d.ts.map +0 -1
  146. package/dist/types/ui/components/elements/Preferences/index.d.ts +0 -2
  147. package/dist/types/ui/components/elements/Preferences/index.d.ts.map +0 -1
  148. package/dist/types/ui/components/elements/Root.d.ts +0 -3
  149. package/dist/types/ui/components/elements/Root.d.ts.map +0 -1
  150. package/dist/types/ui/components/elements/index.d.ts +0 -6
  151. package/dist/types/ui/components/elements/index.d.ts.map +0 -1
  152. package/dist/types/ui/components/index.d.ts +0 -4
  153. package/dist/types/ui/components/index.d.ts.map +0 -1
  154. package/dist/types/ui/components/primitives/Button.d.ts +0 -13
  155. package/dist/types/ui/components/primitives/Button.d.ts.map +0 -1
  156. package/dist/types/ui/components/primitives/Dropdown/DropdownContent.d.ts +0 -8
  157. package/dist/types/ui/components/primitives/Dropdown/DropdownContent.d.ts.map +0 -1
  158. package/dist/types/ui/components/primitives/Dropdown/DropdownItem.d.ts +0 -9
  159. package/dist/types/ui/components/primitives/Dropdown/DropdownItem.d.ts.map +0 -1
  160. package/dist/types/ui/components/primitives/Dropdown/DropdownRoot.d.ts +0 -4
  161. package/dist/types/ui/components/primitives/Dropdown/DropdownRoot.d.ts.map +0 -1
  162. package/dist/types/ui/components/primitives/Dropdown/DropdownTrigger.d.ts +0 -8
  163. package/dist/types/ui/components/primitives/Dropdown/DropdownTrigger.d.ts.map +0 -1
  164. package/dist/types/ui/components/primitives/Dropdown/index.d.ts +0 -44
  165. package/dist/types/ui/components/primitives/Dropdown/index.d.ts.map +0 -1
  166. package/dist/types/ui/components/primitives/Popover/PopoverClose.d.ts +0 -7
  167. package/dist/types/ui/components/primitives/Popover/PopoverClose.d.ts.map +0 -1
  168. package/dist/types/ui/components/primitives/Popover/PopoverContent.d.ts +0 -9
  169. package/dist/types/ui/components/primitives/Popover/PopoverContent.d.ts.map +0 -1
  170. package/dist/types/ui/components/primitives/Popover/PopoverRoot.d.ts +0 -23
  171. package/dist/types/ui/components/primitives/Popover/PopoverRoot.d.ts.map +0 -1
  172. package/dist/types/ui/components/primitives/Popover/PopoverTrigger.d.ts +0 -9
  173. package/dist/types/ui/components/primitives/Popover/PopoverTrigger.d.ts.map +0 -1
  174. package/dist/types/ui/components/primitives/Popover/index.d.ts +0 -28
  175. package/dist/types/ui/components/primitives/Popover/index.d.ts.map +0 -1
  176. package/dist/types/ui/components/primitives/Skeleton.d.ts +0 -14
  177. package/dist/types/ui/components/primitives/Skeleton.d.ts.map +0 -1
  178. package/dist/types/ui/components/primitives/Tabs/TabsContent.d.ts +0 -10
  179. package/dist/types/ui/components/primitives/Tabs/TabsContent.d.ts.map +0 -1
  180. package/dist/types/ui/components/primitives/Tabs/TabsList.d.ts +0 -11
  181. package/dist/types/ui/components/primitives/Tabs/TabsList.d.ts.map +0 -1
  182. package/dist/types/ui/components/primitives/Tabs/TabsRoot.d.ts +0 -20
  183. package/dist/types/ui/components/primitives/Tabs/TabsRoot.d.ts.map +0 -1
  184. package/dist/types/ui/components/primitives/Tabs/TabsTrigger.d.ts +0 -13
  185. package/dist/types/ui/components/primitives/Tabs/TabsTrigger.d.ts.map +0 -1
  186. package/dist/types/ui/components/primitives/Tabs/index.d.ts +0 -35
  187. package/dist/types/ui/components/primitives/Tabs/index.d.ts.map +0 -1
  188. package/dist/types/ui/components/primitives/Tabs/useKeyboardNavigation.d.ts +0 -7
  189. package/dist/types/ui/components/primitives/Tabs/useKeyboardNavigation.d.ts.map +0 -1
  190. package/dist/types/ui/components/primitives/Tooltip/TooltipContent.d.ts +0 -9
  191. package/dist/types/ui/components/primitives/Tooltip/TooltipContent.d.ts.map +0 -1
  192. package/dist/types/ui/components/primitives/Tooltip/TooltipRoot.d.ts +0 -21
  193. package/dist/types/ui/components/primitives/Tooltip/TooltipRoot.d.ts.map +0 -1
  194. package/dist/types/ui/components/primitives/Tooltip/TooltipTrigger.d.ts +0 -9
  195. package/dist/types/ui/components/primitives/Tooltip/TooltipTrigger.d.ts.map +0 -1
  196. package/dist/types/ui/components/primitives/Tooltip/index.d.ts +0 -21
  197. package/dist/types/ui/components/primitives/Tooltip/index.d.ts.map +0 -1
  198. package/dist/types/ui/components/primitives/index.d.ts +0 -5
  199. package/dist/types/ui/components/primitives/index.d.ts.map +0 -1
  200. package/dist/types/ui/config/appearanceKeys.d.ts +0 -2
  201. package/dist/types/ui/config/appearanceKeys.d.ts.map +0 -1
  202. package/dist/types/ui/config/defaultLocalization.d.ts +0 -26
  203. package/dist/types/ui/config/defaultLocalization.d.ts.map +0 -1
  204. package/dist/types/ui/config/defaultVariables.d.ts +0 -3
  205. package/dist/types/ui/config/defaultVariables.d.ts.map +0 -1
  206. package/dist/types/ui/config/index.d.ts +0 -4
  207. package/dist/types/ui/config/index.d.ts.map +0 -1
  208. package/dist/types/ui/context/AppearanceContext.d.ts +0 -17
  209. package/dist/types/ui/context/AppearanceContext.d.ts.map +0 -1
  210. package/dist/types/ui/context/CountContext.d.ts +0 -23
  211. package/dist/types/ui/context/CountContext.d.ts.map +0 -1
  212. package/dist/types/ui/context/FocusManagerContext.d.ts +0 -12
  213. package/dist/types/ui/context/FocusManagerContext.d.ts.map +0 -1
  214. package/dist/types/ui/context/InboxContext.d.ts +0 -25
  215. package/dist/types/ui/context/InboxContext.d.ts.map +0 -1
  216. package/dist/types/ui/context/LocalizationContext.d.ts +0 -24
  217. package/dist/types/ui/context/LocalizationContext.d.ts.map +0 -1
  218. package/dist/types/ui/context/NovuContext.d.ts +0 -11
  219. package/dist/types/ui/context/NovuContext.d.ts.map +0 -1
  220. package/dist/types/ui/context/index.d.ts +0 -7
  221. package/dist/types/ui/context/index.d.ts.map +0 -1
  222. package/dist/types/ui/helpers/browser.d.ts +0 -2
  223. package/dist/types/ui/helpers/browser.d.ts.map +0 -1
  224. package/dist/types/ui/helpers/constants.d.ts +0 -5
  225. package/dist/types/ui/helpers/constants.d.ts.map +0 -1
  226. package/dist/types/ui/helpers/createDelayedLoading.d.ts +0 -3
  227. package/dist/types/ui/helpers/createDelayedLoading.d.ts.map +0 -1
  228. package/dist/types/ui/helpers/createInfiniteScroll.d.ts +0 -19
  229. package/dist/types/ui/helpers/createInfiniteScroll.d.ts.map +0 -1
  230. package/dist/types/ui/helpers/formatToRelativeTime.d.ts +0 -6
  231. package/dist/types/ui/helpers/formatToRelativeTime.d.ts.map +0 -1
  232. package/dist/types/ui/helpers/index.d.ts +0 -7
  233. package/dist/types/ui/helpers/index.d.ts.map +0 -1
  234. package/dist/types/ui/helpers/types.d.ts +0 -4
  235. package/dist/types/ui/helpers/types.d.ts.map +0 -1
  236. package/dist/types/ui/helpers/useBrowserTabsChannel.d.ts +0 -7
  237. package/dist/types/ui/helpers/useBrowserTabsChannel.d.ts.map +0 -1
  238. package/dist/types/ui/helpers/useFocusTrap.d.ts +0 -7
  239. package/dist/types/ui/helpers/useFocusTrap.d.ts.map +0 -1
  240. package/dist/types/ui/helpers/useNovuEvent.d.ts +0 -6
  241. package/dist/types/ui/helpers/useNovuEvent.d.ts.map +0 -1
  242. package/dist/types/ui/helpers/useStyle.d.ts +0 -3
  243. package/dist/types/ui/helpers/useStyle.d.ts.map +0 -1
  244. package/dist/types/ui/helpers/useUncontrolledState.d.ts +0 -9
  245. package/dist/types/ui/helpers/useUncontrolledState.d.ts.map +0 -1
  246. package/dist/types/ui/helpers/useWebSocketEvent.d.ts +0 -6
  247. package/dist/types/ui/helpers/useWebSocketEvent.d.ts.map +0 -1
  248. package/dist/types/ui/helpers/utils.d.ts +0 -33
  249. package/dist/types/ui/helpers/utils.d.ts.map +0 -1
  250. package/dist/types/ui/icons/Archive.d.ts +0 -3
  251. package/dist/types/ui/icons/Archive.d.ts.map +0 -1
  252. package/dist/types/ui/icons/ArchiveRead.d.ts +0 -3
  253. package/dist/types/ui/icons/ArchiveRead.d.ts.map +0 -1
  254. package/dist/types/ui/icons/ArrowDropDown.d.ts +0 -3
  255. package/dist/types/ui/icons/ArrowDropDown.d.ts.map +0 -1
  256. package/dist/types/ui/icons/ArrowLeft.d.ts +0 -3
  257. package/dist/types/ui/icons/ArrowLeft.d.ts.map +0 -1
  258. package/dist/types/ui/icons/BellIcon.d.ts +0 -3
  259. package/dist/types/ui/icons/BellIcon.d.ts.map +0 -1
  260. package/dist/types/ui/icons/Chat.d.ts +0 -3
  261. package/dist/types/ui/icons/Chat.d.ts.map +0 -1
  262. package/dist/types/ui/icons/Check.d.ts +0 -3
  263. package/dist/types/ui/icons/Check.d.ts.map +0 -1
  264. package/dist/types/ui/icons/Dots.d.ts +0 -3
  265. package/dist/types/ui/icons/Dots.d.ts.map +0 -1
  266. package/dist/types/ui/icons/Email.d.ts +0 -3
  267. package/dist/types/ui/icons/Email.d.ts.map +0 -1
  268. package/dist/types/ui/icons/EmptyIcon.d.ts +0 -3
  269. package/dist/types/ui/icons/EmptyIcon.d.ts.map +0 -1
  270. package/dist/types/ui/icons/InApp.d.ts +0 -3
  271. package/dist/types/ui/icons/InApp.d.ts.map +0 -1
  272. package/dist/types/ui/icons/Inbox.d.ts +0 -3
  273. package/dist/types/ui/icons/Inbox.d.ts.map +0 -1
  274. package/dist/types/ui/icons/Lock.d.ts +0 -2
  275. package/dist/types/ui/icons/Lock.d.ts.map +0 -1
  276. package/dist/types/ui/icons/Novu.d.ts +0 -3
  277. package/dist/types/ui/icons/Novu.d.ts.map +0 -1
  278. package/dist/types/ui/icons/Push.d.ts +0 -3
  279. package/dist/types/ui/icons/Push.d.ts.map +0 -1
  280. package/dist/types/ui/icons/ReadAll.d.ts +0 -3
  281. package/dist/types/ui/icons/ReadAll.d.ts.map +0 -1
  282. package/dist/types/ui/icons/Settings.d.ts +0 -3
  283. package/dist/types/ui/icons/Settings.d.ts.map +0 -1
  284. package/dist/types/ui/icons/Sms.d.ts +0 -3
  285. package/dist/types/ui/icons/Sms.d.ts.map +0 -1
  286. package/dist/types/ui/icons/Unarchive.d.ts +0 -3
  287. package/dist/types/ui/icons/Unarchive.d.ts.map +0 -1
  288. package/dist/types/ui/icons/Unread.d.ts +0 -3
  289. package/dist/types/ui/icons/Unread.d.ts.map +0 -1
  290. package/dist/types/ui/icons/index.d.ts +0 -20
  291. package/dist/types/ui/icons/index.d.ts.map +0 -1
  292. package/dist/types/ui/index.d.ts +0 -6
  293. package/dist/types/ui/index.d.ts.map +0 -1
  294. package/dist/types/ui/novuUI.d.ts +0 -25
  295. package/dist/types/ui/novuUI.d.ts.map +0 -1
  296. package/dist/types/ui/themes/dark.d.ts +0 -3
  297. package/dist/types/ui/themes/dark.d.ts.map +0 -1
  298. package/dist/types/ui/themes/index.d.ts +0 -2
  299. package/dist/types/ui/themes/index.d.ts.map +0 -1
  300. package/dist/types/ui/types.d.ts +0 -57
  301. package/dist/types/ui/types.d.ts.map +0 -1
  302. package/dist/types/umd.d.ts +0 -2
  303. package/dist/types/umd.d.ts.map +0 -1
  304. package/dist/types/utils/arrays.d.ts +0 -2
  305. package/dist/types/utils/arrays.d.ts.map +0 -1
  306. package/dist/types/utils/config.d.ts +0 -2
  307. package/dist/types/utils/config.d.ts.map +0 -1
  308. package/dist/types/utils/errors.d.ts +0 -5
  309. package/dist/types/utils/errors.d.ts.map +0 -1
  310. package/dist/types/utils/inbox-service-singleton.d.ts +0 -6
  311. package/dist/types/utils/inbox-service-singleton.d.ts.map +0 -1
  312. package/dist/types/utils/notification-utils.d.ts +0 -6
  313. package/dist/types/utils/notification-utils.d.ts.map +0 -1
  314. package/dist/types/ws/index.d.ts +0 -2
  315. package/dist/types/ws/index.d.ts.map +0 -1
  316. package/dist/types/ws/socket.d.ts +0 -13
  317. package/dist/types/ws/socket.d.ts.map +0 -1
Binary file
package/package.json CHANGED
@@ -1,34 +1,42 @@
1
1
  {
2
2
  "name": "@novu/js",
3
- "version": "2.0.1",
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.cjs",
8
+ "main": "dist/cjs/index.js",
9
9
  "module": "dist/esm/index.mjs",
10
- "types": "dist/types/index.d.ts",
10
+ "types": "dist/cjs/index.d.ts",
11
11
  "exports": {
12
12
  ".": {
13
- "require": "./dist/cjs/index.cjs",
14
- "import": "./dist/esm/index.mjs",
15
- "default": "./dist/esm/index.mjs",
16
- "types": "./dist/types/index.d.ts"
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
- "require": "./dist/cjs/ui/index.cjs",
20
- "import": "./dist/esm/ui/index.mjs",
21
- "default": "./dist/esm/ui/index.mjs",
22
- "types": "./dist/types/ui/index.d.ts"
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
- "@tailwindcss/line-clamp": "^0.4.4",
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",
@@ -0,0 +1,5 @@
1
+ {
2
+ "main": "../dist/cjs/ui/index.cjs",
3
+ "module": "../dist/esm/ui/index.mjs",
4
+ "types": "../dist/cjs/ui/index.d.ts"
5
+ }
@@ -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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,EACxB,UAAU,EACV,kBAAkB,GACnB,EAAE;QACD,UAAU,EAAE,MAAM,CAAC;QACnB,kBAAkB,EAAE,iBAAiB,CAAC;KACvC,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAGjC"}
@@ -1,2 +0,0 @@
1
- export * from './inbox-service';
2
- //# sourceMappingURL=index.d.ts.map
@@ -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,2 +0,0 @@
1
- export { NotificationsCache } from './notifications-cache';
2
- //# sourceMappingURL=index.d.ts.map
@@ -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,3 +0,0 @@
1
- export * from './novu-event-emitter';
2
- export * from './types';
3
- //# sourceMappingURL=index.d.ts.map
@@ -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","sourceRoot":"","sources":["../../../src/event-emitter/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,qBAAqB,EACrB,YAAY,EACZ,yBAAyB,EACzB,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,cAAc,EACd,UAAU,EACX,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAEnD,KAAK,gBAAgB,CAAC,CAAC,EAAE,CAAC,GAAG,SAAS,IAAI;IACxC,IAAI,EAAE,CAAC,CAAC;IACR,IAAI,CAAC,EAAE,CAAC,CAAC;CACV,CAAC;AACF,KAAK,iBAAiB,CAAC,CAAC,EAAE,CAAC,IAAI,gBAAgB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Root":"","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,4 +0,0 @@
1
- export * from './notifications';
2
- export * from './types';
3
- export * from './notification';
4
- //# sourceMappingURL=index.d.ts.map
@@ -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,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAC7C,QAAQ,CAAC,UAAU,EAAE,iBAAiB,CAAC,YAAY,CAAC,CAAC;IACrD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AAS,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,GAAG,WAAW,EAAE,GAAE,qBAA0B,GAAG,MAAM,CAAC,yBAAyB,CAAC;IAoCnG,KAAK,CAAC,IAAI,CAAC,EAAE,eAAe,GAAG,MAAM,CAAC,mBAAmB,CAAC;IAC1D,KAAK,CAAC,IAAI,CAAC,EAAE,gBAAgB,GAAG,MAAM,CAAC,oBAAoB,CAAC;IA4B5D,IAAI,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAC,YAAY,CAAC;IAC1C,IAAI,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;IAW9C,MAAM,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAC,YAAY,CAAC;IAC5C,MAAM,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;IAWhD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