@metamask-previews/notification-services-controller 25.0.0-preview-1590150f2 → 25.0.0-preview-e196c24cd

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 (100) hide show
  1. package/CHANGELOG.md +0 -22
  2. package/dist/NotificationServicesController/NotificationServicesController.cjs +2 -24
  3. package/dist/NotificationServicesController/NotificationServicesController.cjs.map +1 -1
  4. package/dist/NotificationServicesController/NotificationServicesController.d.cts.map +1 -1
  5. package/dist/NotificationServicesController/NotificationServicesController.d.mts.map +1 -1
  6. package/dist/NotificationServicesController/NotificationServicesController.mjs +2 -24
  7. package/dist/NotificationServicesController/NotificationServicesController.mjs.map +1 -1
  8. package/dist/NotificationServicesController/index.cjs +1 -3
  9. package/dist/NotificationServicesController/index.cjs.map +1 -1
  10. package/dist/NotificationServicesController/index.d.cts +0 -1
  11. package/dist/NotificationServicesController/index.d.cts.map +1 -1
  12. package/dist/NotificationServicesController/index.d.mts +0 -1
  13. package/dist/NotificationServicesController/index.d.mts.map +1 -1
  14. package/dist/NotificationServicesController/index.mjs +0 -1
  15. package/dist/NotificationServicesController/index.mjs.map +1 -1
  16. package/dist/NotificationServicesController/processors/process-api-notifications.cjs +0 -2
  17. package/dist/NotificationServicesController/processors/process-api-notifications.cjs.map +1 -1
  18. package/dist/NotificationServicesController/processors/process-api-notifications.d.cts.map +1 -1
  19. package/dist/NotificationServicesController/processors/process-api-notifications.d.mts.map +1 -1
  20. package/dist/NotificationServicesController/processors/process-api-notifications.mjs +0 -2
  21. package/dist/NotificationServicesController/processors/process-api-notifications.mjs.map +1 -1
  22. package/dist/NotificationServicesController/processors/process-feature-announcement.cjs +0 -2
  23. package/dist/NotificationServicesController/processors/process-feature-announcement.cjs.map +1 -1
  24. package/dist/NotificationServicesController/processors/process-feature-announcement.d.cts.map +1 -1
  25. package/dist/NotificationServicesController/processors/process-feature-announcement.d.mts.map +1 -1
  26. package/dist/NotificationServicesController/processors/process-feature-announcement.mjs +0 -2
  27. package/dist/NotificationServicesController/processors/process-feature-announcement.mjs.map +1 -1
  28. package/dist/NotificationServicesController/processors/process-snap-notifications.cjs +0 -2
  29. package/dist/NotificationServicesController/processors/process-snap-notifications.cjs.map +1 -1
  30. package/dist/NotificationServicesController/processors/process-snap-notifications.d.cts.map +1 -1
  31. package/dist/NotificationServicesController/processors/process-snap-notifications.d.mts.map +1 -1
  32. package/dist/NotificationServicesController/processors/process-snap-notifications.mjs +0 -2
  33. package/dist/NotificationServicesController/processors/process-snap-notifications.mjs.map +1 -1
  34. package/dist/NotificationServicesController/types/notification/notification.cjs.map +1 -1
  35. package/dist/NotificationServicesController/types/notification/notification.d.cts +0 -1
  36. package/dist/NotificationServicesController/types/notification/notification.d.cts.map +1 -1
  37. package/dist/NotificationServicesController/types/notification/notification.d.mts +0 -1
  38. package/dist/NotificationServicesController/types/notification/notification.d.mts.map +1 -1
  39. package/dist/NotificationServicesController/types/notification/notification.mjs.map +1 -1
  40. package/dist/NotificationServicesPushController/NotificationServicesPushController.cjs.map +1 -1
  41. package/dist/NotificationServicesPushController/NotificationServicesPushController.d.cts +4 -3
  42. package/dist/NotificationServicesPushController/NotificationServicesPushController.d.cts.map +1 -1
  43. package/dist/NotificationServicesPushController/NotificationServicesPushController.d.mts +4 -3
  44. package/dist/NotificationServicesPushController/NotificationServicesPushController.d.mts.map +1 -1
  45. package/dist/NotificationServicesPushController/NotificationServicesPushController.mjs.map +1 -1
  46. package/dist/NotificationServicesPushController/types/index.cjs.map +1 -1
  47. package/dist/NotificationServicesPushController/types/index.d.cts +0 -1
  48. package/dist/NotificationServicesPushController/types/index.d.cts.map +1 -1
  49. package/dist/NotificationServicesPushController/types/index.d.mts +0 -1
  50. package/dist/NotificationServicesPushController/types/index.d.mts.map +1 -1
  51. package/dist/NotificationServicesPushController/types/index.mjs.map +1 -1
  52. package/dist/NotificationServicesPushController/utils/index.cjs +0 -1
  53. package/dist/NotificationServicesPushController/utils/index.cjs.map +1 -1
  54. package/dist/NotificationServicesPushController/utils/index.d.cts +0 -1
  55. package/dist/NotificationServicesPushController/utils/index.d.cts.map +1 -1
  56. package/dist/NotificationServicesPushController/utils/index.d.mts +0 -1
  57. package/dist/NotificationServicesPushController/utils/index.d.mts.map +1 -1
  58. package/dist/NotificationServicesPushController/utils/index.mjs +0 -1
  59. package/dist/NotificationServicesPushController/utils/index.mjs.map +1 -1
  60. package/dist/NotificationServicesPushController/web/push-utils.cjs +25 -13
  61. package/dist/NotificationServicesPushController/web/push-utils.cjs.map +1 -1
  62. package/dist/NotificationServicesPushController/web/push-utils.d.cts +3 -3
  63. package/dist/NotificationServicesPushController/web/push-utils.d.cts.map +1 -1
  64. package/dist/NotificationServicesPushController/web/push-utils.d.mts +3 -3
  65. package/dist/NotificationServicesPushController/web/push-utils.d.mts.map +1 -1
  66. package/dist/NotificationServicesPushController/web/push-utils.mjs +25 -13
  67. package/dist/NotificationServicesPushController/web/push-utils.mjs.map +1 -1
  68. package/dist/shared/is-onchain-notification.cjs +10 -4
  69. package/dist/shared/is-onchain-notification.cjs.map +1 -1
  70. package/dist/shared/is-onchain-notification.d.cts +4 -4
  71. package/dist/shared/is-onchain-notification.d.cts.map +1 -1
  72. package/dist/shared/is-onchain-notification.d.mts +4 -4
  73. package/dist/shared/is-onchain-notification.d.mts.map +1 -1
  74. package/dist/shared/is-onchain-notification.mjs +10 -4
  75. package/dist/shared/is-onchain-notification.mjs.map +1 -1
  76. package/package.json +1 -1
  77. package/dist/NotificationServicesController/utils/get-notification-subtype.cjs +0 -33
  78. package/dist/NotificationServicesController/utils/get-notification-subtype.cjs.map +0 -1
  79. package/dist/NotificationServicesController/utils/get-notification-subtype.d.cts +0 -17
  80. package/dist/NotificationServicesController/utils/get-notification-subtype.d.cts.map +0 -1
  81. package/dist/NotificationServicesController/utils/get-notification-subtype.d.mts +0 -17
  82. package/dist/NotificationServicesController/utils/get-notification-subtype.d.mts.map +0 -1
  83. package/dist/NotificationServicesController/utils/get-notification-subtype.mjs +0 -29
  84. package/dist/NotificationServicesController/utils/get-notification-subtype.mjs.map +0 -1
  85. package/dist/NotificationServicesPushController/types/push-analytics.cjs +0 -5
  86. package/dist/NotificationServicesPushController/types/push-analytics.cjs.map +0 -1
  87. package/dist/NotificationServicesPushController/types/push-analytics.d.cts +0 -18
  88. package/dist/NotificationServicesPushController/types/push-analytics.d.cts.map +0 -1
  89. package/dist/NotificationServicesPushController/types/push-analytics.d.mts +0 -18
  90. package/dist/NotificationServicesPushController/types/push-analytics.d.mts.map +0 -1
  91. package/dist/NotificationServicesPushController/types/push-analytics.mjs +0 -4
  92. package/dist/NotificationServicesPushController/types/push-analytics.mjs.map +0 -1
  93. package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.cjs +0 -26
  94. package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.cjs.map +0 -1
  95. package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.d.cts +0 -12
  96. package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.d.cts.map +0 -1
  97. package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.d.mts +0 -12
  98. package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.d.mts.map +0 -1
  99. package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.mjs +0 -22
  100. package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.mjs.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"push-analytics.d.mts","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/types/push-analytics.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,eAAe,EAAE,MAAM,CAAC;IACxB,sDAAsD;IACtD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oDAAoD;IACpD,oBAAoB,EAAE,MAAM,CAAC;IAC7B,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC"}
@@ -1,4 +0,0 @@
1
- // snake_case mirrors the FCM payload and Segment schema keys
2
- /* eslint-disable @typescript-eslint/naming-convention */
3
- export {};
4
- //# sourceMappingURL=push-analytics.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"push-analytics.mjs","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/types/push-analytics.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,yDAAyD","sourcesContent":["// snake_case mirrors the FCM payload and Segment schema keys\n/* eslint-disable @typescript-eslint/naming-convention */\n\n/**\n * Analytics fields carried by the `NotificationServicesPushController` messenger\n * events (`onNewNotifications`, `pushNotificationClicked`). Read directly from\n * top-level FCM payload keys, so clients build Segment events without fallback\n * chains or parsing a `metadata` blob.\n */\nexport type PushAnalyticsPayload = {\n notification_id: string;\n /** Free-form snake_case label set by the producer. */\n notification_type: string;\n /** Team-owned, open-ended (e.g. `eth_received`). */\n notification_subtype: string;\n /** Only present when the notification has a chain context. */\n chain_id?: number;\n /** Platform notifications only; the CTA link to route to on tap. */\n deeplink?: string;\n};\n"]}
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toPushAnalyticsPayload = void 0;
4
- /**
5
- * Builds the first-class push analytics payload from the top-level FCM `data`
6
- * keys written by push-services. Returns `null` when the required identity
7
- * fields are missing (e.g. a malformed or legacy payload), so callers can
8
- * safely bail out.
9
- *
10
- * @param data - the top-level FCM `data` map (all values are strings).
11
- * @returns the analytics payload, or `null` if required fields are absent.
12
- */
13
- function toPushAnalyticsPayload(data) {
14
- if (!data?.notification_id || !data?.notification_type) {
15
- return null;
16
- }
17
- return {
18
- notification_id: data.notification_id,
19
- notification_type: data.notification_type,
20
- notification_subtype: data.notification_subtype ?? '',
21
- chain_id: data.chain_id ? Number(data.chain_id) : undefined,
22
- deeplink: data.deeplink || undefined,
23
- };
24
- }
25
- exports.toPushAnalyticsPayload = toPushAnalyticsPayload;
26
- //# sourceMappingURL=to-push-analytics-payload.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"to-push-analytics-payload.cjs","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/utils/to-push-analytics-payload.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;GAQG;AACH,SAAgB,sBAAsB,CACpC,IAAwC;IAExC,IAAI,CAAC,IAAI,EAAE,eAAe,IAAI,CAAC,IAAI,EAAE,iBAAiB,EAAE,CAAC;QACvD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO;QACL,eAAe,EAAE,IAAI,CAAC,eAAe;QACrC,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;QACzC,oBAAoB,EAAE,IAAI,CAAC,oBAAoB,IAAI,EAAE;QACrD,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS;QAC3D,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,SAAS;KACrC,CAAC;AACJ,CAAC;AAdD,wDAcC","sourcesContent":["import type { PushAnalyticsPayload } from '../types';\n\n/**\n * Builds the first-class push analytics payload from the top-level FCM `data`\n * keys written by push-services. Returns `null` when the required identity\n * fields are missing (e.g. a malformed or legacy payload), so callers can\n * safely bail out.\n *\n * @param data - the top-level FCM `data` map (all values are strings).\n * @returns the analytics payload, or `null` if required fields are absent.\n */\nexport function toPushAnalyticsPayload(\n data: Record<string, string> | undefined,\n): PushAnalyticsPayload | null {\n if (!data?.notification_id || !data?.notification_type) {\n return null;\n }\n\n return {\n notification_id: data.notification_id,\n notification_type: data.notification_type,\n notification_subtype: data.notification_subtype ?? '',\n chain_id: data.chain_id ? Number(data.chain_id) : undefined,\n deeplink: data.deeplink || undefined,\n };\n}\n"]}
@@ -1,12 +0,0 @@
1
- import type { PushAnalyticsPayload } from "../types/index.cjs";
2
- /**
3
- * Builds the first-class push analytics payload from the top-level FCM `data`
4
- * keys written by push-services. Returns `null` when the required identity
5
- * fields are missing (e.g. a malformed or legacy payload), so callers can
6
- * safely bail out.
7
- *
8
- * @param data - the top-level FCM `data` map (all values are strings).
9
- * @returns the analytics payload, or `null` if required fields are absent.
10
- */
11
- export declare function toPushAnalyticsPayload(data: Record<string, string> | undefined): PushAnalyticsPayload | null;
12
- //# sourceMappingURL=to-push-analytics-payload.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"to-push-analytics-payload.d.cts","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/utils/to-push-analytics-payload.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,2BAAiB;AAErD;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,GACvC,oBAAoB,GAAG,IAAI,CAY7B"}
@@ -1,12 +0,0 @@
1
- import type { PushAnalyticsPayload } from "../types/index.mjs";
2
- /**
3
- * Builds the first-class push analytics payload from the top-level FCM `data`
4
- * keys written by push-services. Returns `null` when the required identity
5
- * fields are missing (e.g. a malformed or legacy payload), so callers can
6
- * safely bail out.
7
- *
8
- * @param data - the top-level FCM `data` map (all values are strings).
9
- * @returns the analytics payload, or `null` if required fields are absent.
10
- */
11
- export declare function toPushAnalyticsPayload(data: Record<string, string> | undefined): PushAnalyticsPayload | null;
12
- //# sourceMappingURL=to-push-analytics-payload.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"to-push-analytics-payload.d.mts","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/utils/to-push-analytics-payload.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,2BAAiB;AAErD;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,GACvC,oBAAoB,GAAG,IAAI,CAY7B"}
@@ -1,22 +0,0 @@
1
- /**
2
- * Builds the first-class push analytics payload from the top-level FCM `data`
3
- * keys written by push-services. Returns `null` when the required identity
4
- * fields are missing (e.g. a malformed or legacy payload), so callers can
5
- * safely bail out.
6
- *
7
- * @param data - the top-level FCM `data` map (all values are strings).
8
- * @returns the analytics payload, or `null` if required fields are absent.
9
- */
10
- export function toPushAnalyticsPayload(data) {
11
- if (!data?.notification_id || !data?.notification_type) {
12
- return null;
13
- }
14
- return {
15
- notification_id: data.notification_id,
16
- notification_type: data.notification_type,
17
- notification_subtype: data.notification_subtype ?? '',
18
- chain_id: data.chain_id ? Number(data.chain_id) : undefined,
19
- deeplink: data.deeplink || undefined,
20
- };
21
- }
22
- //# sourceMappingURL=to-push-analytics-payload.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"to-push-analytics-payload.mjs","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/utils/to-push-analytics-payload.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,UAAU,sBAAsB,CACpC,IAAwC;IAExC,IAAI,CAAC,IAAI,EAAE,eAAe,IAAI,CAAC,IAAI,EAAE,iBAAiB,EAAE,CAAC;QACvD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO;QACL,eAAe,EAAE,IAAI,CAAC,eAAe;QACrC,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;QACzC,oBAAoB,EAAE,IAAI,CAAC,oBAAoB,IAAI,EAAE;QACrD,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS;QAC3D,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,SAAS;KACrC,CAAC;AACJ,CAAC","sourcesContent":["import type { PushAnalyticsPayload } from '../types';\n\n/**\n * Builds the first-class push analytics payload from the top-level FCM `data`\n * keys written by push-services. Returns `null` when the required identity\n * fields are missing (e.g. a malformed or legacy payload), so callers can\n * safely bail out.\n *\n * @param data - the top-level FCM `data` map (all values are strings).\n * @returns the analytics payload, or `null` if required fields are absent.\n */\nexport function toPushAnalyticsPayload(\n data: Record<string, string> | undefined,\n): PushAnalyticsPayload | null {\n if (!data?.notification_id || !data?.notification_type) {\n return null;\n }\n\n return {\n notification_id: data.notification_id,\n notification_type: data.notification_type,\n notification_subtype: data.notification_subtype ?? '',\n chain_id: data.chain_id ? Number(data.chain_id) : undefined,\n deeplink: data.deeplink || undefined,\n };\n}\n"]}