@metamask-previews/notification-services-controller 0.5.0-preview-9edcf0e0 → 0.5.0-preview-cf09c0a
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.
- package/dist/NotificationServicesController/NotificationServicesController.cjs +803 -0
- package/dist/NotificationServicesController/NotificationServicesController.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/NotificationServicesController.d.ts → NotificationServicesController/NotificationServicesController.d.cts} +7 -7
- package/dist/NotificationServicesController/NotificationServicesController.d.cts.map +1 -0
- package/dist/NotificationServicesController/NotificationServicesController.d.mts +238 -0
- package/dist/NotificationServicesController/NotificationServicesController.d.mts.map +1 -0
- package/dist/NotificationServicesController/NotificationServicesController.mjs +779 -17
- package/dist/NotificationServicesController/NotificationServicesController.mjs.map +1 -1
- package/dist/NotificationServicesController/__fixtures__/index.cjs +22 -0
- package/dist/NotificationServicesController/__fixtures__/index.cjs.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/index.d.cts +6 -0
- package/dist/NotificationServicesController/__fixtures__/index.d.cts.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/index.d.mts +6 -0
- package/dist/NotificationServicesController/__fixtures__/index.d.mts.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/index.mjs +6 -0
- package/dist/NotificationServicesController/__fixtures__/index.mjs.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/mock-feature-announcements.cjs +210 -0
- package/dist/NotificationServicesController/__fixtures__/mock-feature-announcements.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/__fixtures__/mock-feature-announcements.d.ts → NotificationServicesController/__fixtures__/mock-feature-announcements.d.cts} +3 -3
- package/dist/NotificationServicesController/__fixtures__/mock-feature-announcements.d.cts.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/mock-feature-announcements.d.mts +15 -0
- package/dist/NotificationServicesController/__fixtures__/mock-feature-announcements.d.mts.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/mock-feature-announcements.mjs +205 -0
- package/dist/NotificationServicesController/__fixtures__/mock-feature-announcements.mjs.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/mock-notification-trigger.cjs +22 -0
- package/dist/NotificationServicesController/__fixtures__/mock-notification-trigger.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/__fixtures__/mock-notification-trigger.d.ts → NotificationServicesController/__fixtures__/mock-notification-trigger.d.cts} +2 -2
- package/dist/NotificationServicesController/__fixtures__/mock-notification-trigger.d.cts.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/mock-notification-trigger.d.mts +9 -0
- package/dist/NotificationServicesController/__fixtures__/mock-notification-trigger.d.mts.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/mock-notification-trigger.mjs +18 -0
- package/dist/NotificationServicesController/__fixtures__/mock-notification-trigger.mjs.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/mock-notification-user-storage.cjs +82 -0
- package/dist/NotificationServicesController/__fixtures__/mock-notification-user-storage.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/__fixtures__/mock-notification-user-storage.d.ts → NotificationServicesController/__fixtures__/mock-notification-user-storage.d.cts} +3 -3
- package/dist/NotificationServicesController/__fixtures__/mock-notification-user-storage.d.cts.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/mock-notification-user-storage.d.mts +35 -0
- package/dist/NotificationServicesController/__fixtures__/mock-notification-user-storage.d.mts.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/mock-notification-user-storage.mjs +76 -0
- package/dist/NotificationServicesController/__fixtures__/mock-notification-user-storage.mjs.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/mock-raw-notifications.cjs +624 -0
- package/dist/NotificationServicesController/__fixtures__/mock-raw-notifications.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/__fixtures__/mock-raw-notifications.d.ts → NotificationServicesController/__fixtures__/mock-raw-notifications.d.cts} +2 -2
- package/dist/NotificationServicesController/__fixtures__/mock-raw-notifications.d.cts.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/mock-raw-notifications.d.mts +82 -0
- package/dist/NotificationServicesController/__fixtures__/mock-raw-notifications.d.mts.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/mock-raw-notifications.mjs +605 -0
- package/dist/NotificationServicesController/__fixtures__/mock-raw-notifications.mjs.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/mockResponses.cjs +50 -0
- package/dist/NotificationServicesController/__fixtures__/mockResponses.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/__fixtures__/mockResponses.d.ts → NotificationServicesController/__fixtures__/mockResponses.d.cts} +5 -5
- package/dist/NotificationServicesController/__fixtures__/mockResponses.d.cts.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/mockResponses.d.mts +28 -0
- package/dist/NotificationServicesController/__fixtures__/mockResponses.d.mts.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/mockResponses.mjs +42 -0
- package/dist/NotificationServicesController/__fixtures__/mockResponses.mjs.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/mockServices.cjs +56 -0
- package/dist/NotificationServicesController/__fixtures__/mockServices.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/__fixtures__/mockServices.d.ts → NotificationServicesController/__fixtures__/mockServices.d.cts} +2 -2
- package/dist/NotificationServicesController/__fixtures__/mockServices.d.cts.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/mockServices.d.mts +12 -0
- package/dist/NotificationServicesController/__fixtures__/mockServices.d.mts.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/mockServices.mjs +52 -0
- package/dist/NotificationServicesController/__fixtures__/mockServices.mjs.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/test-utils.cjs +31 -0
- package/dist/NotificationServicesController/__fixtures__/test-utils.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/__fixtures__/test-utils.d.ts → NotificationServicesController/__fixtures__/test-utils.d.cts} +1 -1
- package/dist/NotificationServicesController/__fixtures__/test-utils.d.cts.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/test-utils.d.mts +14 -0
- package/dist/NotificationServicesController/__fixtures__/test-utils.d.mts.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/test-utils.mjs +27 -0
- package/dist/NotificationServicesController/__fixtures__/test-utils.mjs.map +1 -0
- package/dist/NotificationServicesController/constants/constants.cjs +7 -0
- package/dist/NotificationServicesController/constants/constants.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/constants/constants.d.ts → NotificationServicesController/constants/constants.d.cts} +1 -1
- package/dist/NotificationServicesController/constants/constants.d.cts.map +1 -0
- package/dist/NotificationServicesController/constants/constants.d.mts +3 -0
- package/dist/NotificationServicesController/constants/constants.d.mts.map +1 -0
- package/dist/NotificationServicesController/constants/constants.mjs +3 -9
- package/dist/NotificationServicesController/constants/constants.mjs.map +1 -1
- package/dist/NotificationServicesController/constants/index.cjs +19 -0
- package/dist/NotificationServicesController/constants/index.cjs.map +1 -0
- package/dist/NotificationServicesController/constants/index.d.cts +3 -0
- package/dist/NotificationServicesController/constants/index.d.cts.map +1 -0
- package/dist/NotificationServicesController/constants/index.d.mts +3 -0
- package/dist/NotificationServicesController/constants/index.d.mts.map +1 -0
- package/dist/NotificationServicesController/constants/index.mjs +2 -28
- package/dist/NotificationServicesController/constants/index.mjs.map +1 -1
- package/dist/NotificationServicesController/constants/notification-schema.cjs +170 -0
- package/dist/NotificationServicesController/constants/notification-schema.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/constants/notification-schema.d.ts → NotificationServicesController/constants/notification-schema.d.cts} +2 -2
- package/dist/NotificationServicesController/constants/notification-schema.d.cts.map +1 -0
- package/dist/NotificationServicesController/constants/notification-schema.d.mts +48 -0
- package/dist/NotificationServicesController/constants/notification-schema.d.mts.map +1 -0
- package/dist/NotificationServicesController/constants/notification-schema.mjs +165 -20
- package/dist/NotificationServicesController/constants/notification-schema.mjs.map +1 -1
- package/dist/NotificationServicesController/index.cjs +46 -0
- package/dist/NotificationServicesController/index.cjs.map +1 -0
- package/dist/NotificationServicesController/index.d.cts +14 -0
- package/dist/NotificationServicesController/index.d.cts.map +1 -0
- package/dist/NotificationServicesController/index.d.mts +14 -0
- package/dist/NotificationServicesController/index.d.mts.map +1 -0
- package/dist/NotificationServicesController/index.mjs +13 -86
- package/dist/NotificationServicesController/index.mjs.map +1 -1
- package/dist/NotificationServicesController/processors/index.cjs +20 -0
- package/dist/NotificationServicesController/processors/index.cjs.map +1 -0
- package/dist/NotificationServicesController/processors/index.d.cts +4 -0
- package/dist/NotificationServicesController/processors/index.d.cts.map +1 -0
- package/dist/NotificationServicesController/processors/index.d.mts +4 -0
- package/dist/NotificationServicesController/processors/index.d.mts.map +1 -0
- package/dist/NotificationServicesController/processors/index.mjs +3 -21
- package/dist/NotificationServicesController/processors/index.mjs.map +1 -1
- package/dist/NotificationServicesController/processors/process-feature-announcement.cjs +41 -0
- package/dist/{chunk-52CALMRA.js.map → NotificationServicesController/processors/process-feature-announcement.cjs.map} +1 -1
- package/dist/{types/NotificationServicesController/processors/process-feature-announcement.d.ts → NotificationServicesController/processors/process-feature-announcement.d.cts} +3 -3
- package/dist/NotificationServicesController/processors/process-feature-announcement.d.cts.map +1 -0
- package/dist/NotificationServicesController/processors/process-feature-announcement.d.mts +19 -0
- package/dist/NotificationServicesController/processors/process-feature-announcement.d.mts.map +1 -0
- package/dist/NotificationServicesController/processors/process-feature-announcement.mjs +34 -8
- package/dist/NotificationServicesController/processors/process-feature-announcement.mjs.map +1 -1
- package/dist/NotificationServicesController/processors/process-notifications.cjs +50 -0
- package/dist/NotificationServicesController/processors/process-notifications.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/processors/process-notifications.d.ts → NotificationServicesController/processors/process-notifications.d.cts} +2 -2
- package/dist/NotificationServicesController/processors/process-notifications.d.cts.map +1 -0
- package/dist/NotificationServicesController/processors/process-notifications.d.mts +19 -0
- package/dist/NotificationServicesController/processors/process-notifications.d.mts.map +1 -0
- package/dist/NotificationServicesController/processors/process-notifications.mjs +44 -12
- package/dist/NotificationServicesController/processors/process-notifications.mjs.map +1 -1
- package/dist/NotificationServicesController/processors/process-onchain-notifications.cjs +19 -0
- package/dist/NotificationServicesController/processors/process-onchain-notifications.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/processors/process-onchain-notifications.d.ts → NotificationServicesController/processors/process-onchain-notifications.d.cts} +3 -3
- package/dist/NotificationServicesController/processors/process-onchain-notifications.d.cts.map +1 -0
- package/dist/NotificationServicesController/processors/process-onchain-notifications.d.mts +10 -0
- package/dist/NotificationServicesController/processors/process-onchain-notifications.d.mts.map +1 -0
- package/dist/NotificationServicesController/processors/process-onchain-notifications.mjs +14 -7
- package/dist/NotificationServicesController/processors/process-onchain-notifications.mjs.map +1 -1
- package/dist/NotificationServicesController/services/feature-announcements.cjs +97 -0
- package/dist/NotificationServicesController/services/feature-announcements.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/services/feature-announcements.d.ts → NotificationServicesController/services/feature-announcements.d.cts} +4 -4
- package/dist/NotificationServicesController/services/feature-announcements.d.cts.map +1 -0
- package/dist/NotificationServicesController/services/feature-announcements.d.mts +28 -0
- package/dist/NotificationServicesController/services/feature-announcements.d.mts.map +1 -0
- package/dist/NotificationServicesController/services/feature-announcements.mjs +91 -12
- package/dist/NotificationServicesController/services/feature-announcements.mjs.map +1 -1
- package/dist/NotificationServicesController/services/onchain-notifications.cjs +195 -0
- package/dist/NotificationServicesController/services/onchain-notifications.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/services/onchain-notifications.d.ts → NotificationServicesController/services/onchain-notifications.d.cts} +3 -3
- package/dist/NotificationServicesController/services/onchain-notifications.d.cts.map +1 -0
- package/dist/NotificationServicesController/services/onchain-notifications.d.mts +62 -0
- package/dist/NotificationServicesController/services/onchain-notifications.d.mts.map +1 -0
- package/dist/NotificationServicesController/services/onchain-notifications.mjs +190 -29
- package/dist/NotificationServicesController/services/onchain-notifications.mjs.map +1 -1
- package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.cjs +3 -0
- package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/types/feature-announcement/feature-announcement.d.ts → NotificationServicesController/types/feature-announcement/feature-announcement.d.cts} +3 -3
- package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.d.mts +32 -0
- package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.mjs +1 -1
- package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.mjs.map +1 -1
- package/dist/NotificationServicesController/types/feature-announcement/index.cjs +20 -0
- package/dist/NotificationServicesController/types/feature-announcement/index.cjs.map +1 -0
- package/dist/NotificationServicesController/types/feature-announcement/index.d.cts +4 -0
- package/dist/NotificationServicesController/types/feature-announcement/index.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/feature-announcement/index.d.mts +4 -0
- package/dist/NotificationServicesController/types/feature-announcement/index.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/feature-announcement/index.mjs +3 -4
- package/dist/NotificationServicesController/types/feature-announcement/index.mjs.map +1 -1
- package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.cjs +3 -0
- package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/types/feature-announcement/type-feature-announcement.d.ts → NotificationServicesController/types/feature-announcement/type-feature-announcement.d.cts} +3 -3
- package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.d.mts +39 -0
- package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.mjs +1 -1
- package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.mjs.map +1 -1
- package/dist/NotificationServicesController/types/feature-announcement/type-links.cjs +3 -0
- package/dist/NotificationServicesController/types/feature-announcement/type-links.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/types/feature-announcement/type-links.d.ts → NotificationServicesController/types/feature-announcement/type-links.d.cts} +1 -1
- package/dist/NotificationServicesController/types/feature-announcement/type-links.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/feature-announcement/type-links.d.mts +29 -0
- package/dist/NotificationServicesController/types/feature-announcement/type-links.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/feature-announcement/type-links.mjs +1 -1
- package/dist/NotificationServicesController/types/feature-announcement/type-links.mjs.map +1 -1
- package/dist/NotificationServicesController/types/index.cjs +21 -0
- package/dist/NotificationServicesController/types/index.cjs.map +1 -0
- package/dist/NotificationServicesController/types/index.d.cts +5 -0
- package/dist/NotificationServicesController/types/index.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/index.d.mts +5 -0
- package/dist/NotificationServicesController/types/index.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/index.mjs +4 -11
- package/dist/NotificationServicesController/types/index.mjs.map +1 -1
- package/dist/NotificationServicesController/types/notification/index.cjs +18 -0
- package/dist/NotificationServicesController/types/notification/index.cjs.map +1 -0
- package/dist/NotificationServicesController/types/notification/index.d.cts +2 -0
- package/dist/NotificationServicesController/types/notification/index.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/notification/index.d.mts +2 -0
- package/dist/NotificationServicesController/types/notification/index.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/notification/index.mjs +1 -2
- package/dist/NotificationServicesController/types/notification/index.mjs.map +1 -1
- package/dist/NotificationServicesController/types/notification/notification.cjs +3 -0
- package/dist/NotificationServicesController/types/notification/notification.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/types/notification/notification.d.ts → NotificationServicesController/types/notification/notification.d.cts} +4 -4
- package/dist/NotificationServicesController/types/notification/notification.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/notification/notification.d.mts +25 -0
- package/dist/NotificationServicesController/types/notification/notification.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/notification/notification.mjs +1 -1
- package/dist/NotificationServicesController/types/notification/notification.mjs.map +1 -1
- package/dist/NotificationServicesController/types/on-chain-notification/index.cjs +18 -0
- package/dist/NotificationServicesController/types/on-chain-notification/index.cjs.map +1 -0
- package/dist/NotificationServicesController/types/on-chain-notification/index.d.cts +2 -0
- package/dist/NotificationServicesController/types/on-chain-notification/index.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/on-chain-notification/index.d.mts +2 -0
- package/dist/NotificationServicesController/types/on-chain-notification/index.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/on-chain-notification/index.mjs +1 -2
- package/dist/NotificationServicesController/types/on-chain-notification/index.mjs.map +1 -1
- package/dist/NotificationServicesController/types/on-chain-notification/on-chain-notification.cjs +3 -0
- package/dist/NotificationServicesController/types/on-chain-notification/on-chain-notification.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/types/on-chain-notification/on-chain-notification.d.ts → NotificationServicesController/types/on-chain-notification/on-chain-notification.d.cts} +4 -4
- package/dist/NotificationServicesController/types/on-chain-notification/on-chain-notification.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/on-chain-notification/on-chain-notification.d.mts +43 -0
- package/dist/NotificationServicesController/types/on-chain-notification/on-chain-notification.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/on-chain-notification/on-chain-notification.mjs +1 -1
- package/dist/NotificationServicesController/types/on-chain-notification/on-chain-notification.mjs.map +1 -1
- package/dist/NotificationServicesController/types/on-chain-notification/schema.cjs +9 -0
- package/dist/NotificationServicesController/types/on-chain-notification/schema.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/types/on-chain-notification/schema.d.ts → NotificationServicesController/types/on-chain-notification/schema.d.cts} +1 -1
- package/dist/NotificationServicesController/types/on-chain-notification/schema.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/on-chain-notification/schema.d.mts +283 -0
- package/dist/NotificationServicesController/types/on-chain-notification/schema.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/on-chain-notification/schema.mjs +7 -0
- package/dist/NotificationServicesController/types/on-chain-notification/schema.mjs.map +1 -1
- package/dist/NotificationServicesController/types/type-utils.cjs +3 -0
- package/dist/NotificationServicesController/types/type-utils.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/types/type-utils.d.ts → NotificationServicesController/types/type-utils.d.cts} +1 -1
- package/dist/NotificationServicesController/types/type-utils.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/type-utils.d.mts +7 -0
- package/dist/NotificationServicesController/types/type-utils.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/type-utils.mjs +1 -0
- package/dist/NotificationServicesController/types/type-utils.mjs.map +1 -1
- package/dist/NotificationServicesController/types/user-storage/index.cjs +18 -0
- package/dist/NotificationServicesController/types/user-storage/index.cjs.map +1 -0
- package/dist/NotificationServicesController/types/user-storage/index.d.cts +2 -0
- package/dist/NotificationServicesController/types/user-storage/index.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/user-storage/index.d.mts +2 -0
- package/dist/NotificationServicesController/types/user-storage/index.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/user-storage/index.mjs +1 -2
- package/dist/NotificationServicesController/types/user-storage/index.mjs.map +1 -1
- package/dist/NotificationServicesController/types/user-storage/user-storage.cjs +3 -0
- package/dist/NotificationServicesController/types/user-storage/user-storage.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/types/user-storage/user-storage.d.ts → NotificationServicesController/types/user-storage/user-storage.d.cts} +3 -3
- package/dist/NotificationServicesController/types/user-storage/user-storage.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/user-storage/user-storage.d.mts +26 -0
- package/dist/NotificationServicesController/types/user-storage/user-storage.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/user-storage/user-storage.mjs +1 -1
- package/dist/NotificationServicesController/types/user-storage/user-storage.mjs.map +1 -1
- package/dist/NotificationServicesController/ui/constants.cjs +62 -0
- package/dist/NotificationServicesController/ui/constants.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/ui/constants.d.ts → NotificationServicesController/ui/constants.d.cts} +2 -2
- package/dist/NotificationServicesController/ui/constants.d.cts.map +1 -0
- package/dist/NotificationServicesController/ui/constants.d.mts +54 -0
- package/dist/NotificationServicesController/ui/constants.d.mts.map +1 -0
- package/dist/NotificationServicesController/ui/constants.mjs +56 -14
- package/dist/NotificationServicesController/ui/constants.mjs.map +1 -1
- package/dist/NotificationServicesController/ui/index.cjs +18 -0
- package/dist/NotificationServicesController/ui/index.cjs.map +1 -0
- package/dist/NotificationServicesController/ui/index.d.cts +2 -0
- package/dist/NotificationServicesController/ui/index.d.cts.map +1 -0
- package/dist/NotificationServicesController/ui/index.d.mts +2 -0
- package/dist/NotificationServicesController/ui/index.d.mts.map +1 -0
- package/dist/NotificationServicesController/ui/index.mjs +1 -16
- package/dist/NotificationServicesController/ui/index.mjs.map +1 -1
- package/dist/NotificationServicesController/utils/utils.cjs +348 -0
- package/dist/NotificationServicesController/utils/utils.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/utils/utils.d.ts → NotificationServicesController/utils/utils.d.cts} +3 -3
- package/dist/NotificationServicesController/utils/utils.d.cts.map +1 -0
- package/dist/NotificationServicesController/utils/utils.d.mts +142 -0
- package/dist/NotificationServicesController/utils/utils.d.mts.map +1 -0
- package/dist/NotificationServicesController/utils/utils.mjs +332 -31
- package/dist/NotificationServicesController/utils/utils.mjs.map +1 -1
- package/dist/NotificationServicesPushController/NotificationServicesPushController.cjs +215 -0
- package/dist/NotificationServicesPushController/NotificationServicesPushController.cjs.map +1 -0
- package/dist/{types/NotificationServicesPushController/NotificationServicesPushController.d.ts → NotificationServicesPushController/NotificationServicesPushController.d.cts} +6 -6
- package/dist/NotificationServicesPushController/NotificationServicesPushController.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/NotificationServicesPushController.d.mts +112 -0
- package/dist/NotificationServicesPushController/NotificationServicesPushController.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/NotificationServicesPushController.mjs +214 -37
- package/dist/NotificationServicesPushController/NotificationServicesPushController.mjs.map +1 -1
- package/dist/NotificationServicesPushController/__fixtures__/index.cjs +18 -0
- package/dist/NotificationServicesPushController/__fixtures__/index.cjs.map +1 -0
- package/dist/NotificationServicesPushController/__fixtures__/index.d.cts +2 -0
- package/dist/NotificationServicesPushController/__fixtures__/index.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/__fixtures__/index.d.mts +2 -0
- package/dist/NotificationServicesPushController/__fixtures__/index.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/__fixtures__/index.mjs +2 -0
- package/dist/NotificationServicesPushController/__fixtures__/index.mjs.map +1 -0
- package/dist/NotificationServicesPushController/__fixtures__/mockResponse.cjs +57 -0
- package/dist/NotificationServicesPushController/__fixtures__/mockResponse.cjs.map +1 -0
- package/dist/{types/NotificationServicesPushController/__fixtures__/mockResponse.d.ts → NotificationServicesPushController/__fixtures__/mockResponse.d.cts} +2 -2
- package/dist/NotificationServicesPushController/__fixtures__/mockResponse.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/__fixtures__/mockResponse.d.mts +43 -0
- package/dist/NotificationServicesPushController/__fixtures__/mockResponse.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/__fixtures__/mockResponse.mjs +50 -0
- package/dist/NotificationServicesPushController/__fixtures__/mockResponse.mjs.map +1 -0
- package/dist/NotificationServicesPushController/__fixtures__/mockServices.cjs +31 -0
- package/dist/NotificationServicesPushController/__fixtures__/mockServices.cjs.map +1 -0
- package/dist/{types/NotificationServicesPushController/__fixtures__/mockServices.d.ts → NotificationServicesPushController/__fixtures__/mockServices.d.cts} +2 -2
- package/dist/NotificationServicesPushController/__fixtures__/mockServices.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/__fixtures__/mockServices.d.mts +9 -0
- package/dist/NotificationServicesPushController/__fixtures__/mockServices.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/__fixtures__/mockServices.mjs +30 -0
- package/dist/NotificationServicesPushController/__fixtures__/mockServices.mjs.map +1 -0
- package/dist/NotificationServicesPushController/constants.cjs +14 -0
- package/dist/NotificationServicesPushController/constants.cjs.map +1 -0
- package/dist/{types/NotificationServicesPushController/constants.d.ts → NotificationServicesPushController/constants.d.cts} +1 -1
- package/dist/NotificationServicesPushController/constants.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/constants.d.mts +11 -0
- package/dist/NotificationServicesPushController/constants.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/constants.mjs +10 -25
- package/dist/NotificationServicesPushController/constants.mjs.map +1 -1
- package/dist/NotificationServicesPushController/index.cjs +43 -0
- package/dist/NotificationServicesPushController/index.cjs.map +1 -0
- package/dist/NotificationServicesPushController/index.d.cts +11 -0
- package/dist/NotificationServicesPushController/index.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/index.d.mts +11 -0
- package/dist/NotificationServicesPushController/index.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/index.mjs +10 -71
- package/dist/NotificationServicesPushController/index.mjs.map +1 -1
- package/dist/NotificationServicesPushController/services/endpoints.cjs +6 -0
- package/dist/NotificationServicesPushController/services/endpoints.cjs.map +1 -0
- package/dist/{types/NotificationServicesPushController/services/endpoints.d.ts → NotificationServicesPushController/services/endpoints.d.cts} +1 -1
- package/dist/NotificationServicesPushController/services/endpoints.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/services/endpoints.d.mts +2 -0
- package/dist/NotificationServicesPushController/services/endpoints.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/services/endpoints.mjs +2 -7
- package/dist/NotificationServicesPushController/services/endpoints.mjs.map +1 -1
- package/dist/NotificationServicesPushController/services/push/index.cjs +3 -0
- package/dist/NotificationServicesPushController/services/push/index.cjs.map +1 -0
- package/dist/{types/NotificationServicesPushController/services/push/index.d.ts → NotificationServicesPushController/services/push/index.d.cts} +2 -2
- package/dist/NotificationServicesPushController/services/push/index.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/services/push/index.d.mts +6 -0
- package/dist/NotificationServicesPushController/services/push/index.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/services/push/index.mjs +1 -0
- package/dist/NotificationServicesPushController/services/push/index.mjs.map +1 -1
- package/dist/NotificationServicesPushController/services/push/push-web.cjs +121 -0
- package/dist/NotificationServicesPushController/services/push/push-web.cjs.map +1 -0
- package/dist/{types/NotificationServicesPushController/services/push/push-web.d.ts → NotificationServicesPushController/services/push/push-web.d.cts} +3 -3
- package/dist/NotificationServicesPushController/services/push/push-web.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/services/push/push-web.d.mts +32 -0
- package/dist/NotificationServicesPushController/services/push/push-web.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/services/push/push-web.mjs +116 -38
- package/dist/NotificationServicesPushController/services/push/push-web.mjs.map +1 -1
- package/dist/NotificationServicesPushController/services/services.cjs +197 -0
- package/dist/NotificationServicesPushController/services/services.cjs.map +1 -0
- package/dist/{types/NotificationServicesPushController/services/services.d.ts → NotificationServicesPushController/services/services.d.cts} +4 -4
- package/dist/NotificationServicesPushController/services/services.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/services/services.d.mts +95 -0
- package/dist/NotificationServicesPushController/services/services.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/services/services.mjs +168 -45
- package/dist/NotificationServicesPushController/services/services.mjs.map +1 -1
- package/dist/NotificationServicesPushController/types/firebase.cjs +3 -0
- package/dist/NotificationServicesPushController/types/firebase.cjs.map +1 -0
- package/dist/{types/NotificationServicesPushController/types/firebase.d.ts → NotificationServicesPushController/types/firebase.d.cts} +1 -1
- package/dist/NotificationServicesPushController/types/firebase.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/types/firebase.d.mts +53 -0
- package/dist/NotificationServicesPushController/types/firebase.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/types/firebase.mjs +1 -1
- package/dist/NotificationServicesPushController/types/firebase.mjs.map +1 -1
- package/dist/NotificationServicesPushController/types/index.cjs +18 -0
- package/dist/NotificationServicesPushController/types/index.cjs.map +1 -0
- package/dist/NotificationServicesPushController/types/index.d.cts +2 -0
- package/dist/NotificationServicesPushController/types/index.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/types/index.d.mts +2 -0
- package/dist/NotificationServicesPushController/types/index.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/types/index.mjs +1 -2
- package/dist/NotificationServicesPushController/types/index.mjs.map +1 -1
- package/dist/NotificationServicesPushController/utils/get-notification-data.cjs +84 -0
- package/dist/NotificationServicesPushController/utils/get-notification-data.cjs.map +1 -0
- package/dist/{types/NotificationServicesPushController/utils/get-notification-data.d.ts → NotificationServicesPushController/utils/get-notification-data.d.cts} +2 -2
- package/dist/NotificationServicesPushController/utils/get-notification-data.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/utils/get-notification-data.d.mts +42 -0
- package/dist/NotificationServicesPushController/utils/get-notification-data.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/utils/get-notification-data.mjs +76 -12
- package/dist/NotificationServicesPushController/utils/get-notification-data.mjs.map +1 -1
- package/dist/NotificationServicesPushController/utils/get-notification-message.cjs +190 -0
- package/dist/NotificationServicesPushController/utils/get-notification-message.cjs.map +1 -0
- package/dist/{types/NotificationServicesPushController/utils/get-notification-message.d.ts → NotificationServicesPushController/utils/get-notification-message.d.cts} +3 -3
- package/dist/NotificationServicesPushController/utils/get-notification-message.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/utils/get-notification-message.d.mts +67 -0
- package/dist/NotificationServicesPushController/utils/get-notification-message.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/utils/get-notification-message.mjs +182 -37
- package/dist/NotificationServicesPushController/utils/get-notification-message.mjs.map +1 -1
- package/dist/NotificationServicesPushController/utils/index.cjs +19 -0
- package/dist/NotificationServicesPushController/utils/index.cjs.map +1 -0
- package/dist/NotificationServicesPushController/utils/index.d.cts +3 -0
- package/dist/NotificationServicesPushController/utils/index.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/utils/index.d.mts +3 -0
- package/dist/NotificationServicesPushController/utils/index.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/utils/index.mjs +2 -48
- package/dist/NotificationServicesPushController/utils/index.mjs.map +1 -1
- package/dist/index.cjs +29 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +3 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +3 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +2 -45
- package/dist/index.mjs.map +1 -1
- package/dist/shared/to-raw-notification.cjs +19 -0
- package/dist/shared/to-raw-notification.cjs.map +1 -0
- package/dist/{types/shared/to-raw-notification.d.ts → shared/to-raw-notification.d.cts} +2 -2
- package/dist/shared/to-raw-notification.d.cts.map +1 -0
- package/dist/shared/to-raw-notification.d.mts +11 -0
- package/dist/shared/to-raw-notification.d.mts.map +1 -0
- package/dist/shared/to-raw-notification.mjs +14 -7
- package/dist/shared/to-raw-notification.mjs.map +1 -1
- package/package.json +12 -7
- package/dist/NotificationServicesController/NotificationServicesController.js +0 -19
- package/dist/NotificationServicesController/NotificationServicesController.js.map +0 -1
- package/dist/NotificationServicesController/constants/constants.js +0 -10
- package/dist/NotificationServicesController/constants/constants.js.map +0 -1
- package/dist/NotificationServicesController/constants/index.js +0 -29
- package/dist/NotificationServicesController/constants/index.js.map +0 -1
- package/dist/NotificationServicesController/constants/notification-schema.js +0 -22
- package/dist/NotificationServicesController/constants/notification-schema.js.map +0 -1
- package/dist/NotificationServicesController/index.js +0 -87
- package/dist/NotificationServicesController/index.js.map +0 -1
- package/dist/NotificationServicesController/processors/index.js +0 -22
- package/dist/NotificationServicesController/processors/index.js.map +0 -1
- package/dist/NotificationServicesController/processors/process-feature-announcement.js +0 -10
- package/dist/NotificationServicesController/processors/process-feature-announcement.js.map +0 -1
- package/dist/NotificationServicesController/processors/process-notifications.js +0 -13
- package/dist/NotificationServicesController/processors/process-notifications.js.map +0 -1
- package/dist/NotificationServicesController/processors/process-onchain-notifications.js +0 -8
- package/dist/NotificationServicesController/processors/process-onchain-notifications.js.map +0 -1
- package/dist/NotificationServicesController/services/feature-announcements.js +0 -14
- package/dist/NotificationServicesController/services/feature-announcements.js.map +0 -1
- package/dist/NotificationServicesController/services/onchain-notifications.js +0 -30
- package/dist/NotificationServicesController/services/onchain-notifications.js.map +0 -1
- package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.js +0 -2
- package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.js.map +0 -1
- package/dist/NotificationServicesController/types/feature-announcement/index.js +0 -5
- package/dist/NotificationServicesController/types/feature-announcement/index.js.map +0 -1
- package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.js +0 -2
- package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.js.map +0 -1
- package/dist/NotificationServicesController/types/feature-announcement/type-links.js +0 -2
- package/dist/NotificationServicesController/types/feature-announcement/type-links.js.map +0 -1
- package/dist/NotificationServicesController/types/index.js +0 -12
- package/dist/NotificationServicesController/types/index.js.map +0 -1
- package/dist/NotificationServicesController/types/notification/index.js +0 -3
- package/dist/NotificationServicesController/types/notification/index.js.map +0 -1
- package/dist/NotificationServicesController/types/notification/notification.js +0 -2
- package/dist/NotificationServicesController/types/notification/notification.js.map +0 -1
- package/dist/NotificationServicesController/types/on-chain-notification/index.js +0 -3
- package/dist/NotificationServicesController/types/on-chain-notification/index.js.map +0 -1
- package/dist/NotificationServicesController/types/on-chain-notification/on-chain-notification.js +0 -2
- package/dist/NotificationServicesController/types/on-chain-notification/on-chain-notification.js.map +0 -1
- package/dist/NotificationServicesController/types/on-chain-notification/schema.js +0 -1
- package/dist/NotificationServicesController/types/on-chain-notification/schema.js.map +0 -1
- package/dist/NotificationServicesController/types/type-utils.js +0 -1
- package/dist/NotificationServicesController/types/type-utils.js.map +0 -1
- package/dist/NotificationServicesController/types/user-storage/index.js +0 -3
- package/dist/NotificationServicesController/types/user-storage/index.js.map +0 -1
- package/dist/NotificationServicesController/types/user-storage/user-storage.js +0 -2
- package/dist/NotificationServicesController/types/user-storage/user-storage.js.map +0 -1
- package/dist/NotificationServicesController/ui/constants.js +0 -16
- package/dist/NotificationServicesController/ui/constants.js.map +0 -1
- package/dist/NotificationServicesController/ui/index.js +0 -17
- package/dist/NotificationServicesController/ui/index.js.map +0 -1
- package/dist/NotificationServicesController/utils/utils.js +0 -32
- package/dist/NotificationServicesController/utils/utils.js.map +0 -1
- package/dist/NotificationServicesPushController/NotificationServicesPushController.js +0 -39
- package/dist/NotificationServicesPushController/NotificationServicesPushController.js.map +0 -1
- package/dist/NotificationServicesPushController/constants.js +0 -26
- package/dist/NotificationServicesPushController/constants.js.map +0 -1
- package/dist/NotificationServicesPushController/index.js +0 -72
- package/dist/NotificationServicesPushController/index.js.map +0 -1
- package/dist/NotificationServicesPushController/services/endpoints.js +0 -8
- package/dist/NotificationServicesPushController/services/endpoints.js.map +0 -1
- package/dist/NotificationServicesPushController/services/push/index.js +0 -1
- package/dist/NotificationServicesPushController/services/push/index.js.map +0 -1
- package/dist/NotificationServicesPushController/services/push/push-web.js +0 -40
- package/dist/NotificationServicesPushController/services/push/push-web.js.map +0 -1
- package/dist/NotificationServicesPushController/services/services.js +0 -46
- package/dist/NotificationServicesPushController/services/services.js.map +0 -1
- package/dist/NotificationServicesPushController/types/firebase.js +0 -2
- package/dist/NotificationServicesPushController/types/firebase.js.map +0 -1
- package/dist/NotificationServicesPushController/types/index.js +0 -3
- package/dist/NotificationServicesPushController/types/index.js.map +0 -1
- package/dist/NotificationServicesPushController/utils/get-notification-data.js +0 -14
- package/dist/NotificationServicesPushController/utils/get-notification-data.js.map +0 -1
- package/dist/NotificationServicesPushController/utils/get-notification-message.js +0 -39
- package/dist/NotificationServicesPushController/utils/get-notification-message.js.map +0 -1
- package/dist/NotificationServicesPushController/utils/index.js +0 -49
- package/dist/NotificationServicesPushController/utils/index.js.map +0 -1
- package/dist/chunk-232HZSEV.js +0 -7
- package/dist/chunk-232HZSEV.js.map +0 -1
- package/dist/chunk-2P5WP5NT.mjs +0 -37
- package/dist/chunk-2P5WP5NT.mjs.map +0 -1
- package/dist/chunk-3ZS2HAEG.js +0 -1
- package/dist/chunk-3ZS2HAEG.js.map +0 -1
- package/dist/chunk-4BTNTREI.mjs +0 -1
- package/dist/chunk-4BTNTREI.mjs.map +0 -1
- package/dist/chunk-4QXAPVW3.mjs +0 -1
- package/dist/chunk-4QXAPVW3.mjs.map +0 -1
- package/dist/chunk-52CALMRA.js +0 -28
- package/dist/chunk-53F3SYYM.mjs +0 -178
- package/dist/chunk-53F3SYYM.mjs.map +0 -1
- package/dist/chunk-5FAAZCBK.mjs +0 -29
- package/dist/chunk-5FAAZCBK.mjs.map +0 -1
- package/dist/chunk-6FLC6CJD.js +0 -149
- package/dist/chunk-6FLC6CJD.js.map +0 -1
- package/dist/chunk-6ZDVTRRT.mjs +0 -9
- package/dist/chunk-6ZDVTRRT.mjs.map +0 -1
- package/dist/chunk-77QIITUL.mjs +0 -67
- package/dist/chunk-77QIITUL.mjs.map +0 -1
- package/dist/chunk-7LWR54U7.js +0 -7
- package/dist/chunk-7LWR54U7.js.map +0 -1
- package/dist/chunk-7PWKQSM2.mjs +0 -972
- package/dist/chunk-7PWKQSM2.mjs.map +0 -1
- package/dist/chunk-7RM3YNTD.mjs +0 -1
- package/dist/chunk-7RM3YNTD.mjs.map +0 -1
- package/dist/chunk-A2RPVX47.mjs +0 -1
- package/dist/chunk-A2RPVX47.mjs.map +0 -1
- package/dist/chunk-B25TJ7KS.js +0 -8
- package/dist/chunk-B25TJ7KS.js.map +0 -1
- package/dist/chunk-B4ECJJ5C.mjs +0 -7
- package/dist/chunk-B4ECJJ5C.mjs.map +0 -1
- package/dist/chunk-BONB66A2.mjs +0 -14
- package/dist/chunk-BONB66A2.mjs.map +0 -1
- package/dist/chunk-C62SK2KY.mjs +0 -92
- package/dist/chunk-C62SK2KY.mjs.map +0 -1
- package/dist/chunk-CGPMMFUQ.mjs +0 -96
- package/dist/chunk-CGPMMFUQ.mjs.map +0 -1
- package/dist/chunk-CWZQMK63.mjs +0 -118
- package/dist/chunk-CWZQMK63.mjs.map +0 -1
- package/dist/chunk-D42BBXBM.mjs +0 -28
- package/dist/chunk-D42BBXBM.mjs.map +0 -1
- package/dist/chunk-DINCLRZT.mjs +0 -12
- package/dist/chunk-DINCLRZT.mjs.map +0 -1
- package/dist/chunk-DMH4NSLF.js +0 -1
- package/dist/chunk-DMH4NSLF.js.map +0 -1
- package/dist/chunk-DT6SLUWJ.js +0 -12
- package/dist/chunk-DT6SLUWJ.js.map +0 -1
- package/dist/chunk-EJ52BDLB.js +0 -55
- package/dist/chunk-EJ52BDLB.js.map +0 -1
- package/dist/chunk-ER475D6V.mjs +0 -231
- package/dist/chunk-ER475D6V.mjs.map +0 -1
- package/dist/chunk-G52DNXFH.mjs +0 -1
- package/dist/chunk-G52DNXFH.mjs.map +0 -1
- package/dist/chunk-GETQWOTI.js +0 -1
- package/dist/chunk-GETQWOTI.js.map +0 -1
- package/dist/chunk-HCDICNYK.js +0 -207
- package/dist/chunk-HCDICNYK.js.map +0 -1
- package/dist/chunk-HE3P5RM7.js +0 -178
- package/dist/chunk-HE3P5RM7.js.map +0 -1
- package/dist/chunk-HPUQYDVC.js +0 -1
- package/dist/chunk-HPUQYDVC.js.map +0 -1
- package/dist/chunk-HT6T5R4U.js +0 -96
- package/dist/chunk-HT6T5R4U.js.map +0 -1
- package/dist/chunk-IDO4JFV5.mjs +0 -1
- package/dist/chunk-IDO4JFV5.mjs.map +0 -1
- package/dist/chunk-IGY2S5BC.js +0 -36
- package/dist/chunk-IGY2S5BC.js.map +0 -1
- package/dist/chunk-IKWNHNJQ.mjs +0 -8
- package/dist/chunk-IKWNHNJQ.mjs.map +0 -1
- package/dist/chunk-IOMDG67D.mjs +0 -7
- package/dist/chunk-IOMDG67D.mjs.map +0 -1
- package/dist/chunk-IPI7BAW3.js +0 -1
- package/dist/chunk-IPI7BAW3.js.map +0 -1
- package/dist/chunk-JIJXHO5V.js +0 -885
- package/dist/chunk-JIJXHO5V.js.map +0 -1
- package/dist/chunk-JQ7WKFCI.mjs +0 -1
- package/dist/chunk-JQ7WKFCI.mjs.map +0 -1
- package/dist/chunk-JW3TK3NU.js +0 -221
- package/dist/chunk-JW3TK3NU.js.map +0 -1
- package/dist/chunk-KGLHGLER.js +0 -231
- package/dist/chunk-KGLHGLER.js.map +0 -1
- package/dist/chunk-LGXHJ24K.js +0 -92
- package/dist/chunk-LGXHJ24K.js.map +0 -1
- package/dist/chunk-LYEXYTOI.js +0 -14
- package/dist/chunk-LYEXYTOI.js.map +0 -1
- package/dist/chunk-LZMC2QML.mjs +0 -25
- package/dist/chunk-LZMC2QML.mjs.map +0 -1
- package/dist/chunk-MG5QDUDI.mjs +0 -48
- package/dist/chunk-MG5QDUDI.mjs.map +0 -1
- package/dist/chunk-MNBV5FJI.mjs +0 -31
- package/dist/chunk-MNBV5FJI.mjs.map +0 -1
- package/dist/chunk-NIPCK74T.js +0 -185
- package/dist/chunk-NIPCK74T.js.map +0 -1
- package/dist/chunk-O45HYLIV.js +0 -67
- package/dist/chunk-O45HYLIV.js.map +0 -1
- package/dist/chunk-ODI2BTKS.mjs +0 -55
- package/dist/chunk-ODI2BTKS.mjs.map +0 -1
- package/dist/chunk-OHFX4S6R.mjs +0 -185
- package/dist/chunk-OHFX4S6R.mjs.map +0 -1
- package/dist/chunk-OMBFVTP2.js +0 -37
- package/dist/chunk-OMBFVTP2.js.map +0 -1
- package/dist/chunk-PJMQ2XEG.js +0 -29
- package/dist/chunk-PJMQ2XEG.js.map +0 -1
- package/dist/chunk-PNCS6GEX.mjs +0 -1
- package/dist/chunk-PNCS6GEX.mjs.map +0 -1
- package/dist/chunk-PROWNV4M.js +0 -1
- package/dist/chunk-PROWNV4M.js.map +0 -1
- package/dist/chunk-QAOZN4AX.js +0 -25
- package/dist/chunk-QAOZN4AX.js.map +0 -1
- package/dist/chunk-QB5IFRLA.mjs +0 -1
- package/dist/chunk-QB5IFRLA.mjs.map +0 -1
- package/dist/chunk-RAUV5UV4.mjs +0 -1
- package/dist/chunk-RAUV5UV4.mjs.map +0 -1
- package/dist/chunk-SGLVWM4N.js +0 -48
- package/dist/chunk-SGLVWM4N.js.map +0 -1
- package/dist/chunk-TLX5QQK5.js +0 -9
- package/dist/chunk-TLX5QQK5.js.map +0 -1
- package/dist/chunk-U5UIDVOO.mjs +0 -36
- package/dist/chunk-U5UIDVOO.mjs.map +0 -1
- package/dist/chunk-U74Q3BRP.mjs +0 -1
- package/dist/chunk-U74Q3BRP.mjs.map +0 -1
- package/dist/chunk-UQ6MTYIR.js +0 -972
- package/dist/chunk-UQ6MTYIR.js.map +0 -1
- package/dist/chunk-UZHUVXRM.js +0 -31
- package/dist/chunk-UZHUVXRM.js.map +0 -1
- package/dist/chunk-V5HMYDWE.js +0 -1
- package/dist/chunk-V5HMYDWE.js.map +0 -1
- package/dist/chunk-VZMQIJMK.mjs +0 -149
- package/dist/chunk-VZMQIJMK.mjs.map +0 -1
- package/dist/chunk-W7IP4LDB.js +0 -118
- package/dist/chunk-W7IP4LDB.js.map +0 -1
- package/dist/chunk-WE4RFGT7.mjs +0 -885
- package/dist/chunk-WE4RFGT7.mjs.map +0 -1
- package/dist/chunk-WGBEAP2F.mjs +0 -207
- package/dist/chunk-WGBEAP2F.mjs.map +0 -1
- package/dist/chunk-WRYFIWNK.js +0 -1
- package/dist/chunk-WRYFIWNK.js.map +0 -1
- package/dist/chunk-XZEVRYUE.js +0 -1
- package/dist/chunk-XZEVRYUE.js.map +0 -1
- package/dist/chunk-YUMIJSUD.mjs +0 -221
- package/dist/chunk-YUMIJSUD.mjs.map +0 -1
- package/dist/chunk-ZBNBZN5H.js +0 -1
- package/dist/chunk-ZBNBZN5H.js.map +0 -1
- package/dist/chunk-ZV3DFBO4.js +0 -1
- package/dist/chunk-ZV3DFBO4.js.map +0 -1
- package/dist/index.js +0 -46
- package/dist/index.js.map +0 -1
- package/dist/shared/to-raw-notification.js +0 -8
- package/dist/shared/to-raw-notification.js.map +0 -1
- package/dist/tsconfig.build.tsbuildinfo +0 -1
- package/dist/types/NotificationServicesController/NotificationServicesController.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/__fixtures__/index.d.ts +0 -6
- package/dist/types/NotificationServicesController/__fixtures__/index.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/__fixtures__/mock-feature-announcements.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/__fixtures__/mock-notification-trigger.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/__fixtures__/mock-notification-user-storage.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/__fixtures__/mock-raw-notifications.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/__fixtures__/mockResponses.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/__fixtures__/mockServices.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/__fixtures__/test-utils.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/constants/constants.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/constants/index.d.ts +0 -3
- package/dist/types/NotificationServicesController/constants/index.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/constants/notification-schema.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/index.d.ts +0 -14
- package/dist/types/NotificationServicesController/index.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/processors/index.d.ts +0 -4
- package/dist/types/NotificationServicesController/processors/index.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/processors/process-feature-announcement.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/processors/process-notifications.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/processors/process-onchain-notifications.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/services/feature-announcements.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/services/onchain-notifications.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/types/feature-announcement/feature-announcement.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/types/feature-announcement/index.d.ts +0 -4
- package/dist/types/NotificationServicesController/types/feature-announcement/index.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/types/feature-announcement/type-feature-announcement.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/types/feature-announcement/type-links.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/types/index.d.ts +0 -5
- package/dist/types/NotificationServicesController/types/index.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/types/notification/index.d.ts +0 -2
- package/dist/types/NotificationServicesController/types/notification/index.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/types/notification/notification.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/types/on-chain-notification/index.d.ts +0 -2
- package/dist/types/NotificationServicesController/types/on-chain-notification/index.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/types/on-chain-notification/on-chain-notification.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/types/on-chain-notification/schema.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/types/type-utils.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/types/user-storage/index.d.ts +0 -2
- package/dist/types/NotificationServicesController/types/user-storage/index.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/types/user-storage/user-storage.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/ui/constants.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/ui/index.d.ts +0 -2
- package/dist/types/NotificationServicesController/ui/index.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/utils/utils.d.ts.map +0 -1
- package/dist/types/NotificationServicesPushController/NotificationServicesPushController.d.ts.map +0 -1
- package/dist/types/NotificationServicesPushController/__fixtures__/index.d.ts +0 -2
- package/dist/types/NotificationServicesPushController/__fixtures__/index.d.ts.map +0 -1
- package/dist/types/NotificationServicesPushController/__fixtures__/mockResponse.d.ts.map +0 -1
- package/dist/types/NotificationServicesPushController/__fixtures__/mockServices.d.ts.map +0 -1
- package/dist/types/NotificationServicesPushController/constants.d.ts.map +0 -1
- package/dist/types/NotificationServicesPushController/index.d.ts +0 -11
- package/dist/types/NotificationServicesPushController/index.d.ts.map +0 -1
- package/dist/types/NotificationServicesPushController/services/endpoints.d.ts.map +0 -1
- package/dist/types/NotificationServicesPushController/services/push/index.d.ts.map +0 -1
- package/dist/types/NotificationServicesPushController/services/push/push-web.d.ts.map +0 -1
- package/dist/types/NotificationServicesPushController/services/services.d.ts.map +0 -1
- package/dist/types/NotificationServicesPushController/types/firebase.d.ts.map +0 -1
- package/dist/types/NotificationServicesPushController/types/index.d.ts +0 -2
- package/dist/types/NotificationServicesPushController/types/index.d.ts.map +0 -1
- package/dist/types/NotificationServicesPushController/utils/get-notification-data.d.ts.map +0 -1
- package/dist/types/NotificationServicesPushController/utils/get-notification-message.d.ts.map +0 -1
- package/dist/types/NotificationServicesPushController/utils/index.d.ts +0 -3
- package/dist/types/NotificationServicesPushController/utils/index.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -3
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/shared/to-raw-notification.d.ts.map +0 -1
|
@@ -1,87 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
import "../chunk-IDO4JFV5.mjs";
|
|
15
|
-
import "../chunk-A2RPVX47.mjs";
|
|
16
|
-
import "../chunk-4BTNTREI.mjs";
|
|
17
|
-
import "../chunk-QB5IFRLA.mjs";
|
|
18
|
-
import {
|
|
19
|
-
ui_exports
|
|
20
|
-
} from "../chunk-LZMC2QML.mjs";
|
|
21
|
-
import "../chunk-77QIITUL.mjs";
|
|
22
|
-
import {
|
|
23
|
-
constants_exports
|
|
24
|
-
} from "../chunk-2P5WP5NT.mjs";
|
|
25
|
-
import {
|
|
26
|
-
processors_exports
|
|
27
|
-
} from "../chunk-5FAAZCBK.mjs";
|
|
28
|
-
import {
|
|
29
|
-
NotificationServicesController,
|
|
30
|
-
defaultState
|
|
31
|
-
} from "../chunk-WE4RFGT7.mjs";
|
|
32
|
-
import {
|
|
33
|
-
processNotification,
|
|
34
|
-
safeProcessNotification
|
|
35
|
-
} from "../chunk-MG5QDUDI.mjs";
|
|
36
|
-
import {
|
|
37
|
-
processOnChainNotification
|
|
38
|
-
} from "../chunk-BONB66A2.mjs";
|
|
39
|
-
import "../chunk-C62SK2KY.mjs";
|
|
40
|
-
import {
|
|
41
|
-
isFeatureAnnouncementRead,
|
|
42
|
-
processFeatureAnnouncement
|
|
43
|
-
} from "../chunk-D42BBXBM.mjs";
|
|
44
|
-
import "../chunk-OHFX4S6R.mjs";
|
|
45
|
-
import "../chunk-YUMIJSUD.mjs";
|
|
46
|
-
import {
|
|
47
|
-
CHAIN_SYMBOLS,
|
|
48
|
-
NOTIFICATION_CHAINS,
|
|
49
|
-
NOTIFICATION_CHAINS_ID,
|
|
50
|
-
SUPPORTED_CHAINS,
|
|
51
|
-
TRIGGERS,
|
|
52
|
-
TRIGGER_TYPES,
|
|
53
|
-
TRIGGER_TYPES_GROUPS,
|
|
54
|
-
TRIGGER_TYPES_WALLET_SET
|
|
55
|
-
} from "../chunk-53F3SYYM.mjs";
|
|
56
|
-
import "../chunk-DINCLRZT.mjs";
|
|
57
|
-
import {
|
|
58
|
-
USER_STORAGE_VERSION,
|
|
59
|
-
USER_STORAGE_VERSION_KEY
|
|
60
|
-
} from "../chunk-6ZDVTRRT.mjs";
|
|
61
|
-
import "../chunk-U5UIDVOO.mjs";
|
|
62
|
-
export {
|
|
63
|
-
CHAIN_SYMBOLS,
|
|
64
|
-
constants_exports as Constants,
|
|
65
|
-
NotificationServicesController as Controller,
|
|
66
|
-
fixtures_exports as Mocks,
|
|
67
|
-
NOTIFICATION_CHAINS,
|
|
68
|
-
NOTIFICATION_CHAINS_ID,
|
|
69
|
-
processors_exports as Processors,
|
|
70
|
-
SUPPORTED_CHAINS,
|
|
71
|
-
TRIGGERS,
|
|
72
|
-
TRIGGER_TYPES,
|
|
73
|
-
TRIGGER_TYPES_GROUPS,
|
|
74
|
-
TRIGGER_TYPES_WALLET_SET,
|
|
75
|
-
types_exports as Types,
|
|
76
|
-
ui_exports as UI,
|
|
77
|
-
USER_STORAGE_VERSION,
|
|
78
|
-
USER_STORAGE_VERSION_KEY,
|
|
79
|
-
NotificationServicesController_default as default,
|
|
80
|
-
defaultState,
|
|
81
|
-
isFeatureAnnouncementRead,
|
|
82
|
-
processFeatureAnnouncement,
|
|
83
|
-
processNotification,
|
|
84
|
-
processOnChainNotification,
|
|
85
|
-
safeProcessNotification
|
|
86
|
-
};
|
|
1
|
+
import Controller from "./NotificationServicesController.mjs";
|
|
2
|
+
const NotificationServicesController = Controller;
|
|
3
|
+
export { Controller };
|
|
4
|
+
export default NotificationServicesController;
|
|
5
|
+
export * from "./NotificationServicesController.mjs";
|
|
6
|
+
export * as Types from "./types/index.mjs";
|
|
7
|
+
export * from "./types/index.mjs";
|
|
8
|
+
export * as Processors from "./processors/index.mjs";
|
|
9
|
+
export * from "./processors/index.mjs";
|
|
10
|
+
export * as Constants from "./constants/index.mjs";
|
|
11
|
+
export * from "./constants/index.mjs";
|
|
12
|
+
export * as Mocks from "./__fixtures__/index.mjs";
|
|
13
|
+
export * as UI from "./ui/index.mjs";
|
|
87
14
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/NotificationServicesController/index.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,6CAAyC;AAE1D,MAAM,8BAA8B,GAAG,UAAU,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,eAAe,8BAA8B,CAAC;AAC9C,qDAAiD;AACjD,OAAO,KAAK,KAAK,0BAAgB;AACjC,kCAAwB;AACxB,OAAO,KAAK,UAAU,+BAAqB;AAC3C,uCAA6B;AAC7B,OAAO,KAAK,SAAS,8BAAoB;AACzC,sCAA4B;AAC5B,OAAO,KAAK,KAAK,iCAAuB;AACxC,OAAO,KAAK,EAAE,uBAAa","sourcesContent":["import Controller from './NotificationServicesController';\n\nconst NotificationServicesController = Controller;\nexport { Controller };\nexport default NotificationServicesController;\nexport * from './NotificationServicesController';\nexport * as Types from './types';\nexport * from './types';\nexport * as Processors from './processors';\nexport * from './processors';\nexport * as Constants from './constants';\nexport * from './constants';\nexport * as Mocks from './__fixtures__';\nexport * as UI from './ui';\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./process-feature-announcement.cjs"), exports);
|
|
18
|
+
__exportStar(require("./process-notifications.cjs"), exports);
|
|
19
|
+
__exportStar(require("./process-onchain-notifications.cjs"), exports);
|
|
20
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qEAA+C;AAC/C,8DAAwC;AACxC,sEAAgD","sourcesContent":["export * from './process-feature-announcement';\nexport * from './process-notifications';\nexport * from './process-onchain-notifications';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/index.ts"],"names":[],"mappings":"AAAA,mDAA+C;AAC/C,4CAAwC;AACxC,oDAAgD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/index.ts"],"names":[],"mappings":"AAAA,mDAA+C;AAC/C,4CAAwC;AACxC,oDAAgD"}
|
|
@@ -1,22 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
safeProcessNotification
|
|
5
|
-
} from "../../chunk-MG5QDUDI.mjs";
|
|
6
|
-
import {
|
|
7
|
-
processOnChainNotification
|
|
8
|
-
} from "../../chunk-BONB66A2.mjs";
|
|
9
|
-
import {
|
|
10
|
-
isFeatureAnnouncementRead,
|
|
11
|
-
processFeatureAnnouncement
|
|
12
|
-
} from "../../chunk-D42BBXBM.mjs";
|
|
13
|
-
import "../../chunk-53F3SYYM.mjs";
|
|
14
|
-
import "../../chunk-U5UIDVOO.mjs";
|
|
15
|
-
export {
|
|
16
|
-
isFeatureAnnouncementRead,
|
|
17
|
-
processFeatureAnnouncement,
|
|
18
|
-
processNotification,
|
|
19
|
-
processOnChainNotification,
|
|
20
|
-
safeProcessNotification
|
|
21
|
-
};
|
|
1
|
+
export * from "./process-feature-announcement.mjs";
|
|
2
|
+
export * from "./process-notifications.mjs";
|
|
3
|
+
export * from "./process-onchain-notifications.mjs";
|
|
22
4
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/index.ts"],"names":[],"mappings":"AAAA,mDAA+C;AAC/C,4CAAwC;AACxC,oDAAgD","sourcesContent":["export * from './process-feature-announcement';\nexport * from './process-notifications';\nexport * from './process-onchain-notifications';\n"]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.processFeatureAnnouncement = exports.isFeatureAnnouncementRead = void 0;
|
|
4
|
+
const ONE_DAY_MS = 1000 * 60 * 60 * 24;
|
|
5
|
+
const shouldAutoExpire = (oldDate) => {
|
|
6
|
+
const differenceInTime = Date.now() - oldDate.getTime();
|
|
7
|
+
const differenceInDays = differenceInTime / ONE_DAY_MS;
|
|
8
|
+
return differenceInDays >= 90;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Checks if a feature announcement should be read.
|
|
12
|
+
* Checks feature announcement state (from param), as well as if the notification is "expired"
|
|
13
|
+
*
|
|
14
|
+
* @param notification - notification to check
|
|
15
|
+
* @param readPlatformNotificationsList - list of read notifications
|
|
16
|
+
* @returns boolean if notification should be marked as read or unread
|
|
17
|
+
*/
|
|
18
|
+
function isFeatureAnnouncementRead(notification, readPlatformNotificationsList) {
|
|
19
|
+
if (readPlatformNotificationsList.includes(notification.id)) {
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
return shouldAutoExpire(new Date(notification.createdAt));
|
|
23
|
+
}
|
|
24
|
+
exports.isFeatureAnnouncementRead = isFeatureAnnouncementRead;
|
|
25
|
+
/**
|
|
26
|
+
* Processes a feature announcement into a shared/normalised notification shape.
|
|
27
|
+
*
|
|
28
|
+
* @param notification - raw feature announcement
|
|
29
|
+
* @returns a normalised feature announcement
|
|
30
|
+
*/
|
|
31
|
+
function processFeatureAnnouncement(notification) {
|
|
32
|
+
return {
|
|
33
|
+
type: notification.type,
|
|
34
|
+
id: notification.data.id,
|
|
35
|
+
createdAt: new Date(notification.createdAt).toISOString(),
|
|
36
|
+
data: notification.data,
|
|
37
|
+
isRead: false,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
exports.processFeatureAnnouncement = processFeatureAnnouncement;
|
|
41
|
+
//# sourceMappingURL=process-feature-announcement.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"file":"process-feature-announcement.cjs","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/process-feature-announcement.ts"],"names":[],"mappings":";;;AAGA,MAAM,UAAU,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAEvC,MAAM,gBAAgB,GAAG,CAAC,OAAa,EAAE,EAAE;IACzC,MAAM,gBAAgB,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IACxD,MAAM,gBAAgB,GAAG,gBAAgB,GAAG,UAAU,CAAC;IACvD,OAAO,gBAAgB,IAAI,EAAE,CAAC;AAChC,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,SAAgB,yBAAyB,CACvC,YAAqD,EACrD,6BAAuC;IAEvC,IAAI,6BAA6B,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,EAAE;QAC3D,OAAO,IAAI,CAAC;KACb;IACD,OAAO,gBAAgB,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC;AAC5D,CAAC;AARD,8DAQC;AAED;;;;;GAKG;AACH,SAAgB,0BAA0B,CACxC,YAAgD;IAEhD,OAAO;QACL,IAAI,EAAE,YAAY,CAAC,IAAI;QACvB,EAAE,EAAE,YAAY,CAAC,IAAI,CAAC,EAAE;QACxB,SAAS,EAAE,IAAI,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE;QACzD,IAAI,EAAE,YAAY,CAAC,IAAI;QACvB,MAAM,EAAE,KAAK;KACd,CAAC;AACJ,CAAC;AAVD,gEAUC","sourcesContent":["import type { FeatureAnnouncementRawNotification } from '../types/feature-announcement/feature-announcement';\nimport type { INotification } from '../types/notification/notification';\n\nconst ONE_DAY_MS = 1000 * 60 * 60 * 24;\n\nconst shouldAutoExpire = (oldDate: Date) => {\n const differenceInTime = Date.now() - oldDate.getTime();\n const differenceInDays = differenceInTime / ONE_DAY_MS;\n return differenceInDays >= 90;\n};\n\n/**\n * Checks if a feature announcement should be read.\n * Checks feature announcement state (from param), as well as if the notification is \"expired\"\n *\n * @param notification - notification to check\n * @param readPlatformNotificationsList - list of read notifications\n * @returns boolean if notification should be marked as read or unread\n */\nexport function isFeatureAnnouncementRead(\n notification: Pick<INotification, 'id' | 'createdAt'>,\n readPlatformNotificationsList: string[],\n): boolean {\n if (readPlatformNotificationsList.includes(notification.id)) {\n return true;\n }\n return shouldAutoExpire(new Date(notification.createdAt));\n}\n\n/**\n * Processes a feature announcement into a shared/normalised notification shape.\n *\n * @param notification - raw feature announcement\n * @returns a normalised feature announcement\n */\nexport function processFeatureAnnouncement(\n notification: FeatureAnnouncementRawNotification,\n): INotification {\n return {\n type: notification.type,\n id: notification.data.id,\n createdAt: new Date(notification.createdAt).toISOString(),\n data: notification.data,\n isRead: false,\n };\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { FeatureAnnouncementRawNotification } from
|
|
2
|
-
import type { INotification } from
|
|
1
|
+
import type { FeatureAnnouncementRawNotification } from "../types/feature-announcement/feature-announcement.cjs";
|
|
2
|
+
import type { INotification } from "../types/notification/notification.cjs";
|
|
3
3
|
/**
|
|
4
4
|
* Checks if a feature announcement should be read.
|
|
5
5
|
* Checks feature announcement state (from param), as well as if the notification is "expired"
|
|
@@ -16,4 +16,4 @@ export declare function isFeatureAnnouncementRead(notification: Pick<INotificati
|
|
|
16
16
|
* @returns a normalised feature announcement
|
|
17
17
|
*/
|
|
18
18
|
export declare function processFeatureAnnouncement(notification: FeatureAnnouncementRawNotification): INotification;
|
|
19
|
-
//# sourceMappingURL=process-feature-announcement.d.
|
|
19
|
+
//# sourceMappingURL=process-feature-announcement.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-feature-announcement.d.cts","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/process-feature-announcement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kCAAkC,EAAE,+DAA2D;AAC7G,OAAO,KAAK,EAAE,aAAa,EAAE,+CAA2C;AAUxE;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,YAAY,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,GAAG,WAAW,CAAC,EACrD,6BAA6B,EAAE,MAAM,EAAE,GACtC,OAAO,CAKT;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACxC,YAAY,EAAE,kCAAkC,GAC/C,aAAa,CAQf"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { FeatureAnnouncementRawNotification } from "../types/feature-announcement/feature-announcement.mjs";
|
|
2
|
+
import type { INotification } from "../types/notification/notification.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* Checks if a feature announcement should be read.
|
|
5
|
+
* Checks feature announcement state (from param), as well as if the notification is "expired"
|
|
6
|
+
*
|
|
7
|
+
* @param notification - notification to check
|
|
8
|
+
* @param readPlatformNotificationsList - list of read notifications
|
|
9
|
+
* @returns boolean if notification should be marked as read or unread
|
|
10
|
+
*/
|
|
11
|
+
export declare function isFeatureAnnouncementRead(notification: Pick<INotification, 'id' | 'createdAt'>, readPlatformNotificationsList: string[]): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Processes a feature announcement into a shared/normalised notification shape.
|
|
14
|
+
*
|
|
15
|
+
* @param notification - raw feature announcement
|
|
16
|
+
* @returns a normalised feature announcement
|
|
17
|
+
*/
|
|
18
|
+
export declare function processFeatureAnnouncement(notification: FeatureAnnouncementRawNotification): INotification;
|
|
19
|
+
//# sourceMappingURL=process-feature-announcement.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-feature-announcement.d.mts","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/process-feature-announcement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kCAAkC,EAAE,+DAA2D;AAC7G,OAAO,KAAK,EAAE,aAAa,EAAE,+CAA2C;AAUxE;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,YAAY,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,GAAG,WAAW,CAAC,EACrD,6BAA6B,EAAE,MAAM,EAAE,GACtC,OAAO,CAKT;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACxC,YAAY,EAAE,kCAAkC,GAC/C,aAAa,CAQf"}
|
|
@@ -1,10 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export {
|
|
7
|
-
isFeatureAnnouncementRead,
|
|
8
|
-
processFeatureAnnouncement
|
|
1
|
+
const ONE_DAY_MS = 1000 * 60 * 60 * 24;
|
|
2
|
+
const shouldAutoExpire = (oldDate) => {
|
|
3
|
+
const differenceInTime = Date.now() - oldDate.getTime();
|
|
4
|
+
const differenceInDays = differenceInTime / ONE_DAY_MS;
|
|
5
|
+
return differenceInDays >= 90;
|
|
9
6
|
};
|
|
7
|
+
/**
|
|
8
|
+
* Checks if a feature announcement should be read.
|
|
9
|
+
* Checks feature announcement state (from param), as well as if the notification is "expired"
|
|
10
|
+
*
|
|
11
|
+
* @param notification - notification to check
|
|
12
|
+
* @param readPlatformNotificationsList - list of read notifications
|
|
13
|
+
* @returns boolean if notification should be marked as read or unread
|
|
14
|
+
*/
|
|
15
|
+
export function isFeatureAnnouncementRead(notification, readPlatformNotificationsList) {
|
|
16
|
+
if (readPlatformNotificationsList.includes(notification.id)) {
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
return shouldAutoExpire(new Date(notification.createdAt));
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Processes a feature announcement into a shared/normalised notification shape.
|
|
23
|
+
*
|
|
24
|
+
* @param notification - raw feature announcement
|
|
25
|
+
* @returns a normalised feature announcement
|
|
26
|
+
*/
|
|
27
|
+
export function processFeatureAnnouncement(notification) {
|
|
28
|
+
return {
|
|
29
|
+
type: notification.type,
|
|
30
|
+
id: notification.data.id,
|
|
31
|
+
createdAt: new Date(notification.createdAt).toISOString(),
|
|
32
|
+
data: notification.data,
|
|
33
|
+
isRead: false,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
10
36
|
//# sourceMappingURL=process-feature-announcement.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"
|
|
1
|
+
{"version":3,"file":"process-feature-announcement.mjs","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/process-feature-announcement.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAEvC,MAAM,gBAAgB,GAAG,CAAC,OAAa,EAAE,EAAE;IACzC,MAAM,gBAAgB,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IACxD,MAAM,gBAAgB,GAAG,gBAAgB,GAAG,UAAU,CAAC;IACvD,OAAO,gBAAgB,IAAI,EAAE,CAAC;AAChC,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,UAAU,yBAAyB,CACvC,YAAqD,EACrD,6BAAuC;IAEvC,IAAI,6BAA6B,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,EAAE;QAC3D,OAAO,IAAI,CAAC;KACb;IACD,OAAO,gBAAgB,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC;AAC5D,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,0BAA0B,CACxC,YAAgD;IAEhD,OAAO;QACL,IAAI,EAAE,YAAY,CAAC,IAAI;QACvB,EAAE,EAAE,YAAY,CAAC,IAAI,CAAC,EAAE;QACxB,SAAS,EAAE,IAAI,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE;QACzD,IAAI,EAAE,YAAY,CAAC,IAAI;QACvB,MAAM,EAAE,KAAK;KACd,CAAC;AACJ,CAAC","sourcesContent":["import type { FeatureAnnouncementRawNotification } from '../types/feature-announcement/feature-announcement';\nimport type { INotification } from '../types/notification/notification';\n\nconst ONE_DAY_MS = 1000 * 60 * 60 * 24;\n\nconst shouldAutoExpire = (oldDate: Date) => {\n const differenceInTime = Date.now() - oldDate.getTime();\n const differenceInDays = differenceInTime / ONE_DAY_MS;\n return differenceInDays >= 90;\n};\n\n/**\n * Checks if a feature announcement should be read.\n * Checks feature announcement state (from param), as well as if the notification is \"expired\"\n *\n * @param notification - notification to check\n * @param readPlatformNotificationsList - list of read notifications\n * @returns boolean if notification should be marked as read or unread\n */\nexport function isFeatureAnnouncementRead(\n notification: Pick<INotification, 'id' | 'createdAt'>,\n readPlatformNotificationsList: string[],\n): boolean {\n if (readPlatformNotificationsList.includes(notification.id)) {\n return true;\n }\n return shouldAutoExpire(new Date(notification.createdAt));\n}\n\n/**\n * Processes a feature announcement into a shared/normalised notification shape.\n *\n * @param notification - raw feature announcement\n * @returns a normalised feature announcement\n */\nexport function processFeatureAnnouncement(\n notification: FeatureAnnouncementRawNotification,\n): INotification {\n return {\n type: notification.type,\n id: notification.data.id,\n createdAt: new Date(notification.createdAt).toISOString(),\n data: notification.data,\n isRead: false,\n };\n}\n"]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.safeProcessNotification = exports.processNotification = void 0;
|
|
4
|
+
const notification_schema_1 = require("../constants/notification-schema.cjs");
|
|
5
|
+
const process_feature_announcement_1 = require("./process-feature-announcement.cjs");
|
|
6
|
+
const process_onchain_notifications_1 = require("./process-onchain-notifications.cjs");
|
|
7
|
+
const isOnChainNotification = (n) => Object.values(notification_schema_1.TRIGGER_TYPES).includes(n.type);
|
|
8
|
+
const isFeatureAnnouncement = (n) => n.type === notification_schema_1.TRIGGER_TYPES.FEATURES_ANNOUNCEMENT;
|
|
9
|
+
/**
|
|
10
|
+
* Process feature announcement and wallet notifications into a shared/normalised notification shape.
|
|
11
|
+
* We can still differentiate notifications by the `type` property
|
|
12
|
+
*
|
|
13
|
+
* @param notification - a feature announcement or on chain notification
|
|
14
|
+
* @param readNotifications - all read notifications currently
|
|
15
|
+
* @returns a processed notification
|
|
16
|
+
*/
|
|
17
|
+
function processNotification(notification, readNotifications = []) {
|
|
18
|
+
const exhaustedAllCases = (_) => {
|
|
19
|
+
const type = notification?.type;
|
|
20
|
+
throw new Error(`No processor found for notification kind ${type}`);
|
|
21
|
+
};
|
|
22
|
+
if (isFeatureAnnouncement(notification)) {
|
|
23
|
+
const n = (0, process_feature_announcement_1.processFeatureAnnouncement)(notification);
|
|
24
|
+
n.isRead = (0, process_feature_announcement_1.isFeatureAnnouncementRead)(n, readNotifications);
|
|
25
|
+
return n;
|
|
26
|
+
}
|
|
27
|
+
if (isOnChainNotification(notification)) {
|
|
28
|
+
return (0, process_onchain_notifications_1.processOnChainNotification)(notification);
|
|
29
|
+
}
|
|
30
|
+
return exhaustedAllCases(notification);
|
|
31
|
+
}
|
|
32
|
+
exports.processNotification = processNotification;
|
|
33
|
+
/**
|
|
34
|
+
* Safe version of processing a notification. Rather than throwing an error if failed to process, it will return the Notification or undefined
|
|
35
|
+
*
|
|
36
|
+
* @param notification - notification to processes
|
|
37
|
+
* @param readNotifications - all read notifications currently
|
|
38
|
+
* @returns a process notification or undefined if failed to process
|
|
39
|
+
*/
|
|
40
|
+
function safeProcessNotification(notification, readNotifications = []) {
|
|
41
|
+
try {
|
|
42
|
+
const processedNotification = processNotification(notification, readNotifications);
|
|
43
|
+
return processedNotification;
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.safeProcessNotification = safeProcessNotification;
|
|
50
|
+
//# sourceMappingURL=process-notifications.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-notifications.cjs","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/process-notifications.ts"],"names":[],"mappings":";;;AAAA,8EAAiE;AAOjE,qFAGwC;AACxC,uFAA6E;AAE7E,MAAM,qBAAqB,GAAG,CAC5B,CAAoB,EACS,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,mCAAa,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAEhF,MAAM,qBAAqB,GAAG,CAC5B,CAAoB,EACqB,EAAE,CAC3C,CAAC,CAAC,IAAI,KAAK,mCAAa,CAAC,qBAAqB,CAAC;AAEjD;;;;;;;GAOG;AACH,SAAgB,mBAAmB,CACjC,YAA+B,EAC/B,oBAA8B,EAAE;IAEhC,MAAM,iBAAiB,GAAG,CAAC,CAAQ,EAAE,EAAE;QACrC,MAAM,IAAI,GAAW,YAAY,EAAE,IAAI,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,4CAA4C,IAAI,EAAE,CAAC,CAAC;IACtE,CAAC,CAAC;IAEF,IAAI,qBAAqB,CAAC,YAAY,CAAC,EAAE;QACvC,MAAM,CAAC,GAAG,IAAA,yDAA0B,EAClC,YAAkD,CACnD,CAAC;QACF,CAAC,CAAC,MAAM,GAAG,IAAA,wDAAyB,EAAC,CAAC,EAAE,iBAAiB,CAAC,CAAC;QAC3D,OAAO,CAAC,CAAC;KACV;IAED,IAAI,qBAAqB,CAAC,YAAY,CAAC,EAAE;QACvC,OAAO,IAAA,0DAA0B,EAAC,YAAsC,CAAC,CAAC;KAC3E;IAED,OAAO,iBAAiB,CAAC,YAAqB,CAAC,CAAC;AAClD,CAAC;AAtBD,kDAsBC;AAED;;;;;;GAMG;AACH,SAAgB,uBAAuB,CACrC,YAA+B,EAC/B,oBAA8B,EAAE;IAEhC,IAAI;QACF,MAAM,qBAAqB,GAAG,mBAAmB,CAC/C,YAAY,EACZ,iBAAiB,CAClB,CAAC;QACF,OAAO,qBAAqB,CAAC;KAC9B;IAAC,MAAM;QACN,OAAO,SAAS,CAAC;KAClB;AACH,CAAC;AAbD,0DAaC","sourcesContent":["import { TRIGGER_TYPES } from '../constants/notification-schema';\nimport type { FeatureAnnouncementRawNotification } from '../types/feature-announcement/feature-announcement';\nimport type {\n INotification,\n NotificationUnion,\n} from '../types/notification/notification';\nimport type { OnChainRawNotification } from '../types/on-chain-notification/on-chain-notification';\nimport {\n isFeatureAnnouncementRead,\n processFeatureAnnouncement,\n} from './process-feature-announcement';\nimport { processOnChainNotification } from './process-onchain-notifications';\n\nconst isOnChainNotification = (\n n: NotificationUnion,\n): n is OnChainRawNotification => Object.values(TRIGGER_TYPES).includes(n.type);\n\nconst isFeatureAnnouncement = (\n n: NotificationUnion,\n): n is FeatureAnnouncementRawNotification =>\n n.type === TRIGGER_TYPES.FEATURES_ANNOUNCEMENT;\n\n/**\n * Process feature announcement and wallet notifications into a shared/normalised notification shape.\n * We can still differentiate notifications by the `type` property\n *\n * @param notification - a feature announcement or on chain notification\n * @param readNotifications - all read notifications currently\n * @returns a processed notification\n */\nexport function processNotification(\n notification: NotificationUnion,\n readNotifications: string[] = [],\n): INotification {\n const exhaustedAllCases = (_: never) => {\n const type: string = notification?.type;\n throw new Error(`No processor found for notification kind ${type}`);\n };\n\n if (isFeatureAnnouncement(notification)) {\n const n = processFeatureAnnouncement(\n notification as FeatureAnnouncementRawNotification,\n );\n n.isRead = isFeatureAnnouncementRead(n, readNotifications);\n return n;\n }\n\n if (isOnChainNotification(notification)) {\n return processOnChainNotification(notification as OnChainRawNotification);\n }\n\n return exhaustedAllCases(notification as never);\n}\n\n/**\n * Safe version of processing a notification. Rather than throwing an error if failed to process, it will return the Notification or undefined\n *\n * @param notification - notification to processes\n * @param readNotifications - all read notifications currently\n * @returns a process notification or undefined if failed to process\n */\nexport function safeProcessNotification(\n notification: NotificationUnion,\n readNotifications: string[] = [],\n): INotification | undefined {\n try {\n const processedNotification = processNotification(\n notification,\n readNotifications,\n );\n return processedNotification;\n } catch {\n return undefined;\n }\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { INotification, NotificationUnion } from
|
|
1
|
+
import type { INotification, NotificationUnion } from "../types/notification/notification.cjs";
|
|
2
2
|
/**
|
|
3
3
|
* Process feature announcement and wallet notifications into a shared/normalised notification shape.
|
|
4
4
|
* We can still differentiate notifications by the `type` property
|
|
@@ -16,4 +16,4 @@ export declare function processNotification(notification: NotificationUnion, rea
|
|
|
16
16
|
* @returns a process notification or undefined if failed to process
|
|
17
17
|
*/
|
|
18
18
|
export declare function safeProcessNotification(notification: NotificationUnion, readNotifications?: string[]): INotification | undefined;
|
|
19
|
-
//# sourceMappingURL=process-notifications.d.
|
|
19
|
+
//# sourceMappingURL=process-notifications.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-notifications.d.cts","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/process-notifications.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,aAAa,EACb,iBAAiB,EAClB,+CAA2C;AAiB5C;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,YAAY,EAAE,iBAAiB,EAC/B,iBAAiB,GAAE,MAAM,EAAO,GAC/B,aAAa,CAmBf;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,YAAY,EAAE,iBAAiB,EAC/B,iBAAiB,GAAE,MAAM,EAAO,GAC/B,aAAa,GAAG,SAAS,CAU3B"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { INotification, NotificationUnion } from "../types/notification/notification.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* Process feature announcement and wallet notifications into a shared/normalised notification shape.
|
|
4
|
+
* We can still differentiate notifications by the `type` property
|
|
5
|
+
*
|
|
6
|
+
* @param notification - a feature announcement or on chain notification
|
|
7
|
+
* @param readNotifications - all read notifications currently
|
|
8
|
+
* @returns a processed notification
|
|
9
|
+
*/
|
|
10
|
+
export declare function processNotification(notification: NotificationUnion, readNotifications?: string[]): INotification;
|
|
11
|
+
/**
|
|
12
|
+
* Safe version of processing a notification. Rather than throwing an error if failed to process, it will return the Notification or undefined
|
|
13
|
+
*
|
|
14
|
+
* @param notification - notification to processes
|
|
15
|
+
* @param readNotifications - all read notifications currently
|
|
16
|
+
* @returns a process notification or undefined if failed to process
|
|
17
|
+
*/
|
|
18
|
+
export declare function safeProcessNotification(notification: NotificationUnion, readNotifications?: string[]): INotification | undefined;
|
|
19
|
+
//# sourceMappingURL=process-notifications.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-notifications.d.mts","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/process-notifications.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,aAAa,EACb,iBAAiB,EAClB,+CAA2C;AAiB5C;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,YAAY,EAAE,iBAAiB,EAC/B,iBAAiB,GAAE,MAAM,EAAO,GAC/B,aAAa,CAmBf;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,YAAY,EAAE,iBAAiB,EAC/B,iBAAiB,GAAE,MAAM,EAAO,GAC/B,aAAa,GAAG,SAAS,CAU3B"}
|
|
@@ -1,13 +1,45 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { TRIGGER_TYPES } from "../constants/notification-schema.mjs";
|
|
2
|
+
import { isFeatureAnnouncementRead, processFeatureAnnouncement } from "./process-feature-announcement.mjs";
|
|
3
|
+
import { processOnChainNotification } from "./process-onchain-notifications.mjs";
|
|
4
|
+
const isOnChainNotification = (n) => Object.values(TRIGGER_TYPES).includes(n.type);
|
|
5
|
+
const isFeatureAnnouncement = (n) => n.type === TRIGGER_TYPES.FEATURES_ANNOUNCEMENT;
|
|
6
|
+
/**
|
|
7
|
+
* Process feature announcement and wallet notifications into a shared/normalised notification shape.
|
|
8
|
+
* We can still differentiate notifications by the `type` property
|
|
9
|
+
*
|
|
10
|
+
* @param notification - a feature announcement or on chain notification
|
|
11
|
+
* @param readNotifications - all read notifications currently
|
|
12
|
+
* @returns a processed notification
|
|
13
|
+
*/
|
|
14
|
+
export function processNotification(notification, readNotifications = []) {
|
|
15
|
+
const exhaustedAllCases = (_) => {
|
|
16
|
+
const type = notification?.type;
|
|
17
|
+
throw new Error(`No processor found for notification kind ${type}`);
|
|
18
|
+
};
|
|
19
|
+
if (isFeatureAnnouncement(notification)) {
|
|
20
|
+
const n = processFeatureAnnouncement(notification);
|
|
21
|
+
n.isRead = isFeatureAnnouncementRead(n, readNotifications);
|
|
22
|
+
return n;
|
|
23
|
+
}
|
|
24
|
+
if (isOnChainNotification(notification)) {
|
|
25
|
+
return processOnChainNotification(notification);
|
|
26
|
+
}
|
|
27
|
+
return exhaustedAllCases(notification);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Safe version of processing a notification. Rather than throwing an error if failed to process, it will return the Notification or undefined
|
|
31
|
+
*
|
|
32
|
+
* @param notification - notification to processes
|
|
33
|
+
* @param readNotifications - all read notifications currently
|
|
34
|
+
* @returns a process notification or undefined if failed to process
|
|
35
|
+
*/
|
|
36
|
+
export function safeProcessNotification(notification, readNotifications = []) {
|
|
37
|
+
try {
|
|
38
|
+
const processedNotification = processNotification(notification, readNotifications);
|
|
39
|
+
return processedNotification;
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
13
45
|
//# sourceMappingURL=process-notifications.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"
|
|
1
|
+
{"version":3,"file":"process-notifications.mjs","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/process-notifications.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,6CAAyC;AAOjE,OAAO,EACL,yBAAyB,EACzB,0BAA0B,EAC3B,2CAAuC;AACxC,OAAO,EAAE,0BAA0B,EAAE,4CAAwC;AAE7E,MAAM,qBAAqB,GAAG,CAC5B,CAAoB,EACS,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAEhF,MAAM,qBAAqB,GAAG,CAC5B,CAAoB,EACqB,EAAE,CAC3C,CAAC,CAAC,IAAI,KAAK,aAAa,CAAC,qBAAqB,CAAC;AAEjD;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CACjC,YAA+B,EAC/B,oBAA8B,EAAE;IAEhC,MAAM,iBAAiB,GAAG,CAAC,CAAQ,EAAE,EAAE;QACrC,MAAM,IAAI,GAAW,YAAY,EAAE,IAAI,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,4CAA4C,IAAI,EAAE,CAAC,CAAC;IACtE,CAAC,CAAC;IAEF,IAAI,qBAAqB,CAAC,YAAY,CAAC,EAAE;QACvC,MAAM,CAAC,GAAG,0BAA0B,CAClC,YAAkD,CACnD,CAAC;QACF,CAAC,CAAC,MAAM,GAAG,yBAAyB,CAAC,CAAC,EAAE,iBAAiB,CAAC,CAAC;QAC3D,OAAO,CAAC,CAAC;KACV;IAED,IAAI,qBAAqB,CAAC,YAAY,CAAC,EAAE;QACvC,OAAO,0BAA0B,CAAC,YAAsC,CAAC,CAAC;KAC3E;IAED,OAAO,iBAAiB,CAAC,YAAqB,CAAC,CAAC;AAClD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CACrC,YAA+B,EAC/B,oBAA8B,EAAE;IAEhC,IAAI;QACF,MAAM,qBAAqB,GAAG,mBAAmB,CAC/C,YAAY,EACZ,iBAAiB,CAClB,CAAC;QACF,OAAO,qBAAqB,CAAC;KAC9B;IAAC,MAAM;QACN,OAAO,SAAS,CAAC;KAClB;AACH,CAAC","sourcesContent":["import { TRIGGER_TYPES } from '../constants/notification-schema';\nimport type { FeatureAnnouncementRawNotification } from '../types/feature-announcement/feature-announcement';\nimport type {\n INotification,\n NotificationUnion,\n} from '../types/notification/notification';\nimport type { OnChainRawNotification } from '../types/on-chain-notification/on-chain-notification';\nimport {\n isFeatureAnnouncementRead,\n processFeatureAnnouncement,\n} from './process-feature-announcement';\nimport { processOnChainNotification } from './process-onchain-notifications';\n\nconst isOnChainNotification = (\n n: NotificationUnion,\n): n is OnChainRawNotification => Object.values(TRIGGER_TYPES).includes(n.type);\n\nconst isFeatureAnnouncement = (\n n: NotificationUnion,\n): n is FeatureAnnouncementRawNotification =>\n n.type === TRIGGER_TYPES.FEATURES_ANNOUNCEMENT;\n\n/**\n * Process feature announcement and wallet notifications into a shared/normalised notification shape.\n * We can still differentiate notifications by the `type` property\n *\n * @param notification - a feature announcement or on chain notification\n * @param readNotifications - all read notifications currently\n * @returns a processed notification\n */\nexport function processNotification(\n notification: NotificationUnion,\n readNotifications: string[] = [],\n): INotification {\n const exhaustedAllCases = (_: never) => {\n const type: string = notification?.type;\n throw new Error(`No processor found for notification kind ${type}`);\n };\n\n if (isFeatureAnnouncement(notification)) {\n const n = processFeatureAnnouncement(\n notification as FeatureAnnouncementRawNotification,\n );\n n.isRead = isFeatureAnnouncementRead(n, readNotifications);\n return n;\n }\n\n if (isOnChainNotification(notification)) {\n return processOnChainNotification(notification as OnChainRawNotification);\n }\n\n return exhaustedAllCases(notification as never);\n}\n\n/**\n * Safe version of processing a notification. Rather than throwing an error if failed to process, it will return the Notification or undefined\n *\n * @param notification - notification to processes\n * @param readNotifications - all read notifications currently\n * @returns a process notification or undefined if failed to process\n */\nexport function safeProcessNotification(\n notification: NotificationUnion,\n readNotifications: string[] = [],\n): INotification | undefined {\n try {\n const processedNotification = processNotification(\n notification,\n readNotifications,\n );\n return processedNotification;\n } catch {\n return undefined;\n }\n}\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.processOnChainNotification = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Processes On-Chain notifications to a normalized notification
|
|
6
|
+
*
|
|
7
|
+
* @param notification - On-Chain Notification
|
|
8
|
+
* @returns Normalized Notification
|
|
9
|
+
*/
|
|
10
|
+
function processOnChainNotification(notification) {
|
|
11
|
+
return {
|
|
12
|
+
...notification,
|
|
13
|
+
id: notification.id,
|
|
14
|
+
createdAt: new Date(notification.created_at).toISOString(),
|
|
15
|
+
isRead: !notification.unread,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
exports.processOnChainNotification = processOnChainNotification;
|
|
19
|
+
//# sourceMappingURL=process-onchain-notifications.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-onchain-notifications.cjs","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/process-onchain-notifications.ts"],"names":[],"mappings":";;;AAGA;;;;;GAKG;AACH,SAAgB,0BAA0B,CACxC,YAAoC;IAEpC,OAAO;QACL,GAAG,YAAY;QACf,EAAE,EAAE,YAAY,CAAC,EAAE;QACnB,SAAS,EAAE,IAAI,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,WAAW,EAAE;QAC1D,MAAM,EAAE,CAAC,YAAY,CAAC,MAAM;KAC7B,CAAC;AACJ,CAAC;AATD,gEASC","sourcesContent":["import type { INotification } from '../types/notification/notification';\nimport type { OnChainRawNotification } from '../types/on-chain-notification/on-chain-notification';\n\n/**\n * Processes On-Chain notifications to a normalized notification\n *\n * @param notification - On-Chain Notification\n * @returns Normalized Notification\n */\nexport function processOnChainNotification(\n notification: OnChainRawNotification,\n): INotification {\n return {\n ...notification,\n id: notification.id,\n createdAt: new Date(notification.created_at).toISOString(),\n isRead: !notification.unread,\n };\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { INotification } from
|
|
2
|
-
import type { OnChainRawNotification } from
|
|
1
|
+
import type { INotification } from "../types/notification/notification.cjs";
|
|
2
|
+
import type { OnChainRawNotification } from "../types/on-chain-notification/on-chain-notification.cjs";
|
|
3
3
|
/**
|
|
4
4
|
* Processes On-Chain notifications to a normalized notification
|
|
5
5
|
*
|
|
@@ -7,4 +7,4 @@ import type { OnChainRawNotification } from '../types/on-chain-notification/on-c
|
|
|
7
7
|
* @returns Normalized Notification
|
|
8
8
|
*/
|
|
9
9
|
export declare function processOnChainNotification(notification: OnChainRawNotification): INotification;
|
|
10
|
-
//# sourceMappingURL=process-onchain-notifications.d.
|
|
10
|
+
//# sourceMappingURL=process-onchain-notifications.d.cts.map
|
package/dist/NotificationServicesController/processors/process-onchain-notifications.d.cts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-onchain-notifications.d.cts","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/process-onchain-notifications.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,+CAA2C;AACxE,OAAO,KAAK,EAAE,sBAAsB,EAAE,iEAA6D;AAEnG;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACxC,YAAY,EAAE,sBAAsB,GACnC,aAAa,CAOf"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { INotification } from "../types/notification/notification.mjs";
|
|
2
|
+
import type { OnChainRawNotification } from "../types/on-chain-notification/on-chain-notification.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* Processes On-Chain notifications to a normalized notification
|
|
5
|
+
*
|
|
6
|
+
* @param notification - On-Chain Notification
|
|
7
|
+
* @returns Normalized Notification
|
|
8
|
+
*/
|
|
9
|
+
export declare function processOnChainNotification(notification: OnChainRawNotification): INotification;
|
|
10
|
+
//# sourceMappingURL=process-onchain-notifications.d.mts.map
|
package/dist/NotificationServicesController/processors/process-onchain-notifications.d.mts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-onchain-notifications.d.mts","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/process-onchain-notifications.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,+CAA2C;AACxE,OAAO,KAAK,EAAE,sBAAsB,EAAE,iEAA6D;AAEnG;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACxC,YAAY,EAAE,sBAAsB,GACnC,aAAa,CAOf"}
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Processes On-Chain notifications to a normalized notification
|
|
3
|
+
*
|
|
4
|
+
* @param notification - On-Chain Notification
|
|
5
|
+
* @returns Normalized Notification
|
|
6
|
+
*/
|
|
7
|
+
export function processOnChainNotification(notification) {
|
|
8
|
+
return {
|
|
9
|
+
...notification,
|
|
10
|
+
id: notification.id,
|
|
11
|
+
createdAt: new Date(notification.created_at).toISOString(),
|
|
12
|
+
isRead: !notification.unread,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
8
15
|
//# sourceMappingURL=process-onchain-notifications.mjs.map
|
package/dist/NotificationServicesController/processors/process-onchain-notifications.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"
|
|
1
|
+
{"version":3,"file":"process-onchain-notifications.mjs","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/process-onchain-notifications.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,MAAM,UAAU,0BAA0B,CACxC,YAAoC;IAEpC,OAAO;QACL,GAAG,YAAY;QACf,EAAE,EAAE,YAAY,CAAC,EAAE;QACnB,SAAS,EAAE,IAAI,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,WAAW,EAAE;QAC1D,MAAM,EAAE,CAAC,YAAY,CAAC,MAAM;KAC7B,CAAC;AACJ,CAAC","sourcesContent":["import type { INotification } from '../types/notification/notification';\nimport type { OnChainRawNotification } from '../types/on-chain-notification/on-chain-notification';\n\n/**\n * Processes On-Chain notifications to a normalized notification\n *\n * @param notification - On-Chain Notification\n * @returns Normalized Notification\n */\nexport function processOnChainNotification(\n notification: OnChainRawNotification,\n): INotification {\n return {\n ...notification,\n id: notification.id,\n createdAt: new Date(notification.created_at).toISOString(),\n isRead: !notification.unread,\n };\n}\n"]}
|