@metamask-previews/notification-services-controller 0.1.0-preview-509f7952 → 0.1.0-preview-caf274f8

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 (102) hide show
  1. package/dist/NotificationServicesController/NotificationServicesController.js +3 -3
  2. package/dist/NotificationServicesController/NotificationServicesController.mjs +2 -2
  3. package/dist/NotificationServicesController/constants/constants.js +1 -1
  4. package/dist/NotificationServicesController/constants/constants.mjs +1 -1
  5. package/dist/NotificationServicesController/constants/index.js +2 -2
  6. package/dist/NotificationServicesController/constants/index.mjs +2 -2
  7. package/dist/NotificationServicesController/constants/notification-schema.js +1 -1
  8. package/dist/NotificationServicesController/constants/notification-schema.mjs +1 -1
  9. package/dist/NotificationServicesController/index.js +6 -6
  10. package/dist/NotificationServicesController/index.mjs +5 -5
  11. package/dist/NotificationServicesController/processors/index.js +2 -2
  12. package/dist/NotificationServicesController/processors/index.mjs +2 -2
  13. package/dist/NotificationServicesController/processors/process-feature-announcement.js +1 -1
  14. package/dist/NotificationServicesController/processors/process-feature-announcement.mjs +1 -1
  15. package/dist/NotificationServicesController/processors/process-notifications.js +1 -1
  16. package/dist/NotificationServicesController/processors/process-notifications.mjs +1 -1
  17. package/dist/NotificationServicesController/processors/process-onchain-notifications.js +1 -1
  18. package/dist/NotificationServicesController/processors/process-onchain-notifications.mjs +1 -1
  19. package/dist/NotificationServicesController/services/feature-announcements.js +1 -1
  20. package/dist/NotificationServicesController/services/feature-announcements.mjs +1 -1
  21. package/dist/NotificationServicesController/services/onchain-notifications.js +1 -1
  22. package/dist/NotificationServicesController/services/onchain-notifications.mjs +1 -1
  23. package/dist/NotificationServicesController/utils/utils.js +1 -1
  24. package/dist/NotificationServicesController/utils/utils.mjs +1 -1
  25. package/dist/NotificationServicesPushController/NotificationServicesPushController.js +9 -9
  26. package/dist/NotificationServicesPushController/NotificationServicesPushController.mjs +8 -8
  27. package/dist/NotificationServicesPushController/constants.js +1 -1
  28. package/dist/NotificationServicesPushController/constants.mjs +1 -1
  29. package/dist/NotificationServicesPushController/index.js +12 -12
  30. package/dist/NotificationServicesPushController/index.mjs +11 -11
  31. package/dist/NotificationServicesPushController/services/endpoints.js +1 -1
  32. package/dist/NotificationServicesPushController/services/endpoints.mjs +1 -1
  33. package/dist/NotificationServicesPushController/services/push/push-web.js +7 -7
  34. package/dist/NotificationServicesPushController/services/push/push-web.mjs +6 -6
  35. package/dist/NotificationServicesPushController/services/services.js +8 -8
  36. package/dist/NotificationServicesPushController/services/services.mjs +7 -7
  37. package/dist/NotificationServicesPushController/utils/get-notification-data.js +1 -1
  38. package/dist/NotificationServicesPushController/utils/get-notification-data.mjs +1 -1
  39. package/dist/NotificationServicesPushController/utils/get-notification-message.js +7 -7
  40. package/dist/NotificationServicesPushController/utils/get-notification-message.mjs +6 -6
  41. package/dist/NotificationServicesPushController/utils/index.js +8 -8
  42. package/dist/NotificationServicesPushController/utils/index.mjs +7 -7
  43. package/dist/{chunk-QTK2RMF7.mjs → chunk-57S5B7X2.mjs} +2 -2
  44. package/dist/{chunk-UPVIT75F.js → chunk-6265FKB5.js} +3 -3
  45. package/dist/{chunk-O22GVG7K.js → chunk-6GPIA5G3.js} +35 -35
  46. package/dist/{chunk-PGMXFZ6Y.js → chunk-ABFHAGGB.js} +3 -3
  47. package/dist/{chunk-SSWX2N73.mjs → chunk-AHEMTJDE.mjs} +2 -2
  48. package/dist/{chunk-5DA74RWP.mjs → chunk-CQI6FYPZ.mjs} +2 -2
  49. package/dist/{chunk-JLHFZ2UG.mjs → chunk-DBTJ34DS.mjs} +3 -3
  50. package/dist/{chunk-YD3VVORT.js → chunk-DOYL2MCR.js} +85 -85
  51. package/dist/{chunk-ABJDEX2S.js → chunk-H4RSHSWR.js} +3 -3
  52. package/dist/chunk-IGY2S5BC.js +36 -0
  53. package/dist/{chunk-CQ6CGSKZ.js → chunk-IK7KP7N3.js} +3 -3
  54. package/dist/{chunk-FFQNSBPU.js → chunk-KCIC5BWH.js} +7 -7
  55. package/dist/chunk-NBRY7XVG.mjs +925 -0
  56. package/dist/chunk-NBRY7XVG.mjs.map +1 -0
  57. package/dist/{chunk-WTE64QEK.js → chunk-O6RMA2N6.js} +9 -36
  58. package/dist/chunk-O6RMA2N6.js.map +1 -0
  59. package/dist/{chunk-YETZSCGK.js → chunk-QJTZL7TJ.js} +4 -4
  60. package/dist/{chunk-VE4DTN4R.mjs → chunk-QSFGJCPI.mjs} +2 -2
  61. package/dist/{chunk-QUNLD7F2.mjs → chunk-TI4UC3G3.mjs} +2 -2
  62. package/dist/{chunk-ATR6FRAX.mjs → chunk-TS2NQOUA.mjs} +6 -33
  63. package/dist/chunk-TS2NQOUA.mjs.map +1 -0
  64. package/dist/chunk-U5UIDVOO.mjs +36 -0
  65. package/dist/chunk-XYIGTTEP.js +925 -0
  66. package/dist/chunk-XYIGTTEP.js.map +1 -0
  67. package/dist/{chunk-R6AIAXQV.mjs → chunk-YSNDM6BH.mjs} +2 -2
  68. package/dist/{chunk-7ET5GUSY.mjs → chunk-ZFNFSLS6.mjs} +4 -4
  69. package/dist/index.js +12 -12
  70. package/dist/index.mjs +11 -11
  71. package/dist/tsconfig.build.tsbuildinfo +1 -1
  72. package/dist/types/NotificationServicesController/__fixtures__/index.d.ts +0 -1
  73. package/dist/types/NotificationServicesController/__fixtures__/index.d.ts.map +1 -1
  74. package/dist/types/NotificationServicesPushController/__fixtures__/index.d.ts +0 -1
  75. package/dist/types/NotificationServicesPushController/__fixtures__/index.d.ts.map +1 -1
  76. package/package.json +1 -1
  77. package/dist/chunk-26CCETCM.mjs +0 -70
  78. package/dist/chunk-5I4DIH6O.mjs +0 -4300
  79. package/dist/chunk-5I4DIH6O.mjs.map +0 -1
  80. package/dist/chunk-ATR6FRAX.mjs.map +0 -1
  81. package/dist/chunk-K75FPFTD.js +0 -4300
  82. package/dist/chunk-K75FPFTD.js.map +0 -1
  83. package/dist/chunk-V46WVGWN.js +0 -70
  84. package/dist/chunk-WTE64QEK.js.map +0 -1
  85. /package/dist/{chunk-QTK2RMF7.mjs.map → chunk-57S5B7X2.mjs.map} +0 -0
  86. /package/dist/{chunk-UPVIT75F.js.map → chunk-6265FKB5.js.map} +0 -0
  87. /package/dist/{chunk-O22GVG7K.js.map → chunk-6GPIA5G3.js.map} +0 -0
  88. /package/dist/{chunk-PGMXFZ6Y.js.map → chunk-ABFHAGGB.js.map} +0 -0
  89. /package/dist/{chunk-SSWX2N73.mjs.map → chunk-AHEMTJDE.mjs.map} +0 -0
  90. /package/dist/{chunk-5DA74RWP.mjs.map → chunk-CQI6FYPZ.mjs.map} +0 -0
  91. /package/dist/{chunk-JLHFZ2UG.mjs.map → chunk-DBTJ34DS.mjs.map} +0 -0
  92. /package/dist/{chunk-YD3VVORT.js.map → chunk-DOYL2MCR.js.map} +0 -0
  93. /package/dist/{chunk-ABJDEX2S.js.map → chunk-H4RSHSWR.js.map} +0 -0
  94. /package/dist/{chunk-V46WVGWN.js.map → chunk-IGY2S5BC.js.map} +0 -0
  95. /package/dist/{chunk-CQ6CGSKZ.js.map → chunk-IK7KP7N3.js.map} +0 -0
  96. /package/dist/{chunk-FFQNSBPU.js.map → chunk-KCIC5BWH.js.map} +0 -0
  97. /package/dist/{chunk-YETZSCGK.js.map → chunk-QJTZL7TJ.js.map} +0 -0
  98. /package/dist/{chunk-VE4DTN4R.mjs.map → chunk-QSFGJCPI.mjs.map} +0 -0
  99. /package/dist/{chunk-QUNLD7F2.mjs.map → chunk-TI4UC3G3.mjs.map} +0 -0
  100. /package/dist/{chunk-26CCETCM.mjs.map → chunk-U5UIDVOO.mjs.map} +0 -0
  101. /package/dist/{chunk-R6AIAXQV.mjs.map → chunk-YSNDM6BH.mjs.map} +0 -0
  102. /package/dist/{chunk-7ET5GUSY.mjs.map → chunk-ZFNFSLS6.mjs.map} +0 -0
@@ -1,70 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
8
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
9
- }) : x)(function(x) {
10
- if (typeof require !== "undefined")
11
- return require.apply(this, arguments);
12
- throw Error('Dynamic require of "' + x + '" is not supported');
13
- });
14
- var __commonJS = (cb, mod) => function __require2() {
15
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
16
- };
17
- var __export = (target, all) => {
18
- for (var name in all)
19
- __defProp(target, name, { get: all[name], enumerable: true });
20
- };
21
- var __copyProps = (to, from, except, desc) => {
22
- if (from && typeof from === "object" || typeof from === "function") {
23
- for (let key of __getOwnPropNames(from))
24
- if (!__hasOwnProp.call(to, key) && key !== except)
25
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
26
- }
27
- return to;
28
- };
29
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
30
- // If the importer is in node compatibility mode or this is not an ESM
31
- // file that has been converted to a CommonJS file using a Babel-
32
- // compatible transform (i.e. "__esModule" has not been set), then set
33
- // "default" to the CommonJS "module.exports" for node compatibility.
34
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
35
- mod
36
- ));
37
- var __accessCheck = (obj, member, msg) => {
38
- if (!member.has(obj))
39
- throw TypeError("Cannot " + msg);
40
- };
41
- var __privateGet = (obj, member, getter) => {
42
- __accessCheck(obj, member, "read from private field");
43
- return getter ? getter.call(obj) : member.get(obj);
44
- };
45
- var __privateAdd = (obj, member, value) => {
46
- if (member.has(obj))
47
- throw TypeError("Cannot add the same private member more than once");
48
- member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
49
- };
50
- var __privateSet = (obj, member, value, setter) => {
51
- __accessCheck(obj, member, "write to private field");
52
- setter ? setter.call(obj, value) : member.set(obj, value);
53
- return value;
54
- };
55
- var __privateMethod = (obj, member, method) => {
56
- __accessCheck(obj, member, "access private method");
57
- return method;
58
- };
59
-
60
-
61
-
62
-
63
-
64
-
65
-
66
-
67
-
68
-
69
- exports.__require = __require; exports.__commonJS = __commonJS; exports.__export = __export; exports.__toESM = __toESM; exports.__privateGet = __privateGet; exports.__privateAdd = __privateAdd; exports.__privateSet = __privateSet; exports.__privateMethod = __privateMethod;
70
- //# sourceMappingURL=chunk-V46WVGWN.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/NotificationServicesPushController/index.ts","../src/NotificationServicesPushController/__fixtures__/index.ts","../src/NotificationServicesPushController/__fixtures__/mockResponse.ts","../src/NotificationServicesPushController/__fixtures__/mockServices.ts"],"names":["nock"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;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;;;AC7DA,kBAAiB;AAYV,IAAM,uCAAuC,CAAC,cAA0B;AAC7E,QAAM,eAAe,6CAA6C;AAClE,QAAM,QAAQ,aAAa;AAAA,IACzB,QAAQ;AAAA,IACR,MAAM,aAAa;AAAA,EACrB;AAEA,QAAM,mBAAe,YAAAA,SAAK,aAAa,GAAG,EACvC,IAAI,EAAE,EACN,MAAM,MAAM,QAAQ,MAAM,IAAI;AAEjC,SAAO;AACT;AAEO,IAAM,0CAA0C,CACrD,cACG;AACH,QAAM,eAAe,2CAA2C;AAChE,QAAM,QAAQ,aAAa;AAAA,IACzB,QAAQ;AAAA,IACR,MAAM,aAAa;AAAA,EACrB;AAEA,QAAM,mBAAe,YAAAA,SAAK,aAAa,GAAG,EAAE,KAAK,EAAE,EAAE,MAAM,MAAM,MAAM;AAEvE,SAAO;AACT","sourcesContent":["import Controller from './NotificationServicesPushController';\n\nexport { Controller };\nexport * from './NotificationServicesPushController';\nexport * as Types from './types';\nexport * as Utils from './utils';\nexport * as Mocks from './__fixtures__';\n","export * from './mockResponse';\nexport * from './mockServices';\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","import nock from 'nock';\n\nimport {\n getMockRetrievePushNotificationLinksResponse,\n getMockUpdatePushNotificationLinksResponse,\n} from './mockResponse';\n\ntype MockReply = {\n status: nock.StatusCode;\n body?: nock.Body;\n};\n\nexport const mockEndpointGetPushNotificationLinks = (mockReply?: MockReply) => {\n const mockResponse = getMockRetrievePushNotificationLinksResponse();\n const reply = mockReply ?? {\n status: 200,\n body: mockResponse.response,\n };\n\n const mockEndpoint = nock(mockResponse.url)\n .get('')\n .reply(reply.status, reply.body);\n\n return mockEndpoint;\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"]}