@metamask-previews/notification-services-controller 24.1.2-preview-5620ede0b → 24.1.2-preview-cf351fcd3

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 (104) hide show
  1. package/CHANGELOG.md +0 -17
  2. package/dist/NotificationServicesController/NotificationServicesController.cjs +2 -4
  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 -4
  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/mocks/mock-raw-notifications.cjs +0 -1
  17. package/dist/NotificationServicesController/mocks/mock-raw-notifications.cjs.map +1 -1
  18. package/dist/NotificationServicesController/mocks/mock-raw-notifications.d.cts.map +1 -1
  19. package/dist/NotificationServicesController/mocks/mock-raw-notifications.d.mts.map +1 -1
  20. package/dist/NotificationServicesController/mocks/mock-raw-notifications.mjs +0 -1
  21. package/dist/NotificationServicesController/mocks/mock-raw-notifications.mjs.map +1 -1
  22. package/dist/NotificationServicesController/processors/process-api-notifications.cjs +0 -2
  23. package/dist/NotificationServicesController/processors/process-api-notifications.cjs.map +1 -1
  24. package/dist/NotificationServicesController/processors/process-api-notifications.d.cts.map +1 -1
  25. package/dist/NotificationServicesController/processors/process-api-notifications.d.mts.map +1 -1
  26. package/dist/NotificationServicesController/processors/process-api-notifications.mjs +0 -2
  27. package/dist/NotificationServicesController/processors/process-api-notifications.mjs.map +1 -1
  28. package/dist/NotificationServicesController/processors/process-feature-announcement.cjs +0 -2
  29. package/dist/NotificationServicesController/processors/process-feature-announcement.cjs.map +1 -1
  30. package/dist/NotificationServicesController/processors/process-feature-announcement.d.cts.map +1 -1
  31. package/dist/NotificationServicesController/processors/process-feature-announcement.d.mts.map +1 -1
  32. package/dist/NotificationServicesController/processors/process-feature-announcement.mjs +0 -2
  33. package/dist/NotificationServicesController/processors/process-feature-announcement.mjs.map +1 -1
  34. package/dist/NotificationServicesController/processors/process-snap-notifications.cjs +0 -2
  35. package/dist/NotificationServicesController/processors/process-snap-notifications.cjs.map +1 -1
  36. package/dist/NotificationServicesController/processors/process-snap-notifications.d.cts.map +1 -1
  37. package/dist/NotificationServicesController/processors/process-snap-notifications.d.mts.map +1 -1
  38. package/dist/NotificationServicesController/processors/process-snap-notifications.mjs +0 -2
  39. package/dist/NotificationServicesController/processors/process-snap-notifications.mjs.map +1 -1
  40. package/dist/NotificationServicesController/types/notification/notification.cjs.map +1 -1
  41. package/dist/NotificationServicesController/types/notification/notification.d.cts +0 -1
  42. package/dist/NotificationServicesController/types/notification/notification.d.cts.map +1 -1
  43. package/dist/NotificationServicesController/types/notification/notification.d.mts +0 -1
  44. package/dist/NotificationServicesController/types/notification/notification.d.mts.map +1 -1
  45. package/dist/NotificationServicesController/types/notification/notification.mjs.map +1 -1
  46. package/dist/NotificationServicesController/types/notification-api/schema.cjs.map +1 -1
  47. package/dist/NotificationServicesController/types/notification-api/schema.d.cts +1 -8
  48. package/dist/NotificationServicesController/types/notification-api/schema.d.cts.map +1 -1
  49. package/dist/NotificationServicesController/types/notification-api/schema.d.mts +1 -8
  50. package/dist/NotificationServicesController/types/notification-api/schema.d.mts.map +1 -1
  51. package/dist/NotificationServicesController/types/notification-api/schema.mjs.map +1 -1
  52. package/dist/NotificationServicesPushController/NotificationServicesPushController.cjs.map +1 -1
  53. package/dist/NotificationServicesPushController/NotificationServicesPushController.d.cts +4 -3
  54. package/dist/NotificationServicesPushController/NotificationServicesPushController.d.cts.map +1 -1
  55. package/dist/NotificationServicesPushController/NotificationServicesPushController.d.mts +4 -3
  56. package/dist/NotificationServicesPushController/NotificationServicesPushController.d.mts.map +1 -1
  57. package/dist/NotificationServicesPushController/NotificationServicesPushController.mjs.map +1 -1
  58. package/dist/NotificationServicesPushController/types/index.cjs.map +1 -1
  59. package/dist/NotificationServicesPushController/types/index.d.cts +0 -1
  60. package/dist/NotificationServicesPushController/types/index.d.cts.map +1 -1
  61. package/dist/NotificationServicesPushController/types/index.d.mts +0 -1
  62. package/dist/NotificationServicesPushController/types/index.d.mts.map +1 -1
  63. package/dist/NotificationServicesPushController/types/index.mjs.map +1 -1
  64. package/dist/NotificationServicesPushController/utils/index.cjs +0 -1
  65. package/dist/NotificationServicesPushController/utils/index.cjs.map +1 -1
  66. package/dist/NotificationServicesPushController/utils/index.d.cts +0 -1
  67. package/dist/NotificationServicesPushController/utils/index.d.cts.map +1 -1
  68. package/dist/NotificationServicesPushController/utils/index.d.mts +0 -1
  69. package/dist/NotificationServicesPushController/utils/index.d.mts.map +1 -1
  70. package/dist/NotificationServicesPushController/utils/index.mjs +0 -1
  71. package/dist/NotificationServicesPushController/utils/index.mjs.map +1 -1
  72. package/dist/NotificationServicesPushController/web/push-utils.cjs +25 -13
  73. package/dist/NotificationServicesPushController/web/push-utils.cjs.map +1 -1
  74. package/dist/NotificationServicesPushController/web/push-utils.d.cts +3 -3
  75. package/dist/NotificationServicesPushController/web/push-utils.d.cts.map +1 -1
  76. package/dist/NotificationServicesPushController/web/push-utils.d.mts +3 -3
  77. package/dist/NotificationServicesPushController/web/push-utils.d.mts.map +1 -1
  78. package/dist/NotificationServicesPushController/web/push-utils.mjs +25 -13
  79. package/dist/NotificationServicesPushController/web/push-utils.mjs.map +1 -1
  80. package/package.json +1 -1
  81. package/dist/NotificationServicesController/utils/get-notification-subtype.cjs +0 -33
  82. package/dist/NotificationServicesController/utils/get-notification-subtype.cjs.map +0 -1
  83. package/dist/NotificationServicesController/utils/get-notification-subtype.d.cts +0 -17
  84. package/dist/NotificationServicesController/utils/get-notification-subtype.d.cts.map +0 -1
  85. package/dist/NotificationServicesController/utils/get-notification-subtype.d.mts +0 -17
  86. package/dist/NotificationServicesController/utils/get-notification-subtype.d.mts.map +0 -1
  87. package/dist/NotificationServicesController/utils/get-notification-subtype.mjs +0 -29
  88. package/dist/NotificationServicesController/utils/get-notification-subtype.mjs.map +0 -1
  89. package/dist/NotificationServicesPushController/types/push-analytics.cjs +0 -5
  90. package/dist/NotificationServicesPushController/types/push-analytics.cjs.map +0 -1
  91. package/dist/NotificationServicesPushController/types/push-analytics.d.cts +0 -20
  92. package/dist/NotificationServicesPushController/types/push-analytics.d.cts.map +0 -1
  93. package/dist/NotificationServicesPushController/types/push-analytics.d.mts +0 -20
  94. package/dist/NotificationServicesPushController/types/push-analytics.d.mts.map +0 -1
  95. package/dist/NotificationServicesPushController/types/push-analytics.mjs +0 -4
  96. package/dist/NotificationServicesPushController/types/push-analytics.mjs.map +0 -1
  97. package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.cjs +0 -27
  98. package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.cjs.map +0 -1
  99. package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.d.cts +0 -12
  100. package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.d.cts.map +0 -1
  101. package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.d.mts +0 -12
  102. package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.d.mts.map +0 -1
  103. package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.mjs +0 -23
  104. package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.mjs.map +0 -1
@@ -1,17 +0,0 @@
1
- import type { RawNotificationUnion } from "../types/notification/notification.cjs";
2
- /**
3
- * Derives the normalised `notification_subtype` for a processed in-app
4
- * notification. This is the team-owned axis (e.g. `eth_received`) and is
5
- * always derivable from an `INotification`, so every consumer (both clients)
6
- * pulls it from one place rather than recomputing a fallback chain.
7
- *
8
- * - on-chain: the trigger kind (`payload.data.kind`, e.g. `eth_received`).
9
- * - platform: the server-set `notification_subtype` from the inbox API.
10
- * - everything else (snap, feature-announcement): the top-level `type`
11
- * (`snap` / `features_announcement`).
12
- *
13
- * @param notification - a raw or processed notification.
14
- * @returns the normalised subtype string.
15
- */
16
- export declare function getNotificationSubtype(notification: RawNotificationUnion): string;
17
- //# sourceMappingURL=get-notification-subtype.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-notification-subtype.d.cts","sourceRoot":"","sources":["../../../src/NotificationServicesController/utils/get-notification-subtype.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,+CAA2C;AAE/E;;;;;;;;;;;;;GAaG;AACH,wBAAgB,sBAAsB,CACpC,YAAY,EAAE,oBAAoB,GACjC,MAAM,CAaR"}
@@ -1,17 +0,0 @@
1
- import type { RawNotificationUnion } from "../types/notification/notification.mjs";
2
- /**
3
- * Derives the normalised `notification_subtype` for a processed in-app
4
- * notification. This is the team-owned axis (e.g. `eth_received`) and is
5
- * always derivable from an `INotification`, so every consumer (both clients)
6
- * pulls it from one place rather than recomputing a fallback chain.
7
- *
8
- * - on-chain: the trigger kind (`payload.data.kind`, e.g. `eth_received`).
9
- * - platform: the server-set `notification_subtype` from the inbox API.
10
- * - everything else (snap, feature-announcement): the top-level `type`
11
- * (`snap` / `features_announcement`).
12
- *
13
- * @param notification - a raw or processed notification.
14
- * @returns the normalised subtype string.
15
- */
16
- export declare function getNotificationSubtype(notification: RawNotificationUnion): string;
17
- //# sourceMappingURL=get-notification-subtype.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-notification-subtype.d.mts","sourceRoot":"","sources":["../../../src/NotificationServicesController/utils/get-notification-subtype.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,+CAA2C;AAE/E;;;;;;;;;;;;;GAaG;AACH,wBAAgB,sBAAsB,CACpC,YAAY,EAAE,oBAAoB,GACjC,MAAM,CAaR"}
@@ -1,29 +0,0 @@
1
- import { isOnChainRawNotification } from "../../shared/is-onchain-notification.mjs";
2
- import { TRIGGER_TYPES } from "../constants/notification-schema.mjs";
3
- /**
4
- * Derives the normalised `notification_subtype` for a processed in-app
5
- * notification. This is the team-owned axis (e.g. `eth_received`) and is
6
- * always derivable from an `INotification`, so every consumer (both clients)
7
- * pulls it from one place rather than recomputing a fallback chain.
8
- *
9
- * - on-chain: the trigger kind (`payload.data.kind`, e.g. `eth_received`).
10
- * - platform: the server-set `notification_subtype` from the inbox API.
11
- * - everything else (snap, feature-announcement): the top-level `type`
12
- * (`snap` / `features_announcement`).
13
- *
14
- * @param notification - a raw or processed notification.
15
- * @returns the normalised subtype string.
16
- */
17
- export function getNotificationSubtype(notification) {
18
- // On-chain: the trigger kind (e.g. `eth_received`).
19
- if (isOnChainRawNotification(notification)) {
20
- return notification.payload.data.kind;
21
- }
22
- // Platform: the server-set `notification_subtype` from the inbox API.
23
- if (notification.type === TRIGGER_TYPES.PLATFORM) {
24
- return notification.notification_subtype;
25
- }
26
- // Fallback (snap, feature-announcement): the top-level `type`.
27
- return notification.type;
28
- }
29
- //# sourceMappingURL=get-notification-subtype.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-notification-subtype.mjs","sourceRoot":"","sources":["../../../src/NotificationServicesController/utils/get-notification-subtype.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,iDAA6C;AAChF,OAAO,EAAE,aAAa,EAAE,6CAAyC;AAGjE;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,sBAAsB,CACpC,YAAkC;IAElC,oDAAoD;IACpD,IAAI,wBAAwB,CAAC,YAAY,CAAC,EAAE,CAAC;QAC3C,OAAO,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;IACxC,CAAC;IAED,sEAAsE;IACtE,IAAI,YAAY,CAAC,IAAI,KAAK,aAAa,CAAC,QAAQ,EAAE,CAAC;QACjD,OAAO,YAAY,CAAC,oBAAoB,CAAC;IAC3C,CAAC;IAED,+DAA+D;IAC/D,OAAO,YAAY,CAAC,IAAI,CAAC;AAC3B,CAAC","sourcesContent":["import { isOnChainRawNotification } from '../../shared/is-onchain-notification';\nimport { TRIGGER_TYPES } from '../constants/notification-schema';\nimport type { RawNotificationUnion } from '../types/notification/notification';\n\n/**\n * Derives the normalised `notification_subtype` for a processed in-app\n * notification. This is the team-owned axis (e.g. `eth_received`) and is\n * always derivable from an `INotification`, so every consumer (both clients)\n * pulls it from one place rather than recomputing a fallback chain.\n *\n * - on-chain: the trigger kind (`payload.data.kind`, e.g. `eth_received`).\n * - platform: the server-set `notification_subtype` from the inbox API.\n * - everything else (snap, feature-announcement): the top-level `type`\n * (`snap` / `features_announcement`).\n *\n * @param notification - a raw or processed notification.\n * @returns the normalised subtype string.\n */\nexport function getNotificationSubtype(\n notification: RawNotificationUnion,\n): string {\n // On-chain: the trigger kind (e.g. `eth_received`).\n if (isOnChainRawNotification(notification)) {\n return notification.payload.data.kind;\n }\n\n // Platform: the server-set `notification_subtype` from the inbox API.\n if (notification.type === TRIGGER_TYPES.PLATFORM) {\n return notification.notification_subtype;\n }\n\n // Fallback (snap, feature-announcement): the top-level `type`.\n return notification.type;\n}\n"]}
@@ -1,5 +0,0 @@
1
- "use strict";
2
- // snake_case mirrors the FCM payload and Segment schema keys
3
- /* eslint-disable @typescript-eslint/naming-convention */
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- //# sourceMappingURL=push-analytics.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"push-analytics.cjs","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 /** Server-side cross-check; clients prefer their own AuthController source. */\n profile_id?: 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,20 +0,0 @@
1
- /**
2
- * Analytics fields carried by the `NotificationServicesPushController` messenger
3
- * events (`onNewNotifications`, `pushNotificationClicked`). Read directly from
4
- * top-level FCM payload keys, so clients build Segment events without fallback
5
- * chains or parsing a `metadata` blob.
6
- */
7
- export type PushAnalyticsPayload = {
8
- notification_id: string;
9
- /** Free-form snake_case label set by the producer. */
10
- notification_type: string;
11
- /** Team-owned, open-ended (e.g. `eth_received`). */
12
- notification_subtype: string;
13
- /** Server-side cross-check; clients prefer their own AuthController source. */
14
- profile_id?: string;
15
- /** Only present when the notification has a chain context. */
16
- chain_id?: number;
17
- /** Platform notifications only; the CTA link to route to on tap. */
18
- deeplink?: string;
19
- };
20
- //# sourceMappingURL=push-analytics.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"push-analytics.d.cts","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,+EAA+E;IAC/E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC"}
@@ -1,20 +0,0 @@
1
- /**
2
- * Analytics fields carried by the `NotificationServicesPushController` messenger
3
- * events (`onNewNotifications`, `pushNotificationClicked`). Read directly from
4
- * top-level FCM payload keys, so clients build Segment events without fallback
5
- * chains or parsing a `metadata` blob.
6
- */
7
- export type PushAnalyticsPayload = {
8
- notification_id: string;
9
- /** Free-form snake_case label set by the producer. */
10
- notification_type: string;
11
- /** Team-owned, open-ended (e.g. `eth_received`). */
12
- notification_subtype: string;
13
- /** Server-side cross-check; clients prefer their own AuthController source. */
14
- profile_id?: string;
15
- /** Only present when the notification has a chain context. */
16
- chain_id?: number;
17
- /** Platform notifications only; the CTA link to route to on tap. */
18
- deeplink?: string;
19
- };
20
- //# sourceMappingURL=push-analytics.d.mts.map
@@ -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,+EAA+E;IAC/E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,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 /** Server-side cross-check; clients prefer their own AuthController source. */\n profile_id?: 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,27 +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
- profile_id: data.profile_id || undefined,
22
- chain_id: data.chain_id ? Number(data.chain_id) : undefined,
23
- deeplink: data.deeplink || undefined,
24
- };
25
- }
26
- exports.toPushAnalyticsPayload = toPushAnalyticsPayload;
27
- //# 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,UAAU,EAAE,IAAI,CAAC,UAAU,IAAI,SAAS;QACxC,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;AAfD,wDAeC","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 profile_id: data.profile_id || undefined,\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,CAa7B"}
@@ -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,CAa7B"}
@@ -1,23 +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
- profile_id: data.profile_id || undefined,
19
- chain_id: data.chain_id ? Number(data.chain_id) : undefined,
20
- deeplink: data.deeplink || undefined,
21
- };
22
- }
23
- //# 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,UAAU,EAAE,IAAI,CAAC,UAAU,IAAI,SAAS;QACxC,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 profile_id: data.profile_id || undefined,\n chain_id: data.chain_id ? Number(data.chain_id) : undefined,\n deeplink: data.deeplink || undefined,\n };\n}\n"]}