@metamask-previews/notification-services-controller 27.0.2-preview-6eff555ee → 28.0.0-preview-0a30e47

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 (657) hide show
  1. package/CHANGELOG.md +22 -1
  2. package/dist/NotificationServicesController/{NotificationServicesController-method-action-types.d.mts → NotificationServicesController-method-action-types.d.ts} +2 -2
  3. package/dist/NotificationServicesController/NotificationServicesController-method-action-types.d.ts.map +1 -0
  4. package/dist/NotificationServicesController/{NotificationServicesController-method-action-types.mjs → NotificationServicesController-method-action-types.js} +1 -1
  5. package/dist/NotificationServicesController/NotificationServicesController-method-action-types.js.map +1 -0
  6. package/dist/NotificationServicesController/{NotificationServicesController.d.cts → NotificationServicesController.d.ts} +15 -15
  7. package/dist/NotificationServicesController/NotificationServicesController.d.ts.map +1 -0
  8. package/dist/NotificationServicesController/{NotificationServicesController.mjs → NotificationServicesController.js} +411 -386
  9. package/dist/NotificationServicesController/NotificationServicesController.js.map +1 -0
  10. package/dist/NotificationServicesController/constants/index.d.ts +2 -0
  11. package/dist/NotificationServicesController/constants/index.d.ts.map +1 -0
  12. package/dist/NotificationServicesController/constants/index.js +2 -0
  13. package/dist/NotificationServicesController/constants/index.js.map +1 -0
  14. package/dist/NotificationServicesController/constants/{notification-schema.d.cts → notification-schema.d.ts} +1 -1
  15. package/dist/NotificationServicesController/constants/notification-schema.d.ts.map +1 -0
  16. package/dist/NotificationServicesController/constants/{notification-schema.mjs → notification-schema.js} +1 -1
  17. package/dist/NotificationServicesController/constants/notification-schema.js.map +1 -0
  18. package/dist/NotificationServicesController/{index.d.cts → index.d.ts} +14 -14
  19. package/dist/NotificationServicesController/index.d.ts.map +1 -0
  20. package/dist/NotificationServicesController/index.js +13 -0
  21. package/dist/NotificationServicesController/index.js.map +1 -0
  22. package/dist/NotificationServicesController/mocks/index.d.ts +5 -0
  23. package/dist/NotificationServicesController/mocks/index.d.ts.map +1 -0
  24. package/dist/NotificationServicesController/mocks/index.js +5 -0
  25. package/dist/NotificationServicesController/mocks/index.js.map +1 -0
  26. package/dist/NotificationServicesController/mocks/{mock-feature-announcements.d.cts → mock-feature-announcements.d.ts} +3 -3
  27. package/dist/NotificationServicesController/mocks/mock-feature-announcements.d.ts.map +1 -0
  28. package/dist/NotificationServicesController/mocks/{mock-feature-announcements.mjs → mock-feature-announcements.js} +2 -2
  29. package/dist/NotificationServicesController/mocks/mock-feature-announcements.js.map +1 -0
  30. package/dist/NotificationServicesController/mocks/{mock-raw-notifications.d.cts → mock-raw-notifications.d.ts} +2 -2
  31. package/dist/NotificationServicesController/mocks/mock-raw-notifications.d.ts.map +1 -0
  32. package/dist/NotificationServicesController/mocks/{mock-raw-notifications.mjs → mock-raw-notifications.js} +2 -2
  33. package/dist/NotificationServicesController/mocks/mock-raw-notifications.js.map +1 -0
  34. package/dist/NotificationServicesController/mocks/{mock-snap-notification.d.cts → mock-snap-notification.d.ts} +2 -2
  35. package/dist/NotificationServicesController/mocks/mock-snap-notification.d.ts.map +1 -0
  36. package/dist/NotificationServicesController/mocks/{mock-snap-notification.mjs → mock-snap-notification.js} +2 -2
  37. package/dist/NotificationServicesController/mocks/mock-snap-notification.js.map +1 -0
  38. package/dist/NotificationServicesController/mocks/{mockResponses.d.cts → mockResponses.d.ts} +3 -3
  39. package/dist/NotificationServicesController/mocks/mockResponses.d.ts.map +1 -0
  40. package/dist/NotificationServicesController/mocks/{mockResponses.mjs → mockResponses.js} +6 -6
  41. package/dist/NotificationServicesController/mocks/mockResponses.js.map +1 -0
  42. package/dist/NotificationServicesController/processors/index.d.ts +4 -0
  43. package/dist/NotificationServicesController/processors/index.d.ts.map +1 -0
  44. package/dist/NotificationServicesController/processors/index.js +4 -0
  45. package/dist/NotificationServicesController/processors/index.js.map +1 -0
  46. package/dist/NotificationServicesController/processors/{process-api-notifications.d.cts → process-api-notifications.d.ts} +3 -3
  47. package/dist/NotificationServicesController/processors/process-api-notifications.d.ts.map +1 -0
  48. package/dist/NotificationServicesController/processors/{process-api-notifications.mjs → process-api-notifications.js} +3 -3
  49. package/dist/NotificationServicesController/processors/process-api-notifications.js.map +1 -0
  50. package/dist/NotificationServicesController/processors/{process-feature-announcement.d.mts → process-feature-announcement.d.ts} +3 -3
  51. package/dist/NotificationServicesController/processors/process-feature-announcement.d.ts.map +1 -0
  52. package/dist/NotificationServicesController/processors/{process-feature-announcement.mjs → process-feature-announcement.js} +3 -3
  53. package/dist/NotificationServicesController/processors/process-feature-announcement.js.map +1 -0
  54. package/dist/NotificationServicesController/processors/{process-notifications.d.cts → process-notifications.d.ts} +2 -2
  55. package/dist/NotificationServicesController/processors/process-notifications.d.ts.map +1 -0
  56. package/dist/NotificationServicesController/processors/{process-notifications.mjs → process-notifications.js} +5 -5
  57. package/dist/NotificationServicesController/processors/process-notifications.js.map +1 -0
  58. package/dist/NotificationServicesController/processors/{process-snap-notifications.d.cts → process-snap-notifications.d.ts} +3 -3
  59. package/dist/NotificationServicesController/processors/process-snap-notifications.d.ts.map +1 -0
  60. package/dist/NotificationServicesController/processors/{process-snap-notifications.mjs → process-snap-notifications.js} +3 -3
  61. package/dist/NotificationServicesController/processors/process-snap-notifications.js.map +1 -0
  62. package/dist/NotificationServicesController/services/{api-notifications.d.cts → api-notifications.d.ts} +2 -2
  63. package/dist/NotificationServicesController/services/api-notifications.d.ts.map +1 -0
  64. package/dist/NotificationServicesController/services/{api-notifications.mjs → api-notifications.js} +5 -12
  65. package/dist/NotificationServicesController/services/api-notifications.js.map +1 -0
  66. package/dist/NotificationServicesController/services/{feature-announcements.d.mts → feature-announcements.d.ts} +4 -4
  67. package/dist/NotificationServicesController/services/feature-announcements.d.ts.map +1 -0
  68. package/dist/NotificationServicesController/services/{feature-announcements.mjs → feature-announcements.js} +5 -5
  69. package/dist/NotificationServicesController/services/feature-announcements.js.map +1 -0
  70. package/dist/NotificationServicesController/services/{notification-config-cache.d.mts → notification-config-cache.d.ts} +1 -1
  71. package/dist/NotificationServicesController/services/notification-config-cache.d.ts.map +1 -0
  72. package/dist/NotificationServicesController/services/notification-config-cache.js +43 -0
  73. package/dist/NotificationServicesController/services/notification-config-cache.js.map +1 -0
  74. package/dist/NotificationServicesController/services/{perp-notifications.d.cts → perp-notifications.d.ts} +2 -2
  75. package/dist/NotificationServicesController/services/perp-notifications.d.ts.map +1 -0
  76. package/dist/NotificationServicesController/services/{perp-notifications.mjs → perp-notifications.js} +2 -2
  77. package/dist/NotificationServicesController/services/perp-notifications.js.map +1 -0
  78. package/dist/NotificationServicesController/types/feature-announcement/{feature-announcement.d.cts → feature-announcement.d.ts} +3 -3
  79. package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.d.ts.map +1 -0
  80. package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.js +2 -0
  81. package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.js.map +1 -0
  82. package/dist/NotificationServicesController/types/feature-announcement/index.d.ts +4 -0
  83. package/dist/NotificationServicesController/types/feature-announcement/index.d.ts.map +1 -0
  84. package/dist/NotificationServicesController/types/feature-announcement/index.js +2 -0
  85. package/dist/NotificationServicesController/types/feature-announcement/index.js.map +1 -0
  86. package/dist/NotificationServicesController/types/feature-announcement/{type-feature-announcement.d.cts → type-feature-announcement.d.ts} +3 -3
  87. package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.d.ts.map +1 -0
  88. package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.js +2 -0
  89. package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.js.map +1 -0
  90. package/dist/NotificationServicesController/types/feature-announcement/{type-links.d.cts → type-links.d.ts} +1 -1
  91. package/dist/NotificationServicesController/types/feature-announcement/type-links.d.ts.map +1 -0
  92. package/dist/NotificationServicesController/types/feature-announcement/type-links.js +2 -0
  93. package/dist/NotificationServicesController/types/feature-announcement/type-links.js.map +1 -0
  94. package/dist/NotificationServicesController/types/index.d.ts +6 -0
  95. package/dist/NotificationServicesController/types/index.d.ts.map +1 -0
  96. package/dist/NotificationServicesController/types/index.js +2 -0
  97. package/dist/NotificationServicesController/types/index.js.map +1 -0
  98. package/dist/NotificationServicesController/types/notification/index.d.ts +2 -0
  99. package/dist/NotificationServicesController/types/notification/index.d.ts.map +1 -0
  100. package/dist/NotificationServicesController/types/notification/index.js +2 -0
  101. package/dist/NotificationServicesController/types/notification/index.js.map +1 -0
  102. package/dist/NotificationServicesController/types/notification/{notification.d.cts → notification.d.ts} +5 -5
  103. package/dist/NotificationServicesController/types/notification/notification.d.ts.map +1 -0
  104. package/dist/NotificationServicesController/types/notification/notification.js +2 -0
  105. package/dist/NotificationServicesController/types/notification/notification.js.map +1 -0
  106. package/dist/NotificationServicesController/types/notification-api/index.d.ts +3 -0
  107. package/dist/NotificationServicesController/types/notification-api/index.d.ts.map +1 -0
  108. package/dist/NotificationServicesController/types/notification-api/index.js +2 -0
  109. package/dist/NotificationServicesController/types/notification-api/index.js.map +1 -0
  110. package/dist/NotificationServicesController/types/notification-api/{notification-api.d.mts → notification-api.d.ts} +4 -4
  111. package/dist/NotificationServicesController/types/notification-api/notification-api.d.ts.map +1 -0
  112. package/dist/NotificationServicesController/types/notification-api/notification-api.js +2 -0
  113. package/dist/NotificationServicesController/types/notification-api/notification-api.js.map +1 -0
  114. package/dist/NotificationServicesController/types/notification-api/{schema.d.cts → schema.d.ts} +1 -1
  115. package/dist/NotificationServicesController/types/notification-api/schema.d.ts.map +1 -0
  116. package/dist/NotificationServicesController/types/notification-api/{schema.mjs → schema.js} +1 -1
  117. package/dist/NotificationServicesController/types/notification-api/schema.js.map +1 -0
  118. package/dist/NotificationServicesController/types/perps/index.d.ts +2 -0
  119. package/dist/NotificationServicesController/types/perps/index.d.ts.map +1 -0
  120. package/dist/NotificationServicesController/types/perps/index.js +2 -0
  121. package/dist/NotificationServicesController/types/perps/index.js.map +1 -0
  122. package/dist/NotificationServicesController/types/perps/perp-types.d.ts +3 -0
  123. package/dist/NotificationServicesController/types/perps/perp-types.d.ts.map +1 -0
  124. package/dist/NotificationServicesController/types/perps/perp-types.js +2 -0
  125. package/dist/NotificationServicesController/types/perps/perp-types.js.map +1 -0
  126. package/dist/NotificationServicesController/types/perps/{schema.d.cts → schema.d.ts} +1 -1
  127. package/dist/NotificationServicesController/types/perps/schema.d.ts.map +1 -0
  128. package/dist/NotificationServicesController/types/perps/{schema.mjs → schema.js} +1 -1
  129. package/dist/NotificationServicesController/types/perps/schema.js.map +1 -0
  130. package/dist/NotificationServicesController/types/snaps/index.d.ts +2 -0
  131. package/dist/NotificationServicesController/types/snaps/index.d.ts.map +1 -0
  132. package/dist/NotificationServicesController/types/snaps/index.js +2 -0
  133. package/dist/NotificationServicesController/types/snaps/index.js.map +1 -0
  134. package/dist/NotificationServicesController/types/snaps/{snaps.d.cts → snaps.d.ts} +2 -2
  135. package/dist/NotificationServicesController/types/snaps/snaps.d.ts.map +1 -0
  136. package/dist/NotificationServicesController/types/snaps/snaps.js +2 -0
  137. package/dist/NotificationServicesController/types/snaps/snaps.js.map +1 -0
  138. package/dist/NotificationServicesController/types/{type-utils.d.cts → type-utils.d.ts} +1 -1
  139. package/dist/NotificationServicesController/types/type-utils.d.ts.map +1 -0
  140. package/dist/NotificationServicesController/types/type-utils.js +2 -0
  141. package/dist/NotificationServicesController/types/type-utils.js.map +1 -0
  142. package/dist/NotificationServicesController/utils/{get-notification-subtype.d.cts → get-notification-subtype.d.ts} +2 -2
  143. package/dist/NotificationServicesController/utils/get-notification-subtype.d.ts.map +1 -0
  144. package/dist/NotificationServicesController/utils/{get-notification-subtype.mjs → get-notification-subtype.js} +3 -3
  145. package/dist/NotificationServicesController/utils/get-notification-subtype.js.map +1 -0
  146. package/dist/NotificationServicesController/utils/{isVersionInBounds.d.cts → isVersionInBounds.d.ts} +1 -1
  147. package/dist/NotificationServicesController/utils/isVersionInBounds.d.ts.map +1 -0
  148. package/dist/NotificationServicesController/utils/{isVersionInBounds.mjs → isVersionInBounds.js} +2 -2
  149. package/dist/NotificationServicesController/utils/isVersionInBounds.js.map +1 -0
  150. package/dist/NotificationServicesController/utils/{should-auto-expire.d.cts → should-auto-expire.d.ts} +1 -1
  151. package/dist/NotificationServicesController/utils/should-auto-expire.d.ts.map +1 -0
  152. package/dist/NotificationServicesController/utils/{should-auto-expire.mjs → should-auto-expire.js} +1 -1
  153. package/dist/NotificationServicesController/utils/should-auto-expire.js.map +1 -0
  154. package/dist/NotificationServicesController/utils/{utils.d.cts → utils.d.ts} +1 -1
  155. package/dist/NotificationServicesController/utils/utils.d.ts.map +1 -0
  156. package/dist/NotificationServicesController/utils/{utils.mjs → utils.js} +1 -1
  157. package/dist/NotificationServicesController/utils/utils.js.map +1 -0
  158. package/dist/NotificationServicesPushController/{NotificationServicesPushController-method-action-types.d.cts → NotificationServicesPushController-method-action-types.d.ts} +2 -2
  159. package/dist/NotificationServicesPushController/NotificationServicesPushController-method-action-types.d.ts.map +1 -0
  160. package/dist/NotificationServicesPushController/{NotificationServicesPushController-method-action-types.mjs → NotificationServicesPushController-method-action-types.js} +1 -1
  161. package/dist/NotificationServicesPushController/NotificationServicesPushController-method-action-types.js.map +1 -0
  162. package/dist/NotificationServicesPushController/{NotificationServicesPushController.d.cts → NotificationServicesPushController.d.ts} +9 -9
  163. package/dist/NotificationServicesPushController/NotificationServicesPushController.d.ts.map +1 -0
  164. package/dist/NotificationServicesPushController/NotificationServicesPushController.js +326 -0
  165. package/dist/NotificationServicesPushController/NotificationServicesPushController.js.map +1 -0
  166. package/dist/NotificationServicesPushController/{index.d.cts → index.d.ts} +9 -9
  167. package/dist/NotificationServicesPushController/index.d.ts.map +1 -0
  168. package/dist/NotificationServicesPushController/index.js +8 -0
  169. package/dist/NotificationServicesPushController/index.js.map +1 -0
  170. package/dist/NotificationServicesPushController/mocks/index.d.ts +2 -0
  171. package/dist/NotificationServicesPushController/mocks/index.d.ts.map +1 -0
  172. package/dist/NotificationServicesPushController/mocks/index.js +2 -0
  173. package/dist/NotificationServicesPushController/mocks/index.js.map +1 -0
  174. package/dist/NotificationServicesPushController/mocks/{mockResponse.d.mts → mockResponse.d.ts} +1 -1
  175. package/dist/NotificationServicesPushController/mocks/mockResponse.d.ts.map +1 -0
  176. package/dist/NotificationServicesPushController/mocks/{mockResponse.mjs → mockResponse.js} +2 -2
  177. package/dist/NotificationServicesPushController/mocks/mockResponse.js.map +1 -0
  178. package/dist/NotificationServicesPushController/services/{endpoints.d.cts → endpoints.d.ts} +1 -1
  179. package/dist/NotificationServicesPushController/services/endpoints.d.ts.map +1 -0
  180. package/dist/NotificationServicesPushController/services/{endpoints.mjs → endpoints.js} +1 -1
  181. package/dist/NotificationServicesPushController/services/endpoints.js.map +1 -0
  182. package/dist/NotificationServicesPushController/services/{services.d.mts → services.d.ts} +4 -4
  183. package/dist/NotificationServicesPushController/services/services.d.ts.map +1 -0
  184. package/dist/NotificationServicesPushController/services/{services.mjs → services.js} +2 -2
  185. package/dist/NotificationServicesPushController/services/services.js.map +1 -0
  186. package/dist/NotificationServicesPushController/types/{firebase.d.mts → firebase.d.ts} +1 -1
  187. package/dist/NotificationServicesPushController/types/firebase.d.ts.map +1 -0
  188. package/dist/NotificationServicesPushController/types/firebase.js +2 -0
  189. package/dist/NotificationServicesPushController/types/firebase.js.map +1 -0
  190. package/dist/NotificationServicesPushController/types/index.d.ts +4 -0
  191. package/dist/NotificationServicesPushController/types/index.d.ts.map +1 -0
  192. package/dist/NotificationServicesPushController/types/index.js +2 -0
  193. package/dist/NotificationServicesPushController/types/index.js.map +1 -0
  194. package/dist/NotificationServicesPushController/types/{push-analytics.d.cts → push-analytics.d.ts} +1 -1
  195. package/dist/NotificationServicesPushController/types/push-analytics.d.ts.map +1 -0
  196. package/dist/NotificationServicesPushController/types/{push-analytics.mjs → push-analytics.js} +1 -1
  197. package/dist/NotificationServicesPushController/types/push-analytics.js.map +1 -0
  198. package/dist/NotificationServicesPushController/types/{push-service-interface.d.cts → push-service-interface.d.ts} +2 -2
  199. package/dist/NotificationServicesPushController/types/push-service-interface.d.ts.map +1 -0
  200. package/dist/NotificationServicesPushController/types/push-service-interface.js +2 -0
  201. package/dist/NotificationServicesPushController/types/push-service-interface.js.map +1 -0
  202. package/dist/NotificationServicesPushController/utils/{get-notification-data.d.cts → get-notification-data.d.ts} +2 -2
  203. package/dist/NotificationServicesPushController/utils/get-notification-data.d.ts.map +1 -0
  204. package/dist/NotificationServicesPushController/utils/{get-notification-data.mjs → get-notification-data.js} +2 -2
  205. package/dist/NotificationServicesPushController/utils/get-notification-data.js.map +1 -0
  206. package/dist/NotificationServicesPushController/utils/{get-notification-message.d.mts → get-notification-message.d.ts} +3 -3
  207. package/dist/NotificationServicesPushController/utils/get-notification-message.d.ts.map +1 -0
  208. package/dist/NotificationServicesPushController/utils/{get-notification-message.mjs → get-notification-message.js} +2 -2
  209. package/dist/NotificationServicesPushController/utils/get-notification-message.js.map +1 -0
  210. package/dist/NotificationServicesPushController/utils/index.d.ts +4 -0
  211. package/dist/NotificationServicesPushController/utils/index.d.ts.map +1 -0
  212. package/dist/NotificationServicesPushController/utils/index.js +4 -0
  213. package/dist/NotificationServicesPushController/utils/index.js.map +1 -0
  214. package/dist/NotificationServicesPushController/utils/{to-push-analytics-payload.d.cts → to-push-analytics-payload.d.ts} +2 -2
  215. package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.d.ts.map +1 -0
  216. package/dist/NotificationServicesPushController/utils/{to-push-analytics-payload.mjs → to-push-analytics-payload.js} +1 -1
  217. package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.js.map +1 -0
  218. package/dist/NotificationServicesPushController/web/index.d.ts +2 -0
  219. package/dist/NotificationServicesPushController/web/index.d.ts.map +1 -0
  220. package/dist/NotificationServicesPushController/web/index.js +2 -0
  221. package/dist/NotificationServicesPushController/web/index.js.map +1 -0
  222. package/dist/NotificationServicesPushController/web/{push-utils.d.cts → push-utils.d.ts} +4 -5
  223. package/dist/NotificationServicesPushController/web/push-utils.d.ts.map +1 -0
  224. package/dist/NotificationServicesPushController/web/{push-utils.mjs → push-utils.js} +7 -14
  225. package/dist/NotificationServicesPushController/web/push-utils.js.map +1 -0
  226. package/dist/index.d.ts +4 -0
  227. package/dist/index.d.ts.map +1 -0
  228. package/dist/index.js +4 -0
  229. package/dist/index.js.map +1 -0
  230. package/dist/shared/index.d.ts +4 -0
  231. package/dist/shared/index.d.ts.map +1 -0
  232. package/dist/shared/index.js +4 -0
  233. package/dist/shared/index.js.map +1 -0
  234. package/dist/shared/{is-onchain-notification.d.cts → is-onchain-notification.d.ts} +2 -2
  235. package/dist/shared/is-onchain-notification.d.ts.map +1 -0
  236. package/dist/shared/{is-onchain-notification.mjs → is-onchain-notification.js} +2 -2
  237. package/dist/shared/is-onchain-notification.js.map +1 -0
  238. package/dist/shared/{notification-api-type-guards.d.mts → notification-api-type-guards.d.ts} +2 -2
  239. package/dist/shared/notification-api-type-guards.d.ts.map +1 -0
  240. package/dist/shared/{notification-api-type-guards.mjs → notification-api-type-guards.js} +1 -1
  241. package/dist/shared/notification-api-type-guards.js.map +1 -0
  242. package/dist/shared/{to-raw-notification.d.cts → to-raw-notification.d.ts} +2 -2
  243. package/dist/shared/to-raw-notification.d.ts.map +1 -0
  244. package/dist/shared/{to-raw-notification.mjs → to-raw-notification.js} +3 -3
  245. package/dist/shared/to-raw-notification.js.map +1 -0
  246. package/package.json +31 -65
  247. package/dist/NotificationServicesController/NotificationServicesController-method-action-types.cjs +0 -7
  248. package/dist/NotificationServicesController/NotificationServicesController-method-action-types.cjs.map +0 -1
  249. package/dist/NotificationServicesController/NotificationServicesController-method-action-types.d.cts +0 -206
  250. package/dist/NotificationServicesController/NotificationServicesController-method-action-types.d.cts.map +0 -1
  251. package/dist/NotificationServicesController/NotificationServicesController-method-action-types.d.mts.map +0 -1
  252. package/dist/NotificationServicesController/NotificationServicesController-method-action-types.mjs.map +0 -1
  253. package/dist/NotificationServicesController/NotificationServicesController.cjs +0 -1056
  254. package/dist/NotificationServicesController/NotificationServicesController.cjs.map +0 -1
  255. package/dist/NotificationServicesController/NotificationServicesController.d.cts.map +0 -1
  256. package/dist/NotificationServicesController/NotificationServicesController.d.mts +0 -292
  257. package/dist/NotificationServicesController/NotificationServicesController.d.mts.map +0 -1
  258. package/dist/NotificationServicesController/NotificationServicesController.mjs.map +0 -1
  259. package/dist/NotificationServicesController/constants/index.cjs +0 -18
  260. package/dist/NotificationServicesController/constants/index.cjs.map +0 -1
  261. package/dist/NotificationServicesController/constants/index.d.cts +0 -2
  262. package/dist/NotificationServicesController/constants/index.d.cts.map +0 -1
  263. package/dist/NotificationServicesController/constants/index.d.mts +0 -2
  264. package/dist/NotificationServicesController/constants/index.d.mts.map +0 -1
  265. package/dist/NotificationServicesController/constants/index.mjs +0 -2
  266. package/dist/NotificationServicesController/constants/index.mjs.map +0 -1
  267. package/dist/NotificationServicesController/constants/notification-schema.cjs +0 -46
  268. package/dist/NotificationServicesController/constants/notification-schema.cjs.map +0 -1
  269. package/dist/NotificationServicesController/constants/notification-schema.d.cts.map +0 -1
  270. package/dist/NotificationServicesController/constants/notification-schema.d.mts +0 -22
  271. package/dist/NotificationServicesController/constants/notification-schema.d.mts.map +0 -1
  272. package/dist/NotificationServicesController/constants/notification-schema.mjs.map +0 -1
  273. package/dist/NotificationServicesController/index.cjs +0 -44
  274. package/dist/NotificationServicesController/index.cjs.map +0 -1
  275. package/dist/NotificationServicesController/index.d.cts.map +0 -1
  276. package/dist/NotificationServicesController/index.d.mts +0 -16
  277. package/dist/NotificationServicesController/index.d.mts.map +0 -1
  278. package/dist/NotificationServicesController/index.mjs +0 -13
  279. package/dist/NotificationServicesController/index.mjs.map +0 -1
  280. package/dist/NotificationServicesController/mocks/index.cjs +0 -21
  281. package/dist/NotificationServicesController/mocks/index.cjs.map +0 -1
  282. package/dist/NotificationServicesController/mocks/index.d.cts +0 -5
  283. package/dist/NotificationServicesController/mocks/index.d.cts.map +0 -1
  284. package/dist/NotificationServicesController/mocks/index.d.mts +0 -5
  285. package/dist/NotificationServicesController/mocks/index.d.mts.map +0 -1
  286. package/dist/NotificationServicesController/mocks/index.mjs +0 -5
  287. package/dist/NotificationServicesController/mocks/index.mjs.map +0 -1
  288. package/dist/NotificationServicesController/mocks/mock-feature-announcements.cjs +0 -210
  289. package/dist/NotificationServicesController/mocks/mock-feature-announcements.cjs.map +0 -1
  290. package/dist/NotificationServicesController/mocks/mock-feature-announcements.d.cts.map +0 -1
  291. package/dist/NotificationServicesController/mocks/mock-feature-announcements.d.mts +0 -15
  292. package/dist/NotificationServicesController/mocks/mock-feature-announcements.d.mts.map +0 -1
  293. package/dist/NotificationServicesController/mocks/mock-feature-announcements.mjs.map +0 -1
  294. package/dist/NotificationServicesController/mocks/mock-raw-notifications.cjs +0 -830
  295. package/dist/NotificationServicesController/mocks/mock-raw-notifications.cjs.map +0 -1
  296. package/dist/NotificationServicesController/mocks/mock-raw-notifications.d.cts.map +0 -1
  297. package/dist/NotificationServicesController/mocks/mock-raw-notifications.d.mts +0 -104
  298. package/dist/NotificationServicesController/mocks/mock-raw-notifications.d.mts.map +0 -1
  299. package/dist/NotificationServicesController/mocks/mock-raw-notifications.mjs.map +0 -1
  300. package/dist/NotificationServicesController/mocks/mock-snap-notification.cjs +0 -29
  301. package/dist/NotificationServicesController/mocks/mock-snap-notification.cjs.map +0 -1
  302. package/dist/NotificationServicesController/mocks/mock-snap-notification.d.cts.map +0 -1
  303. package/dist/NotificationServicesController/mocks/mock-snap-notification.d.mts +0 -8
  304. package/dist/NotificationServicesController/mocks/mock-snap-notification.d.mts.map +0 -1
  305. package/dist/NotificationServicesController/mocks/mock-snap-notification.mjs.map +0 -1
  306. package/dist/NotificationServicesController/mocks/mockResponses.cjs +0 -61
  307. package/dist/NotificationServicesController/mocks/mockResponses.cjs.map +0 -1
  308. package/dist/NotificationServicesController/mocks/mockResponses.d.cts.map +0 -1
  309. package/dist/NotificationServicesController/mocks/mockResponses.d.mts +0 -15
  310. package/dist/NotificationServicesController/mocks/mockResponses.d.mts.map +0 -1
  311. package/dist/NotificationServicesController/mocks/mockResponses.mjs.map +0 -1
  312. package/dist/NotificationServicesController/processors/index.cjs +0 -20
  313. package/dist/NotificationServicesController/processors/index.cjs.map +0 -1
  314. package/dist/NotificationServicesController/processors/index.d.cts +0 -4
  315. package/dist/NotificationServicesController/processors/index.d.cts.map +0 -1
  316. package/dist/NotificationServicesController/processors/index.d.mts +0 -4
  317. package/dist/NotificationServicesController/processors/index.d.mts.map +0 -1
  318. package/dist/NotificationServicesController/processors/index.mjs +0 -4
  319. package/dist/NotificationServicesController/processors/index.mjs.map +0 -1
  320. package/dist/NotificationServicesController/processors/process-api-notifications.cjs +0 -24
  321. package/dist/NotificationServicesController/processors/process-api-notifications.cjs.map +0 -1
  322. package/dist/NotificationServicesController/processors/process-api-notifications.d.cts.map +0 -1
  323. package/dist/NotificationServicesController/processors/process-api-notifications.d.mts +0 -10
  324. package/dist/NotificationServicesController/processors/process-api-notifications.d.mts.map +0 -1
  325. package/dist/NotificationServicesController/processors/process-api-notifications.mjs.map +0 -1
  326. package/dist/NotificationServicesController/processors/process-feature-announcement.cjs +0 -38
  327. package/dist/NotificationServicesController/processors/process-feature-announcement.cjs.map +0 -1
  328. package/dist/NotificationServicesController/processors/process-feature-announcement.d.cts +0 -19
  329. package/dist/NotificationServicesController/processors/process-feature-announcement.d.cts.map +0 -1
  330. package/dist/NotificationServicesController/processors/process-feature-announcement.d.mts.map +0 -1
  331. package/dist/NotificationServicesController/processors/process-feature-announcement.mjs.map +0 -1
  332. package/dist/NotificationServicesController/processors/process-notifications.cjs +0 -60
  333. package/dist/NotificationServicesController/processors/process-notifications.cjs.map +0 -1
  334. package/dist/NotificationServicesController/processors/process-notifications.d.cts.map +0 -1
  335. package/dist/NotificationServicesController/processors/process-notifications.d.mts +0 -20
  336. package/dist/NotificationServicesController/processors/process-notifications.d.mts.map +0 -1
  337. package/dist/NotificationServicesController/processors/process-notifications.mjs.map +0 -1
  338. package/dist/NotificationServicesController/processors/process-snap-notifications.cjs +0 -25
  339. package/dist/NotificationServicesController/processors/process-snap-notifications.cjs.map +0 -1
  340. package/dist/NotificationServicesController/processors/process-snap-notifications.d.cts.map +0 -1
  341. package/dist/NotificationServicesController/processors/process-snap-notifications.d.mts +0 -10
  342. package/dist/NotificationServicesController/processors/process-snap-notifications.d.mts.map +0 -1
  343. package/dist/NotificationServicesController/processors/process-snap-notifications.mjs.map +0 -1
  344. package/dist/NotificationServicesController/services/api-notifications.cjs +0 -167
  345. package/dist/NotificationServicesController/services/api-notifications.cjs.map +0 -1
  346. package/dist/NotificationServicesController/services/api-notifications.d.cts.map +0 -1
  347. package/dist/NotificationServicesController/services/api-notifications.d.mts +0 -65
  348. package/dist/NotificationServicesController/services/api-notifications.d.mts.map +0 -1
  349. package/dist/NotificationServicesController/services/api-notifications.mjs.map +0 -1
  350. package/dist/NotificationServicesController/services/feature-announcements.cjs +0 -140
  351. package/dist/NotificationServicesController/services/feature-announcements.cjs.map +0 -1
  352. package/dist/NotificationServicesController/services/feature-announcements.d.cts +0 -32
  353. package/dist/NotificationServicesController/services/feature-announcements.d.cts.map +0 -1
  354. package/dist/NotificationServicesController/services/feature-announcements.d.mts.map +0 -1
  355. package/dist/NotificationServicesController/services/feature-announcements.mjs.map +0 -1
  356. package/dist/NotificationServicesController/services/notification-config-cache.cjs +0 -61
  357. package/dist/NotificationServicesController/services/notification-config-cache.cjs.map +0 -1
  358. package/dist/NotificationServicesController/services/notification-config-cache.d.cts +0 -15
  359. package/dist/NotificationServicesController/services/notification-config-cache.d.cts.map +0 -1
  360. package/dist/NotificationServicesController/services/notification-config-cache.d.mts.map +0 -1
  361. package/dist/NotificationServicesController/services/notification-config-cache.mjs +0 -57
  362. package/dist/NotificationServicesController/services/notification-config-cache.mjs.map +0 -1
  363. package/dist/NotificationServicesController/services/perp-notifications.cjs +0 -31
  364. package/dist/NotificationServicesController/services/perp-notifications.cjs.map +0 -1
  365. package/dist/NotificationServicesController/services/perp-notifications.d.cts.map +0 -1
  366. package/dist/NotificationServicesController/services/perp-notifications.d.mts +0 -11
  367. package/dist/NotificationServicesController/services/perp-notifications.d.mts.map +0 -1
  368. package/dist/NotificationServicesController/services/perp-notifications.mjs.map +0 -1
  369. package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.cjs +0 -3
  370. package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.cjs.map +0 -1
  371. package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.d.cts.map +0 -1
  372. package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.d.mts +0 -32
  373. package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.d.mts.map +0 -1
  374. package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.mjs +0 -2
  375. package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.mjs.map +0 -1
  376. package/dist/NotificationServicesController/types/feature-announcement/index.cjs +0 -3
  377. package/dist/NotificationServicesController/types/feature-announcement/index.cjs.map +0 -1
  378. package/dist/NotificationServicesController/types/feature-announcement/index.d.cts +0 -4
  379. package/dist/NotificationServicesController/types/feature-announcement/index.d.cts.map +0 -1
  380. package/dist/NotificationServicesController/types/feature-announcement/index.d.mts +0 -4
  381. package/dist/NotificationServicesController/types/feature-announcement/index.d.mts.map +0 -1
  382. package/dist/NotificationServicesController/types/feature-announcement/index.mjs +0 -2
  383. package/dist/NotificationServicesController/types/feature-announcement/index.mjs.map +0 -1
  384. package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.cjs +0 -3
  385. package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.cjs.map +0 -1
  386. package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.d.cts.map +0 -1
  387. package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.d.mts +0 -43
  388. package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.d.mts.map +0 -1
  389. package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.mjs +0 -2
  390. package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.mjs.map +0 -1
  391. package/dist/NotificationServicesController/types/feature-announcement/type-links.cjs +0 -3
  392. package/dist/NotificationServicesController/types/feature-announcement/type-links.cjs.map +0 -1
  393. package/dist/NotificationServicesController/types/feature-announcement/type-links.d.cts.map +0 -1
  394. package/dist/NotificationServicesController/types/feature-announcement/type-links.d.mts +0 -29
  395. package/dist/NotificationServicesController/types/feature-announcement/type-links.d.mts.map +0 -1
  396. package/dist/NotificationServicesController/types/feature-announcement/type-links.mjs +0 -2
  397. package/dist/NotificationServicesController/types/feature-announcement/type-links.mjs.map +0 -1
  398. package/dist/NotificationServicesController/types/index.cjs +0 -3
  399. package/dist/NotificationServicesController/types/index.cjs.map +0 -1
  400. package/dist/NotificationServicesController/types/index.d.cts +0 -6
  401. package/dist/NotificationServicesController/types/index.d.cts.map +0 -1
  402. package/dist/NotificationServicesController/types/index.d.mts +0 -6
  403. package/dist/NotificationServicesController/types/index.d.mts.map +0 -1
  404. package/dist/NotificationServicesController/types/index.mjs +0 -2
  405. package/dist/NotificationServicesController/types/index.mjs.map +0 -1
  406. package/dist/NotificationServicesController/types/notification/index.cjs +0 -3
  407. package/dist/NotificationServicesController/types/notification/index.cjs.map +0 -1
  408. package/dist/NotificationServicesController/types/notification/index.d.cts +0 -2
  409. package/dist/NotificationServicesController/types/notification/index.d.cts.map +0 -1
  410. package/dist/NotificationServicesController/types/notification/index.d.mts +0 -2
  411. package/dist/NotificationServicesController/types/notification/index.d.mts.map +0 -1
  412. package/dist/NotificationServicesController/types/notification/index.mjs +0 -2
  413. package/dist/NotificationServicesController/types/notification/index.mjs.map +0 -1
  414. package/dist/NotificationServicesController/types/notification/notification.cjs +0 -3
  415. package/dist/NotificationServicesController/types/notification/notification.cjs.map +0 -1
  416. package/dist/NotificationServicesController/types/notification/notification.d.cts.map +0 -1
  417. package/dist/NotificationServicesController/types/notification/notification.d.mts +0 -22
  418. package/dist/NotificationServicesController/types/notification/notification.d.mts.map +0 -1
  419. package/dist/NotificationServicesController/types/notification/notification.mjs +0 -2
  420. package/dist/NotificationServicesController/types/notification/notification.mjs.map +0 -1
  421. package/dist/NotificationServicesController/types/notification-api/index.cjs +0 -3
  422. package/dist/NotificationServicesController/types/notification-api/index.cjs.map +0 -1
  423. package/dist/NotificationServicesController/types/notification-api/index.d.cts +0 -3
  424. package/dist/NotificationServicesController/types/notification-api/index.d.cts.map +0 -1
  425. package/dist/NotificationServicesController/types/notification-api/index.d.mts +0 -3
  426. package/dist/NotificationServicesController/types/notification-api/index.d.mts.map +0 -1
  427. package/dist/NotificationServicesController/types/notification-api/index.mjs +0 -2
  428. package/dist/NotificationServicesController/types/notification-api/index.mjs.map +0 -1
  429. package/dist/NotificationServicesController/types/notification-api/notification-api.cjs +0 -4
  430. package/dist/NotificationServicesController/types/notification-api/notification-api.cjs.map +0 -1
  431. package/dist/NotificationServicesController/types/notification-api/notification-api.d.cts +0 -59
  432. package/dist/NotificationServicesController/types/notification-api/notification-api.d.cts.map +0 -1
  433. package/dist/NotificationServicesController/types/notification-api/notification-api.d.mts.map +0 -1
  434. package/dist/NotificationServicesController/types/notification-api/notification-api.mjs +0 -2
  435. package/dist/NotificationServicesController/types/notification-api/notification-api.mjs.map +0 -1
  436. package/dist/NotificationServicesController/types/notification-api/schema.cjs +0 -6
  437. package/dist/NotificationServicesController/types/notification-api/schema.cjs.map +0 -1
  438. package/dist/NotificationServicesController/types/notification-api/schema.d.cts.map +0 -1
  439. package/dist/NotificationServicesController/types/notification-api/schema.d.mts +0 -752
  440. package/dist/NotificationServicesController/types/notification-api/schema.d.mts.map +0 -1
  441. package/dist/NotificationServicesController/types/notification-api/schema.mjs.map +0 -1
  442. package/dist/NotificationServicesController/types/perps/index.cjs +0 -3
  443. package/dist/NotificationServicesController/types/perps/index.cjs.map +0 -1
  444. package/dist/NotificationServicesController/types/perps/index.d.cts +0 -2
  445. package/dist/NotificationServicesController/types/perps/index.d.cts.map +0 -1
  446. package/dist/NotificationServicesController/types/perps/index.d.mts +0 -2
  447. package/dist/NotificationServicesController/types/perps/index.d.mts.map +0 -1
  448. package/dist/NotificationServicesController/types/perps/index.mjs +0 -2
  449. package/dist/NotificationServicesController/types/perps/index.mjs.map +0 -1
  450. package/dist/NotificationServicesController/types/perps/perp-types.cjs +0 -3
  451. package/dist/NotificationServicesController/types/perps/perp-types.cjs.map +0 -1
  452. package/dist/NotificationServicesController/types/perps/perp-types.d.cts +0 -3
  453. package/dist/NotificationServicesController/types/perps/perp-types.d.cts.map +0 -1
  454. package/dist/NotificationServicesController/types/perps/perp-types.d.mts +0 -3
  455. package/dist/NotificationServicesController/types/perps/perp-types.d.mts.map +0 -1
  456. package/dist/NotificationServicesController/types/perps/perp-types.mjs +0 -2
  457. package/dist/NotificationServicesController/types/perps/perp-types.mjs.map +0 -1
  458. package/dist/NotificationServicesController/types/perps/schema.cjs +0 -6
  459. package/dist/NotificationServicesController/types/perps/schema.cjs.map +0 -1
  460. package/dist/NotificationServicesController/types/perps/schema.d.cts.map +0 -1
  461. package/dist/NotificationServicesController/types/perps/schema.d.mts +0 -133
  462. package/dist/NotificationServicesController/types/perps/schema.d.mts.map +0 -1
  463. package/dist/NotificationServicesController/types/perps/schema.mjs.map +0 -1
  464. package/dist/NotificationServicesController/types/snaps/index.cjs +0 -3
  465. package/dist/NotificationServicesController/types/snaps/index.cjs.map +0 -1
  466. package/dist/NotificationServicesController/types/snaps/index.d.cts +0 -2
  467. package/dist/NotificationServicesController/types/snaps/index.d.cts.map +0 -1
  468. package/dist/NotificationServicesController/types/snaps/index.d.mts +0 -2
  469. package/dist/NotificationServicesController/types/snaps/index.d.mts.map +0 -1
  470. package/dist/NotificationServicesController/types/snaps/index.mjs +0 -2
  471. package/dist/NotificationServicesController/types/snaps/index.mjs.map +0 -1
  472. package/dist/NotificationServicesController/types/snaps/snaps.cjs +0 -3
  473. package/dist/NotificationServicesController/types/snaps/snaps.cjs.map +0 -1
  474. package/dist/NotificationServicesController/types/snaps/snaps.d.cts.map +0 -1
  475. package/dist/NotificationServicesController/types/snaps/snaps.d.mts +0 -23
  476. package/dist/NotificationServicesController/types/snaps/snaps.d.mts.map +0 -1
  477. package/dist/NotificationServicesController/types/snaps/snaps.mjs +0 -2
  478. package/dist/NotificationServicesController/types/snaps/snaps.mjs.map +0 -1
  479. package/dist/NotificationServicesController/types/type-utils.cjs +0 -3
  480. package/dist/NotificationServicesController/types/type-utils.cjs.map +0 -1
  481. package/dist/NotificationServicesController/types/type-utils.d.cts.map +0 -1
  482. package/dist/NotificationServicesController/types/type-utils.d.mts +0 -7
  483. package/dist/NotificationServicesController/types/type-utils.d.mts.map +0 -1
  484. package/dist/NotificationServicesController/types/type-utils.mjs +0 -2
  485. package/dist/NotificationServicesController/types/type-utils.mjs.map +0 -1
  486. package/dist/NotificationServicesController/utils/get-notification-subtype.cjs +0 -33
  487. package/dist/NotificationServicesController/utils/get-notification-subtype.cjs.map +0 -1
  488. package/dist/NotificationServicesController/utils/get-notification-subtype.d.cts.map +0 -1
  489. package/dist/NotificationServicesController/utils/get-notification-subtype.d.mts +0 -17
  490. package/dist/NotificationServicesController/utils/get-notification-subtype.d.mts.map +0 -1
  491. package/dist/NotificationServicesController/utils/get-notification-subtype.mjs.map +0 -1
  492. package/dist/NotificationServicesController/utils/isVersionInBounds.cjs +0 -37
  493. package/dist/NotificationServicesController/utils/isVersionInBounds.cjs.map +0 -1
  494. package/dist/NotificationServicesController/utils/isVersionInBounds.d.cts.map +0 -1
  495. package/dist/NotificationServicesController/utils/isVersionInBounds.d.mts +0 -18
  496. package/dist/NotificationServicesController/utils/isVersionInBounds.d.mts.map +0 -1
  497. package/dist/NotificationServicesController/utils/isVersionInBounds.mjs.map +0 -1
  498. package/dist/NotificationServicesController/utils/should-auto-expire.cjs +0 -12
  499. package/dist/NotificationServicesController/utils/should-auto-expire.cjs.map +0 -1
  500. package/dist/NotificationServicesController/utils/should-auto-expire.d.cts.map +0 -1
  501. package/dist/NotificationServicesController/utils/should-auto-expire.d.mts +0 -2
  502. package/dist/NotificationServicesController/utils/should-auto-expire.d.mts.map +0 -1
  503. package/dist/NotificationServicesController/utils/should-auto-expire.mjs.map +0 -1
  504. package/dist/NotificationServicesController/utils/utils.cjs +0 -25
  505. package/dist/NotificationServicesController/utils/utils.cjs.map +0 -1
  506. package/dist/NotificationServicesController/utils/utils.d.cts.map +0 -1
  507. package/dist/NotificationServicesController/utils/utils.d.mts +0 -11
  508. package/dist/NotificationServicesController/utils/utils.d.mts.map +0 -1
  509. package/dist/NotificationServicesController/utils/utils.mjs.map +0 -1
  510. package/dist/NotificationServicesPushController/NotificationServicesPushController-method-action-types.cjs +0 -7
  511. package/dist/NotificationServicesPushController/NotificationServicesPushController-method-action-types.cjs.map +0 -1
  512. package/dist/NotificationServicesPushController/NotificationServicesPushController-method-action-types.d.cts.map +0 -1
  513. package/dist/NotificationServicesPushController/NotificationServicesPushController-method-action-types.d.mts +0 -72
  514. package/dist/NotificationServicesPushController/NotificationServicesPushController-method-action-types.d.mts.map +0 -1
  515. package/dist/NotificationServicesPushController/NotificationServicesPushController-method-action-types.mjs.map +0 -1
  516. package/dist/NotificationServicesPushController/NotificationServicesPushController.cjs +0 -342
  517. package/dist/NotificationServicesPushController/NotificationServicesPushController.cjs.map +0 -1
  518. package/dist/NotificationServicesPushController/NotificationServicesPushController.d.cts.map +0 -1
  519. package/dist/NotificationServicesPushController/NotificationServicesPushController.d.mts +0 -123
  520. package/dist/NotificationServicesPushController/NotificationServicesPushController.d.mts.map +0 -1
  521. package/dist/NotificationServicesPushController/NotificationServicesPushController.mjs +0 -342
  522. package/dist/NotificationServicesPushController/NotificationServicesPushController.mjs.map +0 -1
  523. package/dist/NotificationServicesPushController/index.cjs +0 -37
  524. package/dist/NotificationServicesPushController/index.cjs.map +0 -1
  525. package/dist/NotificationServicesPushController/index.d.cts.map +0 -1
  526. package/dist/NotificationServicesPushController/index.d.mts +0 -11
  527. package/dist/NotificationServicesPushController/index.d.mts.map +0 -1
  528. package/dist/NotificationServicesPushController/index.mjs +0 -8
  529. package/dist/NotificationServicesPushController/index.mjs.map +0 -1
  530. package/dist/NotificationServicesPushController/mocks/index.cjs +0 -18
  531. package/dist/NotificationServicesPushController/mocks/index.cjs.map +0 -1
  532. package/dist/NotificationServicesPushController/mocks/index.d.cts +0 -2
  533. package/dist/NotificationServicesPushController/mocks/index.d.cts.map +0 -1
  534. package/dist/NotificationServicesPushController/mocks/index.d.mts +0 -2
  535. package/dist/NotificationServicesPushController/mocks/index.d.mts.map +0 -1
  536. package/dist/NotificationServicesPushController/mocks/index.mjs +0 -2
  537. package/dist/NotificationServicesPushController/mocks/index.mjs.map +0 -1
  538. package/dist/NotificationServicesPushController/mocks/mockResponse.cjs +0 -48
  539. package/dist/NotificationServicesPushController/mocks/mockResponse.cjs.map +0 -1
  540. package/dist/NotificationServicesPushController/mocks/mockResponse.d.cts +0 -22
  541. package/dist/NotificationServicesPushController/mocks/mockResponse.d.cts.map +0 -1
  542. package/dist/NotificationServicesPushController/mocks/mockResponse.d.mts.map +0 -1
  543. package/dist/NotificationServicesPushController/mocks/mockResponse.mjs.map +0 -1
  544. package/dist/NotificationServicesPushController/services/endpoints.cjs +0 -13
  545. package/dist/NotificationServicesPushController/services/endpoints.cjs.map +0 -1
  546. package/dist/NotificationServicesPushController/services/endpoints.d.cts.map +0 -1
  547. package/dist/NotificationServicesPushController/services/endpoints.d.mts +0 -4
  548. package/dist/NotificationServicesPushController/services/endpoints.d.mts.map +0 -1
  549. package/dist/NotificationServicesPushController/services/endpoints.mjs.map +0 -1
  550. package/dist/NotificationServicesPushController/services/services.cjs +0 -133
  551. package/dist/NotificationServicesPushController/services/services.cjs.map +0 -1
  552. package/dist/NotificationServicesPushController/services/services.d.cts +0 -90
  553. package/dist/NotificationServicesPushController/services/services.d.cts.map +0 -1
  554. package/dist/NotificationServicesPushController/services/services.d.mts.map +0 -1
  555. package/dist/NotificationServicesPushController/services/services.mjs.map +0 -1
  556. package/dist/NotificationServicesPushController/types/firebase.cjs +0 -3
  557. package/dist/NotificationServicesPushController/types/firebase.cjs.map +0 -1
  558. package/dist/NotificationServicesPushController/types/firebase.d.cts +0 -53
  559. package/dist/NotificationServicesPushController/types/firebase.d.cts.map +0 -1
  560. package/dist/NotificationServicesPushController/types/firebase.d.mts.map +0 -1
  561. package/dist/NotificationServicesPushController/types/firebase.mjs +0 -2
  562. package/dist/NotificationServicesPushController/types/firebase.mjs.map +0 -1
  563. package/dist/NotificationServicesPushController/types/index.cjs +0 -3
  564. package/dist/NotificationServicesPushController/types/index.cjs.map +0 -1
  565. package/dist/NotificationServicesPushController/types/index.d.cts +0 -4
  566. package/dist/NotificationServicesPushController/types/index.d.cts.map +0 -1
  567. package/dist/NotificationServicesPushController/types/index.d.mts +0 -4
  568. package/dist/NotificationServicesPushController/types/index.d.mts.map +0 -1
  569. package/dist/NotificationServicesPushController/types/index.mjs +0 -2
  570. package/dist/NotificationServicesPushController/types/index.mjs.map +0 -1
  571. package/dist/NotificationServicesPushController/types/push-analytics.cjs +0 -5
  572. package/dist/NotificationServicesPushController/types/push-analytics.cjs.map +0 -1
  573. package/dist/NotificationServicesPushController/types/push-analytics.d.cts.map +0 -1
  574. package/dist/NotificationServicesPushController/types/push-analytics.d.mts +0 -18
  575. package/dist/NotificationServicesPushController/types/push-analytics.d.mts.map +0 -1
  576. package/dist/NotificationServicesPushController/types/push-analytics.mjs.map +0 -1
  577. package/dist/NotificationServicesPushController/types/push-service-interface.cjs +0 -3
  578. package/dist/NotificationServicesPushController/types/push-service-interface.cjs.map +0 -1
  579. package/dist/NotificationServicesPushController/types/push-service-interface.d.cts.map +0 -1
  580. package/dist/NotificationServicesPushController/types/push-service-interface.d.mts +0 -30
  581. package/dist/NotificationServicesPushController/types/push-service-interface.d.mts.map +0 -1
  582. package/dist/NotificationServicesPushController/types/push-service-interface.mjs +0 -2
  583. package/dist/NotificationServicesPushController/types/push-service-interface.mjs.map +0 -1
  584. package/dist/NotificationServicesPushController/utils/get-notification-data.cjs +0 -84
  585. package/dist/NotificationServicesPushController/utils/get-notification-data.cjs.map +0 -1
  586. package/dist/NotificationServicesPushController/utils/get-notification-data.d.cts.map +0 -1
  587. package/dist/NotificationServicesPushController/utils/get-notification-data.d.mts +0 -42
  588. package/dist/NotificationServicesPushController/utils/get-notification-data.d.mts.map +0 -1
  589. package/dist/NotificationServicesPushController/utils/get-notification-data.mjs.map +0 -1
  590. package/dist/NotificationServicesPushController/utils/get-notification-message.cjs +0 -171
  591. package/dist/NotificationServicesPushController/utils/get-notification-message.cjs.map +0 -1
  592. package/dist/NotificationServicesPushController/utils/get-notification-message.d.cts +0 -62
  593. package/dist/NotificationServicesPushController/utils/get-notification-message.d.cts.map +0 -1
  594. package/dist/NotificationServicesPushController/utils/get-notification-message.d.mts.map +0 -1
  595. package/dist/NotificationServicesPushController/utils/get-notification-message.mjs.map +0 -1
  596. package/dist/NotificationServicesPushController/utils/index.cjs +0 -20
  597. package/dist/NotificationServicesPushController/utils/index.cjs.map +0 -1
  598. package/dist/NotificationServicesPushController/utils/index.d.cts +0 -4
  599. package/dist/NotificationServicesPushController/utils/index.d.cts.map +0 -1
  600. package/dist/NotificationServicesPushController/utils/index.d.mts +0 -4
  601. package/dist/NotificationServicesPushController/utils/index.d.mts.map +0 -1
  602. package/dist/NotificationServicesPushController/utils/index.mjs +0 -4
  603. package/dist/NotificationServicesPushController/utils/index.mjs.map +0 -1
  604. package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.cjs +0 -26
  605. package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.cjs.map +0 -1
  606. package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.d.cts.map +0 -1
  607. package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.d.mts +0 -12
  608. package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.d.mts.map +0 -1
  609. package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.mjs.map +0 -1
  610. package/dist/NotificationServicesPushController/web/index.cjs +0 -8
  611. package/dist/NotificationServicesPushController/web/index.cjs.map +0 -1
  612. package/dist/NotificationServicesPushController/web/index.d.cts +0 -2
  613. package/dist/NotificationServicesPushController/web/index.d.cts.map +0 -1
  614. package/dist/NotificationServicesPushController/web/index.d.mts +0 -2
  615. package/dist/NotificationServicesPushController/web/index.d.mts.map +0 -1
  616. package/dist/NotificationServicesPushController/web/index.mjs +0 -2
  617. package/dist/NotificationServicesPushController/web/index.mjs.map +0 -1
  618. package/dist/NotificationServicesPushController/web/push-utils.cjs +0 -169
  619. package/dist/NotificationServicesPushController/web/push-utils.cjs.map +0 -1
  620. package/dist/NotificationServicesPushController/web/push-utils.d.cts.map +0 -1
  621. package/dist/NotificationServicesPushController/web/push-utils.d.mts +0 -37
  622. package/dist/NotificationServicesPushController/web/push-utils.d.mts.map +0 -1
  623. package/dist/NotificationServicesPushController/web/push-utils.mjs.map +0 -1
  624. package/dist/index.cjs +0 -34
  625. package/dist/index.cjs.map +0 -1
  626. package/dist/index.d.cts +0 -4
  627. package/dist/index.d.cts.map +0 -1
  628. package/dist/index.d.mts +0 -4
  629. package/dist/index.d.mts.map +0 -1
  630. package/dist/index.mjs +0 -4
  631. package/dist/index.mjs.map +0 -1
  632. package/dist/shared/index.cjs +0 -20
  633. package/dist/shared/index.cjs.map +0 -1
  634. package/dist/shared/index.d.cts +0 -4
  635. package/dist/shared/index.d.cts.map +0 -1
  636. package/dist/shared/index.d.mts +0 -4
  637. package/dist/shared/index.d.mts.map +0 -1
  638. package/dist/shared/index.mjs +0 -4
  639. package/dist/shared/index.mjs.map +0 -1
  640. package/dist/shared/is-onchain-notification.cjs +0 -15
  641. package/dist/shared/is-onchain-notification.cjs.map +0 -1
  642. package/dist/shared/is-onchain-notification.d.cts.map +0 -1
  643. package/dist/shared/is-onchain-notification.d.mts +0 -9
  644. package/dist/shared/is-onchain-notification.d.mts.map +0 -1
  645. package/dist/shared/is-onchain-notification.mjs.map +0 -1
  646. package/dist/shared/notification-api-type-guards.cjs +0 -24
  647. package/dist/shared/notification-api-type-guards.cjs.map +0 -1
  648. package/dist/shared/notification-api-type-guards.d.cts +0 -16
  649. package/dist/shared/notification-api-type-guards.d.cts.map +0 -1
  650. package/dist/shared/notification-api-type-guards.d.mts.map +0 -1
  651. package/dist/shared/notification-api-type-guards.mjs.map +0 -1
  652. package/dist/shared/to-raw-notification.cjs +0 -30
  653. package/dist/shared/to-raw-notification.cjs.map +0 -1
  654. package/dist/shared/to-raw-notification.d.cts.map +0 -1
  655. package/dist/shared/to-raw-notification.d.mts +0 -11
  656. package/dist/shared/to-raw-notification.d.mts.map +0 -1
  657. package/dist/shared/to-raw-notification.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mockResponses.d.ts","sourceRoot":"","sources":["../../../src/NotificationServicesController/mocks/mockResponses.ts"],"names":[],"mappings":"AAWA,KAAK,YAAY,GAAG;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,aAAa,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAC;IACjD,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,mBAAmB,iEAA2C,CAAC;AAG5E,eAAO,MAAM,kCAAkC,QAAO,YAMrD,CAAC;AAEF,eAAO,MAAM,iCAAiC,QAAO,YAMpD,CAAC;AAEF,eAAO,MAAM,iCAAiC,QAAO,YAMpD,CAAC;AAEF,eAAO,MAAM,+BAA+B,mDACP,CAAC;AAGtC,eAAO,MAAM,gCAAgC,QAAO,YAMnD,CAAC;AAEF,eAAO,MAAM,sCAAsC,QAAO,YAMzD,CAAC;AAEF,eAAO,MAAM,kCAAkC,QAAO,YAMrD,CAAC"}
@@ -1,8 +1,8 @@
1
- import { NOTIFICATION_API_LIST_ENDPOINT, NOTIFICATION_API_MARK_ALL_AS_READ_ENDPOINT, TRIGGER_API_NOTIFICATIONS_ENDPOINT, TRIGGER_API_NOTIFICATIONS_QUERY_ENDPOINT } from "../services/api-notifications.mjs";
2
- import { FEATURE_ANNOUNCEMENT_API } from "../services/feature-announcements.mjs";
3
- import { PERPS_API_CREATE_ORDERS } from "../services/perp-notifications.mjs";
4
- import { createMockFeatureAnnouncementAPIResult } from "./mock-feature-announcements.mjs";
5
- import { createMockRawOnChainNotifications } from "./mock-raw-notifications.mjs";
1
+ import { NOTIFICATION_API_LIST_ENDPOINT, NOTIFICATION_API_MARK_ALL_AS_READ_ENDPOINT, TRIGGER_API_NOTIFICATIONS_ENDPOINT, TRIGGER_API_NOTIFICATIONS_QUERY_ENDPOINT, } from '../services/api-notifications.js';
2
+ import { FEATURE_ANNOUNCEMENT_API } from '../services/feature-announcements.js';
3
+ import { PERPS_API_CREATE_ORDERS } from '../services/perp-notifications.js';
4
+ import { createMockFeatureAnnouncementAPIResult } from './mock-feature-announcements.js';
5
+ import { createMockRawOnChainNotifications } from './mock-raw-notifications.js';
6
6
  export const CONTENTFUL_RESPONSE = createMockFeatureAnnouncementAPIResult();
7
7
  // Using `satisfies` to preserve narrow return types while ensuring type safety; explicit return types would widen to MockResponse
8
8
  export const getMockFeatureAnnouncementResponse = () => {
@@ -49,4 +49,4 @@ export const getMockCreatePerpOrderNotification = () => {
49
49
  response: null,
50
50
  };
51
51
  };
52
- //# sourceMappingURL=mockResponses.mjs.map
52
+ //# sourceMappingURL=mockResponses.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mockResponses.js","sourceRoot":"","sources":["../../../src/NotificationServicesController/mocks/mockResponses.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,8BAA8B,EAC9B,0CAA0C,EAC1C,kCAAkC,EAClC,wCAAwC,GACzC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,EAAE,sCAAsC,EAAE,MAAM,iCAAiC,CAAC;AACzF,OAAO,EAAE,iCAAiC,EAAE,MAAM,6BAA6B,CAAC;AAQhF,MAAM,CAAC,MAAM,mBAAmB,GAAG,sCAAsC,EAAE,CAAC;AAE5E,kIAAkI;A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IFICATION_API_MARK_ALL_AS_READ_ENDPOINT,\n TRIGGER_API_NOTIFICATIONS_ENDPOINT,\n TRIGGER_API_NOTIFICATIONS_QUERY_ENDPOINT,\n} from '../services/api-notifications.js';\nimport { FEATURE_ANNOUNCEMENT_API } from '../services/feature-announcements.js';\nimport { PERPS_API_CREATE_ORDERS } from '../services/perp-notifications.js';\nimport { createMockFeatureAnnouncementAPIResult } from './mock-feature-announcements.js';\nimport { createMockRawOnChainNotifications } from './mock-raw-notifications.js';\n\ntype MockResponse = {\n url: string;\n requestMethod: 'GET' | 'POST' | 'PUT' | 'DELETE';\n response: unknown;\n};\n\nexport const CONTENTFUL_RESPONSE = createMockFeatureAnnouncementAPIResult();\n\n// Using `satisfies` to preserve narrow return types while ensuring type safety; explicit return types would widen to MockResponse\nexport const getMockFeatureAnnouncementResponse = (): MockResponse => {\n return {\n url: FEATURE_ANNOUNCEMENT_API,\n requestMethod: 'GET',\n response: CONTENTFUL_RESPONSE,\n } satisfies MockResponse;\n};\n\nexport const getMockOnChainNotificationsConfig = (): MockResponse => {\n return {\n url: TRIGGER_API_NOTIFICATIONS_QUERY_ENDPOINT(),\n requestMethod: 'POST',\n response: [{ address: '0xTestAddress', enabled: true }],\n } satisfies MockResponse;\n};\n\nexport const getMockUpdateOnChainNotifications = (): MockResponse => {\n return {\n url: TRIGGER_API_NOTIFICATIONS_ENDPOINT(),\n requestMethod: 'POST',\n response: null,\n } satisfies MockResponse;\n};\n\nexport const MOCK_RAW_ON_CHAIN_NOTIFICATIONS =\n createMockRawOnChainNotifications();\n\n// Using `satisfies` to preserve narrow return types while ensuring type safety; explicit return types would widen to MockResponse\nexport const getMockListNotificationsResponse = (): MockResponse => {\n return {\n url: NOTIFICATION_API_LIST_ENDPOINT(),\n requestMethod: 'POST',\n response: MOCK_RAW_ON_CHAIN_NOTIFICATIONS,\n } satisfies MockResponse;\n};\n\nexport const getMockMarkNotificationsAsReadResponse = (): MockResponse => {\n return {\n url: NOTIFICATION_API_MARK_ALL_AS_READ_ENDPOINT(),\n requestMethod: 'POST',\n response: null,\n } satisfies MockResponse;\n};\n\nexport const getMockCreatePerpOrderNotification = (): MockResponse => {\n return {\n url: PERPS_API_CREATE_ORDERS,\n requestMethod: 'POST',\n response: null,\n } satisfies MockResponse;\n};\n"]}
@@ -0,0 +1,4 @@
1
+ export * from './process-feature-announcement.js';
2
+ export * from './process-notifications.js';
3
+ export * from './process-api-notifications.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC;AAClD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from './process-feature-announcement.js';
2
+ export * from './process-notifications.js';
3
+ export * from './process-api-notifications.js';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC;AAClD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC","sourcesContent":["export * from './process-feature-announcement.js';\nexport * from './process-notifications.js';\nexport * from './process-api-notifications.js';\n"]}
@@ -1,5 +1,5 @@
1
- import type { NormalisedAPINotification } from "../types/notification-api/notification-api.cjs";
2
- import type { INotification } from "../types/notification/notification.cjs";
1
+ import type { NormalisedAPINotification } from '../types/notification-api/notification-api.js';
2
+ import type { INotification } from '../types/notification/notification.js';
3
3
  /**
4
4
  * Processes API notifications to a normalized INotification shape
5
5
  *
@@ -7,4 +7,4 @@ import type { INotification } from "../types/notification/notification.cjs";
7
7
  * @returns Normalized Notification
8
8
  */
9
9
  export declare function processAPINotifications(notification: NormalisedAPINotification): INotification;
10
- //# sourceMappingURL=process-api-notifications.d.cts.map
10
+ //# sourceMappingURL=process-api-notifications.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process-api-notifications.d.ts","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/process-api-notifications.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,+CAA+C,CAAC;AAC/F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAI3E;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,YAAY,EAAE,yBAAyB,GACtC,aAAa,CAWf"}
@@ -1,5 +1,5 @@
1
- import { getNotificationSubtype } from "../utils/get-notification-subtype.mjs";
2
- import { shouldAutoExpire } from "../utils/should-auto-expire.mjs";
1
+ import { getNotificationSubtype } from '../utils/get-notification-subtype.js';
2
+ import { shouldAutoExpire } from '../utils/should-auto-expire.js';
3
3
  /**
4
4
  * Processes API notifications to a normalized INotification shape
5
5
  *
@@ -17,4 +17,4 @@ export function processAPINotifications(notification) {
17
17
  isRead: expired || !notification.unread,
18
18
  };
19
19
  }
20
- //# sourceMappingURL=process-api-notifications.mjs.map
20
+ //# sourceMappingURL=process-api-notifications.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process-api-notifications.js","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/process-api-notifications.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAElE;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CACrC,YAAuC;IAEvC,MAAM,aAAa,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;IACxD,MAAM,OAAO,GAAG,gBAAgB,CAAC,aAAa,CAAC,CAAC;IAEhD,OAAO;QACL,GAAG,YAAY;QACf,EAAE,EAAE,YAAY,CAAC,EAAE;QACnB,oBAAoB,EAAE,sBAAsB,CAAC,YAAY,CAAC;QAC1D,SAAS,EAAE,aAAa,CAAC,WAAW,EAAE;QACtC,MAAM,EAAE,OAAO,IAAI,CAAC,YAAY,CAAC,MAAM;KACxC,CAAC;AACJ,CAAC","sourcesContent":["import type { NormalisedAPINotification } from '../types/notification-api/notification-api.js';\nimport type { INotification } from '../types/notification/notification.js';\nimport { getNotificationSubtype } from '../utils/get-notification-subtype.js';\nimport { shouldAutoExpire } from '../utils/should-auto-expire.js';\n\n/**\n * Processes API notifications to a normalized INotification shape\n *\n * @param notification - API Notification (On-Chain or Platform Notification)\n * @returns Normalized Notification\n */\nexport function processAPINotifications(\n notification: NormalisedAPINotification,\n): INotification {\n const createdAtDate = new Date(notification.created_at);\n const expired = shouldAutoExpire(createdAtDate);\n\n return {\n ...notification,\n id: notification.id,\n notification_subtype: getNotificationSubtype(notification),\n createdAt: createdAtDate.toISOString(),\n isRead: expired || !notification.unread,\n };\n}\n"]}
@@ -1,5 +1,5 @@
1
- import type { FeatureAnnouncementRawNotification } from "../types/feature-announcement/feature-announcement.mjs";
2
- import type { INotification } from "../types/notification/notification.mjs";
1
+ import type { FeatureAnnouncementRawNotification } from '../types/feature-announcement/feature-announcement.js';
2
+ import type { INotification } from '../types/notification/notification.js';
3
3
  /**
4
4
  * Checks if a feature announcement should be read.
5
5
  * Checks feature announcement state (from param), as well as if the notification is "expired"
@@ -16,4 +16,4 @@ export declare function isFeatureAnnouncementRead(notification: Pick<INotificati
16
16
  * @returns a normalised feature announcement
17
17
  */
18
18
  export declare function processFeatureAnnouncement(notification: FeatureAnnouncementRawNotification): INotification;
19
- //# sourceMappingURL=process-feature-announcement.d.mts.map
19
+ //# sourceMappingURL=process-feature-announcement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process-feature-announcement.d.ts","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/process-feature-announcement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,uDAAuD,CAAC;AAChH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAI3E;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,YAAY,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,GAAG,WAAW,CAAC,EACrD,6BAA6B,EAAE,MAAM,EAAE,GACtC,OAAO,CAKT;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACxC,YAAY,EAAE,kCAAkC,GAC/C,aAAa,CASf"}
@@ -1,5 +1,5 @@
1
- import { getNotificationSubtype } from "../utils/get-notification-subtype.mjs";
2
- import { shouldAutoExpire } from "../utils/should-auto-expire.mjs";
1
+ import { getNotificationSubtype } from '../utils/get-notification-subtype.js';
2
+ import { shouldAutoExpire } from '../utils/should-auto-expire.js';
3
3
  /**
4
4
  * Checks if a feature announcement should be read.
5
5
  * Checks feature announcement state (from param), as well as if the notification is "expired"
@@ -30,4 +30,4 @@ export function processFeatureAnnouncement(notification) {
30
30
  isRead: false,
31
31
  };
32
32
  }
33
- //# sourceMappingURL=process-feature-announcement.mjs.map
33
+ //# sourceMappingURL=process-feature-announcement.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process-feature-announcement.js","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/process-feature-announcement.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAElE;;;;;;;GAOG;AACH,MAAM,UAAU,yBAAyB,CACvC,YAAqD,EACrD,6BAAuC;IAEvC,IAAI,6BAA6B,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,EAAE,CAAC;QAC5D,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,gBAAgB,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC;AAC5D,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,0BAA0B,CACxC,YAAgD;IAEhD,OAAO;QACL,IAAI,EAAE,YAAY,CAAC,IAAI;QACvB,EAAE,EAAE,YAAY,CAAC,IAAI,CAAC,EAAE;QACxB,oBAAoB,EAAE,sBAAsB,CAAC,YAAY,CAAC;QAC1D,SAAS,EAAE,IAAI,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE;QACzD,IAAI,EAAE,YAAY,CAAC,IAAI;QACvB,MAAM,EAAE,KAAK;KACd,CAAC;AACJ,CAAC","sourcesContent":["import type { FeatureAnnouncementRawNotification } from '../types/feature-announcement/feature-announcement.js';\nimport type { INotification } from '../types/notification/notification.js';\nimport { getNotificationSubtype } from '../utils/get-notification-subtype.js';\nimport { shouldAutoExpire } from '../utils/should-auto-expire.js';\n\n/**\n * Checks if a feature announcement should be read.\n * Checks feature announcement state (from param), as well as if the notification is \"expired\"\n *\n * @param notification - notification to check\n * @param readPlatformNotificationsList - list of read notifications\n * @returns boolean if notification should be marked as read or unread\n */\nexport function isFeatureAnnouncementRead(\n notification: Pick<INotification, 'id' | 'createdAt'>,\n readPlatformNotificationsList: string[],\n): boolean {\n if (readPlatformNotificationsList.includes(notification.id)) {\n return true;\n }\n return shouldAutoExpire(new Date(notification.createdAt));\n}\n\n/**\n * Processes a feature announcement into a shared/normalised notification shape.\n *\n * @param notification - raw feature announcement\n * @returns a normalised feature announcement\n */\nexport function processFeatureAnnouncement(\n notification: FeatureAnnouncementRawNotification,\n): INotification {\n return {\n type: notification.type,\n id: notification.data.id,\n notification_subtype: getNotificationSubtype(notification),\n createdAt: new Date(notification.createdAt).toISOString(),\n data: notification.data,\n isRead: false,\n };\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { INotification, RawNotificationUnion } from "../types/notification/notification.cjs";
1
+ import type { INotification, RawNotificationUnion } from '../types/notification/notification.js';
2
2
  /**
3
3
  * Process feature announcement and wallet notifications into a shared/normalised notification shape.
4
4
  * We can still differentiate notifications by the `type` property
@@ -17,4 +17,4 @@ export declare function processNotification(notification: RawNotificationUnion,
17
17
  */
18
18
  export declare function safeProcessNotification(notification: RawNotificationUnion, readNotifications?: string[]): INotification | undefined;
19
19
  export declare const processAndFilterNotifications: (notifications: RawNotificationUnion[], readIds: string[]) => INotification[];
20
- //# sourceMappingURL=process-notifications.d.cts.map
20
+ //# sourceMappingURL=process-notifications.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process-notifications.d.ts","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/process-notifications.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,aAAa,EACb,oBAAoB,EACrB,MAAM,uCAAuC,CAAC;AAwB/C;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,YAAY,EAAE,oBAAoB,EAClC,iBAAiB,GAAE,MAAM,EAAO,GAC/B,aAAa,CAwBf;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,YAAY,EAAE,oBAAoB,EAClC,iBAAiB,GAAE,MAAM,EAAO,GAC/B,aAAa,GAAG,SAAS,CAU3B;AAGD,eAAO,MAAM,6BAA6B,kBACzB,oBAAoB,EAAE,WAC5B,MAAM,EAAE,KAChB,aAAa,EAGW,CAAC"}
@@ -1,7 +1,7 @@
1
- import { TRIGGER_TYPES, NOTIFICATION_API_TRIGGER_TYPES_SET } from "../constants/notification-schema.mjs";
2
- import { processAPINotifications } from "./process-api-notifications.mjs";
3
- import { isFeatureAnnouncementRead, processFeatureAnnouncement } from "./process-feature-announcement.mjs";
4
- import { processSnapNotification } from "./process-snap-notifications.mjs";
1
+ import { TRIGGER_TYPES, NOTIFICATION_API_TRIGGER_TYPES_SET, } from '../constants/notification-schema.js';
2
+ import { processAPINotifications } from './process-api-notifications.js';
3
+ import { isFeatureAnnouncementRead, processFeatureAnnouncement, } from './process-feature-announcement.js';
4
+ import { processSnapNotification } from './process-snap-notifications.js';
5
5
  const isAPINotification = (notification) => NOTIFICATION_API_TRIGGER_TYPES_SET.has(notification.type);
6
6
  const isFeatureAnnouncement = (notification) => notification.type === TRIGGER_TYPES.FEATURES_ANNOUNCEMENT;
7
7
  const isSnapNotification = (notification) => notification.type === TRIGGER_TYPES.SNAP;
@@ -51,4 +51,4 @@ const isNotUndefined = (item) => Boolean(item);
51
51
  export const processAndFilterNotifications = (notifications, readIds) => notifications
52
52
  .map((notification) => safeProcessNotification(notification, readIds))
53
53
  .filter(isNotUndefined);
54
- //# sourceMappingURL=process-notifications.mjs.map
54
+ //# sourceMappingURL=process-notifications.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process-notifications.js","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/process-notifications.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,kCAAkC,GACnC,MAAM,qCAAqC,CAAC;AAQ7C,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,EACL,yBAAyB,EACzB,0BAA0B,GAC3B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAE1E,MAAM,iBAAiB,GAAG,CACxB,YAAkC,EACS,EAAE,CAC7C,kCAAkC,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;AAE5D,MAAM,qBAAqB,GAAG,CAC5B,YAAkC,EACkB,EAAE,CACtD,YAAY,CAAC,IAAI,KAAK,aAAa,CAAC,qBAAqB,CAAC;AAE5D,MAAM,kBAAkB,GAAG,CACzB,YAAkC,EACG,EAAE,CACvC,YAAY,CAAC,IAAI,KAAK,aAAa,CAAC,IAAI,CAAC;AAE3C;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CACjC,YAAkC,EAClC,iBAAiB,GAAa,EAAE;IAEhC,MAAM,iBAAiB,GAAG,CAAC,cAAqB,EAAS,EAAE;QACzD,MAAM,IAAI,GAAW,YAAY,EAAE,IAAI,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,4CAA4C,IAAI,EAAE,CAAC,CAAC;IACtE,CAAC,CAAC;IAEF,IAAI,qBAAqB,CAAC,YAAY,CAAC,EAAE,CAAC;QACxC,MAAM,qBAAqB,GAAG,0BAA0B,CAAC,YAAY,CAAC,CAAC;QACvE,qBAAqB,CAAC,MAAM,GAAG,yBAAyB,CACtD,qBAAqB,EACrB,iBAAiB,CAClB,CAAC;QACF,OAAO,qBAAqB,CAAC;IAC/B,CAAC;IAED,IAAI,kBAAkB,CAAC,YAAY,CAAC,EAAE,CAAC;QACrC,OAAO,uBAAuB,CAAC,YAAY,CAAC,CAAC;IAC/C,CAAC;IAED,IAAI,iBAAiB,CAAC,YAAY,CAAC,EAAE,CAAC;QACpC,OAAO,uBAAuB,CAAC,YAAY,CAAC,CAAC;IAC/C,CAAC;IAED,OAAO,iBAAiB,CAAC,YAAY,CAAC,CAAC;AACzC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CACrC,YAAkC,EAClC,iBAAiB,GAAa,EAAE;IAEhC,IAAI,CAAC;QACH,MAAM,qBAAqB,GAAG,mBAAmB,CAC/C,YAAY,EACZ,iBAAiB,CAClB,CAAC;QACF,OAAO,qBAAqB,CAAC;IAC/B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED,MAAM,cAAc,GAAG,CAAO,IAAW,EAAgB,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC1E,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAC3C,aAAqC,EACrC,OAAiB,EACA,EAAE,CACnB,aAAa;KACV,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,uBAAuB,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;KACrE,MAAM,CAAC,cAAc,CAAC,CAAC","sourcesContent":["import {\n TRIGGER_TYPES,\n NOTIFICATION_API_TRIGGER_TYPES_SET,\n} from '../constants/notification-schema.js';\nimport type { FeatureAnnouncementRawNotification } from '../types/feature-announcement/feature-announcement.js';\nimport type { NormalisedAPINotification } from '../types/notification-api/notification-api.js';\nimport type {\n INotification,\n RawNotificationUnion,\n} from '../types/notification/notification.js';\nimport type { RawSnapNotification } from '../types/snaps/index.js';\nimport { processAPINotifications } from './process-api-notifications.js';\nimport {\n isFeatureAnnouncementRead,\n processFeatureAnnouncement,\n} from './process-feature-announcement.js';\nimport { processSnapNotification } from './process-snap-notifications.js';\n\nconst isAPINotification = (\n notification: RawNotificationUnion,\n): notification is NormalisedAPINotification =>\n NOTIFICATION_API_TRIGGER_TYPES_SET.has(notification.type);\n\nconst isFeatureAnnouncement = (\n notification: RawNotificationUnion,\n): notification is FeatureAnnouncementRawNotification =>\n notification.type === TRIGGER_TYPES.FEATURES_ANNOUNCEMENT;\n\nconst isSnapNotification = (\n notification: RawNotificationUnion,\n): notification is RawSnapNotification =>\n notification.type === TRIGGER_TYPES.SNAP;\n\n/**\n * Process feature announcement and wallet notifications into a shared/normalised notification shape.\n * We can still differentiate notifications by the `type` property\n *\n * @param notification - a feature announcement or on chain notification\n * @param readNotifications - all read notifications currently\n * @returns a processed notification\n */\nexport function processNotification(\n notification: RawNotificationUnion,\n readNotifications: string[] = [],\n): INotification {\n const exhaustedAllCases = (_uncheckedCase: never): never => {\n const type: string = notification?.type;\n throw new Error(`No processor found for notification kind ${type}`);\n };\n\n if (isFeatureAnnouncement(notification)) {\n const processedNotification = processFeatureAnnouncement(notification);\n processedNotification.isRead = isFeatureAnnouncementRead(\n processedNotification,\n readNotifications,\n );\n return processedNotification;\n }\n\n if (isSnapNotification(notification)) {\n return processSnapNotification(notification);\n }\n\n if (isAPINotification(notification)) {\n return processAPINotifications(notification);\n }\n\n return exhaustedAllCases(notification);\n}\n\n/**\n * Safe version of processing a notification. Rather than throwing an error if failed to process, it will return the Notification or undefined\n *\n * @param notification - notification to processes\n * @param readNotifications - all read notifications currently\n * @returns a process notification or undefined if failed to process\n */\nexport function safeProcessNotification(\n notification: RawNotificationUnion,\n readNotifications: string[] = [],\n): INotification | undefined {\n try {\n const processedNotification = processNotification(\n notification,\n readNotifications,\n );\n return processedNotification;\n } catch {\n return undefined;\n }\n}\n\nconst isNotUndefined = <Item>(item?: Item): item is Item => Boolean(item);\nexport const processAndFilterNotifications = (\n notifications: RawNotificationUnion[],\n readIds: string[],\n): INotification[] =>\n notifications\n .map((notification) => safeProcessNotification(notification, readIds))\n .filter(isNotUndefined);\n"]}
@@ -1,5 +1,5 @@
1
- import type { INotification } from "../types/index.cjs";
2
- import type { RawSnapNotification } from "../types/snaps/index.cjs";
1
+ import type { INotification } from '../types/index.js';
2
+ import type { RawSnapNotification } from '../types/snaps/index.js';
3
3
  /**
4
4
  * Processes a snap notification into a normalized shape.
5
5
  *
@@ -7,4 +7,4 @@ import type { RawSnapNotification } from "../types/snaps/index.cjs";
7
7
  * @returns a normalized snap notification.
8
8
  */
9
9
  export declare const processSnapNotification: (snapNotification: RawSnapNotification) => INotification;
10
- //# sourceMappingURL=process-snap-notifications.d.cts.map
10
+ //# sourceMappingURL=process-snap-notifications.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process-snap-notifications.d.ts","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/process-snap-notifications.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAGnE;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,qBAChB,mBAAmB,KACpC,aAWF,CAAC"}
@@ -1,5 +1,5 @@
1
- import { v4 as uuid } from "uuid";
2
- import { getNotificationSubtype } from "../utils/get-notification-subtype.mjs";
1
+ import { v4 as uuid } from 'uuid';
2
+ import { getNotificationSubtype } from '../utils/get-notification-subtype.js';
3
3
  /**
4
4
  * Processes a snap notification into a normalized shape.
5
5
  *
@@ -18,4 +18,4 @@ export const processSnapNotification = (snapNotification) => {
18
18
  data,
19
19
  };
20
20
  };
21
- //# sourceMappingURL=process-snap-notifications.mjs.map
21
+ //# sourceMappingURL=process-snap-notifications.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process-snap-notifications.js","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/process-snap-notifications.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,IAAI,IAAI,EAAE,MAAM,MAAM,CAAC;AAIlC,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAE9E;;;;;GAKG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,gBAAqC,EACtB,EAAE;IACjB,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,gBAAgB,CAAC;IAClD,OAAO;QACL,EAAE,EAAE,IAAI,EAAE;QACV,oBAAoB,EAAE,sBAAsB,CAAC,gBAAgB,CAAC;QAC9D,QAAQ;QACR,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACnC,MAAM,EAAE,KAAK;QACb,IAAI;QACJ,IAAI;KACL,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { v4 as uuid } from 'uuid';\n\nimport type { INotification } from '../types/index.js';\nimport type { RawSnapNotification } from '../types/snaps/index.js';\nimport { getNotificationSubtype } from '../utils/get-notification-subtype.js';\n\n/**\n * Processes a snap notification into a normalized shape.\n *\n * @param snapNotification - A raw snap notification.\n * @returns a normalized snap notification.\n */\nexport const processSnapNotification = (\n snapNotification: RawSnapNotification,\n): INotification => {\n const { data, type, readDate } = snapNotification;\n return {\n id: uuid(),\n notification_subtype: getNotificationSubtype(snapNotification),\n readDate,\n createdAt: new Date().toISOString(),\n isRead: false,\n type,\n data,\n };\n};\n"]}
@@ -1,4 +1,4 @@
1
- import type { NormalisedAPINotification } from "../types/notification-api/index.cjs";
1
+ import type { NormalisedAPINotification } from '../types/notification-api/index.js';
2
2
  export type ENV = 'prd' | 'uat' | 'dev';
3
3
  export declare const TRIGGER_API: (env?: ENV) => string;
4
4
  export declare const NOTIFICATION_API: (env?: ENV) => string;
@@ -62,4 +62,4 @@ export declare function getAPINotifications(bearerToken: string, addresses: stri
62
62
  * @returns A promise that resolves to void. The promise will reject if there's an error during the API call or if the response status is not 200.
63
63
  */
64
64
  export declare function markNotificationsAsRead(bearerToken: string, notificationIds: string[], env?: ENV): Promise<void>;
65
- //# sourceMappingURL=api-notifications.d.cts.map
65
+ //# sourceMappingURL=api-notifications.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-notifications.d.ts","sourceRoot":"","sources":["../../../src/NotificationServicesController/services/api-notifications.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,yBAAyB,EAG1B,MAAM,oCAAoC,CAAC;AAI5C,MAAM,MAAM,GAAG,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAQxC,eAAO,MAAM,WAAW,SAAS,GAAG,KAAW,MACF,CAAC;AAQ9C,eAAO,MAAM,gBAAgB,SAAS,GAAG,KAAW,MACG,CAAC;AAGxD,eAAO,MAAM,wCAAwC,SAC9C,GAAG,KACP,MAA0D,CAAC;AAG9D,eAAO,MAAM,kCAAkC,SAAS,GAAG,KAAW,MAC1B,CAAC;AAG7C,eAAO,MAAM,8BAA8B,SAAS,GAAG,KAAW,MACjB,CAAC;AAGlD,eAAO,MAAM,0CAA0C,SAChD,GAAG,KACP,MAAsE,CAAC;AAE1E;;;;;;;;;;;;GAYG;AACH,wBAAsB,+BAA+B,CACnD,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EAAE,EACnB,GAAG,GAAE,GAAW,GACf,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,EAAE,GAAG,IAAI,CAAC,CAiCzD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,0BAA0B,CAC9C,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,EAAE,EAClD,GAAG,GAAE,GAAW,GACf,OAAO,CAAC,IAAI,CAAC,CA4Bf;AAED;;;;;;;;;GASG;AACH,wBAAsB,mBAAmB,CACvC,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EAAE,EACnB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,WAAW,GAAG,QAAQ,EAChC,GAAG,GAAE,GAAW,GACf,OAAO,CAAC,yBAAyB,EAAE,CAAC,CA0CtC;AAED;;;;;;;;;GASG;AACH,wBAAsB,uBAAuB,CAC3C,WAAW,EAAE,MAAM,EACnB,eAAe,EAAE,MAAM,EAAE,EACzB,GAAG,GAAE,GAAW,GACf,OAAO,CAAC,IAAI,CAAC,CAqBf"}
@@ -1,14 +1,7 @@
1
- function $importDefault(module) {
2
- if (module?.__esModule) {
3
- return module.default;
4
- }
5
- return module;
6
- }
7
- import $log from "loglevel";
8
- const log = $importDefault($log);
9
- import { toRawAPINotification } from "../../shared/to-raw-notification.mjs";
10
- import { makeApiCall } from "../utils/utils.mjs";
11
- import { notificationsConfigCache } from "./notification-config-cache.mjs";
1
+ import log from 'loglevel';
2
+ import { toRawAPINotification } from '../../shared/to-raw-notification.js';
3
+ import { makeApiCall } from '../utils/utils.js';
4
+ import { notificationsConfigCache } from './notification-config-cache.js';
12
5
  const TRIGGER_API_ENV = {
13
6
  dev: 'https://trigger.dev-api.cx.metamask.io',
14
7
  uat: 'https://trigger.uat-api.cx.metamask.io',
@@ -155,4 +148,4 @@ export async function markNotificationsAsRead(bearerToken, notificationIds, env
155
148
  log.error('Error marking notifications as read:', error);
156
149
  }
157
150
  }
158
- //# sourceMappingURL=api-notifications.mjs.map
151
+ //# sourceMappingURL=api-notifications.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-notifications.js","sourceRoot":"","sources":["../../../src/NotificationServicesController/services/api-notifications.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,UAAU,CAAC;AAE3B,OAAO,EAAE,oBA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,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CACrC;SACA,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IAErB,mCAAmC;IACnC,MAAM,wBAAwB,GAAG,aAAa;QAC5C,EAAE,GAAG,CAAC,CAAC,YAAY,EAA0C,EAAE;QAC7D,IAAI,CAAC,YAAY,CAAC,iBAAiB,EAAE,CAAC;YACpC,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,IAAI,CAAC;YACH,OAAO,oBAAoB,CAAC,YAAY,CAAC,CAAC;QAC5C,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC,CAAC;SACD,MAAM,CAAC,CAAC,IAAI,EAAqC,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IAEtE,OAAO,wBAAwB,IAAI,EAAE,CAAC;AACxC,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,WAAmB,EACnB,eAAyB,EACzB,GAAG,GAAQ,KAAK;IAEhB,IAAI,eAAe,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACjC,OAAO;IACT,CAAC;IAID,MAAM,IAAI,GAAiB;QACzB,GAAG,EAAE,eAAe;KACrB,CAAC;IAEF,IAAI,CAAC;QACH,MAAM,WAAW,CACf,WAAW,EACX,0CAA0C,CAAC,GAAG,CAAC,EAC/C,MAAM,EACN,IAAI,CACL,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,GAAG,CAAC,KAAK,CAAC,sCAAsC,EAAE,KAAK,CAAC,CAAC;IAC3D,CAAC;AACH,CAAC","sourcesContent":["import log from 'loglevel';\n\nimport { toRawAPINotification } from '../../shared/to-raw-notification.js';\nimport type {\n NormalisedAPINotification,\n Schema,\n UnprocessedRawNotification,\n} from '../types/notification-api/index.js';\nimport { makeApiCall } from '../utils/utils.js';\nimport { notificationsConfigCache } from './notification-config-cache.js';\n\nexport type ENV = 'prd' | 'uat' | 'dev';\n\nconst TRIGGER_API_ENV = {\n dev: 'https://trigger.dev-api.cx.metamask.io',\n uat: 'https://trigger.uat-api.cx.metamask.io',\n prd: 'https://trigger.api.cx.metamask.io',\n} satisfies Record<ENV, string>;\n\nexport const TRIGGER_API = (env: ENV = 'prd'): string =>\n TRIGGER_API_ENV[env] ?? TRIGGER_API_ENV.prd;\n\nconst NOTIFICATION_API_ENV = {\n dev: 'https://notification.dev-api.cx.metamask.io',\n uat: 'https://notification.uat-api.cx.metamask.io',\n prd: 'https://notification.api.cx.metamask.io',\n};\n\nexport const NOTIFICATION_API = (env: ENV = 'prd'): string =>\n NOTIFICATION_API_ENV[env] ?? NOTIFICATION_API_ENV.prd;\n\n// Gets notification settings for each account provided\nexport const TRIGGER_API_NOTIFICATIONS_QUERY_ENDPOINT = (\n env: ENV = 'prd',\n): string => `${TRIGGER_API(env)}/api/v2/notifications/query`;\n\n// Creates/updates account notification subscriptions for each account provided\nexport const TRIGGER_API_NOTIFICATIONS_ENDPOINT = (env: ENV = 'prd'): string =>\n `${TRIGGER_API(env)}/api/v2/notifications`;\n\n// Lists notifications for each address provided\nexport const NOTIFICATION_API_LIST_ENDPOINT = (env: ENV = 'prd'): string =>\n `${NOTIFICATION_API(env)}/api/v4/notifications`;\n\n// Marks notifications as read\nexport const NOTIFICATION_API_MARK_ALL_AS_READ_ENDPOINT = (\n env: ENV = 'prd',\n): string => `${NOTIFICATION_API(env)}/api/v4/notifications/mark-as-read`;\n\n/**\n * fetches notification config (accounts enabled vs disabled)\n *\n * @param bearerToken - jwt\n * @param addresses - list of addresses to check\n * @param env - the environment to use for the API call\n * NOTE the API will return addresses config with false if they have not been created before.\n * NOTE this is cached for 1s to prevent multiple update calls\n * @returns the config for each requested address, or `null` if the config could\n * not be read. An empty array means the API answered and no address is\n * subscribed; callers must not read a failure as \"nothing is enabled\", since\n * acting on that would re-subscribe or unregister addresses behind the user.\n */\nexport async function getNotificationsApiConfigCached(\n bearerToken: string,\n addresses: string[],\n env: ENV = 'prd',\n): Promise<{ address: string; enabled: boolean }[] | null> {\n if (addresses.length === 0) {\n return [];\n }\n\n const normalizedAddresses = addresses.map((addr) => addr.toLowerCase());\n\n const cached = notificationsConfigCache.get(normalizedAddresses);\n if (cached) {\n return cached;\n }\n\n type RequestBody = { address: string }[];\n type Response = { address: string; enabled: boolean }[];\n const body: RequestBody = normalizedAddresses.map((address) => ({ address }));\n const result = await makeApiCall(\n bearerToken,\n TRIGGER_API_NOTIFICATIONS_QUERY_ENDPOINT(env),\n 'POST',\n body,\n )\n .then<Response | null>((response) => (response.ok ? response.json() : null))\n .catch(() => null);\n\n if (result === null) {\n return null;\n }\n\n if (result.length > 0) {\n notificationsConfigCache.set(result);\n }\n\n return result;\n}\n\n/**\n * Creates or removes wallet-activity subscriptions for the given addresses.\n *\n * The endpoint is a per-address upsert-or-delete batch rather than a full\n * replace, so two installations authenticating as the same profile do not\n * clobber each other's subscriptions.\n *\n * @param bearerToken - jwt\n * @param addresses - addresses to subscribe (`enabled: true`) or unsubscribe (`enabled: false`)\n * @param env - the environment to use for the API call\n * @throws if the request could not be made or the API rejected it, so callers\n * do not report a subscription change the server never applied.\n */\nexport async function updateOnChainNotifications(\n bearerToken: string,\n addresses: { address: string; enabled: boolean }[],\n env: ENV = 'prd',\n): Promise<void> {\n if (addresses.length === 0) {\n return;\n }\n\n const normalizedAddresses = addresses.map((item) => ({\n ...item,\n address: item.address.toLowerCase(),\n }));\n\n type RequestBody = { address: string; enabled: boolean }[];\n const body: RequestBody = normalizedAddresses;\n const response = await makeApiCall(\n bearerToken,\n TRIGGER_API_NOTIFICATIONS_ENDPOINT(env),\n 'POST',\n body,\n );\n\n if (!response.ok) {\n throw new Error(\n `Failed to update on-chain notifications: ${response.status}`,\n );\n }\n\n // Seeded only once the server has accepted the change: the settings UI reads\n // this back for the whole TTL, so a rejected write must not look applied.\n notificationsConfigCache.set(normalizedAddresses);\n}\n\n/**\n * Fetches on-chain notifications for the given addresses\n *\n * @param bearerToken - The JSON Web Token used for authentication in the API call.\n * @param addresses - List of addresses\n * @param locale - to generate translated notifications\n * @param platform - filter notifications for specific platforms ('extension' | 'mobile')\n * @param env - the environment to use for the API call\n * @returns An array of {@link NormalisedAPINotification}. Returns an empty array on transport or parse errors.\n */\nexport async function getAPINotifications(\n bearerToken: string,\n addresses: string[],\n locale: string,\n platform: 'extension' | 'mobile',\n env: ENV = 'prd',\n): Promise<NormalisedAPINotification[]> {\n if (addresses.length === 0) {\n return [];\n }\n\n type RequestBody =\n Schema.paths['/api/v4/notifications']['post']['requestBody']['content']['application/json'];\n type APIResponse =\n Schema.paths['/api/v4/notifications']['post']['responses']['200']['content']['application/json'];\n\n const body: RequestBody = {\n addresses: addresses.map((addr) => addr.toLowerCase()),\n locale,\n platform,\n };\n const notifications = await makeApiCall(\n bearerToken,\n NOTIFICATION_API_LIST_ENDPOINT(env),\n 'POST',\n body,\n )\n .then<APIResponse | null>((response) =>\n response.ok ? response.json() : null,\n )\n .catch(() => null);\n\n // Transform and sort notifications\n const transformedNotifications = notifications\n ?.map((notification): UnprocessedRawNotification | undefined => {\n if (!notification.notification_type) {\n return undefined;\n }\n\n try {\n return toRawAPINotification(notification);\n } catch {\n return undefined;\n }\n })\n .filter((item): item is NormalisedAPINotification => Boolean(item));\n\n return transformedNotifications ?? [];\n}\n\n/**\n * Marks the specified notifications as read.\n * This method sends a POST request to the notifications service to mark the provided notification IDs as read.\n * If the operation is successful, it completes without error. If the operation fails, it throws an error with details.\n *\n * @param bearerToken - The JSON Web Token used for authentication in the API call.\n * @param notificationIds - An array of notification IDs to be marked as read.\n * @param env - the environment to use for the API call\n * @returns A promise that resolves to void. The promise will reject if there's an error during the API call or if the response status is not 200.\n */\nexport async function markNotificationsAsRead(\n bearerToken: string,\n notificationIds: string[],\n env: ENV = 'prd',\n): Promise<void> {\n if (notificationIds.length === 0) {\n return;\n }\n\n type ResponseBody =\n Schema.paths['/api/v4/notifications/mark-as-read']['post']['requestBody']['content']['application/json'];\n const body: ResponseBody = {\n ids: notificationIds,\n };\n\n try {\n await makeApiCall(\n bearerToken,\n NOTIFICATION_API_MARK_ALL_AS_READ_ENDPOINT(env),\n 'POST',\n body,\n );\n } catch (error) {\n log.error('Error marking notifications as read:', error);\n }\n}\n"]}
@@ -1,6 +1,6 @@
1
- import type { Entry, Asset } from "contentful";
2
- import type { TypeFeatureAnnouncement } from "../types/feature-announcement/type-feature-announcement.mjs";
3
- import type { INotification } from "../types/notification/notification.mjs";
1
+ import type { Entry, Asset } from 'contentful';
2
+ import type { TypeFeatureAnnouncement } from '../types/feature-announcement/type-feature-announcement.js';
3
+ import type { INotification } from '../types/notification/notification.js';
4
4
  export declare const FEATURE_ANNOUNCEMENT_API = "https://cdn.contentful.com/spaces/:space_id/environments/master/entries";
5
5
  export declare const FEATURE_ANNOUNCEMENT_URL = "https://cdn.contentful.com/spaces/:space_id/environments/master/entries?access_token=:access_token&content_type=productAnnouncement&include=10&fields.clients[in]=:client_id";
6
6
  type Env = {
@@ -29,4 +29,4 @@ export declare const getFeatureAnnouncementUrl: (env: Env, previewToken?: string
29
29
  */
30
30
  export declare function getFeatureAnnouncementNotifications(env: Env, previewToken?: string): Promise<INotification[]>;
31
31
  export {};
32
- //# sourceMappingURL=feature-announcements.d.mts.map
32
+ //# sourceMappingURL=feature-announcements.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feature-announcements.d.ts","sourceRoot":"","sources":["../../../src/NotificationServicesController/services/feature-announcements.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,KAAK,EAAmB,MAAM,YAAY,CAAC;AAKhE,OAAO,KAAK,EAEV,uBAAuB,EACxB,MAAM,4DAA4D,CAAC;AAOpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAW3E,eAAO,MAAM,wBAAwB,4EAAqF,CAAC;AAC3H,eAAO,MAAM,wBAAwB,iLAAyJ,CAAC;AAE/L,KAAK,GAAG,GAAG;IACT,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,WAAW,GAAG,QAAQ,CAAC;IACjC,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,CAAC,EAAE;QAGT,KAAK,CAAC,EAAE,KAAK,EAAE,CAAC;QAEhB,KAAK,CAAC,EAAE,KAAK,EAAE,CAAC;KACjB,CAAC;IACF,KAAK,CAAC,EAAE,uBAAuB,EAAE,CAAC;CACnC,CAAC;AAEF,eAAO,MAAM,yBAAyB,QAC/B,GAAG,iBACO,MAAM,KACpB,MAUF,CAAC;AAkJF;;;;;;GAMG;AACH,wBAAsB,mCAAmC,CACvD,GAAG,EAAE,GAAG,EACR,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC,aAAa,EAAE,CAAC,CAc1B"}
@@ -1,7 +1,7 @@
1
- import { documentToHtmlString } from "@contentful/rich-text-html-renderer";
2
- import { TRIGGER_TYPES } from "../constants/notification-schema.mjs";
3
- import { processFeatureAnnouncement } from "../processors/process-feature-announcement.mjs";
4
- import { isVersionInBounds } from "../utils/isVersionInBounds.mjs";
1
+ import { documentToHtmlString } from '@contentful/rich-text-html-renderer';
2
+ import { TRIGGER_TYPES } from '../constants/notification-schema.js';
3
+ import { processFeatureAnnouncement } from '../processors/process-feature-announcement.js';
4
+ import { isVersionInBounds } from '../utils/isVersionInBounds.js';
5
5
  // Feature announcements older than this (by sys.updatedAt) are excluded from the feed.
6
6
  const FEATURE_ANNOUNCEMENT_MAX_AGE_MONTHS = 3;
7
7
  const DEFAULT_SPACE_ID = ':space_id';
@@ -132,4 +132,4 @@ export async function getFeatureAnnouncementNotifications(env, previewToken) {
132
132
  }
133
133
  return [];
134
134
  }
135
- //# sourceMappingURL=feature-announcements.mjs.map
135
+ //# sourceMappingURL=feature-announcements.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feature-announcements.js","sourceRoot":"","sources":["../../../src/NotificationServicesController/services/feature-announcements.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAG3E,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAa3F,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAElE,uFAAuF;AACvF,MAAM,mCAAmC,GAAG,CAAC,CAAC;AAE9C,MAAM,gBAAgB,GAAG,WAAW,CAAC;AACrC,MAAM,oBAAoB,GAAG,eAAe,CAAC;AAC7C,MAAM,iBAAiB,GAAG,YAAY,CAAC;AACvC,MAAM,cAAc,GAAG,oBAAoB,CAAC;AAC5C,MAAM,cAAc,GAAG,wBAAwB,CAAC;AAChD,MAAM,CAAC,MAAM,wBAAwB,GAAG,WAAW,cAAc,WAAW,gBAAgB,8BAA8B,CAAC;AAC3H,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,wBAAwB,iBAAiB,oBAAoB,mEAAmE,iBAAiB,EAAE,CAAC;AAuB/L,MAAM,CAAC,MAAM,yBAAyB,GAAG,CACvC,GAAQ,EACR,YAAqB,EACb,EAAE;IACV,MAAM,MAAM,GAAG,YAAY,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC;IAC9D,MAAM,WAAW,GAAG,wBAAwB,CAAC,OAAO,CAClD,gBAAgB,EAChB,GAAG,CAAC,OAAO,CACZ;SACE,OAAO,CAAC,oBAAoB,EAAE,YAAY,IAAI,GAAG,CAAC,WAAW,CAAC;SAC9D,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,QAAQ,CAAC;SACxC,OAAO,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;IACnC,OAAO,SAAS,CAAC,WAAW,CAAC,CAAC;AACh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eAAe,EAAE,EAAE;QAClB,MAAM,UAAU,GAAG,eAAe,CAAC,IAAI,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC;QACzE,MAAM,UAAU,GAAG,eAAe,CAAC,IAAI,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC;QACzE,OAAO,iBAAiB,CAAC;YACvB,cAAc,EAAE,GAAG,CAAC,eAAe;YACnC,UAAU;YACV,UAAU;SACX,CAAC,CAAC;IACL,CAAC,CACF,CAAC;IAEF,OAAO,wBAAwB,CAAC;AAClC,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,mCAAmC,CACvD,GAAQ,EACR,YAAqB;IAErB,IAAI,GAAG,EAAE,WAAW,IAAI,GAAG,EAAE,OAAO,IAAI,GAAG,EAAE,QAAQ,EAAE,CAAC;QACtD,MAAM,gBAAgB,GAAG,MAAM,qCAAqC,CAClE,GAAG,EACH,YAAY,CACb,CAAC;QACF,MAAM,aAAa,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CAC1D,0BAA0B,CAAC,YAAY,CAAC,CACzC,CAAC;QAEF,OAAO,aAAa,CAAC;IACvB,CAAC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC","sourcesContent":["import { documentToHtmlString } from '@contentful/rich-text-html-renderer';\nimport type { Entry, Asset, EntryCollection } from 'contentful';\n\nimport { TRIGGER_TYPES } from '../constants/notification-schema.js';\nimport { processFeatureAnnouncement } from '../processors/process-feature-announcement.js';\nimport type { FeatureAnnouncementRawNotification } from '../types/feature-announcement/feature-announcement.js';\nimport type {\n ImageFields,\n TypeFeatureAnnouncement,\n} from '../types/feature-announcement/type-feature-announcement.js';\nimport type {\n TypeExternalLinkFields,\n TypePortfolioLinkFields,\n TypeExtensionLinkFields,\n TypeMobileLinkFields,\n} from '../types/feature-announcement/type-links.js';\nimport type { INotification } from '../types/notification/notification.js';\nimport { isVersionInBounds } from '../utils/isVersionInBounds.js';\n\n// Feature announcements older than this (by sys.updatedAt) are excluded from the feed.\nconst FEATURE_ANNOUNCEMENT_MAX_AGE_MONTHS = 3;\n\nconst DEFAULT_SPACE_ID = ':space_id';\nconst DEFAULT_ACCESS_TOKEN = ':access_token';\nconst DEFAULT_CLIENT_ID = ':client_id';\nconst DEFAULT_DOMAIN = 'cdn.contentful.com';\nconst PREVIEW_DOMAIN = 'preview.contentful.com';\nexport const FEATURE_ANNOUNCEMENT_API = `https://${DEFAULT_DOMAIN}/spaces/${DEFAULT_SPACE_ID}/environments/master/entries`;\nexport const FEATURE_ANNOUNCEMENT_URL = `${FEATURE_ANNOUNCEMENT_API}?access_token=${DEFAULT_ACCESS_TOKEN}&content_type=productAnnouncement&include=10&fields.clients[in]=${DEFAULT_CLIENT_ID}`;\n\ntype Env = {\n spaceId: string;\n accessToken: string;\n platform: 'extension' | 'mobile';\n platformVersion?: string;\n};\n\n/**\n * Contentful API Response Shape\n */\nexport type ContentfulResult = {\n includes?: {\n // Property names match Contentful API response structure\n // eslint-disable-next-line @typescript-eslint/naming-convention\n Entry?: Entry[];\n // eslint-disable-next-line @typescript-eslint/naming-convention\n Asset?: Asset[];\n };\n items?: TypeFeatureAnnouncement[];\n};\n\nexport const getFeatureAnnouncementUrl = (\n env: Env,\n previewToken?: string,\n): string => {\n const domain = previewToken ? PREVIEW_DOMAIN : DEFAULT_DOMAIN;\n const replacedUrl = FEATURE_ANNOUNCEMENT_URL.replace(\n DEFAULT_SPACE_ID,\n env.spaceId,\n )\n .replace(DEFAULT_ACCESS_TOKEN, previewToken ?? env.accessToken)\n .replace(DEFAULT_CLIENT_ID, env.platform)\n .replace(DEFAULT_DOMAIN, domain);\n return encodeURI(replacedUrl);\n};\n\nconst fetchFeatureAnnouncementNotifications = async (\n env: Env,\n previewToken?: string,\n): Promise<FeatureAnnouncementRawNotification[]> => {\n const url = getFeatureAnnouncementUrl(env, previewToken);\n\n const data = await fetch(url)\n .then((response) => response.json())\n .catch(() => null);\n\n if (!data) {\n return [];\n }\n\n const findIncludedItem = (\n sysId: string,\n ):\n | ImageFields['fields']\n | TypeExtensionLinkFields['fields']\n | TypePortfolioLinkFields['fields']\n | TypeMobileLinkFields['fields']\n | TypeExternalLinkFields['fields']\n | null => {\n const typedData: EntryCollection<\n | ImageFields\n | TypeExtensionLinkFields\n | TypePortfolioLinkFields\n | TypeMobileLinkFields\n | TypeExternalLinkFields\n > = data;\n const item =\n typedData?.includes?.Entry?.find(\n (entry: Entry) => entry?.sys?.id === sysId,\n ) ??\n typedData?.includes?.Asset?.find(\n (asset: Asset) => asset?.sys?.id === sysId,\n );\n return item ? item?.fields : null;\n };\n\n const contentfulNotifications = data?.items ?? [];\n const rawNotifications: FeatureAnnouncementRawNotification[] =\n contentfulNotifications\n .filter((item: TypeFeatureAnnouncement) => {\n const updatedAt = new Date(item.sys.updatedAt);\n const limitDate = new Date();\n limitDate.setMonth(\n limitDate.getMonth() - FEATURE_ANNOUNCEMENT_MAX_AGE_MONTHS,\n );\n return updatedAt > limitDate;\n })\n .map((item: TypeFeatureAnnouncement) => {\n const { fields } = item;\n const imageFields = fields.image\n ? (findIncludedItem(fields.image.sys.id) as ImageFields['fields'])\n : undefined;\n\n const externalLinkFields = fields.externalLink\n ? (findIncludedItem(\n fields.externalLink.sys.id,\n ) as TypeExternalLinkFields['fields'])\n : undefined;\n const portfolioLinkFields = fields.portfolioLink\n ? (findIncludedItem(\n fields.portfolioLink.sys.id,\n ) as TypePortfolioLinkFields['fields'])\n : undefined;\n const extensionLinkFields = fields.extensionLink\n ? (findIncludedItem(\n fields.extensionLink.sys.id,\n ) as TypeExtensionLinkFields['fields'])\n : undefined;\n const mobileLinkFields = fields.mobileLink\n ? (findIncludedItem(\n fields.mobileLink.sys.id,\n ) as TypeMobileLinkFields['fields'])\n : undefined;\n\n const notification: FeatureAnnouncementRawNotification = {\n type: TRIGGER_TYPES.FEATURES_ANNOUNCEMENT,\n createdAt: new Date(item.sys.createdAt).toString(),\n data: {\n id: fields.id,\n category: fields.category,\n title: fields.title,\n longDescription: documentToHtmlString(fields.longDescription),\n shortDescription: fields.shortDescription,\n image: {\n title: imageFields?.title,\n description: imageFields?.description,\n url: imageFields?.file?.url ?? '',\n },\n externalLink: externalLinkFields && {\n externalLinkText: externalLinkFields?.externalLinkText,\n externalLinkUrl: externalLinkFields?.externalLinkUrl,\n },\n portfolioLink: portfolioLinkFields && {\n portfolioLinkText: portfolioLinkFields?.portfolioLinkText,\n portfolioLinkUrl: portfolioLinkFields?.portfolioLinkUrl,\n },\n extensionLink: extensionLinkFields && {\n extensionLinkText: extensionLinkFields?.extensionLinkText,\n extensionLinkRoute: extensionLinkFields?.extensionLinkRoute,\n },\n mobileLink: mobileLinkFields && {\n mobileLinkText: mobileLinkFields?.mobileLinkText,\n mobileLinkUrl: mobileLinkFields?.mobileLinkUrl,\n },\n extensionMinimumVersionNumber: fields.extensionMinimumVersionNumber,\n mobileMinimumVersionNumber: fields.mobileMinimumVersionNumber,\n extensionMaximumVersionNumber: fields.extensionMaximumVersionNumber,\n mobileMaximumVersionNumber: fields.mobileMaximumVersionNumber,\n },\n };\n\n return notification;\n });\n\n const versionKeys = {\n extension: {\n min: 'extensionMinimumVersionNumber',\n max: 'extensionMaximumVersionNumber',\n },\n mobile: {\n min: 'mobileMinimumVersionNumber',\n max: 'mobileMaximumVersionNumber',\n },\n } as const;\n\n const filteredRawNotifications = rawNotifications.filter(\n (rawNotification) => {\n const minVersion = rawNotification.data?.[versionKeys[env.platform].min];\n const maxVersion = rawNotification.data?.[versionKeys[env.platform].max];\n return isVersionInBounds({\n currentVersion: env.platformVersion,\n minVersion,\n maxVersion,\n });\n },\n );\n\n return filteredRawNotifications;\n};\n\n/**\n * Gets Feature Announcement from our services\n *\n * @param env - environment for feature announcements\n * @param previewToken - the preview token to use if needed\n * @returns Raw Feature Announcements\n */\nexport async function getFeatureAnnouncementNotifications(\n env: Env,\n previewToken?: string,\n): Promise<INotification[]> {\n if (env?.accessToken && env?.spaceId && env?.platform) {\n const rawNotifications = await fetchFeatureAnnouncementNotifications(\n env,\n previewToken,\n );\n const notifications = rawNotifications.map((notification) =>\n processFeatureAnnouncement(notification),\n );\n\n return notifications;\n }\n\n return [];\n}\n"]}
@@ -12,4 +12,4 @@ export declare class OnChainNotificationsCache {
12
12
  clear(): void;
13
13
  }
14
14
  export declare const notificationsConfigCache: OnChainNotificationsCache;
15
- //# sourceMappingURL=notification-config-cache.d.mts.map
15
+ //# sourceMappingURL=notification-config-cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification-config-cache.d.ts","sourceRoot":"","sources":["../../../src/NotificationServicesController/services/notification-config-cache.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,0BAA0B,QAAY,CAAC;AAEpD,qBAAa,yBAAyB;;IAgBpC,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,EAAE,GAAG,IAAI,CASvE;IAED,GAAG,CAAC,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,EAAE,GAAG,IAAI,CAiBvD;IAED,KAAK,IAAI,IAAI,CAEZ;CACF;AAED,eAAO,MAAM,wBAAwB,2BAAkC,CAAC"}
@@ -0,0 +1,43 @@
1
+ export const NotificationConfigCacheTTL = 1000 * 60; // 60 seconds
2
+ export class OnChainNotificationsCache {
3
+ #cache = null;
4
+ #ttl = NotificationConfigCacheTTL;
5
+ #isExpired() {
6
+ return !this.#cache || Date.now() - this.#cache.timestamp > this.#ttl;
7
+ }
8
+ #hasAllAddresses(addresses) {
9
+ if (!this.#cache) {
10
+ return false;
11
+ }
12
+ return addresses.every((address) => this.#cache?.data.has(address));
13
+ }
14
+ get(addresses) {
15
+ if (this.#isExpired() || !this.#hasAllAddresses(addresses)) {
16
+ return null;
17
+ }
18
+ return addresses.map((address) => ({
19
+ address,
20
+ enabled: this.#cache?.data.get(address) ?? false,
21
+ }));
22
+ }
23
+ set(data) {
24
+ let map = new Map();
25
+ // If we have existing cache, preserve it and update with new data
26
+ if (this.#cache && !this.#isExpired()) {
27
+ map = new Map(this.#cache.data);
28
+ }
29
+ // Update with new data
30
+ data.forEach(({ address, enabled }) => {
31
+ map.set(address, enabled);
32
+ });
33
+ this.#cache = {
34
+ data: map,
35
+ timestamp: Date.now(),
36
+ };
37
+ }
38
+ clear() {
39
+ this.#cache = null;
40
+ }
41
+ }
42
+ export const notificationsConfigCache = new OnChainNotificationsCache();
43
+ //# sourceMappingURL=notification-config-cache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification-config-cache.js","sourceRoot":"","sources":["../../../src/NotificationServicesController/services/notification-config-cache.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,GAAG,EAAE,CAAC,CAAC,aAAa;AAElE,MAAM,OAAO,yBAAyB;IACpC,MAAM,GAAmC,IAAI,CAAC;IAErC,IAAI,GAAG,0BAA0B,CAAC;IAE3C,UAAU;QACR,OAAO,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC;IACxE,CAAC;IAED,gBAAgB,CAAC,SAAmB;QAClC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACjB,OAAO,KAAK,CAAC;QACf,CAAC;QACD,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;IACtE,CAAC;IAED,GAAG,CAAC,SAAmB;QACrB,IAAI,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,EAAE,CAAC;YAC3D,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;YACjC,OAAO;YACP,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,KAAK;SACjD,CAAC,CAAC,CAAC;IACN,CAAC;IAED,GAAG,CAAC,IAA6C;QAC/C,IAAI,GAAG,GAAyB,IAAI,GAAG,EAAmB,CAAC;QAE3D,kEAAkE;QAClE,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC;YACtC,GAAG,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAClC,CAAC;QAED,uBAAuB;QACvB,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE;YACpC,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC5B,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,MAAM,GAAG;YACZ,IAAI,EAAE,GAAG;YACT,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;SACtB,CAAC;IACJ,CAAC;IAED,KAAK;QACH,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACrB,CAAC;CACF;AAED,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,yBAAyB,EAAE,CAAC","sourcesContent":["type NotificationConfigCache = {\n data: Map<string, boolean>;\n timestamp: number;\n};\n\nexport const NotificationConfigCacheTTL = 1000 * 60; // 60 seconds\n\nexport class OnChainNotificationsCache {\n #cache: NotificationConfigCache | null = null;\n\n readonly #ttl = NotificationConfigCacheTTL;\n\n #isExpired(): boolean {\n return !this.#cache || Date.now() - this.#cache.timestamp > this.#ttl;\n }\n\n #hasAllAddresses(addresses: string[]): boolean {\n if (!this.#cache) {\n return false;\n }\n return addresses.every((address) => this.#cache?.data.has(address));\n }\n\n get(addresses: string[]): { address: string; enabled: boolean }[] | null {\n if (this.#isExpired() || !this.#hasAllAddresses(addresses)) {\n return null;\n }\n\n return addresses.map((address) => ({\n address,\n enabled: this.#cache?.data.get(address) ?? false,\n }));\n }\n\n set(data: { address: string; enabled: boolean }[]): void {\n let map: Map<string, boolean> = new Map<string, boolean>();\n\n // If we have existing cache, preserve it and update with new data\n if (this.#cache && !this.#isExpired()) {\n map = new Map(this.#cache.data);\n }\n\n // Update with new data\n data.forEach(({ address, enabled }) => {\n map.set(address, enabled);\n });\n\n this.#cache = {\n data: map,\n timestamp: Date.now(),\n };\n }\n\n clear(): void {\n this.#cache = null;\n }\n}\n\nexport const notificationsConfigCache = new OnChainNotificationsCache();\n"]}
@@ -1,4 +1,4 @@
1
- import type { OrderInput } from "../types/index.cjs";
1
+ import type { OrderInput } from '../types/index.js';
2
2
  export declare const PERPS_API = "https://perps.api.cx.metamask.io";
3
3
  export declare const PERPS_API_CREATE_ORDERS = "https://perps.api.cx.metamask.io/api/v1/orders";
4
4
  /**
@@ -8,4 +8,4 @@ export declare const PERPS_API_CREATE_ORDERS = "https://perps.api.cx.metamask.io
8
8
  * @param orderInput - order input shape
9
9
  */
10
10
  export declare function createPerpOrderNotification(bearerToken: string, orderInput: OrderInput): Promise<void>;
11
- //# sourceMappingURL=perp-notifications.d.cts.map
11
+ //# sourceMappingURL=perp-notifications.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"perp-notifications.d.ts","sourceRoot":"","sources":["../../../src/NotificationServicesController/services/perp-notifications.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,eAAO,MAAM,SAAS,qCAAqC,CAAC;AAC5D,eAAO,MAAM,uBAAuB,mDAA+B,CAAC;AAEpE;;;;;GAKG;AACH,wBAAsB,2BAA2B,CAC/C,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,UAAU,GACrB,OAAO,CAAC,IAAI,CAAC,CAef"}
@@ -1,4 +1,4 @@
1
- import { createServicePolicy, successfulFetch } from "@metamask/controller-utils";
1
+ import { createServicePolicy, successfulFetch, } from '@metamask/controller-utils';
2
2
  export const PERPS_API = 'https://perps.api.cx.metamask.io';
3
3
  export const PERPS_API_CREATE_ORDERS = `${PERPS_API}/api/v1/orders`;
4
4
  /**
@@ -24,4 +24,4 @@ export async function createPerpOrderNotification(bearerToken, orderInput) {
24
24
  console.error('Failed to create perp order notification', error);
25
25
  }
26
26
  }
27
- //# sourceMappingURL=perp-notifications.mjs.map
27
+ //# sourceMappingURL=perp-notifications.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"perp-notifications.js","sourceRoot":"","sources":["../../../src/NotificationServicesController/services/perp-notifications.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,eAAe,GAChB,MAAM,4BAA4B,CAAC;AAIpC,MAAM,CAAC,MAAM,SAAS,GAAG,kCAAkC,CAAC;AAC5D,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,SAAS,gBAAgB,CAAC;AAEpE;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAC/C,WAAmB,EACnB,UAAsB;IAEtB,IAAI,CAAC;QACH,MAAM,mBAAmB,EAAE,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE;YAC7C,OAAO,eAAe,CAAC,uBAAuB,EAAE;gBAC9C,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE;oBACP,cAAc,EAAE,kBAAkB;oBAClC,aAAa,EAAE,UAAU,WAAW,EAAE;iBACvC;gBACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC;aACjC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,0CAA0C,EAAE,KAAK,CAAC,CAAC;IACnE,CAAC;AACH,CAAC","sourcesContent":["import {\n createServicePolicy,\n successfulFetch,\n} from '@metamask/controller-utils';\n\nimport type { OrderInput } from '../types/index.js';\n\nexport const PERPS_API = 'https://perps.api.cx.metamask.io';\nexport const PERPS_API_CREATE_ORDERS = `${PERPS_API}/api/v1/orders`;\n\n/**\n * Sends a perp order to our API to create a perp order subscription\n *\n * @param bearerToken - JWT for authentication\n * @param orderInput - order input shape\n */\nexport async function createPerpOrderNotification(\n bearerToken: string,\n orderInput: OrderInput,\n): Promise<void> {\n try {\n await createServicePolicy().execute(async () => {\n return successfulFetch(PERPS_API_CREATE_ORDERS, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: `Bearer ${bearerToken}`,\n },\n body: JSON.stringify(orderInput),\n });\n });\n } catch (error) {\n console.error('Failed to create perp order notification', error);\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
- import type { TRIGGER_TYPES } from "../../constants/notification-schema.cjs";
2
- import type { TypeFeatureAnnouncement } from "./type-feature-announcement.cjs";
1
+ import type { TRIGGER_TYPES } from '../../constants/notification-schema.js';
2
+ import type { TypeFeatureAnnouncement } from './type-feature-announcement.js';
3
3
  export type FeatureAnnouncementRawNotificationData = Omit<TypeFeatureAnnouncement['fields'], 'image' | 'longDescription' | 'extensionLink' | 'portfolioLink' | 'externalLink' | 'mobileLink'> & {
4
4
  longDescription: string;
5
5
  image: {
@@ -29,4 +29,4 @@ export type FeatureAnnouncementRawNotification = {
29
29
  createdAt: string;
30
30
  data: FeatureAnnouncementRawNotificationData;
31
31
  };
32
- //# sourceMappingURL=feature-announcement.d.cts.map
32
+ //# sourceMappingURL=feature-announcement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feature-announcement.d.ts","sourceRoot":"","sources":["../../../../src/NotificationServicesController/types/feature-announcement/feature-announcement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAE9E,MAAM,MAAM,sCAAsC,GAAG,IAAI,CACvD,uBAAuB,CAAC,QAAQ,CAAC,EAC/B,OAAO,GACP,iBAAiB,GACjB,eAAe,GACf,eAAe,GACf,cAAc,GACd,YAAY,CACf,GAAG;IACF,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE;QACL,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IAGF,YAAY,CAAC,EAAE;QACb,gBAAgB,EAAE,MAAM,CAAC;QACzB,eAAe,EAAE,MAAM,CAAC;KACzB,CAAC;IAGF,aAAa,CAAC,EAAE;QACd,iBAAiB,EAAE,MAAM,CAAC;QAC1B,gBAAgB,EAAE,MAAM,CAAC;KAC1B,CAAC;IAGF,aAAa,CAAC,EAAE;QACd,iBAAiB,EAAE,MAAM,CAAC;QAC1B,kBAAkB,EAAE,MAAM,CAAC;KAC5B,CAAC;IAGF,UAAU,CAAC,EAAE;QACX,cAAc,EAAE,MAAM,CAAC;QACvB,aAAa,EAAE,MAAM,CAAC;KACvB,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,kCAAkC,GAAG;IAC/C,IAAI,EAAE,aAAa,CAAC,qBAAqB,CAAC;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,sCAAsC,CAAC;CAC9C,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=feature-announcement.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feature-announcement.js","sourceRoot":"","sources":["../../../../src/NotificationServicesController/types/feature-announcement/feature-announcement.ts"],"names":[],"mappings":"","sourcesContent":["import type { TRIGGER_TYPES } from '../../constants/notification-schema.js';\nimport type { TypeFeatureAnnouncement } from './type-feature-announcement.js';\n\nexport type FeatureAnnouncementRawNotificationData = Omit<\n TypeFeatureAnnouncement['fields'],\n | 'image'\n | 'longDescription'\n | 'extensionLink'\n | 'portfolioLink'\n | 'externalLink'\n | 'mobileLink'\n> & {\n longDescription: string;\n image: {\n title?: string;\n description?: string;\n url: string;\n };\n\n // External Link\n externalLink?: {\n externalLinkText: string;\n externalLinkUrl: string;\n };\n\n // Portfolio Link\n portfolioLink?: {\n portfolioLinkText: string;\n portfolioLinkUrl: string;\n };\n\n // Extension Link\n extensionLink?: {\n extensionLinkText: string;\n extensionLinkRoute: string;\n };\n\n // Mobile Link\n mobileLink?: {\n mobileLinkText: string;\n mobileLinkUrl: string;\n };\n};\n\nexport type FeatureAnnouncementRawNotification = {\n type: TRIGGER_TYPES.FEATURES_ANNOUNCEMENT;\n createdAt: string;\n data: FeatureAnnouncementRawNotificationData;\n};\n"]}
@@ -0,0 +1,4 @@
1
+ export type * from './feature-announcement.js';
2
+ export type * from './type-links.js';
3
+ export type * from './type-feature-announcement.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/NotificationServicesController/types/feature-announcement/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,2BAA2B,CAAC;AAC/C,mBAAmB,iBAAiB,CAAC;AACrC,mBAAmB,gCAAgC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/NotificationServicesController/types/feature-announcement/index.ts"],"names":[],"mappings":"","sourcesContent":["export type * from './feature-announcement.js';\nexport type * from './type-links.js';\nexport type * from './type-feature-announcement.js';\n"]}
@@ -1,5 +1,5 @@
1
- import type { Entry, EntryFieldTypes } from "contentful";
2
- import type { TypeExternalLinkFields, TypeExtensionLinkFields, TypePortfolioLinkFields, TypeMobileLinkFields } from "./type-links.cjs";
1
+ import type { Entry, EntryFieldTypes } from 'contentful';
2
+ import type { TypeExternalLinkFields, TypeExtensionLinkFields, TypePortfolioLinkFields, TypeMobileLinkFields } from './type-links.js';
3
3
  export type ImageFields = {
4
4
  fields: {
5
5
  title?: string;
@@ -40,4 +40,4 @@ export type TypeFeatureAnnouncementFields = {
40
40
  contentTypeId: 'productAnnouncement';
41
41
  };
42
42
  export type TypeFeatureAnnouncement = Entry<TypeFeatureAnnouncementFields, 'WITHOUT_UNRESOLVABLE_LINKS'>;
43
- //# sourceMappingURL=type-feature-announcement.d.cts.map
43
+ //# sourceMappingURL=type-feature-announcement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-feature-announcement.d.ts","sourceRoot":"","sources":["../../../../src/NotificationServicesController/types/feature-announcement/type-feature-announcement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEzD,OAAO,KAAK,EACV,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE;QACN,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,IAAI,CAAC,EAAE;YACL,GAAG,EAAE,MAAM,CAAC;YACZ,QAAQ,EAAE,MAAM,CAAC;YACjB,WAAW,EAAE,MAAM,CAAC;YACpB,OAAO,EAAE;gBACP,IAAI,EAAE,MAAM,CAAC;gBACb,KAAK,CAAC,EAAE;oBACN,KAAK,EAAE,MAAM,CAAC;oBACd,MAAM,EAAE,MAAM,CAAC;iBAChB,CAAC;aACH,CAAC;SACH,CAAC;KACH,CAAC;IACF,aAAa,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG;IAC1C,MAAM,EAAE;QACN,KAAK,EAAE,eAAe,CAAC,IAAI,CAAC;QAC5B,EAAE,EAAE,eAAe,CAAC,MAAM,CAAC;QAC3B,QAAQ,EAAE,eAAe,CAAC,IAAI,CAAC;QAC/B,gBAAgB,EAAE,eAAe,CAAC,IAAI,CAAC;QACvC,KAAK,EAAE,eAAe,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;QAC9C,eAAe,EAAE,eAAe,CAAC,QAAQ,CAAC;QAG1C,YAAY,CAAC,EAAE,eAAe,CAAC,SAAS,CAAC,sBAAsB,CAAC,CAAC;QAEjE,aAAa,CAAC,EAAE,eAAe,CAAC,SAAS,CAAC,uBAAuB,CAAC,CAAC;QAEnE,aAAa,CAAC,EAAE,eAAe,CAAC,SAAS,CAAC,uBAAuB,CAAC,CAAC;QAEnE,UAAU,CAAC,EAAE,eAAe,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAC;QAE7D,OAAO,CAAC,EAAE,eAAe,CAAC,IAAI,CAAC,WAAW,GAAG,QAAQ,GAAG,WAAW,CAAC,CAAC;QAGrE,6BAA6B,CAAC,EAAE,eAAe,CAAC,IAAI,CAAC;QACrD,0BAA0B,CAAC,EAAE,eAAe,CAAC,IAAI,CAAC;QAElD,6BAA6B,CAAC,EAAE,eAAe,CAAC,IAAI,CAAC;QACrD,0BAA0B,CAAC,EAAE,eAAe,CAAC,IAAI,CAAC;KACnD,CAAC;IACF,aAAa,EAAE,qBAAqB,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,KAAK,CACzC,6BAA6B,EAC7B,4BAA4B,CAC7B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=type-feature-announcement.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-feature-announcement.js","sourceRoot":"","sources":["../../../../src/NotificationServicesController/types/feature-announcement/type-feature-announcement.ts"],"names":[],"mappings":"","sourcesContent":["import type { Entry, EntryFieldTypes } from 'contentful';\n\nimport type {\n TypeExternalLinkFields,\n TypeExtensionLinkFields,\n TypePortfolioLinkFields,\n TypeMobileLinkFields,\n} from './type-links.js';\n\nexport type ImageFields = {\n fields: {\n title?: string;\n description?: string;\n file?: {\n url: string;\n fileName: string;\n contentType: string;\n details: {\n size: number;\n image?: {\n width: number;\n height: number;\n };\n };\n };\n };\n contentTypeId: 'Image';\n};\n\nexport type TypeFeatureAnnouncementFields = {\n fields: {\n title: EntryFieldTypes.Text;\n id: EntryFieldTypes.Symbol;\n category: EntryFieldTypes.Text; // E.g. Announcement, etc.\n shortDescription: EntryFieldTypes.Text;\n image: EntryFieldTypes.EntryLink<ImageFields>;\n longDescription: EntryFieldTypes.RichText;\n\n // External Link\n externalLink?: EntryFieldTypes.EntryLink<TypeExternalLinkFields>;\n // Portfolio Link\n portfolioLink?: EntryFieldTypes.EntryLink<TypePortfolioLinkFields>;\n // Extension Link\n extensionLink?: EntryFieldTypes.EntryLink<TypeExtensionLinkFields>;\n // Mobile Link\n mobileLink?: EntryFieldTypes.EntryLink<TypeMobileLinkFields>;\n\n clients?: EntryFieldTypes.Text<'extension' | 'mobile' | 'portfolio'>;\n\n // Min Versions\n extensionMinimumVersionNumber?: EntryFieldTypes.Text;\n mobileMinimumVersionNumber?: EntryFieldTypes.Text;\n // Max Versions\n extensionMaximumVersionNumber?: EntryFieldTypes.Text;\n mobileMaximumVersionNumber?: EntryFieldTypes.Text;\n };\n contentTypeId: 'productAnnouncement';\n};\n\nexport type TypeFeatureAnnouncement = Entry<\n TypeFeatureAnnouncementFields,\n 'WITHOUT_UNRESOLVABLE_LINKS'\n>;\n"]}
@@ -26,4 +26,4 @@ export type TypeMobileLinkFields = {
26
26
  };
27
27
  contentTypeId: 'mobileLink';
28
28
  };
29
- //# sourceMappingURL=type-links.d.cts.map
29
+ //# sourceMappingURL=type-links.d.ts.map