@metamask-previews/notification-services-controller 0.2.1-preview-12fc043b → 0.2.1-preview-21d139ea

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 (38) hide show
  1. package/dist/NotificationServicesController/index.js +4 -2
  2. package/dist/NotificationServicesController/index.mjs +4 -2
  3. package/dist/NotificationServicesPushController/NotificationServicesPushController.js +1 -1
  4. package/dist/NotificationServicesPushController/NotificationServicesPushController.mjs +1 -1
  5. package/dist/NotificationServicesPushController/index.js +5 -3
  6. package/dist/NotificationServicesPushController/index.mjs +5 -3
  7. package/dist/NotificationServicesPushController/services/push/push-web.js +1 -1
  8. package/dist/NotificationServicesPushController/services/push/push-web.mjs +1 -1
  9. package/dist/NotificationServicesPushController/services/services.js +1 -1
  10. package/dist/NotificationServicesPushController/services/services.mjs +1 -1
  11. package/dist/NotificationServicesPushController/utils/get-notification-message.js +1 -1
  12. package/dist/NotificationServicesPushController/utils/get-notification-message.mjs +1 -1
  13. package/dist/NotificationServicesPushController/utils/index.js +1 -1
  14. package/dist/NotificationServicesPushController/utils/index.mjs +1 -1
  15. package/dist/chunk-CYDWGKDU.js +100 -0
  16. package/dist/chunk-CYDWGKDU.js.map +1 -0
  17. package/dist/chunk-GHSFPMEE.mjs +935 -0
  18. package/dist/chunk-GHSFPMEE.mjs.map +1 -0
  19. package/dist/chunk-O3EYZ3LP.js +935 -0
  20. package/dist/chunk-O3EYZ3LP.js.map +1 -0
  21. package/dist/chunk-P437IUQJ.mjs +100 -0
  22. package/dist/chunk-P437IUQJ.mjs.map +1 -0
  23. package/dist/index.js +3 -3
  24. package/dist/index.mjs +2 -2
  25. package/dist/tsconfig.build.tsbuildinfo +1 -1
  26. package/dist/types/NotificationServicesController/index.d.ts +1 -0
  27. package/dist/types/NotificationServicesController/index.d.ts.map +1 -1
  28. package/dist/types/NotificationServicesPushController/index.d.ts +1 -0
  29. package/dist/types/NotificationServicesPushController/index.d.ts.map +1 -1
  30. package/package.json +1 -1
  31. package/dist/chunk-J776HRLN.js +0 -31
  32. package/dist/chunk-J776HRLN.js.map +0 -1
  33. package/dist/chunk-OPGQSY7Y.mjs +0 -39
  34. package/dist/chunk-OPGQSY7Y.mjs.map +0 -1
  35. package/dist/chunk-RT45HUZ6.mjs +0 -31
  36. package/dist/chunk-RT45HUZ6.mjs.map +0 -1
  37. package/dist/chunk-VIB7ZSZG.js +0 -39
  38. package/dist/chunk-VIB7ZSZG.js.map +0 -1
@@ -1,6 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkVIB7ZSZGjs = require('../chunk-VIB7ZSZG.js');
3
+
4
+ var _chunkO3EYZ3LPjs = require('../chunk-O3EYZ3LP.js');
4
5
 
5
6
 
6
7
  var _chunk232HZSEVjs = require('../chunk-232HZSEV.js');
@@ -46,5 +47,6 @@ require('../chunk-IGY2S5BC.js');
46
47
 
47
48
 
48
49
 
49
- exports.Constants = _chunkQY4UST5Vjs.constants_exports; exports.Controller = _chunkFFKCMR6Qjs.NotificationServicesController; exports.Processors = _chunkKWTSMLNDjs.processors_exports; exports.Types = _chunk232HZSEVjs.types_exports; exports.UI = _chunkIG3KWCQUjs.ui_exports; exports.default = _chunkVIB7ZSZGjs.NotificationServicesController_default; exports.defaultState = _chunkFFKCMR6Qjs.defaultState;
50
+
51
+ exports.Constants = _chunkQY4UST5Vjs.constants_exports; exports.Controller = _chunkFFKCMR6Qjs.NotificationServicesController; exports.Mocks = _chunkO3EYZ3LPjs.fixtures_exports; exports.Processors = _chunkKWTSMLNDjs.processors_exports; exports.Types = _chunk232HZSEVjs.types_exports; exports.UI = _chunkIG3KWCQUjs.ui_exports; exports.default = _chunkO3EYZ3LPjs.NotificationServicesController_default; exports.defaultState = _chunkFFKCMR6Qjs.defaultState;
50
52
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,7 @@
1
1
  import {
2
- NotificationServicesController_default
3
- } from "../chunk-OPGQSY7Y.mjs";
2
+ NotificationServicesController_default,
3
+ fixtures_exports
4
+ } from "../chunk-GHSFPMEE.mjs";
4
5
  import {
5
6
  types_exports
6
7
  } from "../chunk-B4ECJJ5C.mjs";
@@ -41,6 +42,7 @@ import "../chunk-U5UIDVOO.mjs";
41
42
  export {
42
43
  constants_exports as Constants,
43
44
  NotificationServicesController as Controller,
45
+ fixtures_exports as Mocks,
44
46
  processors_exports as Processors,
45
47
  types_exports as Types,
46
48
  ui_exports as UI,
@@ -5,7 +5,7 @@ var _chunk6GXEFQ64js = require('../chunk-6GXEFQ64.js');
5
5
  require('../chunk-4HOEZMSV.js');
6
6
  require('../chunk-GDKHOBJT.js');
7
7
  require('../chunk-B25TJ7KS.js');
8
- require('../chunk-VIB7ZSZG.js');
8
+ require('../chunk-O3EYZ3LP.js');
9
9
  require('../chunk-232HZSEV.js');
10
10
  require('../chunk-XZEVRYUE.js');
11
11
  require('../chunk-3ZS2HAEG.js');
@@ -5,7 +5,7 @@ import {
5
5
  import "../chunk-WGGW6VCR.mjs";
6
6
  import "../chunk-YHVXD5WW.mjs";
7
7
  import "../chunk-IKWNHNJQ.mjs";
8
- import "../chunk-OPGQSY7Y.mjs";
8
+ import "../chunk-GHSFPMEE.mjs";
9
9
  import "../chunk-B4ECJJ5C.mjs";
10
10
  import "../chunk-U74Q3BRP.mjs";
11
11
  import "../chunk-G52DNXFH.mjs";
@@ -1,6 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkJ776HRLNjs = require('../chunk-J776HRLN.js');
3
+
4
+ var _chunkCYDWGKDUjs = require('../chunk-CYDWGKDU.js');
4
5
 
5
6
 
6
7
  var _chunk7LWR54U7js = require('../chunk-7LWR54U7.js');
@@ -17,7 +18,7 @@ var _chunk6GXEFQ64js = require('../chunk-6GXEFQ64.js');
17
18
  require('../chunk-4HOEZMSV.js');
18
19
  require('../chunk-GDKHOBJT.js');
19
20
  require('../chunk-B25TJ7KS.js');
20
- require('../chunk-VIB7ZSZG.js');
21
+ require('../chunk-O3EYZ3LP.js');
21
22
  require('../chunk-232HZSEV.js');
22
23
  require('../chunk-XZEVRYUE.js');
23
24
  require('../chunk-3ZS2HAEG.js');
@@ -50,5 +51,6 @@ require('../chunk-IGY2S5BC.js');
50
51
 
51
52
 
52
53
 
53
- exports.Controller = _chunk6GXEFQ64js.NotificationServicesPushController; exports.Types = _chunk7LWR54U7js.types_exports; exports.Utils = _chunkENRKCWJ6js.utils_exports; exports.default = _chunkJ776HRLNjs.NotificationServicesPushController_default; exports.defaultState = _chunk6GXEFQ64js.defaultState;
54
+
55
+ exports.Controller = _chunk6GXEFQ64js.NotificationServicesPushController; exports.Mocks = _chunkCYDWGKDUjs.fixtures_exports; exports.Types = _chunk7LWR54U7js.types_exports; exports.Utils = _chunkENRKCWJ6js.utils_exports; exports.default = _chunkCYDWGKDUjs.NotificationServicesPushController_default; exports.defaultState = _chunk6GXEFQ64js.defaultState;
54
56
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,7 @@
1
1
  import {
2
- NotificationServicesPushController_default
3
- } from "../chunk-RT45HUZ6.mjs";
2
+ NotificationServicesPushController_default,
3
+ fixtures_exports
4
+ } from "../chunk-P437IUQJ.mjs";
4
5
  import {
5
6
  types_exports
6
7
  } from "../chunk-IOMDG67D.mjs";
@@ -17,7 +18,7 @@ import {
17
18
  import "../chunk-WGGW6VCR.mjs";
18
19
  import "../chunk-YHVXD5WW.mjs";
19
20
  import "../chunk-IKWNHNJQ.mjs";
20
- import "../chunk-OPGQSY7Y.mjs";
21
+ import "../chunk-GHSFPMEE.mjs";
21
22
  import "../chunk-B4ECJJ5C.mjs";
22
23
  import "../chunk-U74Q3BRP.mjs";
23
24
  import "../chunk-G52DNXFH.mjs";
@@ -46,6 +47,7 @@ import "../chunk-6ZDVTRRT.mjs";
46
47
  import "../chunk-U5UIDVOO.mjs";
47
48
  export {
48
49
  NotificationServicesPushController as Controller,
50
+ fixtures_exports as Mocks,
49
51
  types_exports as Types,
50
52
  utils_exports as Utils,
51
53
  NotificationServicesPushController_default as default,
@@ -4,7 +4,7 @@
4
4
 
5
5
 
6
6
  var _chunkGDKHOBJTjs = require('../../../chunk-GDKHOBJT.js');
7
- require('../../../chunk-VIB7ZSZG.js');
7
+ require('../../../chunk-O3EYZ3LP.js');
8
8
  require('../../../chunk-232HZSEV.js');
9
9
  require('../../../chunk-XZEVRYUE.js');
10
10
  require('../../../chunk-3ZS2HAEG.js');
@@ -4,7 +4,7 @@ import {
4
4
  listenToPushNotificationsClicked,
5
5
  listenToPushNotificationsReceived
6
6
  } from "../../../chunk-YHVXD5WW.mjs";
7
- import "../../../chunk-OPGQSY7Y.mjs";
7
+ import "../../../chunk-GHSFPMEE.mjs";
8
8
  import "../../../chunk-B4ECJJ5C.mjs";
9
9
  import "../../../chunk-U74Q3BRP.mjs";
10
10
  import "../../../chunk-G52DNXFH.mjs";
@@ -8,7 +8,7 @@
8
8
  var _chunk4HOEZMSVjs = require('../../chunk-4HOEZMSV.js');
9
9
  require('../../chunk-GDKHOBJT.js');
10
10
  require('../../chunk-B25TJ7KS.js');
11
- require('../../chunk-VIB7ZSZG.js');
11
+ require('../../chunk-O3EYZ3LP.js');
12
12
  require('../../chunk-232HZSEV.js');
13
13
  require('../../chunk-XZEVRYUE.js');
14
14
  require('../../chunk-3ZS2HAEG.js');
@@ -8,7 +8,7 @@ import {
8
8
  } from "../../chunk-WGGW6VCR.mjs";
9
9
  import "../../chunk-YHVXD5WW.mjs";
10
10
  import "../../chunk-IKWNHNJQ.mjs";
11
- import "../../chunk-OPGQSY7Y.mjs";
11
+ import "../../chunk-GHSFPMEE.mjs";
12
12
  import "../../chunk-B4ECJJ5C.mjs";
13
13
  import "../../chunk-U74Q3BRP.mjs";
14
14
  import "../../chunk-G52DNXFH.mjs";
@@ -4,7 +4,7 @@
4
4
 
5
5
  var _chunkBUT7X5F2js = require('../../chunk-BUT7X5F2.js');
6
6
  require('../../chunk-EJ52BDLB.js');
7
- require('../../chunk-VIB7ZSZG.js');
7
+ require('../../chunk-O3EYZ3LP.js');
8
8
  require('../../chunk-232HZSEV.js');
9
9
  require('../../chunk-XZEVRYUE.js');
10
10
  require('../../chunk-3ZS2HAEG.js');
@@ -4,7 +4,7 @@ import {
4
4
  isOnChainNotification
5
5
  } from "../../chunk-6GUOLD7O.mjs";
6
6
  import "../../chunk-ODI2BTKS.mjs";
7
- import "../../chunk-OPGQSY7Y.mjs";
7
+ import "../../chunk-GHSFPMEE.mjs";
8
8
  import "../../chunk-B4ECJJ5C.mjs";
9
9
  import "../../chunk-U74Q3BRP.mjs";
10
10
  import "../../chunk-G52DNXFH.mjs";
@@ -10,7 +10,7 @@ var _chunkBUT7X5F2js = require('../../chunk-BUT7X5F2.js');
10
10
 
11
11
 
12
12
  var _chunkEJ52BDLBjs = require('../../chunk-EJ52BDLB.js');
13
- require('../../chunk-VIB7ZSZG.js');
13
+ require('../../chunk-O3EYZ3LP.js');
14
14
  require('../../chunk-232HZSEV.js');
15
15
  require('../../chunk-XZEVRYUE.js');
16
16
  require('../../chunk-3ZS2HAEG.js');
@@ -10,7 +10,7 @@ import {
10
10
  getAmount,
11
11
  getLeadingZeroCount
12
12
  } from "../../chunk-ODI2BTKS.mjs";
13
- import "../../chunk-OPGQSY7Y.mjs";
13
+ import "../../chunk-GHSFPMEE.mjs";
14
14
  import "../../chunk-B4ECJJ5C.mjs";
15
15
  import "../../chunk-U74Q3BRP.mjs";
16
16
  import "../../chunk-G52DNXFH.mjs";
@@ -0,0 +1,100 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunk7LWR54U7js = require('./chunk-7LWR54U7.js');
4
+
5
+
6
+ var _chunkENRKCWJ6js = require('./chunk-ENRKCWJ6.js');
7
+
8
+
9
+
10
+ var _chunk6GXEFQ64js = require('./chunk-6GXEFQ64.js');
11
+
12
+
13
+ var _chunkB25TJ7KSjs = require('./chunk-B25TJ7KS.js');
14
+
15
+
16
+ var _chunkIGY2S5BCjs = require('./chunk-IGY2S5BC.js');
17
+
18
+ // src/NotificationServicesPushController/index.ts
19
+ var NotificationServicesPushController_exports = {};
20
+ _chunkIGY2S5BCjs.__export.call(void 0, NotificationServicesPushController_exports, {
21
+ Controller: () => _chunk6GXEFQ64js.NotificationServicesPushController,
22
+ Mocks: () => fixtures_exports,
23
+ Types: () => _chunk7LWR54U7js.types_exports,
24
+ Utils: () => _chunkENRKCWJ6js.utils_exports,
25
+ default: () => NotificationServicesPushController_default,
26
+ defaultState: () => _chunk6GXEFQ64js.defaultState
27
+ });
28
+
29
+ // src/NotificationServicesPushController/__fixtures__/index.ts
30
+ var fixtures_exports = {};
31
+ _chunkIGY2S5BCjs.__export.call(void 0, fixtures_exports, {
32
+ MOCK_FCM_RESPONSE: () => MOCK_FCM_RESPONSE,
33
+ MOCK_LINKS_RESPONSE: () => MOCK_LINKS_RESPONSE,
34
+ MOCK_REG_TOKEN: () => MOCK_REG_TOKEN,
35
+ getMockCreateFCMRegistrationTokenResponse: () => getMockCreateFCMRegistrationTokenResponse,
36
+ getMockDeleteFCMRegistrationTokenResponse: () => getMockDeleteFCMRegistrationTokenResponse,
37
+ getMockRetrievePushNotificationLinksResponse: () => getMockRetrievePushNotificationLinksResponse,
38
+ getMockUpdatePushNotificationLinksResponse: () => getMockUpdatePushNotificationLinksResponse
39
+ });
40
+
41
+ // src/NotificationServicesPushController/__fixtures__/mockResponse.ts
42
+ var MOCK_REG_TOKEN = "REG_TOKEN";
43
+ var MOCK_LINKS_RESPONSE = {
44
+ // eslint-disable-next-line @typescript-eslint/naming-convention
45
+ trigger_ids: ["1", "2", "3"],
46
+ // eslint-disable-next-line @typescript-eslint/naming-convention
47
+ registration_tokens: [
48
+ { token: "reg_token_1", platform: "portfolio" },
49
+ { token: "reg_token_2", platform: "extension" }
50
+ ]
51
+ };
52
+ var getMockRetrievePushNotificationLinksResponse = () => {
53
+ return {
54
+ url: _chunkB25TJ7KSjs.REGISTRATION_TOKENS_ENDPOINT,
55
+ requestMethod: "GET",
56
+ response: MOCK_LINKS_RESPONSE
57
+ };
58
+ };
59
+ var getMockUpdatePushNotificationLinksResponse = () => {
60
+ return {
61
+ url: _chunkB25TJ7KSjs.REGISTRATION_TOKENS_ENDPOINT,
62
+ requestMethod: "POST",
63
+ response: null
64
+ };
65
+ };
66
+ var MOCK_FCM_RESPONSE = {
67
+ name: "",
68
+ token: "fcm-token",
69
+ web: {
70
+ endpoint: "",
71
+ p256dh: "",
72
+ auth: "",
73
+ applicationPubKey: ""
74
+ }
75
+ };
76
+ var getMockCreateFCMRegistrationTokenResponse = () => {
77
+ return {
78
+ url: /^https:\/\/fcmregistrations\.googleapis\.com\/v1\/projects\/.*$/u,
79
+ requestMethod: "POST",
80
+ response: MOCK_FCM_RESPONSE
81
+ };
82
+ };
83
+ var getMockDeleteFCMRegistrationTokenResponse = () => {
84
+ return {
85
+ url: /^https:\/\/fcmregistrations\.googleapis\.com\/v1\/projects\/.*$/u,
86
+ requestMethod: "POST",
87
+ response: {}
88
+ };
89
+ };
90
+
91
+ // src/NotificationServicesPushController/index.ts
92
+ var NotificationServicesPushController2 = _chunk6GXEFQ64js.NotificationServicesPushController;
93
+ var NotificationServicesPushController_default = NotificationServicesPushController2;
94
+
95
+
96
+
97
+
98
+
99
+ exports.fixtures_exports = fixtures_exports; exports.NotificationServicesPushController_default = NotificationServicesPushController_default; exports.NotificationServicesPushController_exports = NotificationServicesPushController_exports;
100
+ //# sourceMappingURL=chunk-CYDWGKDU.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/NotificationServicesPushController/index.ts","../src/NotificationServicesPushController/__fixtures__/index.ts","../src/NotificationServicesPushController/__fixtures__/mockResponse.ts"],"names":["NotificationServicesPushController"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACSO,IAAM,iBAAiB;AACvB,IAAM,sBAAmC;AAAA;AAAA,EAE9C,aAAa,CAAC,KAAK,KAAK,GAAG;AAAA;AAAA,EAE3B,qBAAqB;AAAA,IACnB,EAAE,OAAO,eAAe,UAAU,YAAY;AAAA,IAC9C,EAAE,OAAO,eAAe,UAAU,YAAY;AAAA,EAChD;AACF;AAEO,IAAM,+CAA+C,MAAM;AAChE,SAAO;AAAA,IACL,KAAK;AAAA,IACL,eAAe;AAAA,IACf,UAAU;AAAA,EACZ;AACF;AAEO,IAAM,6CAA6C,MAAM;AAC9D,SAAO;AAAA,IACL,KAAK;AAAA,IACL,eAAe;AAAA,IACf,UAAU;AAAA,EACZ;AACF;AAEO,IAAM,oBAAoB;AAAA,EAC/B,MAAM;AAAA,EACN,OAAO;AAAA,EACP,KAAK;AAAA,IACH,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,mBAAmB;AAAA,EACrB;AACF;AAEO,IAAM,4CAA4C,MAAM;AAC7D,SAAO;AAAA,IACL,KAAK;AAAA,IACL,eAAe;AAAA,IACf,UAAU;AAAA,EACZ;AACF;AAEO,IAAM,4CAA4C,MAAM;AAC7D,SAAO;AAAA,IACL,KAAK;AAAA,IACL,eAAe;AAAA,IACf,UAAU,CAAC;AAAA,EACb;AACF;;;AF3DA,IAAMA,sCAAqC;AAE3C,IAAO,6CAAQA","sourcesContent":["import Controller from './NotificationServicesPushController';\n\nconst NotificationServicesPushController = Controller;\nexport { Controller };\nexport default NotificationServicesPushController;\nexport * from './NotificationServicesPushController';\nexport * as Types from './types';\nexport * as Utils from './utils';\nexport * as Mocks from './__fixtures__';\n","export * from './mockResponse';\n","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 // eslint-disable-next-line @typescript-eslint/naming-convention\n trigger_ids: ['1', '2', '3'],\n // eslint-disable-next-line @typescript-eslint/naming-convention\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"]}