@metamask/notification-services-controller 1.0.0 → 3.0.0

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 (191) hide show
  1. package/CHANGELOG.md +21 -1
  2. package/README.md +35 -1
  3. package/dist/NotificationServicesController/NotificationServicesController.cjs +5 -2
  4. package/dist/NotificationServicesController/NotificationServicesController.cjs.map +1 -1
  5. package/dist/NotificationServicesController/NotificationServicesController.d.cts.map +1 -1
  6. package/dist/NotificationServicesController/NotificationServicesController.d.mts.map +1 -1
  7. package/dist/NotificationServicesController/NotificationServicesController.mjs +5 -2
  8. package/dist/NotificationServicesController/NotificationServicesController.mjs.map +1 -1
  9. package/dist/NotificationServicesController/index.cjs +1 -1
  10. package/dist/NotificationServicesController/index.cjs.map +1 -1
  11. package/dist/NotificationServicesController/index.d.cts +1 -1
  12. package/dist/NotificationServicesController/index.d.cts.map +1 -1
  13. package/dist/NotificationServicesController/index.d.mts +1 -1
  14. package/dist/NotificationServicesController/index.d.mts.map +1 -1
  15. package/dist/NotificationServicesController/index.mjs +1 -1
  16. package/dist/NotificationServicesController/index.mjs.map +1 -1
  17. package/dist/NotificationServicesController/mocks/index.cjs.map +1 -0
  18. package/dist/NotificationServicesController/mocks/index.d.cts.map +1 -0
  19. package/dist/NotificationServicesController/mocks/index.d.mts.map +1 -0
  20. package/dist/NotificationServicesController/mocks/index.mjs.map +1 -0
  21. package/dist/NotificationServicesController/mocks/mock-feature-announcements.cjs.map +1 -0
  22. package/dist/NotificationServicesController/mocks/mock-feature-announcements.d.cts.map +1 -0
  23. package/dist/NotificationServicesController/mocks/mock-feature-announcements.d.mts.map +1 -0
  24. package/dist/NotificationServicesController/mocks/mock-feature-announcements.mjs.map +1 -0
  25. package/dist/NotificationServicesController/mocks/mock-notification-trigger.cjs.map +1 -0
  26. package/dist/NotificationServicesController/mocks/mock-notification-trigger.d.cts.map +1 -0
  27. package/dist/NotificationServicesController/mocks/mock-notification-trigger.d.mts.map +1 -0
  28. package/dist/NotificationServicesController/mocks/mock-notification-trigger.mjs.map +1 -0
  29. package/dist/NotificationServicesController/mocks/mock-notification-user-storage.cjs.map +1 -0
  30. package/dist/NotificationServicesController/mocks/mock-notification-user-storage.d.cts.map +1 -0
  31. package/dist/NotificationServicesController/mocks/mock-notification-user-storage.d.mts.map +1 -0
  32. package/dist/NotificationServicesController/mocks/mock-notification-user-storage.mjs.map +1 -0
  33. package/dist/NotificationServicesController/mocks/mock-raw-notifications.cjs.map +1 -0
  34. package/dist/NotificationServicesController/mocks/mock-raw-notifications.d.cts.map +1 -0
  35. package/dist/NotificationServicesController/mocks/mock-raw-notifications.d.mts.map +1 -0
  36. package/dist/NotificationServicesController/mocks/mock-raw-notifications.mjs.map +1 -0
  37. package/dist/NotificationServicesController/mocks/mock-snap-notification.cjs.map +1 -0
  38. package/dist/NotificationServicesController/mocks/mock-snap-notification.d.cts.map +1 -0
  39. package/dist/NotificationServicesController/mocks/mock-snap-notification.d.mts.map +1 -0
  40. package/dist/NotificationServicesController/mocks/mock-snap-notification.mjs.map +1 -0
  41. package/dist/NotificationServicesController/mocks/mockResponses.cjs.map +1 -0
  42. package/dist/NotificationServicesController/mocks/mockResponses.d.cts.map +1 -0
  43. package/dist/NotificationServicesController/mocks/mockResponses.d.mts.map +1 -0
  44. package/dist/NotificationServicesController/mocks/mockResponses.mjs.map +1 -0
  45. package/dist/NotificationServicesPushController/NotificationServicesPushController.cjs +2 -0
  46. package/dist/NotificationServicesPushController/NotificationServicesPushController.cjs.map +1 -1
  47. package/dist/NotificationServicesPushController/NotificationServicesPushController.d.cts +4 -0
  48. package/dist/NotificationServicesPushController/NotificationServicesPushController.d.cts.map +1 -1
  49. package/dist/NotificationServicesPushController/NotificationServicesPushController.d.mts +4 -0
  50. package/dist/NotificationServicesPushController/NotificationServicesPushController.d.mts.map +1 -1
  51. package/dist/NotificationServicesPushController/NotificationServicesPushController.mjs +2 -0
  52. package/dist/NotificationServicesPushController/NotificationServicesPushController.mjs.map +1 -1
  53. package/dist/NotificationServicesPushController/index.cjs +1 -1
  54. package/dist/NotificationServicesPushController/index.cjs.map +1 -1
  55. package/dist/NotificationServicesPushController/index.d.cts +1 -1
  56. package/dist/NotificationServicesPushController/index.d.cts.map +1 -1
  57. package/dist/NotificationServicesPushController/index.d.mts +1 -1
  58. package/dist/NotificationServicesPushController/index.d.mts.map +1 -1
  59. package/dist/NotificationServicesPushController/index.mjs +1 -1
  60. package/dist/NotificationServicesPushController/index.mjs.map +1 -1
  61. package/dist/NotificationServicesPushController/mocks/index.cjs.map +1 -0
  62. package/dist/NotificationServicesPushController/mocks/index.d.cts.map +1 -0
  63. package/dist/NotificationServicesPushController/mocks/index.d.mts.map +1 -0
  64. package/dist/NotificationServicesPushController/mocks/index.mjs.map +1 -0
  65. package/dist/NotificationServicesPushController/{__fixtures__ → mocks}/mockResponse.cjs +2 -2
  66. package/dist/NotificationServicesPushController/mocks/mockResponse.cjs.map +1 -0
  67. package/dist/NotificationServicesPushController/mocks/mockResponse.d.cts.map +1 -0
  68. package/dist/NotificationServicesPushController/mocks/mockResponse.d.mts.map +1 -0
  69. package/dist/NotificationServicesPushController/{__fixtures__ → mocks}/mockResponse.mjs +2 -2
  70. package/dist/NotificationServicesPushController/mocks/mockResponse.mjs.map +1 -0
  71. package/dist/NotificationServicesPushController/services/services.cjs +6 -4
  72. package/dist/NotificationServicesPushController/services/services.cjs.map +1 -1
  73. package/dist/NotificationServicesPushController/services/services.d.cts +3 -0
  74. package/dist/NotificationServicesPushController/services/services.d.cts.map +1 -1
  75. package/dist/NotificationServicesPushController/services/services.d.mts +3 -0
  76. package/dist/NotificationServicesPushController/services/services.d.mts.map +1 -1
  77. package/dist/NotificationServicesPushController/services/services.mjs +6 -4
  78. package/dist/NotificationServicesPushController/services/services.mjs.map +1 -1
  79. package/notification-services/mocks/package.json +2 -2
  80. package/package.json +14 -14
  81. package/push-services/mocks/package.json +2 -2
  82. package/dist/NotificationServicesController/__fixtures__/index.cjs.map +0 -1
  83. package/dist/NotificationServicesController/__fixtures__/index.d.cts.map +0 -1
  84. package/dist/NotificationServicesController/__fixtures__/index.d.mts.map +0 -1
  85. package/dist/NotificationServicesController/__fixtures__/index.mjs.map +0 -1
  86. package/dist/NotificationServicesController/__fixtures__/mock-feature-announcements.cjs.map +0 -1
  87. package/dist/NotificationServicesController/__fixtures__/mock-feature-announcements.d.cts.map +0 -1
  88. package/dist/NotificationServicesController/__fixtures__/mock-feature-announcements.d.mts.map +0 -1
  89. package/dist/NotificationServicesController/__fixtures__/mock-feature-announcements.mjs.map +0 -1
  90. package/dist/NotificationServicesController/__fixtures__/mock-notification-trigger.cjs.map +0 -1
  91. package/dist/NotificationServicesController/__fixtures__/mock-notification-trigger.d.cts.map +0 -1
  92. package/dist/NotificationServicesController/__fixtures__/mock-notification-trigger.d.mts.map +0 -1
  93. package/dist/NotificationServicesController/__fixtures__/mock-notification-trigger.mjs.map +0 -1
  94. package/dist/NotificationServicesController/__fixtures__/mock-notification-user-storage.cjs.map +0 -1
  95. package/dist/NotificationServicesController/__fixtures__/mock-notification-user-storage.d.cts.map +0 -1
  96. package/dist/NotificationServicesController/__fixtures__/mock-notification-user-storage.d.mts.map +0 -1
  97. package/dist/NotificationServicesController/__fixtures__/mock-notification-user-storage.mjs.map +0 -1
  98. package/dist/NotificationServicesController/__fixtures__/mock-raw-notifications.cjs.map +0 -1
  99. package/dist/NotificationServicesController/__fixtures__/mock-raw-notifications.d.cts.map +0 -1
  100. package/dist/NotificationServicesController/__fixtures__/mock-raw-notifications.d.mts.map +0 -1
  101. package/dist/NotificationServicesController/__fixtures__/mock-raw-notifications.mjs.map +0 -1
  102. package/dist/NotificationServicesController/__fixtures__/mock-snap-notification.cjs.map +0 -1
  103. package/dist/NotificationServicesController/__fixtures__/mock-snap-notification.d.cts.map +0 -1
  104. package/dist/NotificationServicesController/__fixtures__/mock-snap-notification.d.mts.map +0 -1
  105. package/dist/NotificationServicesController/__fixtures__/mock-snap-notification.mjs.map +0 -1
  106. package/dist/NotificationServicesController/__fixtures__/mockAddresses.cjs +0 -6
  107. package/dist/NotificationServicesController/__fixtures__/mockAddresses.cjs.map +0 -1
  108. package/dist/NotificationServicesController/__fixtures__/mockAddresses.d.cts +0 -3
  109. package/dist/NotificationServicesController/__fixtures__/mockAddresses.d.cts.map +0 -1
  110. package/dist/NotificationServicesController/__fixtures__/mockAddresses.d.mts +0 -3
  111. package/dist/NotificationServicesController/__fixtures__/mockAddresses.d.mts.map +0 -1
  112. package/dist/NotificationServicesController/__fixtures__/mockAddresses.mjs +0 -3
  113. package/dist/NotificationServicesController/__fixtures__/mockAddresses.mjs.map +0 -1
  114. package/dist/NotificationServicesController/__fixtures__/mockResponses.cjs.map +0 -1
  115. package/dist/NotificationServicesController/__fixtures__/mockResponses.d.cts.map +0 -1
  116. package/dist/NotificationServicesController/__fixtures__/mockResponses.d.mts.map +0 -1
  117. package/dist/NotificationServicesController/__fixtures__/mockResponses.mjs.map +0 -1
  118. package/dist/NotificationServicesController/__fixtures__/mockServices.cjs +0 -56
  119. package/dist/NotificationServicesController/__fixtures__/mockServices.cjs.map +0 -1
  120. package/dist/NotificationServicesController/__fixtures__/mockServices.d.cts +0 -12
  121. package/dist/NotificationServicesController/__fixtures__/mockServices.d.cts.map +0 -1
  122. package/dist/NotificationServicesController/__fixtures__/mockServices.d.mts +0 -12
  123. package/dist/NotificationServicesController/__fixtures__/mockServices.d.mts.map +0 -1
  124. package/dist/NotificationServicesController/__fixtures__/mockServices.mjs +0 -52
  125. package/dist/NotificationServicesController/__fixtures__/mockServices.mjs.map +0 -1
  126. package/dist/NotificationServicesController/__fixtures__/test-utils.cjs +0 -31
  127. package/dist/NotificationServicesController/__fixtures__/test-utils.cjs.map +0 -1
  128. package/dist/NotificationServicesController/__fixtures__/test-utils.d.cts +0 -14
  129. package/dist/NotificationServicesController/__fixtures__/test-utils.d.cts.map +0 -1
  130. package/dist/NotificationServicesController/__fixtures__/test-utils.d.mts +0 -14
  131. package/dist/NotificationServicesController/__fixtures__/test-utils.d.mts.map +0 -1
  132. package/dist/NotificationServicesController/__fixtures__/test-utils.mjs +0 -27
  133. package/dist/NotificationServicesController/__fixtures__/test-utils.mjs.map +0 -1
  134. package/dist/NotificationServicesPushController/__fixtures__/index.cjs.map +0 -1
  135. package/dist/NotificationServicesPushController/__fixtures__/index.d.cts.map +0 -1
  136. package/dist/NotificationServicesPushController/__fixtures__/index.d.mts.map +0 -1
  137. package/dist/NotificationServicesPushController/__fixtures__/index.mjs.map +0 -1
  138. package/dist/NotificationServicesPushController/__fixtures__/mockMessenger.cjs +0 -14
  139. package/dist/NotificationServicesPushController/__fixtures__/mockMessenger.cjs.map +0 -1
  140. package/dist/NotificationServicesPushController/__fixtures__/mockMessenger.d.cts +0 -3
  141. package/dist/NotificationServicesPushController/__fixtures__/mockMessenger.d.cts.map +0 -1
  142. package/dist/NotificationServicesPushController/__fixtures__/mockMessenger.d.mts +0 -3
  143. package/dist/NotificationServicesPushController/__fixtures__/mockMessenger.d.mts.map +0 -1
  144. package/dist/NotificationServicesPushController/__fixtures__/mockMessenger.mjs +0 -10
  145. package/dist/NotificationServicesPushController/__fixtures__/mockMessenger.mjs.map +0 -1
  146. package/dist/NotificationServicesPushController/__fixtures__/mockResponse.cjs.map +0 -1
  147. package/dist/NotificationServicesPushController/__fixtures__/mockResponse.d.cts.map +0 -1
  148. package/dist/NotificationServicesPushController/__fixtures__/mockResponse.d.mts.map +0 -1
  149. package/dist/NotificationServicesPushController/__fixtures__/mockResponse.mjs.map +0 -1
  150. package/dist/NotificationServicesPushController/__fixtures__/mockServices.cjs +0 -19
  151. package/dist/NotificationServicesPushController/__fixtures__/mockServices.cjs.map +0 -1
  152. package/dist/NotificationServicesPushController/__fixtures__/mockServices.d.cts +0 -8
  153. package/dist/NotificationServicesPushController/__fixtures__/mockServices.d.cts.map +0 -1
  154. package/dist/NotificationServicesPushController/__fixtures__/mockServices.d.mts +0 -8
  155. package/dist/NotificationServicesPushController/__fixtures__/mockServices.d.mts.map +0 -1
  156. package/dist/NotificationServicesPushController/__fixtures__/mockServices.mjs +0 -19
  157. package/dist/NotificationServicesPushController/__fixtures__/mockServices.mjs.map +0 -1
  158. /package/dist/NotificationServicesController/{__fixtures__ → mocks}/index.cjs +0 -0
  159. /package/dist/NotificationServicesController/{__fixtures__ → mocks}/index.d.cts +0 -0
  160. /package/dist/NotificationServicesController/{__fixtures__ → mocks}/index.d.mts +0 -0
  161. /package/dist/NotificationServicesController/{__fixtures__ → mocks}/index.mjs +0 -0
  162. /package/dist/NotificationServicesController/{__fixtures__ → mocks}/mock-feature-announcements.cjs +0 -0
  163. /package/dist/NotificationServicesController/{__fixtures__ → mocks}/mock-feature-announcements.d.cts +0 -0
  164. /package/dist/NotificationServicesController/{__fixtures__ → mocks}/mock-feature-announcements.d.mts +0 -0
  165. /package/dist/NotificationServicesController/{__fixtures__ → mocks}/mock-feature-announcements.mjs +0 -0
  166. /package/dist/NotificationServicesController/{__fixtures__ → mocks}/mock-notification-trigger.cjs +0 -0
  167. /package/dist/NotificationServicesController/{__fixtures__ → mocks}/mock-notification-trigger.d.cts +0 -0
  168. /package/dist/NotificationServicesController/{__fixtures__ → mocks}/mock-notification-trigger.d.mts +0 -0
  169. /package/dist/NotificationServicesController/{__fixtures__ → mocks}/mock-notification-trigger.mjs +0 -0
  170. /package/dist/NotificationServicesController/{__fixtures__ → mocks}/mock-notification-user-storage.cjs +0 -0
  171. /package/dist/NotificationServicesController/{__fixtures__ → mocks}/mock-notification-user-storage.d.cts +0 -0
  172. /package/dist/NotificationServicesController/{__fixtures__ → mocks}/mock-notification-user-storage.d.mts +0 -0
  173. /package/dist/NotificationServicesController/{__fixtures__ → mocks}/mock-notification-user-storage.mjs +0 -0
  174. /package/dist/NotificationServicesController/{__fixtures__ → mocks}/mock-raw-notifications.cjs +0 -0
  175. /package/dist/NotificationServicesController/{__fixtures__ → mocks}/mock-raw-notifications.d.cts +0 -0
  176. /package/dist/NotificationServicesController/{__fixtures__ → mocks}/mock-raw-notifications.d.mts +0 -0
  177. /package/dist/NotificationServicesController/{__fixtures__ → mocks}/mock-raw-notifications.mjs +0 -0
  178. /package/dist/NotificationServicesController/{__fixtures__ → mocks}/mock-snap-notification.cjs +0 -0
  179. /package/dist/NotificationServicesController/{__fixtures__ → mocks}/mock-snap-notification.d.cts +0 -0
  180. /package/dist/NotificationServicesController/{__fixtures__ → mocks}/mock-snap-notification.d.mts +0 -0
  181. /package/dist/NotificationServicesController/{__fixtures__ → mocks}/mock-snap-notification.mjs +0 -0
  182. /package/dist/NotificationServicesController/{__fixtures__ → mocks}/mockResponses.cjs +0 -0
  183. /package/dist/NotificationServicesController/{__fixtures__ → mocks}/mockResponses.d.cts +0 -0
  184. /package/dist/NotificationServicesController/{__fixtures__ → mocks}/mockResponses.d.mts +0 -0
  185. /package/dist/NotificationServicesController/{__fixtures__ → mocks}/mockResponses.mjs +0 -0
  186. /package/dist/NotificationServicesPushController/{__fixtures__ → mocks}/index.cjs +0 -0
  187. /package/dist/NotificationServicesPushController/{__fixtures__ → mocks}/index.d.cts +0 -0
  188. /package/dist/NotificationServicesPushController/{__fixtures__ → mocks}/index.d.mts +0 -0
  189. /package/dist/NotificationServicesPushController/{__fixtures__ → mocks}/index.mjs +0 -0
  190. /package/dist/NotificationServicesPushController/{__fixtures__ → mocks}/mockResponse.d.cts +0 -0
  191. /package/dist/NotificationServicesPushController/{__fixtures__ → mocks}/mockResponse.d.mts +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/__fixtures__/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAA+B","sourcesContent":["export * from './mockResponse';\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/__fixtures__/index.ts"],"names":[],"mappings":"AAAA,mCAA+B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/__fixtures__/index.ts"],"names":[],"mappings":"AAAA,mCAA+B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/__fixtures__/index.ts"],"names":[],"mappings":"AAAA,mCAA+B","sourcesContent":["export * from './mockResponse';\n"]}
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buildPushPlatformNotificationsControllerMessenger = void 0;
4
- const base_controller_1 = require("@metamask/base-controller");
5
- const buildPushPlatformNotificationsControllerMessenger = () => {
6
- const globalMessenger = new base_controller_1.Messenger();
7
- return globalMessenger.getRestricted({
8
- name: 'NotificationServicesPushController',
9
- allowedActions: ['AuthenticationController:getBearerToken'],
10
- allowedEvents: [],
11
- });
12
- };
13
- exports.buildPushPlatformNotificationsControllerMessenger = buildPushPlatformNotificationsControllerMessenger;
14
- //# sourceMappingURL=mockMessenger.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mockMessenger.cjs","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/__fixtures__/mockMessenger.ts"],"names":[],"mappings":";;;AAAA,+DAAsD;AAQ/C,MAAM,iDAAiD,GAC5D,GAAgD,EAAE;IAChD,MAAM,eAAe,GAAG,IAAI,2BAAS,EAAiC,CAAC;IAEvE,OAAO,eAAe,CAAC,aAAa,CAGlC;QACA,IAAI,EAAE,oCAAoC;QAC1C,cAAc,EAAE,CAAC,yCAAyC,CAAC;QAC3D,aAAa,EAAE,EAAE;KAClB,CAAC,CAAC;AACL,CAAC,CAAC;AAZS,QAAA,iDAAiD,qDAY1D","sourcesContent":["import { Messenger } from '@metamask/base-controller';\n\nimport type {\n AllowedActions,\n AllowedEvents,\n NotificationServicesPushControllerMessenger,\n} from '..';\n\nexport const buildPushPlatformNotificationsControllerMessenger =\n (): NotificationServicesPushControllerMessenger => {\n const globalMessenger = new Messenger<AllowedActions, AllowedEvents>();\n\n return globalMessenger.getRestricted<\n 'NotificationServicesPushController',\n AllowedActions['type']\n >({\n name: 'NotificationServicesPushController',\n allowedActions: ['AuthenticationController:getBearerToken'],\n allowedEvents: [],\n });\n };\n"]}
@@ -1,3 +0,0 @@
1
- import type { NotificationServicesPushControllerMessenger } from "../index.cjs";
2
- export declare const buildPushPlatformNotificationsControllerMessenger: () => NotificationServicesPushControllerMessenger;
3
- //# sourceMappingURL=mockMessenger.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mockMessenger.d.cts","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/__fixtures__/mockMessenger.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAGV,2CAA2C,EAC5C,qBAAW;AAEZ,eAAO,MAAM,iDAAiD,mDAY3D,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { NotificationServicesPushControllerMessenger } from "../index.mjs";
2
- export declare const buildPushPlatformNotificationsControllerMessenger: () => NotificationServicesPushControllerMessenger;
3
- //# sourceMappingURL=mockMessenger.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mockMessenger.d.mts","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/__fixtures__/mockMessenger.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAGV,2CAA2C,EAC5C,qBAAW;AAEZ,eAAO,MAAM,iDAAiD,mDAY3D,CAAC"}
@@ -1,10 +0,0 @@
1
- import { Messenger } from "@metamask/base-controller";
2
- export const buildPushPlatformNotificationsControllerMessenger = () => {
3
- const globalMessenger = new Messenger();
4
- return globalMessenger.getRestricted({
5
- name: 'NotificationServicesPushController',
6
- allowedActions: ['AuthenticationController:getBearerToken'],
7
- allowedEvents: [],
8
- });
9
- };
10
- //# sourceMappingURL=mockMessenger.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mockMessenger.mjs","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/__fixtures__/mockMessenger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,kCAAkC;AAQtD,MAAM,CAAC,MAAM,iDAAiD,GAC5D,GAAgD,EAAE;IAChD,MAAM,eAAe,GAAG,IAAI,SAAS,EAAiC,CAAC;IAEvE,OAAO,eAAe,CAAC,aAAa,CAGlC;QACA,IAAI,EAAE,oCAAoC;QAC1C,cAAc,EAAE,CAAC,yCAAyC,CAAC;QAC3D,aAAa,EAAE,EAAE;KAClB,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["import { Messenger } from '@metamask/base-controller';\n\nimport type {\n AllowedActions,\n AllowedEvents,\n NotificationServicesPushControllerMessenger,\n} from '..';\n\nexport const buildPushPlatformNotificationsControllerMessenger =\n (): NotificationServicesPushControllerMessenger => {\n const globalMessenger = new Messenger<AllowedActions, AllowedEvents>();\n\n return globalMessenger.getRestricted<\n 'NotificationServicesPushController',\n AllowedActions['type']\n >({\n name: 'NotificationServicesPushController',\n allowedActions: ['AuthenticationController:getBearerToken'],\n allowedEvents: [],\n });\n };\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mockResponse.cjs","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/__fixtures__/mockResponse.ts"],"names":[],"mappings":";;;AAAA,yDAAqE;AASxD,QAAA,cAAc,GAAG,WAAW,CAAC;AAC7B,QAAA,mBAAmB,GAAgB;IAC9C,WAAW,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;IAC5B,mBAAmB,EAAE;QACnB,EAAE,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,WAAW,EAAE;QAC/C,EAAE,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,WAAW,EAAE;KAChD;CACF,CAAC;AAEK,MAAM,4CAA4C,GAAG,GAAG,EAAE;IAC/D,OAAO;QACL,GAAG,EAAE,wCAA4B;QACjC,aAAa,EAAE,KAAK;QACpB,QAAQ,EAAE,2BAAmB;KACP,CAAC;AAC3B,CAAC,CAAC;AANW,QAAA,4CAA4C,gDAMvD;AAEK,MAAM,0CAA0C,GAAG,GAAG,EAAE;IAC7D,OAAO;QACL,GAAG,EAAE,wCAA4B;QACjC,aAAa,EAAE,MAAM;QACrB,QAAQ,EAAE,IAAI;KACQ,CAAC;AAC3B,CAAC,CAAC;AANW,QAAA,0CAA0C,8CAMrD;AAEW,QAAA,iBAAiB,GAAG;IAC/B,IAAI,EAAE,EAAE;IACR,KAAK,EAAE,WAAW;IAClB,GAAG,EAAE;QACH,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,EAAE;QACR,iBAAiB,EAAE,EAAE;KACtB;CACF,CAAC;AAEK,MAAM,yCAAyC,GAAG,GAAG,EAAE;IAC5D,OAAO;QACL,GAAG,EAAE,kEAAkE;QACvE,aAAa,EAAE,MAAM;QACrB,QAAQ,EAAE,yBAAiB;KACL,CAAC;AAC3B,CAAC,CAAC;AANW,QAAA,yCAAyC,6CAMpD;AAEK,MAAM,yCAAyC,GAAG,GAAG,EAAE;IAC5D,OAAO;QACL,GAAG,EAAE,kEAAkE;QACvE,aAAa,EAAE,MAAM;QACrB,QAAQ,EAAE,EAAE;KACU,CAAC;AAC3B,CAAC,CAAC;AANW,QAAA,yCAAyC,6CAMpD","sourcesContent":["import { REGISTRATION_TOKENS_ENDPOINT } from '../services/endpoints';\nimport type { LinksResult } from '../services/services';\n\ntype MockResponse = {\n url: string | RegExp;\n requestMethod: 'GET' | 'POST' | 'PUT';\n response: unknown;\n};\n\nexport const MOCK_REG_TOKEN = 'REG_TOKEN';\nexport const MOCK_LINKS_RESPONSE: LinksResult = {\n trigger_ids: ['1', '2', '3'],\n registration_tokens: [\n { token: 'reg_token_1', platform: 'portfolio' },\n { token: 'reg_token_2', platform: 'extension' },\n ],\n};\n\nexport const getMockRetrievePushNotificationLinksResponse = () => {\n return {\n url: REGISTRATION_TOKENS_ENDPOINT,\n requestMethod: 'GET',\n response: MOCK_LINKS_RESPONSE,\n } satisfies MockResponse;\n};\n\nexport const getMockUpdatePushNotificationLinksResponse = () => {\n return {\n url: REGISTRATION_TOKENS_ENDPOINT,\n requestMethod: 'POST',\n response: null,\n } satisfies MockResponse;\n};\n\nexport const MOCK_FCM_RESPONSE = {\n name: '',\n token: 'fcm-token',\n web: {\n endpoint: '',\n p256dh: '',\n auth: '',\n applicationPubKey: '',\n },\n};\n\nexport const getMockCreateFCMRegistrationTokenResponse = () => {\n return {\n url: /^https:\\/\\/fcmregistrations\\.googleapis\\.com\\/v1\\/projects\\/.*$/u,\n requestMethod: 'POST',\n response: MOCK_FCM_RESPONSE,\n } satisfies MockResponse;\n};\n\nexport const getMockDeleteFCMRegistrationTokenResponse = () => {\n return {\n url: /^https:\\/\\/fcmregistrations\\.googleapis\\.com\\/v1\\/projects\\/.*$/u,\n requestMethod: 'POST',\n response: {},\n } satisfies MockResponse;\n};\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mockResponse.d.cts","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/__fixtures__/mockResponse.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,iCAA6B;AAQxD,eAAO,MAAM,cAAc,cAAc,CAAC;AAC1C,eAAO,MAAM,mBAAmB,EAAE,WAMjC,CAAC;AAEF,eAAO,MAAM,4CAA4C;;;;CAMxD,CAAC;AAEF,eAAO,MAAM,0CAA0C;;;;CAMtD,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;CAS7B,CAAC;AAEF,eAAO,MAAM,yCAAyC;;;;;;;;;;;;;CAMrD,CAAC;AAEF,eAAO,MAAM,yCAAyC;;;;CAMrD,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mockResponse.d.mts","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/__fixtures__/mockResponse.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,iCAA6B;AAQxD,eAAO,MAAM,cAAc,cAAc,CAAC;AAC1C,eAAO,MAAM,mBAAmB,EAAE,WAMjC,CAAC;AAEF,eAAO,MAAM,4CAA4C;;;;CAMxD,CAAC;AAEF,eAAO,MAAM,0CAA0C;;;;CAMtD,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;CAS7B,CAAC;AAEF,eAAO,MAAM,yCAAyC;;;;;;;;;;;;;CAMrD,CAAC;AAEF,eAAO,MAAM,yCAAyC;;;;CAMrD,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mockResponse.mjs","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/__fixtures__/mockResponse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,kCAA8B;AASrE,MAAM,CAAC,MAAM,cAAc,GAAG,WAAW,CAAC;AAC1C,MAAM,CAAC,MAAM,mBAAmB,GAAgB;IAC9C,WAAW,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;IAC5B,mBAAmB,EAAE;QACnB,EAAE,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,WAAW,EAAE;QAC/C,EAAE,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,WAAW,EAAE;KAChD;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,4CAA4C,GAAG,GAAG,EAAE;IAC/D,OAAO;QACL,GAAG,EAAE,4BAA4B;QACjC,aAAa,EAAE,KAAK;QACpB,QAAQ,EAAE,mBAAmB;KACP,CAAC;AAC3B,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,0CAA0C,GAAG,GAAG,EAAE;IAC7D,OAAO;QACL,GAAG,EAAE,4BAA4B;QACjC,aAAa,EAAE,MAAM;QACrB,QAAQ,EAAE,IAAI;KACQ,CAAC;AAC3B,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,IAAI,EAAE,EAAE;IACR,KAAK,EAAE,WAAW;IAClB,GAAG,EAAE;QACH,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,EAAE;QACR,iBAAiB,EAAE,EAAE;KACtB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,yCAAyC,GAAG,GAAG,EAAE;IAC5D,OAAO;QACL,GAAG,EAAE,kEAAkE;QACvE,aAAa,EAAE,MAAM;QACrB,QAAQ,EAAE,iBAAiB;KACL,CAAC;AAC3B,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,yCAAyC,GAAG,GAAG,EAAE;IAC5D,OAAO;QACL,GAAG,EAAE,kEAAkE;QACvE,aAAa,EAAE,MAAM;QACrB,QAAQ,EAAE,EAAE;KACU,CAAC;AAC3B,CAAC,CAAC","sourcesContent":["import { REGISTRATION_TOKENS_ENDPOINT } from '../services/endpoints';\nimport type { LinksResult } from '../services/services';\n\ntype MockResponse = {\n url: string | RegExp;\n requestMethod: 'GET' | 'POST' | 'PUT';\n response: unknown;\n};\n\nexport const MOCK_REG_TOKEN = 'REG_TOKEN';\nexport const MOCK_LINKS_RESPONSE: LinksResult = {\n trigger_ids: ['1', '2', '3'],\n registration_tokens: [\n { token: 'reg_token_1', platform: 'portfolio' },\n { token: 'reg_token_2', platform: 'extension' },\n ],\n};\n\nexport const getMockRetrievePushNotificationLinksResponse = () => {\n return {\n url: REGISTRATION_TOKENS_ENDPOINT,\n requestMethod: 'GET',\n response: MOCK_LINKS_RESPONSE,\n } satisfies MockResponse;\n};\n\nexport const getMockUpdatePushNotificationLinksResponse = () => {\n return {\n url: REGISTRATION_TOKENS_ENDPOINT,\n requestMethod: 'POST',\n response: null,\n } satisfies MockResponse;\n};\n\nexport const MOCK_FCM_RESPONSE = {\n name: '',\n token: 'fcm-token',\n web: {\n endpoint: '',\n p256dh: '',\n auth: '',\n applicationPubKey: '',\n },\n};\n\nexport const getMockCreateFCMRegistrationTokenResponse = () => {\n return {\n url: /^https:\\/\\/fcmregistrations\\.googleapis\\.com\\/v1\\/projects\\/.*$/u,\n requestMethod: 'POST',\n response: MOCK_FCM_RESPONSE,\n } satisfies MockResponse;\n};\n\nexport const getMockDeleteFCMRegistrationTokenResponse = () => {\n return {\n url: /^https:\\/\\/fcmregistrations\\.googleapis\\.com\\/v1\\/projects\\/.*$/u,\n requestMethod: 'POST',\n response: {},\n } satisfies MockResponse;\n};\n"]}
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.mockEndpointUpdatePushNotificationLinks = void 0;
7
- const nock_1 = __importDefault(require("nock"));
8
- const mockResponse_1 = require("./mockResponse.cjs");
9
- const mockEndpointUpdatePushNotificationLinks = (mockReply) => {
10
- const mockResponse = (0, mockResponse_1.getMockUpdatePushNotificationLinksResponse)();
11
- const reply = mockReply ?? {
12
- status: 200,
13
- body: mockResponse.response,
14
- };
15
- const mockEndpoint = (0, nock_1.default)(mockResponse.url).post('').reply(reply.status);
16
- return mockEndpoint;
17
- };
18
- exports.mockEndpointUpdatePushNotificationLinks = mockEndpointUpdatePushNotificationLinks;
19
- //# sourceMappingURL=mockServices.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mockServices.cjs","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/__fixtures__/mockServices.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,qDAA4E;AAOrE,MAAM,uCAAuC,GAAG,CACrD,SAAqB,EACrB,EAAE;IACF,MAAM,YAAY,GAAG,IAAA,yDAA0C,GAAE,CAAC;IAClE,MAAM,KAAK,GAAG,SAAS,IAAI;QACzB,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,YAAY,CAAC,QAAQ;KAC5B,CAAC;IAEF,MAAM,YAAY,GAAG,IAAA,cAAI,EAAC,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAEzE,OAAO,YAAY,CAAC;AACtB,CAAC,CAAC;AAZW,QAAA,uCAAuC,2CAYlD","sourcesContent":["import nock from 'nock';\n\nimport { getMockUpdatePushNotificationLinksResponse } from './mockResponse';\n\ntype MockReply = {\n status: nock.StatusCode;\n body?: nock.Body;\n};\n\nexport const mockEndpointUpdatePushNotificationLinks = (\n mockReply?: MockReply,\n) => {\n const mockResponse = getMockUpdatePushNotificationLinksResponse();\n const reply = mockReply ?? {\n status: 200,\n body: mockResponse.response,\n };\n\n const mockEndpoint = nock(mockResponse.url).post('').reply(reply.status);\n\n return mockEndpoint;\n};\n"]}
@@ -1,8 +0,0 @@
1
- import nock from "nock";
2
- type MockReply = {
3
- status: nock.StatusCode;
4
- body?: nock.Body;
5
- };
6
- export declare const mockEndpointUpdatePushNotificationLinks: (mockReply?: MockReply) => nock.Scope;
7
- export {};
8
- //# sourceMappingURL=mockServices.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mockServices.d.cts","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/__fixtures__/mockServices.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,aAAa;AAIxB,KAAK,SAAS,GAAG;IACf,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC;IACxB,IAAI,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,uCAAuC,eACtC,SAAS,eAWtB,CAAC"}
@@ -1,8 +0,0 @@
1
- import nock from "nock";
2
- type MockReply = {
3
- status: nock.StatusCode;
4
- body?: nock.Body;
5
- };
6
- export declare const mockEndpointUpdatePushNotificationLinks: (mockReply?: MockReply) => nock.Scope;
7
- export {};
8
- //# sourceMappingURL=mockServices.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mockServices.d.mts","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/__fixtures__/mockServices.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,aAAa;AAIxB,KAAK,SAAS,GAAG;IACf,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC;IACxB,IAAI,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,uCAAuC,eACtC,SAAS,eAWtB,CAAC"}
@@ -1,19 +0,0 @@
1
- function $importDefault(module) {
2
- if (module?.__esModule) {
3
- return module.default;
4
- }
5
- return module;
6
- }
7
- import $nock from "nock";
8
- const nock = $importDefault($nock);
9
- import { getMockUpdatePushNotificationLinksResponse } from "./mockResponse.mjs";
10
- export const mockEndpointUpdatePushNotificationLinks = (mockReply) => {
11
- const mockResponse = getMockUpdatePushNotificationLinksResponse();
12
- const reply = mockReply ?? {
13
- status: 200,
14
- body: mockResponse.response,
15
- };
16
- const mockEndpoint = nock(mockResponse.url).post('').reply(reply.status);
17
- return mockEndpoint;
18
- };
19
- //# sourceMappingURL=mockServices.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mockServices.mjs","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/__fixtures__/mockServices.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,KAAI,aAAa;;AAExB,OAAO,EAAE,0CAA0C,EAAE,2BAAuB;AAO5E,MAAM,CAAC,MAAM,uCAAuC,GAAG,CACrD,SAAqB,EACrB,EAAE;IACF,MAAM,YAAY,GAAG,0CAA0C,EAAE,CAAC;IAClE,MAAM,KAAK,GAAG,SAAS,IAAI;QACzB,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,YAAY,CAAC,QAAQ;KAC5B,CAAC;IAEF,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAEzE,OAAO,YAAY,CAAC;AACtB,CAAC,CAAC","sourcesContent":["import nock from 'nock';\n\nimport { getMockUpdatePushNotificationLinksResponse } from './mockResponse';\n\ntype MockReply = {\n status: nock.StatusCode;\n body?: nock.Body;\n};\n\nexport const mockEndpointUpdatePushNotificationLinks = (\n mockReply?: MockReply,\n) => {\n const mockResponse = getMockUpdatePushNotificationLinksResponse();\n const reply = mockReply ?? {\n status: 200,\n body: mockResponse.response,\n };\n\n const mockEndpoint = nock(mockResponse.url).post('').reply(reply.status);\n\n return mockEndpoint;\n};\n"]}