@metamask-previews/notification-services-controller 26.0.1-preview-4f4c98e → 26.0.1-preview-eb263b0ee

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 (655) hide show
  1. package/CHANGELOG.md +0 -1
  2. package/dist/NotificationServicesController/NotificationServicesController-method-action-types.cjs +7 -0
  3. package/dist/NotificationServicesController/NotificationServicesController-method-action-types.cjs.map +1 -0
  4. package/dist/NotificationServicesController/{NotificationServicesController-method-action-types.d.ts → NotificationServicesController-method-action-types.d.cts} +2 -2
  5. package/dist/NotificationServicesController/NotificationServicesController-method-action-types.d.cts.map +1 -0
  6. package/dist/NotificationServicesController/NotificationServicesController-method-action-types.d.mts +206 -0
  7. package/dist/NotificationServicesController/NotificationServicesController-method-action-types.d.mts.map +1 -0
  8. package/dist/NotificationServicesController/{NotificationServicesController-method-action-types.js → NotificationServicesController-method-action-types.mjs} +1 -1
  9. package/dist/NotificationServicesController/NotificationServicesController-method-action-types.mjs.map +1 -0
  10. package/dist/NotificationServicesController/NotificationServicesController.cjs +1055 -0
  11. package/dist/NotificationServicesController/NotificationServicesController.cjs.map +1 -0
  12. package/dist/NotificationServicesController/{NotificationServicesController.d.ts → NotificationServicesController.d.cts} +15 -15
  13. package/dist/NotificationServicesController/NotificationServicesController.d.cts.map +1 -0
  14. package/dist/NotificationServicesController/NotificationServicesController.d.mts +292 -0
  15. package/dist/NotificationServicesController/NotificationServicesController.d.mts.map +1 -0
  16. package/dist/NotificationServicesController/{NotificationServicesController.js → NotificationServicesController.mjs} +26 -18
  17. package/dist/NotificationServicesController/NotificationServicesController.mjs.map +1 -0
  18. package/dist/NotificationServicesController/constants/index.cjs +18 -0
  19. package/dist/NotificationServicesController/constants/index.cjs.map +1 -0
  20. package/dist/NotificationServicesController/constants/index.d.cts +2 -0
  21. package/dist/NotificationServicesController/constants/index.d.cts.map +1 -0
  22. package/dist/NotificationServicesController/constants/index.d.mts +2 -0
  23. package/dist/NotificationServicesController/constants/index.d.mts.map +1 -0
  24. package/dist/NotificationServicesController/constants/index.mjs +2 -0
  25. package/dist/NotificationServicesController/constants/index.mjs.map +1 -0
  26. package/dist/NotificationServicesController/constants/notification-schema.cjs +46 -0
  27. package/dist/NotificationServicesController/constants/notification-schema.cjs.map +1 -0
  28. package/dist/NotificationServicesController/constants/{notification-schema.d.ts → notification-schema.d.cts} +1 -1
  29. package/dist/NotificationServicesController/constants/notification-schema.d.cts.map +1 -0
  30. package/dist/NotificationServicesController/constants/notification-schema.d.mts +22 -0
  31. package/dist/NotificationServicesController/constants/notification-schema.d.mts.map +1 -0
  32. package/dist/NotificationServicesController/constants/{notification-schema.js → notification-schema.mjs} +1 -1
  33. package/dist/NotificationServicesController/constants/notification-schema.mjs.map +1 -0
  34. package/dist/NotificationServicesController/index.cjs +44 -0
  35. package/dist/NotificationServicesController/index.cjs.map +1 -0
  36. package/dist/NotificationServicesController/{index.d.ts → index.d.cts} +14 -14
  37. package/dist/NotificationServicesController/index.d.cts.map +1 -0
  38. package/dist/NotificationServicesController/index.d.mts +16 -0
  39. package/dist/NotificationServicesController/index.d.mts.map +1 -0
  40. package/dist/NotificationServicesController/index.mjs +13 -0
  41. package/dist/NotificationServicesController/index.mjs.map +1 -0
  42. package/dist/NotificationServicesController/mocks/index.cjs +21 -0
  43. package/dist/NotificationServicesController/mocks/index.cjs.map +1 -0
  44. package/dist/NotificationServicesController/mocks/index.d.cts +5 -0
  45. package/dist/NotificationServicesController/mocks/index.d.cts.map +1 -0
  46. package/dist/NotificationServicesController/mocks/index.d.mts +5 -0
  47. package/dist/NotificationServicesController/mocks/index.d.mts.map +1 -0
  48. package/dist/NotificationServicesController/mocks/index.mjs +5 -0
  49. package/dist/NotificationServicesController/mocks/index.mjs.map +1 -0
  50. package/dist/NotificationServicesController/mocks/mock-feature-announcements.cjs +210 -0
  51. package/dist/NotificationServicesController/mocks/mock-feature-announcements.cjs.map +1 -0
  52. package/dist/NotificationServicesController/mocks/{mock-feature-announcements.d.ts → mock-feature-announcements.d.cts} +3 -3
  53. package/dist/NotificationServicesController/mocks/mock-feature-announcements.d.cts.map +1 -0
  54. package/dist/NotificationServicesController/mocks/mock-feature-announcements.d.mts +15 -0
  55. package/dist/NotificationServicesController/mocks/mock-feature-announcements.d.mts.map +1 -0
  56. package/dist/NotificationServicesController/mocks/{mock-feature-announcements.js → mock-feature-announcements.mjs} +2 -2
  57. package/dist/NotificationServicesController/mocks/mock-feature-announcements.mjs.map +1 -0
  58. package/dist/NotificationServicesController/mocks/mock-raw-notifications.cjs +830 -0
  59. package/dist/NotificationServicesController/mocks/mock-raw-notifications.cjs.map +1 -0
  60. package/dist/NotificationServicesController/mocks/{mock-raw-notifications.d.ts → mock-raw-notifications.d.cts} +2 -2
  61. package/dist/NotificationServicesController/mocks/mock-raw-notifications.d.cts.map +1 -0
  62. package/dist/NotificationServicesController/mocks/mock-raw-notifications.d.mts +104 -0
  63. package/dist/NotificationServicesController/mocks/mock-raw-notifications.d.mts.map +1 -0
  64. package/dist/NotificationServicesController/mocks/{mock-raw-notifications.js → mock-raw-notifications.mjs} +2 -2
  65. package/dist/NotificationServicesController/mocks/mock-raw-notifications.mjs.map +1 -0
  66. package/dist/NotificationServicesController/mocks/mock-snap-notification.cjs +29 -0
  67. package/dist/NotificationServicesController/mocks/mock-snap-notification.cjs.map +1 -0
  68. package/dist/NotificationServicesController/mocks/{mock-snap-notification.d.ts → mock-snap-notification.d.cts} +2 -2
  69. package/dist/NotificationServicesController/mocks/mock-snap-notification.d.cts.map +1 -0
  70. package/dist/NotificationServicesController/mocks/mock-snap-notification.d.mts +8 -0
  71. package/dist/NotificationServicesController/mocks/mock-snap-notification.d.mts.map +1 -0
  72. package/dist/NotificationServicesController/mocks/{mock-snap-notification.js → mock-snap-notification.mjs} +2 -2
  73. package/dist/NotificationServicesController/mocks/mock-snap-notification.mjs.map +1 -0
  74. package/dist/NotificationServicesController/mocks/mockResponses.cjs +53 -0
  75. package/dist/NotificationServicesController/mocks/mockResponses.cjs.map +1 -0
  76. package/dist/NotificationServicesController/mocks/{mockResponses.d.ts → mockResponses.d.cts} +3 -3
  77. package/dist/NotificationServicesController/mocks/mockResponses.d.cts.map +1 -0
  78. package/dist/NotificationServicesController/mocks/mockResponses.d.mts +14 -0
  79. package/dist/NotificationServicesController/mocks/mockResponses.d.mts.map +1 -0
  80. package/dist/NotificationServicesController/mocks/{mockResponses.js → mockResponses.mjs} +6 -6
  81. package/dist/NotificationServicesController/mocks/mockResponses.mjs.map +1 -0
  82. package/dist/NotificationServicesController/processors/index.cjs +20 -0
  83. package/dist/NotificationServicesController/processors/index.cjs.map +1 -0
  84. package/dist/NotificationServicesController/processors/index.d.cts +4 -0
  85. package/dist/NotificationServicesController/processors/index.d.cts.map +1 -0
  86. package/dist/NotificationServicesController/processors/index.d.mts +4 -0
  87. package/dist/NotificationServicesController/processors/index.d.mts.map +1 -0
  88. package/dist/NotificationServicesController/processors/index.mjs +4 -0
  89. package/dist/NotificationServicesController/processors/index.mjs.map +1 -0
  90. package/dist/NotificationServicesController/processors/process-api-notifications.cjs +24 -0
  91. package/dist/NotificationServicesController/processors/process-api-notifications.cjs.map +1 -0
  92. package/dist/NotificationServicesController/processors/{process-api-notifications.d.ts → process-api-notifications.d.cts} +3 -3
  93. package/dist/NotificationServicesController/processors/process-api-notifications.d.cts.map +1 -0
  94. package/dist/NotificationServicesController/processors/process-api-notifications.d.mts +10 -0
  95. package/dist/NotificationServicesController/processors/process-api-notifications.d.mts.map +1 -0
  96. package/dist/NotificationServicesController/processors/{process-api-notifications.js → process-api-notifications.mjs} +3 -3
  97. package/dist/NotificationServicesController/processors/process-api-notifications.mjs.map +1 -0
  98. package/dist/NotificationServicesController/processors/process-feature-announcement.cjs +38 -0
  99. package/dist/NotificationServicesController/processors/process-feature-announcement.cjs.map +1 -0
  100. package/dist/NotificationServicesController/processors/{process-feature-announcement.d.ts → process-feature-announcement.d.cts} +3 -3
  101. package/dist/NotificationServicesController/processors/process-feature-announcement.d.cts.map +1 -0
  102. package/dist/NotificationServicesController/processors/process-feature-announcement.d.mts +19 -0
  103. package/dist/NotificationServicesController/processors/process-feature-announcement.d.mts.map +1 -0
  104. package/dist/NotificationServicesController/processors/{process-feature-announcement.js → process-feature-announcement.mjs} +3 -3
  105. package/dist/NotificationServicesController/processors/process-feature-announcement.mjs.map +1 -0
  106. package/dist/NotificationServicesController/processors/process-notifications.cjs +60 -0
  107. package/dist/NotificationServicesController/processors/process-notifications.cjs.map +1 -0
  108. package/dist/NotificationServicesController/processors/{process-notifications.d.ts → process-notifications.d.cts} +2 -2
  109. package/dist/NotificationServicesController/processors/process-notifications.d.cts.map +1 -0
  110. package/dist/NotificationServicesController/processors/process-notifications.d.mts +20 -0
  111. package/dist/NotificationServicesController/processors/process-notifications.d.mts.map +1 -0
  112. package/dist/NotificationServicesController/processors/{process-notifications.js → process-notifications.mjs} +5 -5
  113. package/dist/NotificationServicesController/processors/process-notifications.mjs.map +1 -0
  114. package/dist/NotificationServicesController/processors/process-snap-notifications.cjs +25 -0
  115. package/dist/NotificationServicesController/processors/process-snap-notifications.cjs.map +1 -0
  116. package/dist/NotificationServicesController/processors/{process-snap-notifications.d.ts → process-snap-notifications.d.cts} +3 -3
  117. package/dist/NotificationServicesController/processors/process-snap-notifications.d.cts.map +1 -0
  118. package/dist/NotificationServicesController/processors/process-snap-notifications.d.mts +10 -0
  119. package/dist/NotificationServicesController/processors/process-snap-notifications.d.mts.map +1 -0
  120. package/dist/NotificationServicesController/processors/{process-snap-notifications.js → process-snap-notifications.mjs} +3 -3
  121. package/dist/NotificationServicesController/processors/process-snap-notifications.mjs.map +1 -0
  122. package/dist/NotificationServicesController/services/api-notifications.cjs +128 -0
  123. package/dist/NotificationServicesController/services/api-notifications.cjs.map +1 -0
  124. package/dist/NotificationServicesController/services/{api-notifications.d.ts → api-notifications.d.cts} +2 -2
  125. package/dist/NotificationServicesController/services/api-notifications.d.cts.map +1 -0
  126. package/dist/NotificationServicesController/services/api-notifications.d.mts +44 -0
  127. package/dist/NotificationServicesController/services/api-notifications.d.mts.map +1 -0
  128. package/dist/NotificationServicesController/services/{api-notifications.js → api-notifications.mjs} +12 -5
  129. package/dist/NotificationServicesController/services/api-notifications.mjs.map +1 -0
  130. package/dist/NotificationServicesController/services/feature-announcements.cjs +140 -0
  131. package/dist/NotificationServicesController/services/feature-announcements.cjs.map +1 -0
  132. package/dist/NotificationServicesController/services/{feature-announcements.d.ts → feature-announcements.d.cts} +4 -4
  133. package/dist/NotificationServicesController/services/feature-announcements.d.cts.map +1 -0
  134. package/dist/NotificationServicesController/services/feature-announcements.d.mts +32 -0
  135. package/dist/NotificationServicesController/services/feature-announcements.d.mts.map +1 -0
  136. package/dist/NotificationServicesController/services/{feature-announcements.js → feature-announcements.mjs} +5 -5
  137. package/dist/NotificationServicesController/services/feature-announcements.mjs.map +1 -0
  138. package/dist/NotificationServicesController/services/notification-config-cache.cjs +61 -0
  139. package/dist/NotificationServicesController/services/notification-config-cache.cjs.map +1 -0
  140. package/dist/NotificationServicesController/services/{notification-config-cache.d.ts → notification-config-cache.d.cts} +1 -1
  141. package/dist/NotificationServicesController/services/notification-config-cache.d.cts.map +1 -0
  142. package/dist/NotificationServicesController/services/notification-config-cache.d.mts +15 -0
  143. package/dist/NotificationServicesController/services/notification-config-cache.d.mts.map +1 -0
  144. package/dist/NotificationServicesController/services/{notification-config-cache.js → notification-config-cache.mjs} +1 -1
  145. package/dist/NotificationServicesController/services/notification-config-cache.mjs.map +1 -0
  146. package/dist/NotificationServicesController/services/perp-notifications.cjs +31 -0
  147. package/dist/NotificationServicesController/services/perp-notifications.cjs.map +1 -0
  148. package/dist/NotificationServicesController/services/{perp-notifications.d.ts → perp-notifications.d.cts} +2 -2
  149. package/dist/NotificationServicesController/services/perp-notifications.d.cts.map +1 -0
  150. package/dist/NotificationServicesController/services/perp-notifications.d.mts +11 -0
  151. package/dist/NotificationServicesController/services/perp-notifications.d.mts.map +1 -0
  152. package/dist/NotificationServicesController/services/{perp-notifications.js → perp-notifications.mjs} +2 -2
  153. package/dist/NotificationServicesController/services/perp-notifications.mjs.map +1 -0
  154. package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.cjs +3 -0
  155. package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.cjs.map +1 -0
  156. package/dist/NotificationServicesController/types/feature-announcement/{feature-announcement.d.ts → feature-announcement.d.cts} +3 -3
  157. package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.d.cts.map +1 -0
  158. package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.d.mts +32 -0
  159. package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.d.mts.map +1 -0
  160. package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.mjs +2 -0
  161. package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.mjs.map +1 -0
  162. package/dist/NotificationServicesController/types/feature-announcement/index.cjs +3 -0
  163. package/dist/NotificationServicesController/types/feature-announcement/index.cjs.map +1 -0
  164. package/dist/NotificationServicesController/types/feature-announcement/index.d.cts +4 -0
  165. package/dist/NotificationServicesController/types/feature-announcement/index.d.cts.map +1 -0
  166. package/dist/NotificationServicesController/types/feature-announcement/index.d.mts +4 -0
  167. package/dist/NotificationServicesController/types/feature-announcement/index.d.mts.map +1 -0
  168. package/dist/NotificationServicesController/types/feature-announcement/index.mjs +2 -0
  169. package/dist/NotificationServicesController/types/feature-announcement/index.mjs.map +1 -0
  170. package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.cjs +3 -0
  171. package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.cjs.map +1 -0
  172. package/dist/NotificationServicesController/types/feature-announcement/{type-feature-announcement.d.ts → type-feature-announcement.d.cts} +3 -3
  173. package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.d.cts.map +1 -0
  174. package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.d.mts +43 -0
  175. package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.d.mts.map +1 -0
  176. package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.mjs +2 -0
  177. package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.mjs.map +1 -0
  178. package/dist/NotificationServicesController/types/feature-announcement/type-links.cjs +3 -0
  179. package/dist/NotificationServicesController/types/feature-announcement/type-links.cjs.map +1 -0
  180. package/dist/NotificationServicesController/types/feature-announcement/{type-links.d.ts → type-links.d.cts} +1 -1
  181. package/dist/NotificationServicesController/types/feature-announcement/type-links.d.cts.map +1 -0
  182. package/dist/NotificationServicesController/types/feature-announcement/type-links.d.mts +29 -0
  183. package/dist/NotificationServicesController/types/feature-announcement/type-links.d.mts.map +1 -0
  184. package/dist/NotificationServicesController/types/feature-announcement/type-links.mjs +2 -0
  185. package/dist/NotificationServicesController/types/feature-announcement/type-links.mjs.map +1 -0
  186. package/dist/NotificationServicesController/types/index.cjs +3 -0
  187. package/dist/NotificationServicesController/types/index.cjs.map +1 -0
  188. package/dist/NotificationServicesController/types/index.d.cts +6 -0
  189. package/dist/NotificationServicesController/types/index.d.cts.map +1 -0
  190. package/dist/NotificationServicesController/types/index.d.mts +6 -0
  191. package/dist/NotificationServicesController/types/index.d.mts.map +1 -0
  192. package/dist/NotificationServicesController/types/index.mjs +2 -0
  193. package/dist/NotificationServicesController/types/index.mjs.map +1 -0
  194. package/dist/NotificationServicesController/types/notification/index.cjs +3 -0
  195. package/dist/NotificationServicesController/types/notification/index.cjs.map +1 -0
  196. package/dist/NotificationServicesController/types/notification/index.d.cts +2 -0
  197. package/dist/NotificationServicesController/types/notification/index.d.cts.map +1 -0
  198. package/dist/NotificationServicesController/types/notification/index.d.mts +2 -0
  199. package/dist/NotificationServicesController/types/notification/index.d.mts.map +1 -0
  200. package/dist/NotificationServicesController/types/notification/index.mjs +2 -0
  201. package/dist/NotificationServicesController/types/notification/index.mjs.map +1 -0
  202. package/dist/NotificationServicesController/types/notification/notification.cjs +3 -0
  203. package/dist/NotificationServicesController/types/notification/notification.cjs.map +1 -0
  204. package/dist/NotificationServicesController/types/notification/{notification.d.ts → notification.d.cts} +5 -5
  205. package/dist/NotificationServicesController/types/notification/notification.d.cts.map +1 -0
  206. package/dist/NotificationServicesController/types/notification/notification.d.mts +22 -0
  207. package/dist/NotificationServicesController/types/notification/notification.d.mts.map +1 -0
  208. package/dist/NotificationServicesController/types/notification/notification.mjs +2 -0
  209. package/dist/NotificationServicesController/types/notification/notification.mjs.map +1 -0
  210. package/dist/NotificationServicesController/types/notification-api/index.cjs +3 -0
  211. package/dist/NotificationServicesController/types/notification-api/index.cjs.map +1 -0
  212. package/dist/NotificationServicesController/types/notification-api/index.d.cts +3 -0
  213. package/dist/NotificationServicesController/types/notification-api/index.d.cts.map +1 -0
  214. package/dist/NotificationServicesController/types/notification-api/index.d.mts +3 -0
  215. package/dist/NotificationServicesController/types/notification-api/index.d.mts.map +1 -0
  216. package/dist/NotificationServicesController/types/notification-api/index.mjs +2 -0
  217. package/dist/NotificationServicesController/types/notification-api/index.mjs.map +1 -0
  218. package/dist/NotificationServicesController/types/notification-api/notification-api.cjs +4 -0
  219. package/dist/NotificationServicesController/types/notification-api/notification-api.cjs.map +1 -0
  220. package/dist/NotificationServicesController/types/notification-api/{notification-api.d.ts → notification-api.d.cts} +4 -4
  221. package/dist/NotificationServicesController/types/notification-api/notification-api.d.cts.map +1 -0
  222. package/dist/NotificationServicesController/types/notification-api/notification-api.d.mts +59 -0
  223. package/dist/NotificationServicesController/types/notification-api/notification-api.d.mts.map +1 -0
  224. package/dist/NotificationServicesController/types/notification-api/notification-api.mjs +2 -0
  225. package/dist/NotificationServicesController/types/notification-api/notification-api.mjs.map +1 -0
  226. package/dist/NotificationServicesController/types/notification-api/schema.cjs +6 -0
  227. package/dist/NotificationServicesController/types/notification-api/schema.cjs.map +1 -0
  228. package/dist/NotificationServicesController/types/notification-api/{schema.d.ts → schema.d.cts} +1 -1
  229. package/dist/NotificationServicesController/types/notification-api/schema.d.cts.map +1 -0
  230. package/dist/NotificationServicesController/types/notification-api/schema.d.mts +752 -0
  231. package/dist/NotificationServicesController/types/notification-api/schema.d.mts.map +1 -0
  232. package/dist/NotificationServicesController/types/notification-api/{schema.js → schema.mjs} +1 -1
  233. package/dist/NotificationServicesController/types/notification-api/schema.mjs.map +1 -0
  234. package/dist/NotificationServicesController/types/perps/index.cjs +3 -0
  235. package/dist/NotificationServicesController/types/perps/index.cjs.map +1 -0
  236. package/dist/NotificationServicesController/types/perps/index.d.cts +2 -0
  237. package/dist/NotificationServicesController/types/perps/index.d.cts.map +1 -0
  238. package/dist/NotificationServicesController/types/perps/index.d.mts +2 -0
  239. package/dist/NotificationServicesController/types/perps/index.d.mts.map +1 -0
  240. package/dist/NotificationServicesController/types/perps/index.mjs +2 -0
  241. package/dist/NotificationServicesController/types/perps/index.mjs.map +1 -0
  242. package/dist/NotificationServicesController/types/perps/perp-types.cjs +3 -0
  243. package/dist/NotificationServicesController/types/perps/perp-types.cjs.map +1 -0
  244. package/dist/NotificationServicesController/types/perps/perp-types.d.cts +3 -0
  245. package/dist/NotificationServicesController/types/perps/perp-types.d.cts.map +1 -0
  246. package/dist/NotificationServicesController/types/perps/perp-types.d.mts +3 -0
  247. package/dist/NotificationServicesController/types/perps/perp-types.d.mts.map +1 -0
  248. package/dist/NotificationServicesController/types/perps/perp-types.mjs +2 -0
  249. package/dist/NotificationServicesController/types/perps/perp-types.mjs.map +1 -0
  250. package/dist/NotificationServicesController/types/perps/schema.cjs +6 -0
  251. package/dist/NotificationServicesController/types/perps/schema.cjs.map +1 -0
  252. package/dist/NotificationServicesController/types/perps/{schema.d.ts → schema.d.cts} +1 -1
  253. package/dist/NotificationServicesController/types/perps/schema.d.cts.map +1 -0
  254. package/dist/NotificationServicesController/types/perps/schema.d.mts +133 -0
  255. package/dist/NotificationServicesController/types/perps/schema.d.mts.map +1 -0
  256. package/dist/NotificationServicesController/types/perps/{schema.js → schema.mjs} +1 -1
  257. package/dist/NotificationServicesController/types/perps/schema.mjs.map +1 -0
  258. package/dist/NotificationServicesController/types/snaps/index.cjs +3 -0
  259. package/dist/NotificationServicesController/types/snaps/index.cjs.map +1 -0
  260. package/dist/NotificationServicesController/types/snaps/index.d.cts +2 -0
  261. package/dist/NotificationServicesController/types/snaps/index.d.cts.map +1 -0
  262. package/dist/NotificationServicesController/types/snaps/index.d.mts +2 -0
  263. package/dist/NotificationServicesController/types/snaps/index.d.mts.map +1 -0
  264. package/dist/NotificationServicesController/types/snaps/index.mjs +2 -0
  265. package/dist/NotificationServicesController/types/snaps/index.mjs.map +1 -0
  266. package/dist/NotificationServicesController/types/snaps/snaps.cjs +3 -0
  267. package/dist/NotificationServicesController/types/snaps/snaps.cjs.map +1 -0
  268. package/dist/NotificationServicesController/types/snaps/{snaps.d.ts → snaps.d.cts} +2 -2
  269. package/dist/NotificationServicesController/types/snaps/snaps.d.cts.map +1 -0
  270. package/dist/NotificationServicesController/types/snaps/snaps.d.mts +23 -0
  271. package/dist/NotificationServicesController/types/snaps/snaps.d.mts.map +1 -0
  272. package/dist/NotificationServicesController/types/snaps/snaps.mjs +2 -0
  273. package/dist/NotificationServicesController/types/snaps/snaps.mjs.map +1 -0
  274. package/dist/NotificationServicesController/types/type-utils.cjs +3 -0
  275. package/dist/NotificationServicesController/types/type-utils.cjs.map +1 -0
  276. package/dist/NotificationServicesController/types/{type-utils.d.ts → type-utils.d.cts} +1 -1
  277. package/dist/NotificationServicesController/types/type-utils.d.cts.map +1 -0
  278. package/dist/NotificationServicesController/types/type-utils.d.mts +7 -0
  279. package/dist/NotificationServicesController/types/type-utils.d.mts.map +1 -0
  280. package/dist/NotificationServicesController/types/type-utils.mjs +2 -0
  281. package/dist/NotificationServicesController/types/type-utils.mjs.map +1 -0
  282. package/dist/NotificationServicesController/utils/get-notification-subtype.cjs +33 -0
  283. package/dist/NotificationServicesController/utils/get-notification-subtype.cjs.map +1 -0
  284. package/dist/NotificationServicesController/utils/{get-notification-subtype.d.ts → get-notification-subtype.d.cts} +2 -2
  285. package/dist/NotificationServicesController/utils/get-notification-subtype.d.cts.map +1 -0
  286. package/dist/NotificationServicesController/utils/get-notification-subtype.d.mts +17 -0
  287. package/dist/NotificationServicesController/utils/get-notification-subtype.d.mts.map +1 -0
  288. package/dist/NotificationServicesController/utils/{get-notification-subtype.js → get-notification-subtype.mjs} +3 -3
  289. package/dist/NotificationServicesController/utils/get-notification-subtype.mjs.map +1 -0
  290. package/dist/NotificationServicesController/utils/isVersionInBounds.cjs +37 -0
  291. package/dist/NotificationServicesController/utils/isVersionInBounds.cjs.map +1 -0
  292. package/dist/NotificationServicesController/utils/{isVersionInBounds.d.ts → isVersionInBounds.d.cts} +1 -1
  293. package/dist/NotificationServicesController/utils/isVersionInBounds.d.cts.map +1 -0
  294. package/dist/NotificationServicesController/utils/isVersionInBounds.d.mts +18 -0
  295. package/dist/NotificationServicesController/utils/isVersionInBounds.d.mts.map +1 -0
  296. package/dist/NotificationServicesController/utils/{isVersionInBounds.js → isVersionInBounds.mjs} +2 -2
  297. package/dist/NotificationServicesController/utils/isVersionInBounds.mjs.map +1 -0
  298. package/dist/NotificationServicesController/utils/should-auto-expire.cjs +12 -0
  299. package/dist/NotificationServicesController/utils/should-auto-expire.cjs.map +1 -0
  300. package/dist/NotificationServicesController/utils/{should-auto-expire.d.ts → should-auto-expire.d.cts} +1 -1
  301. package/dist/NotificationServicesController/utils/should-auto-expire.d.cts.map +1 -0
  302. package/dist/NotificationServicesController/utils/should-auto-expire.d.mts +2 -0
  303. package/dist/NotificationServicesController/utils/should-auto-expire.d.mts.map +1 -0
  304. package/dist/NotificationServicesController/utils/{should-auto-expire.js → should-auto-expire.mjs} +1 -1
  305. package/dist/NotificationServicesController/utils/should-auto-expire.mjs.map +1 -0
  306. package/dist/NotificationServicesController/utils/utils.cjs +25 -0
  307. package/dist/NotificationServicesController/utils/utils.cjs.map +1 -0
  308. package/dist/NotificationServicesController/utils/{utils.d.ts → utils.d.cts} +1 -1
  309. package/dist/NotificationServicesController/utils/utils.d.cts.map +1 -0
  310. package/dist/NotificationServicesController/utils/utils.d.mts +11 -0
  311. package/dist/NotificationServicesController/utils/utils.d.mts.map +1 -0
  312. package/dist/NotificationServicesController/utils/{utils.js → utils.mjs} +1 -1
  313. package/dist/NotificationServicesController/utils/utils.mjs.map +1 -0
  314. package/dist/NotificationServicesPushController/NotificationServicesPushController-method-action-types.cjs +7 -0
  315. package/dist/NotificationServicesPushController/NotificationServicesPushController-method-action-types.cjs.map +1 -0
  316. package/dist/NotificationServicesPushController/{NotificationServicesPushController-method-action-types.d.ts → NotificationServicesPushController-method-action-types.d.cts} +2 -2
  317. package/dist/NotificationServicesPushController/NotificationServicesPushController-method-action-types.d.cts.map +1 -0
  318. package/dist/NotificationServicesPushController/NotificationServicesPushController-method-action-types.d.mts +72 -0
  319. package/dist/NotificationServicesPushController/NotificationServicesPushController-method-action-types.d.mts.map +1 -0
  320. package/dist/NotificationServicesPushController/{NotificationServicesPushController-method-action-types.js → NotificationServicesPushController-method-action-types.mjs} +1 -1
  321. package/dist/NotificationServicesPushController/NotificationServicesPushController-method-action-types.mjs.map +1 -0
  322. package/dist/NotificationServicesPushController/NotificationServicesPushController.cjs +342 -0
  323. package/dist/NotificationServicesPushController/NotificationServicesPushController.cjs.map +1 -0
  324. package/dist/NotificationServicesPushController/{NotificationServicesPushController.d.ts → NotificationServicesPushController.d.cts} +9 -9
  325. package/dist/NotificationServicesPushController/NotificationServicesPushController.d.cts.map +1 -0
  326. package/dist/NotificationServicesPushController/NotificationServicesPushController.d.mts +123 -0
  327. package/dist/NotificationServicesPushController/NotificationServicesPushController.d.mts.map +1 -0
  328. package/dist/NotificationServicesPushController/{NotificationServicesPushController.js → NotificationServicesPushController.mjs} +11 -4
  329. package/dist/NotificationServicesPushController/NotificationServicesPushController.mjs.map +1 -0
  330. package/dist/NotificationServicesPushController/index.cjs +37 -0
  331. package/dist/NotificationServicesPushController/index.cjs.map +1 -0
  332. package/dist/NotificationServicesPushController/{index.d.ts → index.d.cts} +9 -9
  333. package/dist/NotificationServicesPushController/index.d.cts.map +1 -0
  334. package/dist/NotificationServicesPushController/index.d.mts +11 -0
  335. package/dist/NotificationServicesPushController/index.d.mts.map +1 -0
  336. package/dist/NotificationServicesPushController/index.mjs +8 -0
  337. package/dist/NotificationServicesPushController/index.mjs.map +1 -0
  338. package/dist/NotificationServicesPushController/mocks/index.cjs +18 -0
  339. package/dist/NotificationServicesPushController/mocks/index.cjs.map +1 -0
  340. package/dist/NotificationServicesPushController/mocks/index.d.cts +2 -0
  341. package/dist/NotificationServicesPushController/mocks/index.d.cts.map +1 -0
  342. package/dist/NotificationServicesPushController/mocks/index.d.mts +2 -0
  343. package/dist/NotificationServicesPushController/mocks/index.d.mts.map +1 -0
  344. package/dist/NotificationServicesPushController/mocks/index.mjs +2 -0
  345. package/dist/NotificationServicesPushController/mocks/index.mjs.map +1 -0
  346. package/dist/NotificationServicesPushController/mocks/mockResponse.cjs +48 -0
  347. package/dist/NotificationServicesPushController/mocks/mockResponse.cjs.map +1 -0
  348. package/dist/NotificationServicesPushController/mocks/{mockResponse.d.ts → mockResponse.d.cts} +1 -1
  349. package/dist/NotificationServicesPushController/mocks/mockResponse.d.cts.map +1 -0
  350. package/dist/NotificationServicesPushController/mocks/mockResponse.d.mts +22 -0
  351. package/dist/NotificationServicesPushController/mocks/mockResponse.d.mts.map +1 -0
  352. package/dist/NotificationServicesPushController/mocks/{mockResponse.js → mockResponse.mjs} +2 -2
  353. package/dist/NotificationServicesPushController/mocks/mockResponse.mjs.map +1 -0
  354. package/dist/NotificationServicesPushController/services/endpoints.cjs +13 -0
  355. package/dist/NotificationServicesPushController/services/endpoints.cjs.map +1 -0
  356. package/dist/NotificationServicesPushController/services/{endpoints.d.ts → endpoints.d.cts} +1 -1
  357. package/dist/NotificationServicesPushController/services/endpoints.d.cts.map +1 -0
  358. package/dist/NotificationServicesPushController/services/endpoints.d.mts +4 -0
  359. package/dist/NotificationServicesPushController/services/endpoints.d.mts.map +1 -0
  360. package/dist/NotificationServicesPushController/services/{endpoints.js → endpoints.mjs} +1 -1
  361. package/dist/NotificationServicesPushController/services/endpoints.mjs.map +1 -0
  362. package/dist/NotificationServicesPushController/services/services.cjs +133 -0
  363. package/dist/NotificationServicesPushController/services/services.cjs.map +1 -0
  364. package/dist/NotificationServicesPushController/services/{services.d.ts → services.d.cts} +4 -4
  365. package/dist/NotificationServicesPushController/services/services.d.cts.map +1 -0
  366. package/dist/NotificationServicesPushController/services/services.d.mts +90 -0
  367. package/dist/NotificationServicesPushController/services/services.d.mts.map +1 -0
  368. package/dist/NotificationServicesPushController/services/{services.js → services.mjs} +2 -2
  369. package/dist/NotificationServicesPushController/services/services.mjs.map +1 -0
  370. package/dist/NotificationServicesPushController/types/firebase.cjs +3 -0
  371. package/dist/NotificationServicesPushController/types/firebase.cjs.map +1 -0
  372. package/dist/NotificationServicesPushController/types/{firebase.d.ts → firebase.d.cts} +1 -1
  373. package/dist/NotificationServicesPushController/types/firebase.d.cts.map +1 -0
  374. package/dist/NotificationServicesPushController/types/firebase.d.mts +53 -0
  375. package/dist/NotificationServicesPushController/types/firebase.d.mts.map +1 -0
  376. package/dist/NotificationServicesPushController/types/firebase.mjs +2 -0
  377. package/dist/NotificationServicesPushController/types/firebase.mjs.map +1 -0
  378. package/dist/NotificationServicesPushController/types/index.cjs +3 -0
  379. package/dist/NotificationServicesPushController/types/index.cjs.map +1 -0
  380. package/dist/NotificationServicesPushController/types/index.d.cts +4 -0
  381. package/dist/NotificationServicesPushController/types/index.d.cts.map +1 -0
  382. package/dist/NotificationServicesPushController/types/index.d.mts +4 -0
  383. package/dist/NotificationServicesPushController/types/index.d.mts.map +1 -0
  384. package/dist/NotificationServicesPushController/types/index.mjs +2 -0
  385. package/dist/NotificationServicesPushController/types/index.mjs.map +1 -0
  386. package/dist/NotificationServicesPushController/types/push-analytics.cjs +5 -0
  387. package/dist/NotificationServicesPushController/types/push-analytics.cjs.map +1 -0
  388. package/dist/NotificationServicesPushController/types/{push-analytics.d.ts → push-analytics.d.cts} +1 -1
  389. package/dist/NotificationServicesPushController/types/push-analytics.d.cts.map +1 -0
  390. package/dist/NotificationServicesPushController/types/push-analytics.d.mts +18 -0
  391. package/dist/NotificationServicesPushController/types/push-analytics.d.mts.map +1 -0
  392. package/dist/NotificationServicesPushController/types/{push-analytics.js → push-analytics.mjs} +1 -1
  393. package/dist/NotificationServicesPushController/types/push-analytics.mjs.map +1 -0
  394. package/dist/NotificationServicesPushController/types/push-service-interface.cjs +3 -0
  395. package/dist/NotificationServicesPushController/types/push-service-interface.cjs.map +1 -0
  396. package/dist/NotificationServicesPushController/types/{push-service-interface.d.ts → push-service-interface.d.cts} +2 -2
  397. package/dist/NotificationServicesPushController/types/push-service-interface.d.cts.map +1 -0
  398. package/dist/NotificationServicesPushController/types/push-service-interface.d.mts +30 -0
  399. package/dist/NotificationServicesPushController/types/push-service-interface.d.mts.map +1 -0
  400. package/dist/NotificationServicesPushController/types/push-service-interface.mjs +2 -0
  401. package/dist/NotificationServicesPushController/types/push-service-interface.mjs.map +1 -0
  402. package/dist/NotificationServicesPushController/utils/get-notification-data.cjs +84 -0
  403. package/dist/NotificationServicesPushController/utils/get-notification-data.cjs.map +1 -0
  404. package/dist/NotificationServicesPushController/utils/{get-notification-data.d.ts → get-notification-data.d.cts} +2 -2
  405. package/dist/NotificationServicesPushController/utils/get-notification-data.d.cts.map +1 -0
  406. package/dist/NotificationServicesPushController/utils/get-notification-data.d.mts +42 -0
  407. package/dist/NotificationServicesPushController/utils/get-notification-data.d.mts.map +1 -0
  408. package/dist/NotificationServicesPushController/utils/{get-notification-data.js → get-notification-data.mjs} +2 -2
  409. package/dist/NotificationServicesPushController/utils/get-notification-data.mjs.map +1 -0
  410. package/dist/NotificationServicesPushController/utils/get-notification-message.cjs +171 -0
  411. package/dist/NotificationServicesPushController/utils/get-notification-message.cjs.map +1 -0
  412. package/dist/NotificationServicesPushController/utils/{get-notification-message.d.ts → get-notification-message.d.cts} +3 -3
  413. package/dist/NotificationServicesPushController/utils/get-notification-message.d.cts.map +1 -0
  414. package/dist/NotificationServicesPushController/utils/get-notification-message.d.mts +62 -0
  415. package/dist/NotificationServicesPushController/utils/get-notification-message.d.mts.map +1 -0
  416. package/dist/NotificationServicesPushController/utils/{get-notification-message.js → get-notification-message.mjs} +2 -2
  417. package/dist/NotificationServicesPushController/utils/get-notification-message.mjs.map +1 -0
  418. package/dist/NotificationServicesPushController/utils/index.cjs +20 -0
  419. package/dist/NotificationServicesPushController/utils/index.cjs.map +1 -0
  420. package/dist/NotificationServicesPushController/utils/index.d.cts +4 -0
  421. package/dist/NotificationServicesPushController/utils/index.d.cts.map +1 -0
  422. package/dist/NotificationServicesPushController/utils/index.d.mts +4 -0
  423. package/dist/NotificationServicesPushController/utils/index.d.mts.map +1 -0
  424. package/dist/NotificationServicesPushController/utils/index.mjs +4 -0
  425. package/dist/NotificationServicesPushController/utils/index.mjs.map +1 -0
  426. package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.cjs +26 -0
  427. package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.cjs.map +1 -0
  428. package/dist/NotificationServicesPushController/utils/{to-push-analytics-payload.d.ts → to-push-analytics-payload.d.cts} +2 -2
  429. package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.d.cts.map +1 -0
  430. package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.d.mts +12 -0
  431. package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.d.mts.map +1 -0
  432. package/dist/NotificationServicesPushController/utils/{to-push-analytics-payload.js → to-push-analytics-payload.mjs} +1 -1
  433. package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.mjs.map +1 -0
  434. package/dist/NotificationServicesPushController/web/index.cjs +8 -0
  435. package/dist/NotificationServicesPushController/web/index.cjs.map +1 -0
  436. package/dist/NotificationServicesPushController/web/index.d.cts +2 -0
  437. package/dist/NotificationServicesPushController/web/index.d.cts.map +1 -0
  438. package/dist/NotificationServicesPushController/web/index.d.mts +2 -0
  439. package/dist/NotificationServicesPushController/web/index.d.mts.map +1 -0
  440. package/dist/NotificationServicesPushController/web/index.mjs +2 -0
  441. package/dist/NotificationServicesPushController/web/index.mjs.map +1 -0
  442. package/dist/NotificationServicesPushController/web/push-utils.cjs +169 -0
  443. package/dist/NotificationServicesPushController/web/push-utils.cjs.map +1 -0
  444. package/dist/NotificationServicesPushController/web/{push-utils.d.ts → push-utils.d.cts} +5 -4
  445. package/dist/NotificationServicesPushController/web/push-utils.d.cts.map +1 -0
  446. package/dist/NotificationServicesPushController/web/push-utils.d.mts +37 -0
  447. package/dist/NotificationServicesPushController/web/push-utils.d.mts.map +1 -0
  448. package/dist/NotificationServicesPushController/web/{push-utils.js → push-utils.mjs} +13 -6
  449. package/dist/NotificationServicesPushController/web/push-utils.mjs.map +1 -0
  450. package/dist/index.cjs +34 -0
  451. package/dist/index.cjs.map +1 -0
  452. package/dist/index.d.cts +4 -0
  453. package/dist/index.d.cts.map +1 -0
  454. package/dist/index.d.mts +4 -0
  455. package/dist/index.d.mts.map +1 -0
  456. package/dist/index.mjs +4 -0
  457. package/dist/index.mjs.map +1 -0
  458. package/dist/shared/index.cjs +20 -0
  459. package/dist/shared/index.cjs.map +1 -0
  460. package/dist/shared/index.d.cts +4 -0
  461. package/dist/shared/index.d.cts.map +1 -0
  462. package/dist/shared/index.d.mts +4 -0
  463. package/dist/shared/index.d.mts.map +1 -0
  464. package/dist/shared/index.mjs +4 -0
  465. package/dist/shared/index.mjs.map +1 -0
  466. package/dist/shared/is-onchain-notification.cjs +15 -0
  467. package/dist/shared/is-onchain-notification.cjs.map +1 -0
  468. package/dist/shared/{is-onchain-notification.d.ts → is-onchain-notification.d.cts} +2 -2
  469. package/dist/shared/is-onchain-notification.d.cts.map +1 -0
  470. package/dist/shared/is-onchain-notification.d.mts +9 -0
  471. package/dist/shared/is-onchain-notification.d.mts.map +1 -0
  472. package/dist/shared/{is-onchain-notification.js → is-onchain-notification.mjs} +2 -2
  473. package/dist/shared/is-onchain-notification.mjs.map +1 -0
  474. package/dist/shared/notification-api-type-guards.cjs +24 -0
  475. package/dist/shared/notification-api-type-guards.cjs.map +1 -0
  476. package/dist/shared/{notification-api-type-guards.d.ts → notification-api-type-guards.d.cts} +2 -2
  477. package/dist/shared/notification-api-type-guards.d.cts.map +1 -0
  478. package/dist/shared/notification-api-type-guards.d.mts +16 -0
  479. package/dist/shared/notification-api-type-guards.d.mts.map +1 -0
  480. package/dist/shared/{notification-api-type-guards.js → notification-api-type-guards.mjs} +1 -1
  481. package/dist/shared/notification-api-type-guards.mjs.map +1 -0
  482. package/dist/shared/to-raw-notification.cjs +30 -0
  483. package/dist/shared/to-raw-notification.cjs.map +1 -0
  484. package/dist/shared/{to-raw-notification.d.ts → to-raw-notification.d.cts} +2 -2
  485. package/dist/shared/to-raw-notification.d.cts.map +1 -0
  486. package/dist/shared/to-raw-notification.d.mts +11 -0
  487. package/dist/shared/to-raw-notification.d.mts.map +1 -0
  488. package/dist/shared/{to-raw-notification.js → to-raw-notification.mjs} +3 -3
  489. package/dist/shared/to-raw-notification.mjs.map +1 -0
  490. package/package.json +58 -24
  491. package/dist/NotificationServicesController/NotificationServicesController-method-action-types.d.ts.map +0 -1
  492. package/dist/NotificationServicesController/NotificationServicesController-method-action-types.js.map +0 -1
  493. package/dist/NotificationServicesController/NotificationServicesController.d.ts.map +0 -1
  494. package/dist/NotificationServicesController/NotificationServicesController.js.map +0 -1
  495. package/dist/NotificationServicesController/constants/index.d.ts +0 -2
  496. package/dist/NotificationServicesController/constants/index.d.ts.map +0 -1
  497. package/dist/NotificationServicesController/constants/index.js +0 -2
  498. package/dist/NotificationServicesController/constants/index.js.map +0 -1
  499. package/dist/NotificationServicesController/constants/notification-schema.d.ts.map +0 -1
  500. package/dist/NotificationServicesController/constants/notification-schema.js.map +0 -1
  501. package/dist/NotificationServicesController/index.d.ts.map +0 -1
  502. package/dist/NotificationServicesController/index.js +0 -13
  503. package/dist/NotificationServicesController/index.js.map +0 -1
  504. package/dist/NotificationServicesController/mocks/index.d.ts +0 -5
  505. package/dist/NotificationServicesController/mocks/index.d.ts.map +0 -1
  506. package/dist/NotificationServicesController/mocks/index.js +0 -5
  507. package/dist/NotificationServicesController/mocks/index.js.map +0 -1
  508. package/dist/NotificationServicesController/mocks/mock-feature-announcements.d.ts.map +0 -1
  509. package/dist/NotificationServicesController/mocks/mock-feature-announcements.js.map +0 -1
  510. package/dist/NotificationServicesController/mocks/mock-raw-notifications.d.ts.map +0 -1
  511. package/dist/NotificationServicesController/mocks/mock-raw-notifications.js.map +0 -1
  512. package/dist/NotificationServicesController/mocks/mock-snap-notification.d.ts.map +0 -1
  513. package/dist/NotificationServicesController/mocks/mock-snap-notification.js.map +0 -1
  514. package/dist/NotificationServicesController/mocks/mockResponses.d.ts.map +0 -1
  515. package/dist/NotificationServicesController/mocks/mockResponses.js.map +0 -1
  516. package/dist/NotificationServicesController/processors/index.d.ts +0 -4
  517. package/dist/NotificationServicesController/processors/index.d.ts.map +0 -1
  518. package/dist/NotificationServicesController/processors/index.js +0 -4
  519. package/dist/NotificationServicesController/processors/index.js.map +0 -1
  520. package/dist/NotificationServicesController/processors/process-api-notifications.d.ts.map +0 -1
  521. package/dist/NotificationServicesController/processors/process-api-notifications.js.map +0 -1
  522. package/dist/NotificationServicesController/processors/process-feature-announcement.d.ts.map +0 -1
  523. package/dist/NotificationServicesController/processors/process-feature-announcement.js.map +0 -1
  524. package/dist/NotificationServicesController/processors/process-notifications.d.ts.map +0 -1
  525. package/dist/NotificationServicesController/processors/process-notifications.js.map +0 -1
  526. package/dist/NotificationServicesController/processors/process-snap-notifications.d.ts.map +0 -1
  527. package/dist/NotificationServicesController/processors/process-snap-notifications.js.map +0 -1
  528. package/dist/NotificationServicesController/services/api-notifications.d.ts.map +0 -1
  529. package/dist/NotificationServicesController/services/api-notifications.js.map +0 -1
  530. package/dist/NotificationServicesController/services/feature-announcements.d.ts.map +0 -1
  531. package/dist/NotificationServicesController/services/feature-announcements.js.map +0 -1
  532. package/dist/NotificationServicesController/services/notification-config-cache.d.ts.map +0 -1
  533. package/dist/NotificationServicesController/services/notification-config-cache.js.map +0 -1
  534. package/dist/NotificationServicesController/services/perp-notifications.d.ts.map +0 -1
  535. package/dist/NotificationServicesController/services/perp-notifications.js.map +0 -1
  536. package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.d.ts.map +0 -1
  537. package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.js +0 -2
  538. package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.js.map +0 -1
  539. package/dist/NotificationServicesController/types/feature-announcement/index.d.ts +0 -4
  540. package/dist/NotificationServicesController/types/feature-announcement/index.d.ts.map +0 -1
  541. package/dist/NotificationServicesController/types/feature-announcement/index.js +0 -2
  542. package/dist/NotificationServicesController/types/feature-announcement/index.js.map +0 -1
  543. package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.d.ts.map +0 -1
  544. package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.js +0 -2
  545. package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.js.map +0 -1
  546. package/dist/NotificationServicesController/types/feature-announcement/type-links.d.ts.map +0 -1
  547. package/dist/NotificationServicesController/types/feature-announcement/type-links.js +0 -2
  548. package/dist/NotificationServicesController/types/feature-announcement/type-links.js.map +0 -1
  549. package/dist/NotificationServicesController/types/index.d.ts +0 -6
  550. package/dist/NotificationServicesController/types/index.d.ts.map +0 -1
  551. package/dist/NotificationServicesController/types/index.js +0 -2
  552. package/dist/NotificationServicesController/types/index.js.map +0 -1
  553. package/dist/NotificationServicesController/types/notification/index.d.ts +0 -2
  554. package/dist/NotificationServicesController/types/notification/index.d.ts.map +0 -1
  555. package/dist/NotificationServicesController/types/notification/index.js +0 -2
  556. package/dist/NotificationServicesController/types/notification/index.js.map +0 -1
  557. package/dist/NotificationServicesController/types/notification/notification.d.ts.map +0 -1
  558. package/dist/NotificationServicesController/types/notification/notification.js +0 -2
  559. package/dist/NotificationServicesController/types/notification/notification.js.map +0 -1
  560. package/dist/NotificationServicesController/types/notification-api/index.d.ts +0 -3
  561. package/dist/NotificationServicesController/types/notification-api/index.d.ts.map +0 -1
  562. package/dist/NotificationServicesController/types/notification-api/index.js +0 -2
  563. package/dist/NotificationServicesController/types/notification-api/index.js.map +0 -1
  564. package/dist/NotificationServicesController/types/notification-api/notification-api.d.ts.map +0 -1
  565. package/dist/NotificationServicesController/types/notification-api/notification-api.js +0 -2
  566. package/dist/NotificationServicesController/types/notification-api/notification-api.js.map +0 -1
  567. package/dist/NotificationServicesController/types/notification-api/schema.d.ts.map +0 -1
  568. package/dist/NotificationServicesController/types/notification-api/schema.js.map +0 -1
  569. package/dist/NotificationServicesController/types/perps/index.d.ts +0 -2
  570. package/dist/NotificationServicesController/types/perps/index.d.ts.map +0 -1
  571. package/dist/NotificationServicesController/types/perps/index.js +0 -2
  572. package/dist/NotificationServicesController/types/perps/index.js.map +0 -1
  573. package/dist/NotificationServicesController/types/perps/perp-types.d.ts +0 -3
  574. package/dist/NotificationServicesController/types/perps/perp-types.d.ts.map +0 -1
  575. package/dist/NotificationServicesController/types/perps/perp-types.js +0 -2
  576. package/dist/NotificationServicesController/types/perps/perp-types.js.map +0 -1
  577. package/dist/NotificationServicesController/types/perps/schema.d.ts.map +0 -1
  578. package/dist/NotificationServicesController/types/perps/schema.js.map +0 -1
  579. package/dist/NotificationServicesController/types/snaps/index.d.ts +0 -2
  580. package/dist/NotificationServicesController/types/snaps/index.d.ts.map +0 -1
  581. package/dist/NotificationServicesController/types/snaps/index.js +0 -2
  582. package/dist/NotificationServicesController/types/snaps/index.js.map +0 -1
  583. package/dist/NotificationServicesController/types/snaps/snaps.d.ts.map +0 -1
  584. package/dist/NotificationServicesController/types/snaps/snaps.js +0 -2
  585. package/dist/NotificationServicesController/types/snaps/snaps.js.map +0 -1
  586. package/dist/NotificationServicesController/types/type-utils.d.ts.map +0 -1
  587. package/dist/NotificationServicesController/types/type-utils.js +0 -2
  588. package/dist/NotificationServicesController/types/type-utils.js.map +0 -1
  589. package/dist/NotificationServicesController/utils/get-notification-subtype.d.ts.map +0 -1
  590. package/dist/NotificationServicesController/utils/get-notification-subtype.js.map +0 -1
  591. package/dist/NotificationServicesController/utils/isVersionInBounds.d.ts.map +0 -1
  592. package/dist/NotificationServicesController/utils/isVersionInBounds.js.map +0 -1
  593. package/dist/NotificationServicesController/utils/should-auto-expire.d.ts.map +0 -1
  594. package/dist/NotificationServicesController/utils/should-auto-expire.js.map +0 -1
  595. package/dist/NotificationServicesController/utils/utils.d.ts.map +0 -1
  596. package/dist/NotificationServicesController/utils/utils.js.map +0 -1
  597. package/dist/NotificationServicesPushController/NotificationServicesPushController-method-action-types.d.ts.map +0 -1
  598. package/dist/NotificationServicesPushController/NotificationServicesPushController-method-action-types.js.map +0 -1
  599. package/dist/NotificationServicesPushController/NotificationServicesPushController.d.ts.map +0 -1
  600. package/dist/NotificationServicesPushController/NotificationServicesPushController.js.map +0 -1
  601. package/dist/NotificationServicesPushController/index.d.ts.map +0 -1
  602. package/dist/NotificationServicesPushController/index.js +0 -8
  603. package/dist/NotificationServicesPushController/index.js.map +0 -1
  604. package/dist/NotificationServicesPushController/mocks/index.d.ts +0 -2
  605. package/dist/NotificationServicesPushController/mocks/index.d.ts.map +0 -1
  606. package/dist/NotificationServicesPushController/mocks/index.js +0 -2
  607. package/dist/NotificationServicesPushController/mocks/index.js.map +0 -1
  608. package/dist/NotificationServicesPushController/mocks/mockResponse.d.ts.map +0 -1
  609. package/dist/NotificationServicesPushController/mocks/mockResponse.js.map +0 -1
  610. package/dist/NotificationServicesPushController/services/endpoints.d.ts.map +0 -1
  611. package/dist/NotificationServicesPushController/services/endpoints.js.map +0 -1
  612. package/dist/NotificationServicesPushController/services/services.d.ts.map +0 -1
  613. package/dist/NotificationServicesPushController/services/services.js.map +0 -1
  614. package/dist/NotificationServicesPushController/types/firebase.d.ts.map +0 -1
  615. package/dist/NotificationServicesPushController/types/firebase.js +0 -2
  616. package/dist/NotificationServicesPushController/types/firebase.js.map +0 -1
  617. package/dist/NotificationServicesPushController/types/index.d.ts +0 -4
  618. package/dist/NotificationServicesPushController/types/index.d.ts.map +0 -1
  619. package/dist/NotificationServicesPushController/types/index.js +0 -2
  620. package/dist/NotificationServicesPushController/types/index.js.map +0 -1
  621. package/dist/NotificationServicesPushController/types/push-analytics.d.ts.map +0 -1
  622. package/dist/NotificationServicesPushController/types/push-analytics.js.map +0 -1
  623. package/dist/NotificationServicesPushController/types/push-service-interface.d.ts.map +0 -1
  624. package/dist/NotificationServicesPushController/types/push-service-interface.js +0 -2
  625. package/dist/NotificationServicesPushController/types/push-service-interface.js.map +0 -1
  626. package/dist/NotificationServicesPushController/utils/get-notification-data.d.ts.map +0 -1
  627. package/dist/NotificationServicesPushController/utils/get-notification-data.js.map +0 -1
  628. package/dist/NotificationServicesPushController/utils/get-notification-message.d.ts.map +0 -1
  629. package/dist/NotificationServicesPushController/utils/get-notification-message.js.map +0 -1
  630. package/dist/NotificationServicesPushController/utils/index.d.ts +0 -4
  631. package/dist/NotificationServicesPushController/utils/index.d.ts.map +0 -1
  632. package/dist/NotificationServicesPushController/utils/index.js +0 -4
  633. package/dist/NotificationServicesPushController/utils/index.js.map +0 -1
  634. package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.d.ts.map +0 -1
  635. package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.js.map +0 -1
  636. package/dist/NotificationServicesPushController/web/index.d.ts +0 -2
  637. package/dist/NotificationServicesPushController/web/index.d.ts.map +0 -1
  638. package/dist/NotificationServicesPushController/web/index.js +0 -2
  639. package/dist/NotificationServicesPushController/web/index.js.map +0 -1
  640. package/dist/NotificationServicesPushController/web/push-utils.d.ts.map +0 -1
  641. package/dist/NotificationServicesPushController/web/push-utils.js.map +0 -1
  642. package/dist/index.d.ts +0 -4
  643. package/dist/index.d.ts.map +0 -1
  644. package/dist/index.js +0 -4
  645. package/dist/index.js.map +0 -1
  646. package/dist/shared/index.d.ts +0 -4
  647. package/dist/shared/index.d.ts.map +0 -1
  648. package/dist/shared/index.js +0 -4
  649. package/dist/shared/index.js.map +0 -1
  650. package/dist/shared/is-onchain-notification.d.ts.map +0 -1
  651. package/dist/shared/is-onchain-notification.js.map +0 -1
  652. package/dist/shared/notification-api-type-guards.d.ts.map +0 -1
  653. package/dist/shared/notification-api-type-guards.js.map +0 -1
  654. package/dist/shared/to-raw-notification.d.ts.map +0 -1
  655. package/dist/shared/to-raw-notification.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/NotificationServicesController/types/notification-api/schema.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,2EAA2E;AAC3E,yDAAyD","sourcesContent":["/* eslint-disable jsdoc/tag-lines */\n// Auto-generated from OpenAPI spec - naming follows API schema conventions\n/* eslint-disable @typescript-eslint/naming-convention */\n\n/**\n * This file was auto-generated by openapi-typescript.\n * Do not make direct changes to the file.\n * Script: `npx openapi-typescript <PATH_TO_API_SPEC> -o ./schema.ts`\n */\n\nexport type paths = {\n '/api/v4/notifications': {\n parameters: {\n query?: never;\n header?: never;\n path?: never;\n cookie?: never;\n };\n get?: never;\n put?: never;\n /**\n * List both platform and on-chain notifications for a certain user/address(es)\n * @description Same behaviour as /api/v3/notifications, but the returned notification_type and notification_subtype are taken directly from the producer-set database fields: platform notifications expose platform_notifications.notification_type / notification_subtype, while on-chain notifications expose the constant \"wallet_activity\" as notification_type and notifications_part.kind as notification_subtype. Clients should distinguish the two shapes structurally (presence of \"payload\" for on-chain vs \"template\" for platform).\n */\n post: {\n parameters: {\n query?: never;\n header?: never;\n path?: never;\n cookie?: never;\n };\n requestBody: {\n content: {\n 'application/json': components['schemas']['NotificationInputV3'];\n };\n };\n responses: {\n /** @description Notifications listed successfully */\n 200: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n 'application/json': components['schemas']['NotificationOutputV4'];\n };\n };\n /** @description Bad request */\n 400: {\n headers: {\n [name: string]: unknown;\n };\n content?: never;\n };\n /** @description Internal server error */\n 500: {\n headers: {\n [name: string]: unknown;\n };\n content?: never;\n };\n };\n };\n delete?: never;\n options?: never;\n head?: never;\n patch?: never;\n trace?: never;\n };\n '/api/v4/notifications/mark-as-read': {\n parameters: {\n query?: never;\n header?: never;\n path?: never;\n cookie?: never;\n };\n get?: never;\n put?: never;\n /** Mark notifications as read */\n post: {\n parameters: {\n query?: never;\n header?: never;\n path?: never;\n cookie?: never;\n };\n requestBody: {\n content: {\n 'application/json': {\n ids?: string[];\n };\n };\n };\n responses: {\n /** @description Successfully marked notifications as read */\n 200: {\n headers: {\n [name: string]: unknown;\n };\n content?: never;\n };\n };\n };\n delete?: never;\n options?: never;\n head?: never;\n patch?: never;\n trace?: never;\n };\n '/api/v3/notifications': {\n parameters: {\n query?: never;\n header?: never;\n path?: never;\n cookie?: never;\n };\n get?: never;\n put?: never;\n /** List both platform and on-chain notifications for a certain user/address(es) */\n post: {\n parameters: {\n query?: never;\n header?: never;\n path?: never;\n cookie?: never;\n };\n requestBody: {\n content: {\n 'application/json': components['schemas']['NotificationInputV3'];\n };\n };\n responses: {\n /** @description Notifications listed successfully */\n 200: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n 'application/json': components['schemas']['NotificationOutputV3'];\n };\n };\n /** @description Bad request */\n 400: {\n headers: {\n [name: string]: unknown;\n };\n content?: never;\n };\n /** @description Internal server error */\n 500: {\n headers: {\n [name: string]: unknown;\n };\n content?: never;\n };\n };\n };\n delete?: never;\n options?: never;\n head?: never;\n patch?: never;\n trace?: never;\n };\n '/api/v3/notifications/mark-as-read': {\n parameters: {\n query?: never;\n header?: never;\n path?: never;\n cookie?: never;\n };\n get?: never;\n put?: never;\n /** Mark notifications as read */\n post: {\n parameters: {\n query?: never;\n header?: never;\n path?: never;\n cookie?: never;\n };\n requestBody: {\n content: {\n 'application/json': {\n ids?: string[];\n };\n };\n };\n responses: {\n /** @description Successfully marked notifications as read */\n 200: {\n headers: {\n [name: string]: unknown;\n };\n content?: never;\n };\n };\n };\n delete?: never;\n options?: never;\n head?: never;\n patch?: never;\n trace?: never;\n };\n '/api/v2/notifications': {\n parameters: {\n query?: never;\n header?: never;\n path?: never;\n cookie?: never;\n };\n get?: never;\n put?: never;\n /** List all notifications for a certain user/address(es) */\n post: {\n parameters: {\n query?: never;\n header?: never;\n path?: never;\n cookie?: never;\n };\n requestBody: {\n content: {\n 'application/json': components['schemas']['NotificationInput'][];\n };\n };\n responses: {\n /** @description Notifications listed successfully */\n 200: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n 'application/json': components['schemas']['WalletNotification'][];\n };\n };\n /** @description Bad request */\n 400: {\n headers: {\n [name: string]: unknown;\n };\n content?: never;\n };\n /** @description Internal server error */\n 500: {\n headers: {\n [name: string]: unknown;\n };\n content?: never;\n };\n };\n };\n delete?: never;\n options?: never;\n head?: never;\n patch?: never;\n trace?: never;\n };\n '/api/v2/notifications/mark-as-read': {\n parameters: {\n query?: never;\n header?: never;\n path?: never;\n cookie?: never;\n };\n get?: never;\n put?: never;\n /** Mark notifications as read */\n post: {\n parameters: {\n query?: never;\n header?: never;\n path?: never;\n cookie?: never;\n };\n requestBody: {\n content: {\n 'application/json': {\n ids?: string[];\n };\n };\n };\n responses: {\n /** @description Successfully marked notifications as read */\n 200: {\n headers: {\n [name: string]: unknown;\n };\n content?: never;\n };\n };\n };\n delete?: never;\n options?: never;\n head?: never;\n patch?: never;\n trace?: never;\n };\n '/api/v1/notifications': {\n parameters: {\n query?: never;\n header?: never;\n path?: never;\n cookie?: never;\n };\n get?: never;\n put?: never;\n /** List all notifications ordered by most recent */\n post: {\n parameters: {\n query?: {\n /** @description Page number for pagination */\n page?: number;\n /** @description Number of notifications per page for pagination */\n per_page?: number;\n };\n header?: never;\n path?: never;\n cookie?: never;\n };\n requestBody?: {\n content: {\n 'application/json': {\n trigger_ids: string[];\n chain_ids?: number[];\n kinds?: string[];\n unread?: boolean;\n };\n };\n };\n responses: {\n /** @description Successfully fetched a list of notifications */\n 200: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n 'application/json': components['schemas']['WalletNotification'][];\n };\n };\n };\n };\n delete?: never;\n options?: never;\n head?: never;\n patch?: never;\n trace?: never;\n };\n '/api/v1/notifications/mark-as-read': {\n parameters: {\n query?: never;\n header?: never;\n path?: never;\n cookie?: never;\n };\n get?: never;\n put?: never;\n /** Mark notifications as read */\n post: {\n parameters: {\n query?: never;\n header?: never;\n path?: never;\n cookie?: never;\n };\n requestBody: {\n content: {\n 'application/json': {\n ids?: string[];\n };\n };\n };\n responses: {\n /** @description Successfully marked notifications as read */\n 200: {\n headers: {\n [name: string]: unknown;\n };\n content?: never;\n };\n };\n };\n delete?: never;\n options?: never;\n head?: never;\n patch?: never;\n trace?: never;\n };\n};\nexport type webhooks = Record<string, never>;\nexport type components = {\n schemas: {\n /**\n * @example mobile\n * @enum {string}\n */\n AppPlatform: 'portfolio' | 'extension' | 'mobile';\n NotificationInputV3: {\n /** @example en-US */\n locale: string;\n platform: components['schemas']['AppPlatform'];\n addresses: string[];\n };\n NotificationOutputV3: (\n | components['schemas']['PlatformNotification']\n | components['schemas']['OnChainNotification']\n )[];\n PlatformNotification: {\n /**\n * Format: uuid\n * @example 3fa85f64-5717-4562-b3fc-2c963f66afa6\n */\n id: string;\n /** @enum {string} */\n notification_type: 'platform';\n /** @example position_liquidated */\n notification_subtype: string;\n /** @example false */\n unread: boolean;\n template: components['schemas']['LocalizedNotification'];\n /**\n * Format: date-time\n * @example 2025-10-09T09:45:34.202Z\n */\n created_at: string;\n };\n LocalizedNotification: {\n image_url: string;\n cta?: components['schemas']['LocalizedNotificationCTA'];\n title: string;\n body: string;\n };\n LocalizedNotificationCTA: {\n content: string;\n link: string;\n };\n OnChainNotification: {\n /**\n * Format: uuid\n * @example 3fa85f64-5717-4562-b3fc-2c963f66afa6\n */\n id: string;\n /** @enum {string} */\n notification_type: 'on-chain';\n /** @example false */\n unread: boolean;\n /**\n * Format: date-time\n * @example 2025-10-09T09:45:34.202Z\n */\n created_at: string;\n payload: components['schemas']['OnChainPayload'];\n };\n OnChainPayload: {\n /** @example 1 */\n chain_id: number;\n /** @example 17485840 */\n block_number: number;\n block_timestamp: string;\n /** @example 0x881D40237659C251811CEC9c364ef91dC08D300C */\n tx_hash: string;\n address: string;\n network: components['schemas']['NetworkMetadata'];\n data?:\n | components['schemas']['Data_MetamaskSwapCompleted']\n | components['schemas']['Data_LidoStakeReadyToBeWithdrawn']\n | components['schemas']['Data_LidoStakeCompleted']\n | components['schemas']['Data_LidoWithdrawalRequested']\n | components['schemas']['Data_LidoWithdrawalCompleted']\n | components['schemas']['Data_RocketPoolStakeCompleted']\n | components['schemas']['Data_RocketPoolUnstakeCompleted']\n | components['schemas']['Data_ETHSent']\n | components['schemas']['Data_ETHReceived']\n | components['schemas']['Data_ERC20Sent']\n | components['schemas']['Data_ERC20Received']\n | components['schemas']['Data_ERC721Sent']\n | components['schemas']['Data_ERC721Received']\n | components['schemas']['Data_ERC1155Sent']\n | components['schemas']['Data_ERC1155Received'];\n };\n /** @description A heterogeneous list of platform and on-chain notifications. The two shapes are discriminated by `notification_type`: a value of \"wallet_activity\" identifies an OnChainNotificationV4, any other value identifies a PlatformNotificationV4. \"wallet_activity\" is a reserved value and MUST NOT be used as a producer-set platform notification_type. (This cannot be modelled as a formal OpenAPI discriminator because the platform notification_type set is open-ended.) */\n NotificationOutputV4: (\n | components['schemas']['PlatformNotificationV4']\n | components['schemas']['OnChainNotificationV4']\n )[];\n PlatformNotificationV4: {\n /**\n * Format: uuid\n * @example 3fa85f64-5717-4562-b3fc-2c963f66afa6\n */\n id: string;\n /**\n * @description Producer-set platform_notifications.notification_type value.\n * @example perps\n */\n notification_type: string;\n /**\n * @description Producer-set platform_notifications.notification_subtype value.\n * @example position_liquidated\n */\n notification_subtype: string;\n /** @example false */\n unread: boolean;\n template: components['schemas']['LocalizedNotification'];\n /**\n * Format: date-time\n * @example 2025-10-09T09:45:34.202Z\n */\n created_at: string;\n };\n OnChainNotificationV4: {\n /**\n * Format: uuid\n * @example 3fa85f64-5717-4562-b3fc-2c963f66afa6\n */\n id: string;\n /** @enum {string} */\n notification_type: 'wallet_activity';\n /**\n * @description notifications_part.kind value.\n * @example metamask_swap_completed\n */\n notification_subtype: string;\n /** @example false */\n unread: boolean;\n /**\n * Format: date-time\n * @example 2025-10-09T09:45:34.202Z\n */\n created_at: string;\n payload: components['schemas']['OnChainPayload'];\n };\n NotificationInput: {\n /** Format: address */\n address: string;\n };\n WalletNotification: {\n /** Format: uuid */\n id: string;\n /** Format: uuid */\n trigger_id: string;\n /** @example 1 */\n chain_id: number;\n /** @example 17485840 */\n block_number: number;\n block_timestamp: string;\n /**\n * Format: address\n * @example 0x881D40237659C251811CEC9c364ef91dC08D300C\n */\n tx_hash: string;\n /** @example false */\n unread: boolean;\n /** Format: date-time */\n created_at: string;\n /** Format: address */\n address: string;\n data?:\n | components['schemas']['Data_MetamaskSwapCompleted']\n | components['schemas']['Data_LidoStakeReadyToBeWithdrawn']\n | components['schemas']['Data_LidoStakeCompleted']\n | components['schemas']['Data_LidoWithdrawalRequested']\n | components['schemas']['Data_LidoWithdrawalCompleted']\n | components['schemas']['Data_RocketPoolStakeCompleted']\n | components['schemas']['Data_RocketPoolUnstakeCompleted']\n | components['schemas']['Data_ETHSent']\n | components['schemas']['Data_ETHReceived']\n | components['schemas']['Data_ERC20Sent']\n | components['schemas']['Data_ERC20Received']\n | components['schemas']['Data_ERC721Sent']\n | components['schemas']['Data_ERC721Received']\n | components['schemas']['Data_ERC1155Sent']\n | components['schemas']['Data_ERC1155Received'];\n };\n Data_MetamaskSwapCompleted: {\n /** @enum {string} */\n kind: 'metamask_swap_completed';\n network_fee: components['schemas']['NetworkFee'];\n /** Format: decimal */\n rate: string;\n token_in: components['schemas']['Token'];\n token_out: components['schemas']['Token'];\n };\n Data_LidoStakeCompleted: {\n /** @enum {string} */\n kind: 'lido_stake_completed';\n network_fee: components['schemas']['NetworkFee'];\n stake_in: components['schemas']['Stake'];\n stake_out: components['schemas']['Stake'];\n };\n Data_LidoWithdrawalRequested: {\n /** @enum {string} */\n kind: 'lido_withdrawal_requested';\n network_fee: components['schemas']['NetworkFee'];\n stake_in: components['schemas']['Stake'];\n stake_out: components['schemas']['Stake'];\n };\n Data_LidoStakeReadyToBeWithdrawn: {\n /** @enum {string} */\n kind: 'lido_stake_ready_to_be_withdrawn';\n /** Format: decimal */\n request_id: string;\n staked_eth: components['schemas']['Stake'];\n };\n Data_LidoWithdrawalCompleted: {\n /** @enum {string} */\n kind: 'lido_withdrawal_completed';\n network_fee: components['schemas']['NetworkFee'];\n stake_in: components['schemas']['Stake'];\n stake_out: components['schemas']['Stake'];\n };\n Data_RocketPoolStakeCompleted: {\n /** @enum {string} */\n kind: 'rocketpool_stake_completed';\n network_fee: components['schemas']['NetworkFee'];\n stake_in: components['schemas']['Stake'];\n stake_out: components['schemas']['Stake'];\n };\n Data_RocketPoolUnstakeCompleted: {\n /** @enum {string} */\n kind: 'rocketpool_unstake_completed';\n network_fee: components['schemas']['NetworkFee'];\n stake_in: components['schemas']['Stake'];\n stake_out: components['schemas']['Stake'];\n };\n Data_ETHSent: {\n /** @enum {string} */\n kind: 'eth_sent';\n network_fee: components['schemas']['NetworkFee'];\n /** Format: address */\n from: string;\n /** Format: address */\n to: string;\n amount: {\n /** Format: decimal */\n usd: string;\n /** Format: decimal */\n eth: string;\n };\n };\n Data_ETHReceived: {\n /** @enum {string} */\n kind: 'eth_received';\n network_fee: components['schemas']['NetworkFee'];\n /** Format: address */\n from: string;\n /** Format: address */\n to: string;\n amount: {\n /** Format: decimal */\n usd: string;\n /** Format: decimal */\n eth: string;\n };\n };\n Data_ERC20Sent: {\n /** @enum {string} */\n kind: 'erc20_sent';\n network_fee: components['schemas']['NetworkFee'];\n /** Format: address */\n from: string;\n /** Format: address */\n to: string;\n token: components['schemas']['Token'];\n };\n Data_ERC20Received: {\n /** @enum {string} */\n kind: 'erc20_received';\n network_fee: components['schemas']['NetworkFee'];\n /** Format: address */\n from: string;\n /** Format: address */\n to: string;\n token: components['schemas']['Token'];\n };\n Data_ERC721Sent: {\n /** @enum {string} */\n kind: 'erc721_sent';\n network_fee: components['schemas']['NetworkFee'];\n /** Format: address */\n from: string;\n /** Format: address */\n to: string;\n nft: components['schemas']['NFT'];\n };\n Data_ERC721Received: {\n /** @enum {string} */\n kind: 'erc721_received';\n network_fee: components['schemas']['NetworkFee'];\n /** Format: address */\n from: string;\n /** Format: address */\n to: string;\n nft: components['schemas']['NFT'];\n };\n Data_ERC1155Sent: {\n /** @enum {string} */\n kind: 'erc1155_sent';\n network_fee: components['schemas']['NetworkFee'];\n /** Format: address */\n from: string;\n /** Format: address */\n to: string;\n nft?: components['schemas']['NFT'];\n };\n Data_ERC1155Received: {\n /** @enum {string} */\n kind: 'erc1155_received';\n network_fee: components['schemas']['NetworkFee'];\n /** Format: address */\n from: string;\n /** Format: address */\n to: string;\n nft?: components['schemas']['NFT'];\n };\n NetworkFee: {\n /** Format: decimal */\n gas_price: string;\n /** Format: decimal */\n native_token_price_in_usd: string;\n };\n Token: {\n /** Format: address */\n address: string;\n symbol: string;\n name: string;\n /** Format: decimal */\n amount: string;\n /** Format: int32 */\n decimals: string;\n /** Format: uri */\n image: string;\n /** Format: decimal */\n usd: string;\n };\n NFT: {\n name: string;\n token_id: string;\n /** Format: uri */\n image: string;\n collection: {\n /** Format: address */\n address: string;\n name: string;\n symbol: string;\n /** Format: uri */\n image: string;\n };\n };\n Stake: {\n /** Format: address */\n address: string;\n symbol: string;\n name: string;\n /** Format: decimal */\n amount: string;\n /** Format: int32 */\n decimals: string;\n /** Format: uri */\n image: string;\n /** Format: decimal */\n usd: string;\n };\n BlockExplorer: {\n /**\n * Format: uri\n * @example https://etherscan.io\n */\n url: string;\n /** @example Etherscan */\n name: string;\n };\n NetworkMetadata: {\n /**\n * @description Human-readable network name\n * @example Ethereum\n */\n name: string;\n /**\n * @description Native token symbol\n * @example ETH\n */\n native_symbol: string;\n block_explorer: components['schemas']['BlockExplorer'];\n };\n };\n responses: never;\n parameters: never;\n requestBodies: never;\n headers: never;\n pathItems: never;\n};\nexport type $defs = Record<string, never>;\nexport type operations = Record<string, never>;\n"]}
@@ -1,2 +0,0 @@
1
- export type * from './perp-types.js';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/NotificationServicesController/types/perps/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,iBAAiB,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/NotificationServicesController/types/perps/index.ts"],"names":[],"mappings":"","sourcesContent":["export type * from './perp-types.js';\n"]}
@@ -1,3 +0,0 @@
1
- import type { components } from './schema.js';
2
- export type OrderInput = components['schemas']['OrderInput'];
3
- //# sourceMappingURL=perp-types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"perp-types.d.ts","sourceRoot":"","sources":["../../../../src/NotificationServicesController/types/perps/perp-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,YAAY,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=perp-types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"perp-types.js","sourceRoot":"","sources":["../../../../src/NotificationServicesController/types/perps/perp-types.ts"],"names":[],"mappings":"","sourcesContent":["import type { components } from './schema.js';\n\nexport type OrderInput = components['schemas']['OrderInput'];\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/NotificationServicesController/types/perps/schema.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AAEH;;;GAGG;AAEH,MAAM,MAAM,KAAK,GAAG;IAClB,gBAA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
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/NotificationServicesController/types/perps/schema.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,yGAAyG;AACzG,yDAAyD","sourcesContent":["/* eslint-disable jsdoc/tag-lines */\n// This file is auto-generated from OpenAPI spec and uses snake_case property names from the external API\n/* eslint-disable @typescript-eslint/naming-convention */\n\n/**\n * This file was auto-generated by openapi-typescript.\n * Do not make direct changes to the file.\n * Script: `npx openapi-typescript <PATH TO NOTIFICATION API SPEC> -o ./schema.d.ts`\n */\n\n/**\n * This file was auto-generated by openapi-typescript.\n * Do not make direct changes to the file.\n */\n\nexport type paths = {\n '/api/v1/orders': {\n parameters: {\n query?: never;\n header?: never;\n path?: never;\n cookie?: never;\n };\n get?: never;\n put?: never;\n /**\n * Create a new trading order\n * @description Creates a new trading order for a specific user.\n *\n * Supports optional stop-loss (sl_price) and take-profit (tp_price) levels.\n *\n * **Authentication Required**: This endpoint requires JWT authentication.\n *\n */\n post: {\n parameters: {\n query?: never;\n header?: never;\n path?: never;\n cookie?: never;\n };\n requestBody: {\n content: {\n 'application/json': components['schemas']['OrderInput'];\n };\n };\n responses: {\n /** @description Order successfully created */\n 201: {\n headers: {\n [name: string]: unknown;\n };\n content?: never;\n };\n /** @description Invalid request - malformed JSON or missing required fields */\n 400: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n 'application/json': components['schemas']['Error'];\n };\n };\n /** @description Unauthorized - invalid or missing JWT token */\n 401: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n 'application/json': components['schemas']['Error'];\n };\n };\n /** @description Internal server error */\n 500: {\n headers: {\n [name: string]: unknown;\n };\n content: {\n 'application/json': components['schemas']['Error'];\n };\n };\n };\n };\n delete?: never;\n options?: never;\n head?: never;\n patch?: never;\n trace?: never;\n };\n};\nexport type webhooks = Record<string, never>;\nexport type components = {\n schemas: {\n OrderInput: {\n /**\n * @description User's Ethereum address\n * @example 0x1234567890abcdef1234567890abcdef12345678\n */\n user_id: string;\n /**\n * @description Coin symbol (e.g., BTC, ETH, DOGE)\n * @example BTC\n */\n coin: string;\n /**\n * Format: double\n * @description Optional stop-loss price level\n * @example 45000.5\n */\n sl_price?: number;\n /**\n * Format: double\n * @description Optional take-profit price level\n * @example 55000.75\n */\n tp_price?: number;\n };\n Error: {\n /**\n * @description Human-readable error message\n * @example Invalid request format\n */\n message?: string;\n /**\n * @description Technical error details\n * @example validation error\n */\n error?: string;\n };\n };\n responses: never;\n parameters: never;\n requestBodies: never;\n headers: never;\n pathItems: never;\n};\nexport type $defs = Record<string, never>;\nexport type operations = Record<string, never>;\n"]}
@@ -1,2 +0,0 @@
1
- export type * from './snaps.js';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/NotificationServicesController/types/snaps/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,YAAY,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/NotificationServicesController/types/snaps/index.ts"],"names":[],"mappings":"","sourcesContent":["export type * from './snaps.js';\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"snaps.d.ts","sourceRoot":"","sources":["../../../../src/NotificationServicesController/types/snaps/snaps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAC/B;IACE,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB,GACD;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,YAAY,CAAA;CAAE,CAAC;AAEpE,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,aAAa,CAAC,IAAI,CAAC;IACzB,IAAI,EAAE,uBAAuB,CAAC;IAC9B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=snaps.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"snaps.js","sourceRoot":"","sources":["../../../../src/NotificationServicesController/types/snaps/snaps.ts"],"names":[],"mappings":"","sourcesContent":["import type { TRIGGER_TYPES } from '../../constants/index.js';\n\nexport type ExpandedView = {\n title: string;\n interfaceId: string;\n footerLink?: { href: string; text: string };\n};\n\nexport type RawSnapNotificationData =\n | {\n message: string;\n origin: string;\n }\n | { message: string; origin: string; detailedView: ExpandedView };\n\nexport type RawSnapNotification = {\n type: TRIGGER_TYPES.SNAP;\n data: RawSnapNotificationData;\n readDate: string | null;\n};\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"type-utils.d.ts","sourceRoot":"","sources":["../../../src/NotificationServicesController/types/type-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,OAAO,CAAC,IAAI,IAAI,IAAI,SAAS,IAAI,GACzC;KAAG,CAAC,IAAI,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC;CAAE,GAC9B,KAAK,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=type-utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"type-utils.js","sourceRoot":"","sources":["../../../src/NotificationServicesController/types/type-utils.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Computes and combines intersection types for a more \"prettier\" type (more human readable)\n */\nexport type Compute<Item> = Item extends Item\n ? { [K in keyof Item]: Item[K] }\n : never;\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-notification-subtype.d.ts","sourceRoot":"","sources":["../../../src/NotificationServicesController/utils/get-notification-subtype.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAElF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,sBAAsB,CACpC,YAAY,EAAE,oBAAoB,GACjC,MAAM,CAaR"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-notification-subtype.js","sourceRoot":"","sources":["../../../src/NotificationServicesController/utils/get-notification-subtype.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAGpE;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,sBAAsB,CACpC,YAAkC;IAElC,oDAAoD;IACpD,IAAI,wBAAwB,CAAC,YAAY,CAAC,EAAE,CAAC;QAC3C,OAAO,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;IACxC,CAAC;IAED,sEAAsE;IACtE,IAAI,YAAY,CAAC,IAAI,KAAK,aAAa,CAAC,QAAQ,EAAE,CAAC;QACjD,OAAO,YAAY,CAAC,oBAAoB,CAAC;IAC3C,CAAC;IAED,+DAA+D;IAC/D,OAAO,YAAY,CAAC,IAAI,CAAC;AAC3B,CAAC","sourcesContent":["import { isOnChainRawNotification } from '../../shared/is-onchain-notification.js';\nimport { TRIGGER_TYPES } from '../constants/notification-schema.js';\nimport type { RawNotificationUnion } from '../types/notification/notification.js';\n\n/**\n * Derives the normalised `notification_subtype` for a processed in-app\n * notification. This is the team-owned axis (e.g. `eth_received`) and is\n * always derivable from an `INotification`, so every consumer (both clients)\n * pulls it from one place rather than recomputing a fallback chain.\n *\n * - on-chain: the trigger kind (`payload.data.kind`, e.g. `eth_received`).\n * - platform: the server-set `notification_subtype` from the inbox API.\n * - everything else (snap, feature-announcement): the top-level `type`\n * (`snap` / `features_announcement`).\n *\n * @param notification - a raw or processed notification.\n * @returns the normalised subtype string.\n */\nexport function getNotificationSubtype(\n notification: RawNotificationUnion,\n): string {\n // On-chain: the trigger kind (e.g. `eth_received`).\n if (isOnChainRawNotification(notification)) {\n return notification.payload.data.kind;\n }\n\n // Platform: the server-set `notification_subtype` from the inbox API.\n if (notification.type === TRIGGER_TYPES.PLATFORM) {\n return notification.notification_subtype;\n }\n\n // Fallback (snap, feature-announcement): the top-level `type`.\n return notification.type;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"isVersionInBounds.d.ts","sourceRoot":"","sources":["../../../src/NotificationServicesController/utils/isVersionInBounds.ts"],"names":[],"mappings":"AAEA,KAAK,iBAAiB,GAAG;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,cAAc,EACd,UAAU,EACV,UAAU,GACX,EAAE,iBAAiB,GAAG,OAAO,CAuB7B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"isVersionInBounds.js","sourceRoot":"","sources":["../../../src/NotificationServicesController/utils/isVersionInBounds.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAQhC;;;;;;;;;GASG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAChC,cAAc,EACd,UAAU,EACV,UAAU,GACQ;IAClB,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC;QACH,IAAI,gBAAgB,GAAG,IAAI,CAAC;QAE5B,sEAAsE;QACtE,IAAI,UAAU,EAAE,CAAC;YACf,gBAAgB,GAAG,gBAAgB,IAAI,EAAE,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC;QACxE,CAAC;QAED,mEAAmE;QACnE,IAAI,UAAU,EAAE,CAAC;YACf,gBAAgB,GAAG,gBAAgB,IAAI,EAAE,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC;QACxE,CAAC;QAED,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IAAC,MAAM,CAAC;QACP,uCAAuC;QACvC,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC","sourcesContent":["import { gt, lt } from 'semver';\n\ntype IsVersionInBounds = {\n currentVersion?: string;\n minVersion?: string;\n maxVersion?: string;\n};\n\n/**\n * Checks if a given version is within bounds against a min and max bound\n * Uses semver strings\n *\n * @param params - Object param containing current/min/max versions\n * @param params.currentVersion - (optional) current version of application\n * @param params.minVersion - (optional) exclusive min bounds\n * @param params.maxVersion - (optional) exclusive max bounds\n * @returns boolean is version provided is within bounds\n */\nexport function isVersionInBounds({\n currentVersion,\n minVersion,\n maxVersion,\n}: IsVersionInBounds): boolean {\n if (!currentVersion) {\n return true;\n }\n\n try {\n let showNotification = true;\n\n // Check minimum version: current version must be greater than minimum\n if (minVersion) {\n showNotification = showNotification && gt(currentVersion, minVersion);\n }\n\n // Check maximum version: current version must be less than maximum\n if (maxVersion) {\n showNotification = showNotification && lt(currentVersion, maxVersion);\n }\n\n return showNotification;\n } catch {\n // something went wrong checking bounds\n return false;\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"should-auto-expire.d.ts","sourceRoot":"","sources":["../../../src/NotificationServicesController/utils/should-auto-expire.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB,YAAa,IAAI,KAAG,OAIhD,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"should-auto-expire.js","sourceRoot":"","sources":["../../../src/NotificationServicesController/utils/should-auto-expire.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AACvC,MAAM,QAAQ,GAAG,EAAE,CAAC;AAEpB,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,OAAa,EAAW,EAAE;IACzD,MAAM,gBAAgB,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IACxD,MAAM,gBAAgB,GAAG,gBAAgB,GAAG,UAAU,CAAC;IACvD,OAAO,gBAAgB,IAAI,QAAQ,CAAC;AACtC,CAAC,CAAC","sourcesContent":["const ONE_DAY_MS = 1000 * 60 * 60 * 24;\nconst MAX_DAYS = 30;\n\nexport const shouldAutoExpire = (oldDate: Date): boolean => {\n const differenceInTime = Date.now() - oldDate.getTime();\n const differenceInDays = differenceInTime / ONE_DAY_MS;\n return differenceInDays >= MAX_DAYS;\n};\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/NotificationServicesController/utils/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,wBAAsB,WAAW,CAAC,IAAI,EACpC,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GAAG,QAAQ,EACzB,IAAI,EAAE,IAAI,GACT,OAAO,CAAC,QAAQ,CAAC,CAWnB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/NotificationServicesController/utils/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,WAAmB,EACnB,QAAgB,EAChB,MAAyB,EACzB,IAAU;IAEV,MAAM,OAAO,GAAgB;QAC3B,MAAM;QACN,OAAO,EAAE;YACP,cAAc,EAAE,kBAAkB;YAClC,aAAa,EAAE,UAAU,WAAW,EAAE;SACvC;QACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;KAC3B,CAAC;IAEF,OAAO,MAAM,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACxC,CAAC","sourcesContent":["/**\n * Performs an API call with automatic retries on failure.\n *\n * @param bearerToken - The JSON Web Token for authorization.\n * @param endpoint - The URL of the API endpoint to call.\n * @param method - The HTTP method ('POST' or 'DELETE').\n * @param body - The body of the request. It should be an object that can be serialized to JSON.\n * @returns A Promise that resolves to the response of the fetch request.\n */\nexport async function makeApiCall<Body>(\n bearerToken: string,\n endpoint: string,\n method: 'POST' | 'DELETE',\n body: Body,\n): Promise<Response> {\n const options: RequestInit = {\n method,\n headers: {\n 'Content-Type': 'application/json',\n Authorization: `Bearer ${bearerToken}`,\n },\n body: JSON.stringify(body),\n };\n\n return await fetch(endpoint, options);\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"NotificationServicesPushController-method-action-types.d.ts","sourceRoot":"","sources":["../../src/NotificationServicesPushController/NotificationServicesPushController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,yCAAyC,CAAC;AAElG,MAAM,MAAM,oEAAoE,GAC9E;IACE,IAAI,EAAE,iEAAiE,CAAC;IACxE,OAAO,EAAE,kCAAkC,CAAC,8BAA8B,CAAC,CAAC;CAC7E,CAAC;AAEJ;;;;;;;;;GASG;AACH,MAAM,MAAM,+DAA+D,GAAG;IAC5E,IAAI,EAAE,4DAA4D,CAAC;IACnE,OAAO,EAAE,kCAAkC,CAAC,yBAAyB,CAAC,CAAC;CACxE,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,gEAAgE,GAAG;IAC7E,IAAI,EAAE,6DAA6D,CAAC;IACpE,OAAO,EAAE,kCAAkC,CAAC,0BAA0B,CAAC,CAAC;CACzE,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,gEAAgE,GAAG;IAC7E,IAAI,EAAE,6DAA6D,CAAC;IACpE,OAAO,EAAE,kCAAkC,CAAC,0BAA0B,CAAC,CAAC;CACzE,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,mEAAmE,GAC7E;IACE,IAAI,EAAE,gEAAgE,CAAC;IACvE,OAAO,EAAE,kCAAkC,CAAC,6BAA6B,CAAC,CAAC;CAC5E,CAAC;AAEJ;;;;;;;GAOG;AACH,MAAM,MAAM,sEAAsE,GAChF;IACE,IAAI,EAAE,mEAAmE,CAAC;IAC1E,OAAO,EAAE,kCAAkC,CAAC,gCAAgC,CAAC,CAAC;CAC/E,CAAC;AAEJ;;GAEG;AACH,MAAM,MAAM,+CAA+C,GACvD,oEAAoE,GACpE,+DAA+D,GAC/D,gEAAgE,GAChE,gEAAgE,GAChE,mEAAmE,GACnE,sEAAsE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"NotificationServicesPushController-method-action-types.js","sourceRoot":"","sources":["../../src/NotificationServicesPushController/NotificationServicesPushController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { NotificationServicesPushController } from './NotificationServicesPushController.js';\n\nexport type NotificationServicesPushControllerSubscribeToPushNotificationsAction =\n {\n type: `NotificationServicesPushController:subscribeToPushNotifications`;\n handler: NotificationServicesPushController['subscribeToPushNotifications'];\n };\n\n/**\n * Enables push notifications for the application.\n *\n * This method sets up the necessary infrastructure for handling push notifications by:\n * 1. Registering the service worker to listen for messages.\n * 2. Fetching the Firebase Cloud Messaging (FCM) token from Firebase.\n * 3. Sending the FCM token to the server responsible for sending notifications, to register the device.\n *\n * @param addresses - An array of addresses to enable push notifications for.\n */\nexport type NotificationServicesPushControllerEnablePushNotificationsAction = {\n type: `NotificationServicesPushController:enablePushNotifications`;\n handler: NotificationServicesPushController['enablePushNotifications'];\n};\n\n/**\n * Disables push notifications for the application.\n * This removes the registration token on this device, and ensures we unsubscribe from any listeners\n */\nexport type NotificationServicesPushControllerDisablePushNotificationsAction = {\n type: `NotificationServicesPushController:disablePushNotifications`;\n handler: NotificationServicesPushController['disablePushNotifications'];\n};\n\n/**\n * Adds backend push notification links for the given addresses using the current FCM token.\n * This is used when accounts are added after push notifications have already been enabled,\n * so backend can link the existing device token to the newly added addresses.\n *\n * @param addresses - Addresses that should be linked to push notifications.\n * @returns Whether the add request succeeded.\n */\nexport type NotificationServicesPushControllerAddPushNotificationLinksAction = {\n type: `NotificationServicesPushController:addPushNotificationLinks`;\n handler: NotificationServicesPushController['addPushNotificationLinks'];\n};\n\n/**\n * Deletes backend push notification links for the given addresses on the current platform.\n * This is used when accounts are removed (for example SRP removal), so backend can remove\n * all associated FCM tokens for those address/platform pairs.\n *\n * @param addresses - Addresses that should be unlinked from push notifications.\n * @returns Whether the delete request succeeded.\n */\nexport type NotificationServicesPushControllerDeletePushNotificationLinksAction =\n {\n type: `NotificationServicesPushController:deletePushNotificationLinks`;\n handler: NotificationServicesPushController['deletePushNotificationLinks'];\n };\n\n/**\n * Updates the triggers for push notifications.\n * This method is responsible for updating the server with the new set of addresses that should trigger push notifications.\n * It uses the current FCM token and a BearerToken for authentication.\n *\n * @param addresses - An array of addresses that should trigger push notifications.\n * @deprecated - this is not used anymore and will most likely be removed\n */\nexport type NotificationServicesPushControllerUpdateTriggerPushNotificationsAction =\n {\n type: `NotificationServicesPushController:updateTriggerPushNotifications`;\n handler: NotificationServicesPushController['updateTriggerPushNotifications'];\n };\n\n/**\n * Union of all NotificationServicesPushController action types.\n */\nexport type NotificationServicesPushControllerMethodActions =\n | NotificationServicesPushControllerSubscribeToPushNotificationsAction\n | NotificationServicesPushControllerEnablePushNotificationsAction\n | NotificationServicesPushControllerDisablePushNotificationsAction\n | NotificationServicesPushControllerAddPushNotificationLinksAction\n | NotificationServicesPushControllerDeletePushNotificationLinksAction\n | NotificationServicesPushControllerUpdateTriggerPushNotificationsAction;\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"NotificationServicesPushController.d.ts","sourceRoot":"","sources":["../../src/NotificationServicesPushController/NotificationServicesPushController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAE3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AuB3E;IAED;;;;;;;OAOG;IACU,2BAA2B,CACtC,SAAS,EAAE,MAAM,EAAE,GAClB,OAAO,CAAC,OAAO,CAAC,CAqBlB;IAED;;;;;;;OAOG;IACU,8BAA8B,CACzC,SAAS,EAAE,MAAM,EAAE,GAClB,OAAO,CAAC,IAAI,CAAC,CAsCf;CACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"NotificationServicesPushController.js","sourceRoot":"","sources":["../../src/NotificationServicesPushController/NotificationServicesPushController.ts"],"names":[],"mappings":";;;;;;;;;;;;AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAG3D,OAAO,GAAG,MAAM,UAAU,CAAC;AAK3B,OAAO,EACL,yBAAyB,EACzB,cAAc,EACd,2BAA2B,EAC3B,cAAc,GACf,MAAM,wBAAwB,CAAC;AAOhC,MAAM,cAAc,GAAG,oCAAoC,CAAC;AAQ5D,MAAM,yBAAyB,GAAG;IAChC,8BAA8B;IAC9B,yBAAyB;IACzB,0BAA0B;IAC1B,0BAA0B;IAC1B,gCAAgC;IAChC,6BAA6B;CACrB,CAAC;AA0CX,MAAM,CAAC,MAAM,YAAY,GAA4C;IACnE,aAAa,EAAE,IAAI;IACnB,QAAQ,EAAE,EAAE;IACZ,kBAAkB,EAAE,KAAK;CAC1B,CAAC;AACF,MAAM,QAAQ,GAA2D;IACvE,aAAa,EAAE;QACb,kBAAkB,EAAE,IAAI;QACxB,OAAO,EAAE,IAAI;QACb,sBAAsB,EAAE,IAAI;QAC5B,QAAQ,EAAE,IAAI;KACf;IACD,QAAQ,EAAE;QACR,kBAAkB,EAAE,KAAK;QACzB,OAAO,EAAE,IAAI;QACb,sBAAsB,EAAE,IAAI;QAC5B,QAAQ,EAAE,IAAI;KACf;IACD,kBAAkB,EAAE;QAClB,kBAAkB,EAAE,KAAK;QACzB,OAAO,EAAE,KAAK;QACd,sBAAsB,EAAE,IAAI;QAC5B,QAAQ,EAAE,IAAI;KACf;CACF,CAAC;AAEF,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OAAO,CAAC,QAAQ,CAAC;YAClC,KAAK,CAAC,kBAAkB,GAAG,KAAK,CAAC;QACnC,CAAC,CAAC,CAAC;IACL,CAAC;AACH,CAAC;IAGC,MAAM,aAAa,GAA8B;QAC/C,QAAQ,EAAE,uBAAA,IAAI,kDAAQ,CAAC,QAAQ;QAC/B,MAAM,EAAE,uBAAA,IAAI,kDAAQ,CAAC,SAAS,EAAE,EAAE,IAAI,IAAI;KAC3C,CAAC;IAEF,IAAI,uBAAA,IAAI,kDAAQ,CAAC,EAAE,EAAE,CAAC;QACpB,aAAa,CAAC,EAAE,GAAG,uBAAA,IAAI,kDAAQ,CAAC,EAAE,CAAC;IACrC,CAAC;IAED,IAAI,uBAAA,IAAI,kDAAQ,CAAC,UAAU,EAAE,CAAC;QAC5B,aAAa,CAAC,UAAU,GAAG,uBAAA,IAAI,kDAAQ,CAAC,UAAU,CAAC;IACrD,CAAC;IAED,OAAO,aAAa,CAAC;AACvB,CAAC","sourcesContent":["import type {\n ControllerGetStateAction,\n ControllerStateChangeEvent,\n StateMetadata,\n} from '@metamask/base-controller';\nimport { BaseController } from '@metamask/base-controller';\nimport type { Messenger } from '@metamask/messenger';\nimport type { AuthenticationController } from '@metamask/profile-sync-controller';\nimport log from 'loglevel';\n\nimport type { NotificationServicesPushControllerMethodActions } from './NotificationServicesPushController-method-action-types.js';\nimport type { ENV } from './services/endpoints.js';\nimport type { RegToken } from './services/services.js';\nimport {\n activatePushNotifications,\n deleteLinksAPI,\n deactivatePushNotifications,\n updateLinksAPI,\n} from './services/services.js';\nimport type {\n PushAnalyticsPayload,\n PushNotificationEnv,\n} from './types/index.js';\nimport type { PushService } from './types/push-service-interface.js';\n\nconst controllerName = 'NotificationServicesPushController';\n\nexport type NotificationServicesPushControllerState = {\n isPushEnabled: boolean;\n fcmToken: string;\n isUpdatingFCMToken: boolean;\n};\n\nconst MESSENGER_EXPOSED_METHODS = [\n 'subscribeToPushNotifications',\n 'enablePushNotifications',\n 'addPushNotificationLinks',\n 'disablePushNotifications',\n 'updateTriggerPushNotifications',\n 'deletePushNotificationLinks',\n] as const;\n\nexport type NotificationServicesPushControllerGetStateAction =\n ControllerGetStateAction<\n typeof controllerName,\n NotificationServicesPushControllerState\n >;\n\nexport type Actions =\n | NotificationServicesPushControllerGetStateAction\n | NotificationServicesPushControllerMethodActions;\n\ntype AllowedActions =\n AuthenticationController.AuthenticationControllerGetBearerTokenAction;\n\nexport type NotificationServicesPushControllerStateChangeEvent =\n ControllerStateChangeEvent<\n typeof controllerName,\n NotificationServicesPushControllerState\n >;\n\nexport type NotificationServicesPushControllerOnNewNotificationEvent = {\n type: `${typeof controllerName}:onNewNotifications`;\n payload: [PushAnalyticsPayload];\n};\n\nexport type NotificationServicesPushControllerPushNotificationClickedEvent = {\n type: `${typeof controllerName}:pushNotificationClicked`;\n payload: [PushAnalyticsPayload];\n};\n\nexport type Events =\n | NotificationServicesPushControllerStateChangeEvent\n | NotificationServicesPushControllerOnNewNotificationEvent\n | NotificationServicesPushControllerPushNotificationClickedEvent;\n\nexport type NotificationServicesPushControllerMessenger = Messenger<\n typeof controllerName,\n Actions | AllowedActions,\n Events\n>;\n\nexport const defaultState: NotificationServicesPushControllerState = {\n isPushEnabled: true,\n fcmToken: '',\n isUpdatingFCMToken: false,\n};\nconst metadata: StateMetadata<NotificationServicesPushControllerState> = {\n isPushEnabled: {\n includeInStateLogs: true,\n persist: true,\n includeInDebugSnapshot: true,\n usedInUi: true,\n },\n fcmToken: {\n includeInStateLogs: false,\n persist: true,\n includeInDebugSnapshot: true,\n usedInUi: true,\n },\n isUpdatingFCMToken: {\n includeInStateLogs: false,\n persist: false,\n includeInDebugSnapshot: true,\n usedInUi: true,\n },\n};\n\nconst defaultPushEnv: PushNotificationEnv = {\n apiKey: '',\n authDomain: '',\n storageBucket: '',\n projectId: '',\n messagingSenderId: '',\n appId: '',\n measurementId: '',\n vapidKey: '',\n};\n\nexport type ControllerConfig = {\n /**\n * User locale for server push notifications\n */\n getLocale?: () => string;\n\n /**\n * App or extension version to include when registering push tokens.\n */\n appVersion?: string;\n\n /**\n * Global switch to determine to use push notifications\n * Allows us to control Builds on extension (MV2 vs MV3)\n */\n isPushFeatureEnabled?: boolean;\n\n /**\n * determine the config used for push notification services\n */\n platform: 'extension' | 'mobile';\n\n /**\n * Mobile operating system to include when registering push tokens.\n */\n os?: 'android' | 'ios';\n\n /**\n * Push Service Interface\n * - create reg token\n * - delete reg token\n * - subscribe to push notifications\n */\n pushService: PushService;\n\n env?: ENV;\n};\n\ntype StateCommand =\n | { type: 'enable'; fcmToken: string }\n | { type: 'disable' }\n | { type: 'update'; fcmToken: string };\n\ntype RegistrationTokenMetadata = Pick<\n RegToken,\n 'appVersion' | 'locale' | 'os' | 'platform'\n>;\n\n/**\n * Manages push notifications for the application, including enabling, disabling, and updating triggers for push notifications.\n * This controller integrates with Firebase Cloud Messaging (FCM) to handle the registration and management of push notifications.\n * It is responsible for registering and unregistering the service worker that listens for push notifications,\n * managing the FCM token, and communicating with the server to register or unregister the device for push notifications.\n * Additionally, it provides functionality to update the server with new UUIDs that should trigger push notifications.\n */\nexport class NotificationServicesPushController extends BaseController<\n typeof controllerName,\n NotificationServicesPushControllerState,\n NotificationServicesPushControllerMessenger\n> {\n #pushListenerUnsubscribe: (() => void) | undefined = undefined;\n\n readonly #env: PushNotificationEnv;\n\n readonly #config: ControllerConfig;\n\n constructor({\n messenger,\n state,\n env,\n config,\n }: {\n messenger: NotificationServicesPushControllerMessenger;\n state: NotificationServicesPushControllerState;\n /** Push Environment is only required for extension */\n env?: PushNotificationEnv;\n config: ControllerConfig;\n }) {\n super({\n messenger,\n metadata,\n name: controllerName,\n state: { ...defaultState, ...state },\n });\n\n this.#env = env ?? defaultPushEnv;\n this.#config = config;\n\n this.messenger.registerMethodActionHandlers(\n this,\n MESSENGER_EXPOSED_METHODS,\n );\n\n this.#clearLoadingStates();\n }\n\n #clearLoadingStates(): void {\n this.update((state) => {\n state.isUpdatingFCMToken = false;\n });\n }\n\n async #getAndAssertBearerToken(): Promise<string> {\n const bearerToken = await this.messenger.call(\n 'AuthenticationController:getBearerToken',\n );\n if (!bearerToken) {\n throw new Error('BearerToken token is missing');\n }\n\n return bearerToken;\n }\n\n #updatePushState(command: StateCommand): void {\n if (command.type === 'enable') {\n this.update((state) => {\n state.isPushEnabled = true;\n state.fcmToken = command.fcmToken;\n state.isUpdatingFCMToken = false;\n });\n }\n\n if (command.type === 'disable') {\n this.update((state) => {\n // Note we do not want to clear the old FCM token\n // We can send it as an old token to our backend to cleanup next time turned on\n state.isPushEnabled = false;\n state.isUpdatingFCMToken = false;\n });\n }\n\n if (command.type === 'update') {\n this.update((state) => {\n state.isPushEnabled = true;\n state.fcmToken = command.fcmToken;\n state.isUpdatingFCMToken = false;\n });\n }\n }\n\n #getRegistrationTokenMetadata(): RegistrationTokenMetadata {\n const tokenMetadata: RegistrationTokenMetadata = {\n platform: this.#config.platform,\n locale: this.#config.getLocale?.() ?? 'en',\n };\n\n if (this.#config.os) {\n tokenMetadata.os = this.#config.os;\n }\n\n if (this.#config.appVersion) {\n tokenMetadata.appVersion = this.#config.appVersion;\n }\n\n return tokenMetadata;\n }\n\n public async subscribeToPushNotifications(): Promise<void> {\n if (!this.#config.isPushFeatureEnabled) {\n return;\n }\n\n if (this.#pushListenerUnsubscribe) {\n this.#pushListenerUnsubscribe();\n this.#pushListenerUnsubscribe = undefined;\n }\n\n try {\n this.#pushListenerUnsubscribe =\n (await this.#config.pushService.subscribeToPushNotifications(\n this.#env,\n )) ?? undefined;\n } catch {\n // Do nothing, we are silently failing if push notification registration fails\n }\n }\n\n /**\n * Enables push notifications for the application.\n *\n * This method sets up the necessary infrastructure for handling push notifications by:\n * 1. Registering the service worker to listen for messages.\n * 2. Fetching the Firebase Cloud Messaging (FCM) token from Firebase.\n * 3. Sending the FCM token to the server responsible for sending notifications, to register the device.\n *\n * @param addresses - An array of addresses to enable push notifications for.\n */\n public async enablePushNotifications(addresses: string[]): Promise<void> {\n if (!this.#config.isPushFeatureEnabled) {\n return;\n }\n\n this.update((state) => {\n state.isUpdatingFCMToken = true;\n });\n\n // Handle creating new reg token (if available)\n try {\n const bearerToken = await this.#getAndAssertBearerToken().catch(\n () => null,\n );\n\n // If there is a bearer token, lets try to refresh/create new reg token\n if (bearerToken) {\n // Activate Push Notifications\n const fcmToken = await activatePushNotifications({\n bearerToken,\n addresses,\n env: this.#env,\n createRegToken: this.#config.pushService.createRegToken,\n regToken: {\n ...this.#getRegistrationTokenMetadata(),\n oldToken: this.state.fcmToken,\n },\n controllerEnv: this.#config.env ?? 'prd',\n });\n\n if (fcmToken) {\n this.#updatePushState({ type: 'enable', fcmToken });\n }\n }\n } catch {\n // Do nothing, we are silently failing\n }\n\n // New token created, (re)subscribe to push notifications\n try {\n await this.subscribeToPushNotifications();\n } catch {\n // Do nothing we are silently failing\n }\n\n this.update((state) => {\n state.isUpdatingFCMToken = false;\n });\n }\n\n /**\n * Disables push notifications for the application.\n * This removes the registration token on this device, and ensures we unsubscribe from any listeners\n */\n public async disablePushNotifications(): Promise<void> {\n if (!this.#config.isPushFeatureEnabled) {\n return;\n }\n\n this.update((state) => {\n state.isUpdatingFCMToken = true;\n });\n\n try {\n // Send a request to the server to unregister the token/device\n await deactivatePushNotifications({\n env: this.#env,\n deleteRegToken: this.#config.pushService.deleteRegToken,\n regToken: this.state.fcmToken,\n });\n } catch (error) {\n const errorMessage = `Failed to disable push notifications: ${\n error as string\n }`;\n log.error(errorMessage);\n throw new Error(errorMessage);\n } finally {\n this.update((state) => {\n state.isUpdatingFCMToken = false;\n });\n }\n\n // Unsubscribe from push notifications\n this.#pushListenerUnsubscribe?.();\n\n // Update State\n this.#updatePushState({ type: 'disable' });\n }\n\n /**\n * Adds backend push notification links for the given addresses using the current FCM token.\n * This is used when accounts are added after push notifications have already been enabled,\n * so backend can link the existing device token to the newly added addresses.\n *\n * @param addresses - Addresses that should be linked to push notifications.\n * @returns Whether the add request succeeded.\n */\n public async addPushNotificationLinks(addresses: string[]): Promise<boolean> {\n if (\n !this.#config.isPushFeatureEnabled ||\n addresses.length === 0 ||\n !this.state.fcmToken\n ) {\n return false;\n }\n\n try {\n const bearerToken = await this.#getAndAssertBearerToken();\n return await updateLinksAPI({\n bearerToken,\n addresses,\n regToken: {\n token: this.state.fcmToken,\n ...this.#getRegistrationTokenMetadata(),\n },\n env: this.#config.env ?? 'prd',\n });\n } catch {\n return false;\n }\n }\n\n /**\n * Deletes backend push notification links for the given addresses on the current platform.\n * This is used when accounts are removed (for example SRP removal), so backend can remove\n * all associated FCM tokens for those address/platform pairs.\n *\n * @param addresses - Addresses that should be unlinked from push notifications.\n * @returns Whether the delete request succeeded.\n */\n public async deletePushNotificationLinks(\n addresses: string[],\n ): Promise<boolean> {\n if (\n !this.#config.isPushFeatureEnabled ||\n addresses.length === 0 ||\n !this.state.fcmToken\n ) {\n return false;\n }\n\n try {\n const bearerToken = await this.#getAndAssertBearerToken();\n return await deleteLinksAPI({\n bearerToken,\n addresses,\n platform: this.#config.platform,\n token: this.state.fcmToken,\n env: this.#config.env ?? 'prd',\n });\n } catch {\n return false;\n }\n }\n\n /**\n * Updates the triggers for push notifications.\n * This method is responsible for updating the server with the new set of addresses that should trigger push notifications.\n * It uses the current FCM token and a BearerToken for authentication.\n *\n * @param addresses - An array of addresses that should trigger push notifications.\n * @deprecated - this is not used anymore and will most likely be removed\n */\n public async updateTriggerPushNotifications(\n addresses: string[],\n ): Promise<void> {\n if (!this.#config.isPushFeatureEnabled) {\n return;\n }\n\n this.update((state) => {\n state.isUpdatingFCMToken = true;\n });\n\n try {\n const bearerToken = await this.#getAndAssertBearerToken();\n const fcmToken = await activatePushNotifications({\n bearerToken,\n addresses,\n env: this.#env,\n createRegToken: this.#config.pushService.createRegToken,\n regToken: {\n ...this.#getRegistrationTokenMetadata(),\n oldToken: this.state.fcmToken,\n },\n controllerEnv: this.#config.env ?? 'prd',\n });\n\n // update the state with the new FCM token\n if (fcmToken) {\n this.#updatePushState({ type: 'update', fcmToken });\n }\n } catch (error) {\n const errorMessage = `Failed to update triggers for push notifications: ${\n error as string\n }`;\n log.error(errorMessage);\n throw new Error(errorMessage);\n } finally {\n this.update((state) => {\n state.isUpdatingFCMToken = false;\n });\n }\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/NotificationServicesPushController/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kCAAkC,EAAE,MAAM,yCAAyC,CAAC;AAE7F,OAAO,EAAE,kCAAkC,IAAI,UAAU,EAAE,CAAC;eAC7C,kCAAkC;AACjD,cAAc,yCAAyC,CAAC;AACxD,YAAY,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAC/C,mBAAmB,kBAAkB,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAE1C,YAAY,EACV,oEAAoE,EACpE,+DAA+D,EAC/D,gEAAgE,EAChE,gEAAgE,EAChE,sEAAsE,EACtE,mEAAmE,EACnE,+CAA+C,GAChD,MAAM,6DAA6D,CAAC"}
@@ -1,8 +0,0 @@
1
- import { NotificationServicesPushController } from './NotificationServicesPushController.js';
2
- export { NotificationServicesPushController as Controller };
3
- export default NotificationServicesPushController;
4
- export * from './NotificationServicesPushController.js';
5
- export * as Utils from './utils/index.js';
6
- export * from './utils/index.js';
7
- export * as Mocks from './mocks/index.js';
8
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/NotificationServicesPushController/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kCAAkC,EAAE,MAAM,yCAAyC,CAAC;AAE7F,OAAO,EAAE,kCAAkC,IAAI,UAAU,EAAE,CAAC;AAC5D,eAAe,kCAAkC,CAAC;AAClD,cAAc,yCAAyC,CAAC;AAGxD,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC","sourcesContent":["import { NotificationServicesPushController } from './NotificationServicesPushController.js';\n\nexport { NotificationServicesPushController as Controller };\nexport default NotificationServicesPushController;\nexport * from './NotificationServicesPushController.js';\nexport type * as Types from './types/index.js';\nexport type * from './types/index.js';\nexport * as Utils from './utils/index.js';\nexport * from './utils/index.js';\nexport * as Mocks from './mocks/index.js';\n\nexport type {\n NotificationServicesPushControllerSubscribeToPushNotificationsAction,\n NotificationServicesPushControllerEnablePushNotificationsAction,\n NotificationServicesPushControllerAddPushNotificationLinksAction,\n NotificationServicesPushControllerDisablePushNotificationsAction,\n NotificationServicesPushControllerUpdateTriggerPushNotificationsAction,\n NotificationServicesPushControllerDeletePushNotificationLinksAction,\n NotificationServicesPushControllerMethodActions,\n} from './NotificationServicesPushController-method-action-types.js';\n"]}
@@ -1,2 +0,0 @@
1
- export * from './mockResponse.js';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/mocks/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from './mockResponse.js';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/mocks/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC","sourcesContent":["export * from './mockResponse.js';\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mockResponse.d.ts","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/mocks/mockResponse.ts"],"names":[],"mappings":"AAEA,KAAK,YAAY,GAAG;IAClB,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,aAAa,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAC;IACjD,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,cAAc,cAAc,CAAC;AAE1C,eAAO,MAAM,0CAA0C,QAAO,YAM7D,CAAC;AAEF,eAAO,MAAM,0CAA0C,QAAO,YAM7D,CAAC;AAEF,eAAO,MAAM,iBAAiB;IAC5B,IAAI;IACJ,KAAK;IACL,GAAG;QACD,QAAQ;QACR,MAAM;QACN,IAAI;QACJ,iBAAiB;;CAEpB,CAAC;AAEF,eAAO,MAAM,yCAAyC,QAAO,YAM5D,CAAC;AAEF,eAAO,MAAM,yCAAyC,QAAO,YAM5D,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mockResponse.js","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/mocks/mockResponse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,0BAA0B,CAAC;AAQxE,MAAM,CAAC,MAAM,cAAc,GAAG,WAAW,CAAC;AAE1C,MAAM,CAAC,MAAM,0CAA0C,GAAG,GAAiB,EAAE;IAC3E,OAAO;QACL,GAAG,EAAE,4BAA4B,EAAE;QACnC,aAAa,EAAE,MAAM;QACrB,QAAQ,EAAE,IAAI;KACQ,CAAC;AAC3B,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,0CAA0C,GAAG,GAAiB,EAAE;IAC3E,OAAO;QACL,GAAG,EAAE,4BAA4B,EAAE;QACnC,aAAa,EAAE,QAAQ;QACvB,QAAQ,EAAE,IAAI;KACQ,CAAC;AAC3B,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,IAAI,EAAE,EAAE;IACR,KAAK,EAAE,WAAW;IAClB,GAAG,EAAE;QACH,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,EAAE;QACR,iBAAiB,EAAE,EAAE;KACtB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,yCAAyC,GAAG,GAAiB,EAAE;IAC1E,OAAO;QACL,GAAG,EAAE,kEAAkE;QACvE,aAAa,EAAE,MAAM;QACrB,QAAQ,EAAE,iBAAiB;KACL,CAAC;AAC3B,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,yCAAyC,GAAG,GAAiB,EAAE;IAC1E,OAAO;QACL,GAAG,EAAE,kEAAkE;QACvE,aAAa,EAAE,MAAM;QACrB,QAAQ,EAAE,EAAE;KACU,CAAC;AAC3B,CAAC,CAAC","sourcesContent":["import { REGISTRATION_TOKENS_ENDPOINT } from '../services/endpoints.js';\n\ntype MockResponse = {\n url: string | RegExp;\n requestMethod: 'GET' | 'POST' | 'PUT' | 'DELETE';\n response: unknown;\n};\n\nexport const MOCK_REG_TOKEN = 'REG_TOKEN';\n\nexport const getMockUpdatePushNotificationLinksResponse = (): MockResponse => {\n return {\n url: REGISTRATION_TOKENS_ENDPOINT(),\n requestMethod: 'POST',\n response: null,\n } satisfies MockResponse;\n};\n\nexport const getMockDeletePushNotificationLinksResponse = (): MockResponse => {\n return {\n url: REGISTRATION_TOKENS_ENDPOINT(),\n requestMethod: 'DELETE',\n response: null,\n } satisfies MockResponse;\n};\n\nexport const MOCK_FCM_RESPONSE = {\n name: '',\n token: 'fcm-token',\n web: {\n endpoint: '',\n p256dh: '',\n auth: '',\n applicationPubKey: '',\n },\n};\n\nexport const getMockCreateFCMRegistrationTokenResponse = (): MockResponse => {\n return {\n url: /^https:\\/\\/fcmregistrations\\.googleapis\\.com\\/v1\\/projects\\/.*$/u,\n requestMethod: 'POST',\n response: MOCK_FCM_RESPONSE,\n } satisfies MockResponse;\n};\n\nexport const getMockDeleteFCMRegistrationTokenResponse = (): MockResponse => {\n return {\n url: /^https:\\/\\/fcmregistrations\\.googleapis\\.com\\/v1\\/projects\\/.*$/u,\n requestMethod: 'POST',\n response: {},\n } satisfies MockResponse;\n};\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"endpoints.d.ts","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/services/endpoints.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,GAAG,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAQxC,eAAO,MAAM,QAAQ,SAAS,GAAG,KAAW,MACL,CAAC;AAExC,eAAO,MAAM,4BAA4B,SAAS,GAAG,KAAW,MAC/B,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"endpoints.js","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/services/endpoints.ts"],"names":[],"mappings":"AAEA,MAAM,YAAY,GAAG;IACnB,GAAG,EAAE,qCAAqC;IAC1C,GAAG,EAAE,qCAAqC;IAC1C,GAAG,EAAE,iCAAiC;CACT,CAAC;AAEhC,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAG,GAAQ,KAAK,EAAU,EAAE,CACnD,YAAY,CAAC,GAAG,CAAC,IAAI,YAAY,CAAC,GAAG,CAAC;AAExC,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,GAAG,GAAQ,KAAK,EAAU,EAAE,CACvE,GAAG,QAAQ,CAAC,GAAG,CAAC,eAAe,CAAC","sourcesContent":["export type ENV = 'prd' | 'uat' | 'dev';\n\nconst PUSH_API_ENV = {\n dev: 'https://push.dev-api.cx.metamask.io',\n uat: 'https://push.uat-api.cx.metamask.io',\n prd: 'https://push.api.cx.metamask.io',\n} satisfies Record<ENV, string>;\n\nexport const PUSH_API = (env: ENV = 'prd'): string =>\n PUSH_API_ENV[env] ?? PUSH_API_ENV.prd;\n\nexport const REGISTRATION_TOKENS_ENDPOINT = (env: ENV = 'prd'): string =>\n `${PUSH_API(env)}/api/v2/token`;\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/services/services.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EACf,MAAM,oCAAoC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qBAAqB,GAAG;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,GAAG,CAAC;CACX,CAAC;AAEF;;;;;GAKG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,OAAO,CAAC,CAwBlB;AAED,KAAK,+BAA+B,GAAG;IAErC,GAAG,EAAE,mBAAmB,CAAC;IACzB,cAAc,EAAE,cAAc,CAAC;IAC/B,aAAa,CAAC,EAAE,GAAG,CAAC;IAGpB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,QAAQ,EAAE,IAAI,CACZ,QAAQ,EACR,YAAY,GAAG,QAAQ,GAAG,UAAU,GAAG,IAAI,GAAG,UAAU,CACzD,CAAC;CACH,CAAC;AAEF;;;;;GAKG;AACH,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,+BAA+B,GACtC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAuBxB;AAED,KAAK,iCAAiC,GAAG;IAEvC,QAAQ,EAAE,MAAM,CAAC;IAGjB,GAAG,EAAE,mBAAmB,CAAC;IACzB,cAAc,EAAE,cAAc,CAAC;CAChC,CAAC;AAEF;;;;;;GAMG;AACH,wBAAsB,2BAA2B,CAC/C,MAAM,EAAE,iCAAiC,GACxC,OAAO,CAAC,OAAO,CAAC,CAclB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"services.js","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/services/services.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AA+C5C;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,MAA6B;IAE7B,IAAI,CAAC;QACH,MAAM,IAAI,GAAqB;YAC7B,SAAS,EAA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,GAAG,EAAE,cAAc,EAAE,GAAG,MAAM,CAAC;IAEvC,MAAM,QAAQ,GAAG,MAAM,cAAc,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IAC7D,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,cAAc,CAAC;QACnB,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,QAAQ,EAAE;YACR,KAAK,EAAE,QAAQ;YACf,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ;YAClC,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM;YAC9B,EAAE,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE;YACtB,UAAU,EAAE,MAAM,CAAC,QAAQ,CAAC,UAAU;YACtC,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ;SACnC;QACD,GAAG,EAAE,MAAM,CAAC,aAAa;KAC1B,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC;AAClB,CAAC;AAWD;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAC/C,MAAyC;IAEzC,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,cAAc,EAAE,GAAG,MAAM,CAAC;IAEjD,yDAAyD;IACzD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,qBAAqB,GAAG,MAAM,cAAc,CAAC,GAAG,CAAC,CAAC;IACxD,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import type { PushNotificationEnv } from '../types/index.js';\nimport type {\n CreateRegToken,\n DeleteRegToken,\n} from '../types/push-service-interface.js';\nimport type { ENV } from './endpoints.js';\nimport * as endpoints from './endpoints.js';\n\nexport type RegToken = {\n token: string;\n platform: 'extension' | 'mobile' | 'portfolio';\n locale: string;\n os?: 'android' | 'ios';\n appVersion?: string;\n oldToken?: string;\n};\n\nexport type RegistrationPlatform = 'extension' | 'mobile';\n\n/**\n * Links API Response Shape\n */\nexport type PushTokenRequest = {\n addresses: string[];\n // API response uses snake_case for this property\n // eslint-disable-next-line @typescript-eslint/naming-convention\n registration_token: {\n token: string;\n platform: 'extension' | 'mobile' | 'portfolio';\n locale: string;\n os?: 'android' | 'ios';\n appVersion?: string;\n oldToken?: string;\n };\n};\n\nexport type DeletePushTokenRequest = {\n addresses: string[];\n // API request uses snake_case for this property\n // eslint-disable-next-line @typescript-eslint/naming-convention\n registration_token: {\n platform: RegistrationPlatform;\n token: string;\n };\n};\n\ntype UpdatePushTokenParams = {\n bearerToken: string;\n addresses: string[];\n regToken: RegToken;\n env?: ENV;\n};\n\n/**\n * Updates the push notification links on a remote API.\n *\n * @param params - params for invoking update reg token\n * @returns A promise that resolves with true if the update was successful, false otherwise.\n */\nexport async function updateLinksAPI(\n params: UpdatePushTokenParams,\n): Promise<boolean> {\n try {\n const body: PushTokenRequest = {\n addresses: params.addresses,\n registration_token: params.regToken,\n };\n const response = await fetch(\n endpoints.REGISTRATION_TOKENS_ENDPOINT(params.env),\n {\n method: 'POST',\n headers: {\n Authorization: `Bearer ${params.bearerToken}`,\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(body),\n },\n );\n return response.ok;\n } catch {\n return false;\n }\n}\n\ntype DeletePushTokenParams = {\n bearerToken: string;\n addresses: string[];\n platform: RegistrationPlatform;\n token: string;\n env?: ENV;\n};\n\n/**\n * Deletes push notification links for addresses and platform.\n *\n * @param params - params for deleting registration links\n * @returns A promise that resolves with true if the delete request was successful, false otherwise.\n */\nexport async function deleteLinksAPI(\n params: DeletePushTokenParams,\n): Promise<boolean> {\n try {\n const body: DeletePushTokenRequest = {\n addresses: params.addresses,\n registration_token: {\n platform: params.platform,\n token: params.token,\n },\n };\n const response = await fetch(\n endpoints.REGISTRATION_TOKENS_ENDPOINT(params.env),\n {\n method: 'DELETE',\n headers: {\n Authorization: `Bearer ${params.bearerToken}`,\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(body),\n },\n );\n return response.ok;\n } catch {\n return false;\n }\n}\n\ntype ActivatePushNotificationsParams = {\n // Create Push Token\n env: PushNotificationEnv;\n createRegToken: CreateRegToken;\n controllerEnv?: ENV;\n\n // Other Request Parameters\n bearerToken: string;\n addresses: string[];\n regToken: Pick<\n RegToken,\n 'appVersion' | 'locale' | 'oldToken' | 'os' | 'platform'\n >;\n};\n\n/**\n * Enables push notifications by registering the device and linking triggers.\n *\n * @param params - Activate Push Params\n * @returns A promise that resolves with an object containing the success status and the BearerToken token.\n */\nexport async function activatePushNotifications(\n params: ActivatePushNotificationsParams,\n): Promise<string | null> {\n const { env, createRegToken } = params;\n\n const regToken = await createRegToken(env).catch(() => null);\n if (!regToken) {\n return null;\n }\n\n await updateLinksAPI({\n bearerToken: params.bearerToken,\n addresses: params.addresses,\n regToken: {\n token: regToken,\n platform: params.regToken.platform,\n locale: params.regToken.locale,\n os: params.regToken.os,\n appVersion: params.regToken.appVersion,\n oldToken: params.regToken.oldToken,\n },\n env: params.controllerEnv,\n });\n\n return regToken;\n}\n\ntype DeactivatePushNotificationsParams = {\n // Push Links\n regToken: string;\n\n // Push Un-registration\n env: PushNotificationEnv;\n deleteRegToken: DeleteRegToken;\n};\n\n/**\n * Disables push notifications by removing the registration token\n * We do not need to unlink triggers, and remove old reg tokens (this is cleaned up in the back-end)\n *\n * @param params - Deactivate Push Params\n * @returns A promise that resolves with true if push notifications were successfully disabled, false otherwise.\n */\nexport async function deactivatePushNotifications(\n params: DeactivatePushNotificationsParams,\n): Promise<boolean> {\n const { regToken, env, deleteRegToken } = params;\n\n // if we don't have a reg token, then we can early return\n if (!regToken) {\n return true;\n }\n\n const isTokenRemovedFromFCM = await deleteRegToken(env);\n if (!isTokenRemovedFromFCM) {\n return false;\n }\n\n return true;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"firebase.d.ts","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/types/firebase.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,GAAG,EAAE,WAAW,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAClC,8BAA8B,EAAE,OAAO,CAAC;CACzC,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,YAAY,CAAC,EAAE,mBAAmB,CAAC;IACnC,IAAI,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IACjC,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yBAAyB,CAAC,EAAE,yBAAyB,CAAC;CACvD,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=firebase.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"firebase.js","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/types/firebase.ts"],"names":[],"mappings":"","sourcesContent":["export type PushNotificationEnv = {\n apiKey: string;\n authDomain: string;\n storageBucket: string;\n projectId: string;\n messagingSenderId: string;\n appId: string;\n measurementId: string;\n vapidKey: string;\n};\n\nexport type Messaging = {\n app: FirebaseApp;\n};\n\nexport type FirebaseApp = {\n readonly name: string;\n readonly options: FirebaseOptions;\n automaticDataCollectionEnabled: boolean;\n};\n\nexport type FirebaseOptions = {\n apiKey?: string;\n authDomain?: string;\n databaseURL?: string;\n projectId?: string;\n storageBucket?: string;\n messagingSenderId?: string;\n appId?: string;\n measurementId?: string;\n};\n\nexport type NotificationPayload = {\n title?: string;\n body?: string;\n image?: string;\n icon?: string;\n};\n\nexport type FcmOptions = {\n link?: string;\n analyticsLabel?: string;\n};\n\nexport type MessagePayload = {\n notification?: NotificationPayload;\n data?: { [key: string]: string };\n fcmOptions?: FcmOptions;\n from: string;\n collapseKey: string;\n messageId: string;\n};\n\nexport type GetTokenOptions = {\n vapidKey?: string;\n serviceWorkerRegistration?: ServiceWorkerRegistration;\n};\n"]}
@@ -1,4 +0,0 @@
1
- export type * from './firebase.js';
2
- export type * from './push-analytics.js';
3
- export type * from './push-service-interface.js';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/types/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,eAAe,CAAC;AACnC,mBAAmB,qBAAqB,CAAC;AACzC,mBAAmB,6BAA6B,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/types/index.ts"],"names":[],"mappings":"","sourcesContent":["export type * from './firebase.js';\nexport type * from './push-analytics.js';\nexport type * from './push-service-interface.js';\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"push-analytics.d.ts","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/types/push-analytics.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,eAAe,EAAE,MAAM,CAAC;IACxB,sDAAsD;IACtD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oDAAoD;IACpD,oBAAoB,EAAE,MAAM,CAAC;IAC7B,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"push-analytics.js","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/types/push-analytics.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,yDAAyD","sourcesContent":["// snake_case mirrors the FCM payload and Segment schema keys\n/* eslint-disable @typescript-eslint/naming-convention */\n\n/**\n * Analytics fields carried by the `NotificationServicesPushController` messenger\n * events (`onNewNotifications`, `pushNotificationClicked`). Read directly from\n * top-level FCM payload keys, so clients build Segment events without fallback\n * chains or parsing a `metadata` blob.\n */\nexport type PushAnalyticsPayload = {\n notification_id: string;\n /** Free-form snake_case label set by the producer. */\n notification_type: string;\n /** Team-owned, open-ended (e.g. `eth_received`). */\n notification_subtype: string;\n /** Only present when the notification has a chain context. */\n chain_id?: number;\n /** Platform notifications only; the CTA link to route to on tap. */\n deeplink?: string;\n};\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"push-service-interface.d.ts","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/types/push-service-interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtD,KAAK,WAAW,GAAG,MAAM,IAAI,CAAC;AAE9B;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,CAC3B,GAAG,EAAE,mBAAmB,KACrB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;AAE5B;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,GAAG,EAAE,mBAAmB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAE5E;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,4BAA4B,GAAG,CACzC,GAAG,EAAE,mBAAmB,KACrB,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;AAEjC,MAAM,MAAM,WAAW,GAAG;IACxB,cAAc,EAAE,cAAc,CAAC;IAE/B,cAAc,EAAE,cAAc,CAAC;IAE/B,4BAA4B,EAAE,4BAA4B,CAAC;CAC5D,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=push-service-interface.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"push-service-interface.js","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/types/push-service-interface.ts"],"names":[],"mappings":"","sourcesContent":["import type { PushNotificationEnv } from './index.js';\n\ntype Unsubscribe = () => void;\n\n/**\n * Firebase - allows creating of a registration token for push notifications\n */\nexport type CreateRegToken = (\n env: PushNotificationEnv,\n) => Promise<string | null>;\n\n/**\n * Firebase - allows deleting a reg token. Returns true if successful, otherwise false if failed\n */\nexport type DeleteRegToken = (env: PushNotificationEnv) => Promise<boolean>;\n\n/**\n * Firebase + Platform Specific Logic.\n * Will be used to subscribe to the `onMessage` and `onBackgroundMessage` handlers\n * But will also need client specific logic for showing a notification and clicking a notification\n * (browser APIs for web, and Notifee on mobile)\n *\n * We can either create \"creator\"/\"builder\" function in platform specific files (see push-web.ts),\n * Or the platform needs to correctly handle:\n * - subscriptions\n * - click events\n * - publishing PushController events using it's messenger\n */\nexport type SubscribeToPushNotifications = (\n env: PushNotificationEnv,\n) => Promise<Unsubscribe | null>;\n\nexport type PushService = {\n createRegToken: CreateRegToken;\n\n deleteRegToken: DeleteRegToken;\n\n subscribeToPushNotifications: SubscribeToPushNotifications;\n};\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-notification-data.d.ts","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/utils/get-notification-data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,KAAK,aAAa,GAAG;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAKF;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,CAG1E;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,iBAAkB,MAAM,GAAG,MAAM,KAAG,MAInE,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,YAAY,kBACR,MAAM,SACd,aAAa,KACnB,MA+BF,CAAC;AAEF,eAAO,MAAM,SAAS,WACZ,MAAM,YACJ,MAAM,YACN,aAAa,KACtB,MAWF,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-notification-data.js","sourceRoot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","sourcesContent":["import { BigNumber } from 'bignumber.js';\n\ntype FormatOptions = {\n decimalPlaces?: number;\n shouldEllipse?: boolean;\n};\nconst defaultFormatOptions = {\n decimalPlaces: 4,\n};\n\n/**\n * Calculates the token amount based on the given value and decimals.\n *\n * @param value - The value to calculate the token amount from.\n * @param decimals - The number of decimals to use for the calculation.\n * @returns The calculated token amount.\n */\nexport function calcTokenAmount(value: string, decimals: number): BigNumber {\n const multiplier = Math.pow(10, Number(decimals || 0));\n return new BigNumber(String(value)).div(multiplier);\n}\n\n/**\n * Calculates the number of leading zeros in the fractional part of a number.\n *\n * This function converts a number or a string representation of a number into\n * its decimal form and then counts the number of leading zeros present in the\n * fractional part of the number. This is useful for determining the precision\n * of very small numbers.\n *\n * @param numericValue - The number to analyze, which can be in the form\n * of a number or a string.\n * @returns The count of leading zeros in the fractional part of the number.\n */\nexport const getLeadingZeroCount = (numericValue: number | string): number => {\n const numToString = new BigNumber(numericValue, 10).toString(10);\n const fractionalPart = numToString.split('.')[1] ?? '';\n return fractionalPart.match(/^0*/u)?.[0]?.length ?? 0;\n};\n\n/**\n * This formats a number using Intl\n * It abbreviates large numbers (using K, M, B, T)\n * And abbreviates small numbers in 2 ways:\n * - Will format to the given number of decimal places\n * - Will format up to 4 decimal places\n * - Will ellipse the number if longer than given decimal places\n *\n * @param numericAmount - The number to format\n * @param opts - The options to use when formatting\n * @returns The formatted number\n */\nexport const formatAmount = (\n numericAmount: number,\n opts?: FormatOptions,\n): string => {\n // create options with defaults\n const options = { ...defaultFormatOptions, ...opts };\n\n const leadingZeros = getLeadingZeroCount(numericAmount);\n const isDecimal = numericAmount.toString().includes('.') || leadingZeros > 0;\n const isLargeNumber = numericAmount > 999;\n\n const handleShouldEllipse = (decimalPlaces: number): boolean =>\n Boolean(options?.shouldEllipse) && leadingZeros >= decimalPlaces;\n\n if (isLargeNumber) {\n return Intl.NumberFormat('en-US', {\n notation: 'compact',\n compactDisplay: 'short',\n maximumFractionDigits: 2,\n }).format(numericAmount);\n }\n\n if (isDecimal) {\n const ellipse = handleShouldEllipse(options.decimalPlaces);\n const formattedValue = Intl.NumberFormat('en-US', {\n minimumFractionDigits: ellipse ? options.decimalPlaces : undefined,\n maximumFractionDigits: options.decimalPlaces,\n }).format(numericAmount);\n\n return ellipse ? `${formattedValue}...` : formattedValue;\n }\n\n // Default to showing the raw amount\n return numericAmount.toString();\n};\n\nexport const getAmount = (\n amount: string,\n decimals: string,\n options?: FormatOptions,\n): string => {\n if (!amount || !decimals) {\n return '';\n }\n\n const numericAmount = calcTokenAmount(\n amount,\n parseFloat(decimals),\n ).toNumber();\n\n return formatAmount(numericAmount, options);\n};\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-notification-message.d.ts","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/utils/get-notification-message.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,+CAA+C,CAAC;AAC3E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+CAA+C,CAAC;AAG/E,MAAM,MAAM,eAAe,GAAG;IAC5B,uCAAuC,EAAE,MAAM,MAAM,CAAC;IACtD,oDAAoD,EAAE,MAAM,MAAM,CAAC;IACnE,6CAA6C,EAAE,CAC7C,GAAG,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,KACtB,MAAM,CAAC;IACZ,2CAA2C,EAAE,MAAM,MAAM,CAAC;IAC1D,wDAAwD,EAAE,MAAM,MAAM,CAAC;IACvE,iDAAiD,EAAE,CACjD,GAAG,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,KACtB,MAAM,CAAC;IACZ,2CAA2C,EAAE,MAAM,MAAM,CAAC;IAC1D,iDAAiD,EAAE,MAAM,MAAM,CAAC;IAChE,qCAAqC,EAAE,MAAM,MAAM,CAAC;IACpD,2CAA2C,EAAE,MAAM,MAAM,CAAC;IAC1D,yCAAyC,EAAE,MAAM,MAAM,CAAC;IACxD,+CAA+C,EAAE,MAAM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AM,qCAAqC,oBAC/B,eAAe,KAC/B,uBAwMF,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,oCAAoC,CAClD,YAAY,EAAE,KAAK,CAAC,aAAa,EACjC,YAAY,EAAE,eAAe,GAC5B,uBAAuB,GAAG,IAAI,CA8BhC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-notification-message.js","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/utils/get-notification-message.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAoDrE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAAG,CACnD,eAAgC,EACP,EAAE;IAI3B,MAAM,SAAS,GAAkB,CAAC,GAAG,IAAI,EAAE,EAAE;QAC3C,MAAM,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC,GAAG,IAAI,CAAC;QAEjC,4CAA4C;QAC5C,8DAA8D;QAC9D,MAAM,EAAE,GAAQ,eAAe,CAAC,GAAG,CAAC,CAAC;QACrC,OAAO,EAAE,CAAC,GAAG,SAAS,CAAC,CAAC;IAC1B,CAAC,CAAC;IAEF,OAAO;QACL,UAAU,EAAE;YACV,KAAK,EAAE,GAAkB,EAAE,CACzB,SAAS,CAAC,yCAAyC,CAAC;YACtD,kBAAkB,EAAE,GAAkB,EAAE,CACtC,SAAS,CAAC,sDAAsD,CAAC;YACnE,cAAc,EAAE,CAAC,YAAY,EAAiB,EAAE;gBAC9C,MAAM,MAAM,GAAG,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC;gBAC1D,MAAM,WAAW,GAAG,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC;gBAC/D,MAAM,aAAa,GAAG,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC;gBACnE,IAAI,CAAC,MAAM,IAAI,CAAC,WAAW,IAAI,CA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CAAC;IAC1E,CAAC;IAED,OAAO;QACL,8DAA8D;QAC9D,KAAK,EAAE,mBAAmB,EAAE,KAAK,EAAE,CAAC,YAAmB,CAAC,IAAI,EAAE,EAAE,kCAAkC;QAClG,WAAW,EAAE,WAAW,IAAI,EAAE,EAAE,mCAAmC;KACpE,CAAC;AACJ,CAAC","sourcesContent":["import type { Types } from '../../NotificationServicesController/index.js';\nimport type { Constants } from '../../NotificationServicesController/index.js';\nimport { getAmount, formatAmount } from './get-notification-data.js';\n\nexport type TranslationKeys = {\n pushPlatformNotificationsFundsSentTitle: () => string;\n pushPlatformNotificationsFundsSentDescriptionDefault: () => string;\n pushPlatformNotificationsFundsSentDescription: (\n ...args: [string, string]\n ) => string;\n pushPlatformNotificationsFundsReceivedTitle: () => string;\n pushPlatformNotificationsFundsReceivedDescriptionDefault: () => string;\n pushPlatformNotificationsFundsReceivedDescription: (\n ...args: [string, string]\n ) => string;\n pushPlatformNotificationsSwapCompletedTitle: () => string;\n pushPlatformNotificationsSwapCompletedDescription: () => string;\n pushPlatformNotificationsNftSentTitle: () => string;\n pushPlatformNotificationsNftSentDescription: () => string;\n pushPlatformNotificationsNftReceivedTitle: () => string;\n pushPlatformNotificationsNftReceivedDescription: () => string;\n pushPlatformNotificationsStakingRocketpoolStakeCompletedTitle: () => string;\n pushPlatformNotificationsStakingRocketpoolStakeCompletedDescription: () => string;\n pushPlatformNotificationsStakingRocketpoolUnstakeCompletedTitle: () => string;\n pushPlatformNotificationsStakingRocketpoolUnstakeCompletedDescription: () => string;\n pushPlatformNotificationsStakingLidoStakeCompletedTitle: () => string;\n pushPlatformNotificationsStakingLidoStakeCompletedDescription: () => string;\n pushPlatformNotificationsStakingLidoStakeReadyToBeWithdrawnTitle: () => string;\n pushPlatformNotificationsStakingLidoStakeReadyToBeWithdrawnDescription: () => string;\n pushPlatformNotificationsStakingLidoWithdrawalRequestedTitle: () => string;\n pushPlatformNotificationsStakingLidoWithdrawalRequestedDescription: () => string;\n pushPlatformNotificationsStakingLidoWithdrawalCompletedTitle: () => string;\n pushPlatformNotificationsStakingLidoWithdrawalCompletedDescription: () => string;\n};\n\ntype PushNotificationMessage = {\n title: string;\n description: string;\n ctaLink?: string;\n};\n\ntype NotificationMessage<TNotification extends Types.INotification> = {\n title: (notification: TNotification) => string | null;\n defaultDescription: (notification: TNotification) => string | null;\n getDescription?: (notification: TNotification) => string | null;\n link?: (notification: TNotification) => string | null;\n};\n\ntype NotificationMessageDict = {\n [TriggerType in Constants.TRIGGER_TYPES]?: NotificationMessage<\n Extract<Types.INotification, { type: TriggerType }>\n >;\n};\n\n/**\n * On Chain Push Notification Messages.\n * This is a list of all the push notifications we support. Update this for synced notifications on mobile and extension\n *\n * @param translationKeys - all translations supported\n * @returns A translation push message object.\n */\nexport const createOnChainPushNotificationMessages = (\n translationKeys: TranslationKeys,\n): NotificationMessageDict => {\n type TranslationFn = <TKey extends keyof TranslationKeys>(\n ...args: [TKey, ...Parameters<TranslationKeys[TKey]>]\n ) => string;\n const translate: TranslationFn = (...args) => {\n const [key, ...otherArgs] = args;\n\n // Coerce types for the translation function\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const fn: any = translationKeys[key];\n return fn(...otherArgs);\n };\n\n return {\n erc20_sent: {\n title: (): string | null =>\n translate('pushPlatformNotificationsFundsSentTitle'),\n defaultDescription: (): string | null =>\n translate('pushPlatformNotificationsFundsSentDescriptionDefault'),\n getDescription: (notification): string | null => {\n const symbol = notification?.payload?.data?.token?.symbol;\n const tokenAmount = notification?.payload?.data?.token?.amount;\n const tokenDecimals = notification?.payload?.data?.token?.decimals;\n if (!symbol || !tokenAmount || !tokenDecimals) {\n return null;\n }\n\n const amount = getAmount(tokenAmount, tokenDecimals, {\n shouldEllipse: true,\n });\n return translate(\n 'pushPlatformNotificationsFundsSentDescription',\n amount,\n symbol,\n );\n },\n },\n eth_sent: {\n title: (): string | null =>\n translate('pushPlatformNotificationsFundsSentTitle'),\n defaultDescription: (): string | null =>\n translate('pushPlatformNotificationsFundsSentDescriptionDefault'),\n getDescription: (notification): string | null => {\n const symbol = notification?.payload?.network?.native_symbol;\n const tokenAmount = notification?.payload?.data?.amount?.eth;\n if (!symbol || !tokenAmount) {\n return null;\n }\n\n const amount = formatAmount(parseFloat(tokenAmount), {\n shouldEllipse: true,\n });\n return translate(\n 'pushPlatformNotificationsFundsSentDescription',\n amount,\n symbol,\n );\n },\n },\n erc20_received: {\n title: (): string | null =>\n translate('pushPlatformNotificationsFundsReceivedTitle'),\n defaultDescription: (): string | null =>\n translate('pushPlatformNotificationsFundsReceivedDescriptionDefault'),\n getDescription: (notification): string | null => {\n const symbol = notification?.payload?.data?.token?.symbol;\n const tokenAmount = notification?.payload?.data?.token?.amount;\n const tokenDecimals = notification?.payload?.data?.token?.decimals;\n if (!symbol || !tokenAmount || !tokenDecimals) {\n return null;\n }\n\n const amount = getAmount(tokenAmount, tokenDecimals, {\n shouldEllipse: true,\n });\n return translate(\n 'pushPlatformNotificationsFundsReceivedDescription',\n amount,\n symbol,\n );\n },\n },\n eth_received: {\n title: (): string | null =>\n translate('pushPlatformNotificationsFundsReceivedTitle'),\n defaultDescription: (): string | null =>\n translate('pushPlatformNotificationsFundsReceivedDescriptionDefault'),\n getDescription: (notification): string | null => {\n const symbol = notification?.payload?.network?.native_symbol;\n const tokenAmount = notification?.payload?.data?.amount?.eth;\n if (!symbol || !tokenAmount) {\n return null;\n }\n\n const amount = formatAmount(parseFloat(tokenAmount), {\n shouldEllipse: true,\n });\n return translate(\n 'pushPlatformNotificationsFundsReceivedDescription',\n amount,\n symbol,\n );\n },\n },\n metamask_swap_completed: {\n title: (): string | null =>\n translate('pushPlatformNotificationsSwapCompletedTitle'),\n defaultDescription: (): string | null =>\n translate('pushPlatformNotificationsSwapCompletedDescription'),\n },\n erc721_sent: {\n title: (): string | null =>\n translate('pushPlatformNotificationsNftSentTitle'),\n defaultDescription: (): string | null =>\n translate('pushPlatformNotificationsNftSentDescription'),\n },\n erc1155_sent: {\n title: (): string | null =>\n translate('pushPlatformNotificationsNftSentTitle'),\n defaultDescription: (): string | null =>\n translate('pushPlatformNotificationsNftSentDescription'),\n },\n erc721_received: {\n title: (): string | null =>\n translate('pushPlatformNotificationsNftReceivedTitle'),\n defaultDescription: (): string | null =>\n translate('pushPlatformNotificationsNftReceivedDescription'),\n },\n erc1155_received: {\n title: (): string | null =>\n translate('pushPlatformNotificationsNftReceivedTitle'),\n defaultDescription: (): string | null =>\n translate('pushPlatformNotificationsNftReceivedDescription'),\n },\n rocketpool_stake_completed: {\n title: (): string | null =>\n translate(\n 'pushPlatformNotificationsStakingRocketpoolStakeCompletedTitle',\n ),\n defaultDescription: (): string | null =>\n translate(\n 'pushPlatformNotificationsStakingRocketpoolStakeCompletedDescription',\n ),\n },\n rocketpool_unstake_completed: {\n title: (): string | null =>\n translate(\n 'pushPlatformNotificationsStakingRocketpoolUnstakeCompletedTitle',\n ),\n defaultDescription: (): string | null =>\n translate(\n 'pushPlatformNotificationsStakingRocketpoolUnstakeCompletedDescription',\n ),\n },\n lido_stake_completed: {\n title: (): string | null =>\n translate('pushPlatformNotificationsStakingLidoStakeCompletedTitle'),\n defaultDescription: (): string | null =>\n translate(\n 'pushPlatformNotificationsStakingLidoStakeCompletedDescription',\n ),\n },\n lido_stake_ready_to_be_withdrawn: {\n title: (): string | null =>\n translate(\n 'pushPlatformNotificationsStakingLidoStakeReadyToBeWithdrawnTitle',\n ),\n defaultDescription: (): string | null =>\n translate(\n 'pushPlatformNotificationsStakingLidoStakeReadyToBeWithdrawnDescription',\n ),\n },\n lido_withdrawal_requested: {\n title: (): string | null =>\n translate(\n 'pushPlatformNotificationsStakingLidoWithdrawalRequestedTitle',\n ),\n defaultDescription: (): string | null =>\n translate(\n 'pushPlatformNotificationsStakingLidoWithdrawalRequestedDescription',\n ),\n },\n lido_withdrawal_completed: {\n title: (): string | null =>\n translate(\n 'pushPlatformNotificationsStakingLidoWithdrawalCompletedTitle',\n ),\n defaultDescription: (): string | null =>\n translate(\n 'pushPlatformNotificationsStakingLidoWithdrawalCompletedDescription',\n ),\n },\n platform: {\n title: (notification): string | null => notification.template.title,\n defaultDescription: (notification): string | null =>\n notification.template.body,\n getDescription: (notification): string | null =>\n notification.template.body,\n },\n };\n};\n\n/**\n * Creates a push notification message based on the given on-chain raw notification.\n *\n * @param notification - processed notification.\n * @param translations - translates keys into text\n * @returns The push notification message object, or null if the notification is invalid.\n */\nexport function createOnChainPushNotificationMessage(\n notification: Types.INotification,\n translations: TranslationKeys,\n): PushNotificationMessage | null {\n if (!notification?.type) {\n return null;\n }\n const notificationMessage =\n createOnChainPushNotificationMessages(translations)[notification.type];\n\n if (!notificationMessage) {\n return null;\n }\n\n let description: string | null = null;\n try {\n description =\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n notificationMessage?.getDescription?.(notification as any) ??\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n notificationMessage.defaultDescription?.(notification as any) ??\n null;\n } catch {\n description =\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n notificationMessage.defaultDescription?.(notification as any) ?? null;\n }\n\n return {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n title: notificationMessage?.title?.(notification as any) ?? '', // Ensure title is always a string\n description: description ?? '', // Fallback to empty string if null\n };\n}\n"]}
@@ -1,4 +0,0 @@
1
- export * from './get-notification-data.js';
2
- export * from './get-notification-message.js';
3
- export * from './to-push-analytics-payload.js';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC"}
@@ -1,4 +0,0 @@
1
- export * from './get-notification-data.js';
2
- export * from './get-notification-message.js';
3
- export * from './to-push-analytics-payload.js';
4
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC","sourcesContent":["export * from './get-notification-data.js';\nexport * from './get-notification-message.js';\nexport * from './to-push-analytics-payload.js';\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"to-push-analytics-payload.d.ts","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/utils/to-push-analytics-payload.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9D;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,GACvC,oBAAoB,GAAG,IAAI,CAY7B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"to-push-analytics-payload.js","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/utils/to-push-analytics-payload.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,UAAU,sBAAsB,CACpC,IAAwC;IAExC,IAAI,CAAC,IAAI,EAAE,eAAe,IAAI,CAAC,IAAI,EAAE,iBAAiB,EAAE,CAAC;QACvD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO;QACL,eAAe,EAAE,IAAI,CAAC,eAAe;QACrC,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;QACzC,oBAAoB,EAAE,IAAI,CAAC,oBAAoB,IAAI,EAAE;QACrD,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS;QAC3D,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,SAAS;KACrC,CAAC;AACJ,CAAC","sourcesContent":["import type { PushAnalyticsPayload } from '../types/index.js';\n\n/**\n * Builds the first-class push analytics payload from the top-level FCM `data`\n * keys written by push-services. Returns `null` when the required identity\n * fields are missing (e.g. a malformed or legacy payload), so callers can\n * safely bail out.\n *\n * @param data - the top-level FCM `data` map (all values are strings).\n * @returns the analytics payload, or `null` if required fields are absent.\n */\nexport function toPushAnalyticsPayload(\n data: Record<string, string> | undefined,\n): PushAnalyticsPayload | null {\n if (!data?.notification_id || !data?.notification_type) {\n return null;\n }\n\n return {\n notification_id: data.notification_id,\n notification_type: data.notification_type,\n notification_subtype: data.notification_subtype ?? '',\n chain_id: data.chain_id ? Number(data.chain_id) : undefined,\n deeplink: data.deeplink || undefined,\n };\n}\n"]}
@@ -1,2 +0,0 @@
1
- export { createRegToken, deleteRegToken, createSubscribeToPushNotifications, } from './push-utils.js';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/web/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,cAAc,EACd,kCAAkC,GACnC,MAAM,iBAAiB,CAAC"}
@@ -1,2 +0,0 @@
1
- export { createRegToken, deleteRegToken, createSubscribeToPushNotifications, } from './push-utils.js';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/web/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,cAAc,EACd,kCAAkC,GACnC,MAAM,iBAAiB,CAAC","sourcesContent":["export {\n createRegToken,\n deleteRegToken,\n createSubscribeToPushNotifications,\n} from './push-utils.js';\n"]}