@metamask-previews/notification-services-controller 26.0.1-preview-4f4c98e → 26.0.1-preview-eb263b0ee
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/CHANGELOG.md +0 -1
- package/dist/NotificationServicesController/NotificationServicesController-method-action-types.cjs +7 -0
- package/dist/NotificationServicesController/NotificationServicesController-method-action-types.cjs.map +1 -0
- package/dist/NotificationServicesController/{NotificationServicesController-method-action-types.d.ts → NotificationServicesController-method-action-types.d.cts} +2 -2
- package/dist/NotificationServicesController/NotificationServicesController-method-action-types.d.cts.map +1 -0
- package/dist/NotificationServicesController/NotificationServicesController-method-action-types.d.mts +206 -0
- package/dist/NotificationServicesController/NotificationServicesController-method-action-types.d.mts.map +1 -0
- package/dist/NotificationServicesController/{NotificationServicesController-method-action-types.js → NotificationServicesController-method-action-types.mjs} +1 -1
- package/dist/NotificationServicesController/NotificationServicesController-method-action-types.mjs.map +1 -0
- package/dist/NotificationServicesController/NotificationServicesController.cjs +1055 -0
- package/dist/NotificationServicesController/NotificationServicesController.cjs.map +1 -0
- package/dist/NotificationServicesController/{NotificationServicesController.d.ts → NotificationServicesController.d.cts} +15 -15
- package/dist/NotificationServicesController/NotificationServicesController.d.cts.map +1 -0
- package/dist/NotificationServicesController/NotificationServicesController.d.mts +292 -0
- package/dist/NotificationServicesController/NotificationServicesController.d.mts.map +1 -0
- package/dist/NotificationServicesController/{NotificationServicesController.js → NotificationServicesController.mjs} +26 -18
- package/dist/NotificationServicesController/NotificationServicesController.mjs.map +1 -0
- package/dist/NotificationServicesController/constants/index.cjs +18 -0
- package/dist/NotificationServicesController/constants/index.cjs.map +1 -0
- package/dist/NotificationServicesController/constants/index.d.cts +2 -0
- package/dist/NotificationServicesController/constants/index.d.cts.map +1 -0
- package/dist/NotificationServicesController/constants/index.d.mts +2 -0
- package/dist/NotificationServicesController/constants/index.d.mts.map +1 -0
- package/dist/NotificationServicesController/constants/index.mjs +2 -0
- package/dist/NotificationServicesController/constants/index.mjs.map +1 -0
- package/dist/NotificationServicesController/constants/notification-schema.cjs +46 -0
- package/dist/NotificationServicesController/constants/notification-schema.cjs.map +1 -0
- package/dist/NotificationServicesController/constants/{notification-schema.d.ts → notification-schema.d.cts} +1 -1
- package/dist/NotificationServicesController/constants/notification-schema.d.cts.map +1 -0
- package/dist/NotificationServicesController/constants/notification-schema.d.mts +22 -0
- package/dist/NotificationServicesController/constants/notification-schema.d.mts.map +1 -0
- package/dist/NotificationServicesController/constants/{notification-schema.js → notification-schema.mjs} +1 -1
- package/dist/NotificationServicesController/constants/notification-schema.mjs.map +1 -0
- package/dist/NotificationServicesController/index.cjs +44 -0
- package/dist/NotificationServicesController/index.cjs.map +1 -0
- package/dist/NotificationServicesController/{index.d.ts → index.d.cts} +14 -14
- package/dist/NotificationServicesController/index.d.cts.map +1 -0
- package/dist/NotificationServicesController/index.d.mts +16 -0
- package/dist/NotificationServicesController/index.d.mts.map +1 -0
- package/dist/NotificationServicesController/index.mjs +13 -0
- package/dist/NotificationServicesController/index.mjs.map +1 -0
- package/dist/NotificationServicesController/mocks/index.cjs +21 -0
- package/dist/NotificationServicesController/mocks/index.cjs.map +1 -0
- package/dist/NotificationServicesController/mocks/index.d.cts +5 -0
- package/dist/NotificationServicesController/mocks/index.d.cts.map +1 -0
- package/dist/NotificationServicesController/mocks/index.d.mts +5 -0
- package/dist/NotificationServicesController/mocks/index.d.mts.map +1 -0
- package/dist/NotificationServicesController/mocks/index.mjs +5 -0
- package/dist/NotificationServicesController/mocks/index.mjs.map +1 -0
- package/dist/NotificationServicesController/mocks/mock-feature-announcements.cjs +210 -0
- package/dist/NotificationServicesController/mocks/mock-feature-announcements.cjs.map +1 -0
- package/dist/NotificationServicesController/mocks/{mock-feature-announcements.d.ts → mock-feature-announcements.d.cts} +3 -3
- package/dist/NotificationServicesController/mocks/mock-feature-announcements.d.cts.map +1 -0
- package/dist/NotificationServicesController/mocks/mock-feature-announcements.d.mts +15 -0
- package/dist/NotificationServicesController/mocks/mock-feature-announcements.d.mts.map +1 -0
- package/dist/NotificationServicesController/mocks/{mock-feature-announcements.js → mock-feature-announcements.mjs} +2 -2
- package/dist/NotificationServicesController/mocks/mock-feature-announcements.mjs.map +1 -0
- package/dist/NotificationServicesController/mocks/mock-raw-notifications.cjs +830 -0
- package/dist/NotificationServicesController/mocks/mock-raw-notifications.cjs.map +1 -0
- package/dist/NotificationServicesController/mocks/{mock-raw-notifications.d.ts → mock-raw-notifications.d.cts} +2 -2
- package/dist/NotificationServicesController/mocks/mock-raw-notifications.d.cts.map +1 -0
- package/dist/NotificationServicesController/mocks/mock-raw-notifications.d.mts +104 -0
- package/dist/NotificationServicesController/mocks/mock-raw-notifications.d.mts.map +1 -0
- package/dist/NotificationServicesController/mocks/{mock-raw-notifications.js → mock-raw-notifications.mjs} +2 -2
- package/dist/NotificationServicesController/mocks/mock-raw-notifications.mjs.map +1 -0
- package/dist/NotificationServicesController/mocks/mock-snap-notification.cjs +29 -0
- package/dist/NotificationServicesController/mocks/mock-snap-notification.cjs.map +1 -0
- package/dist/NotificationServicesController/mocks/{mock-snap-notification.d.ts → mock-snap-notification.d.cts} +2 -2
- package/dist/NotificationServicesController/mocks/mock-snap-notification.d.cts.map +1 -0
- package/dist/NotificationServicesController/mocks/mock-snap-notification.d.mts +8 -0
- package/dist/NotificationServicesController/mocks/mock-snap-notification.d.mts.map +1 -0
- package/dist/NotificationServicesController/mocks/{mock-snap-notification.js → mock-snap-notification.mjs} +2 -2
- package/dist/NotificationServicesController/mocks/mock-snap-notification.mjs.map +1 -0
- package/dist/NotificationServicesController/mocks/mockResponses.cjs +53 -0
- package/dist/NotificationServicesController/mocks/mockResponses.cjs.map +1 -0
- package/dist/NotificationServicesController/mocks/{mockResponses.d.ts → mockResponses.d.cts} +3 -3
- package/dist/NotificationServicesController/mocks/mockResponses.d.cts.map +1 -0
- package/dist/NotificationServicesController/mocks/mockResponses.d.mts +14 -0
- package/dist/NotificationServicesController/mocks/mockResponses.d.mts.map +1 -0
- package/dist/NotificationServicesController/mocks/{mockResponses.js → mockResponses.mjs} +6 -6
- package/dist/NotificationServicesController/mocks/mockResponses.mjs.map +1 -0
- 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 +4 -0
- package/dist/NotificationServicesController/processors/index.mjs.map +1 -0
- package/dist/NotificationServicesController/processors/process-api-notifications.cjs +24 -0
- package/dist/NotificationServicesController/processors/process-api-notifications.cjs.map +1 -0
- package/dist/NotificationServicesController/processors/{process-api-notifications.d.ts → process-api-notifications.d.cts} +3 -3
- package/dist/NotificationServicesController/processors/process-api-notifications.d.cts.map +1 -0
- package/dist/NotificationServicesController/processors/process-api-notifications.d.mts +10 -0
- package/dist/NotificationServicesController/processors/process-api-notifications.d.mts.map +1 -0
- package/dist/NotificationServicesController/processors/{process-api-notifications.js → process-api-notifications.mjs} +3 -3
- package/dist/NotificationServicesController/processors/process-api-notifications.mjs.map +1 -0
- package/dist/NotificationServicesController/processors/process-feature-announcement.cjs +38 -0
- package/dist/NotificationServicesController/processors/process-feature-announcement.cjs.map +1 -0
- package/dist/NotificationServicesController/processors/{process-feature-announcement.d.ts → 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.js → process-feature-announcement.mjs} +3 -3
- package/dist/NotificationServicesController/processors/process-feature-announcement.mjs.map +1 -0
- package/dist/NotificationServicesController/processors/process-notifications.cjs +60 -0
- package/dist/NotificationServicesController/processors/process-notifications.cjs.map +1 -0
- package/dist/NotificationServicesController/processors/{process-notifications.d.ts → 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 +20 -0
- package/dist/NotificationServicesController/processors/process-notifications.d.mts.map +1 -0
- package/dist/NotificationServicesController/processors/{process-notifications.js → process-notifications.mjs} +5 -5
- package/dist/NotificationServicesController/processors/process-notifications.mjs.map +1 -0
- package/dist/NotificationServicesController/processors/process-snap-notifications.cjs +25 -0
- package/dist/NotificationServicesController/processors/process-snap-notifications.cjs.map +1 -0
- package/dist/NotificationServicesController/processors/{process-snap-notifications.d.ts → process-snap-notifications.d.cts} +3 -3
- package/dist/NotificationServicesController/processors/process-snap-notifications.d.cts.map +1 -0
- package/dist/NotificationServicesController/processors/process-snap-notifications.d.mts +10 -0
- package/dist/NotificationServicesController/processors/process-snap-notifications.d.mts.map +1 -0
- package/dist/NotificationServicesController/processors/{process-snap-notifications.js → process-snap-notifications.mjs} +3 -3
- package/dist/NotificationServicesController/processors/process-snap-notifications.mjs.map +1 -0
- package/dist/NotificationServicesController/services/api-notifications.cjs +128 -0
- package/dist/NotificationServicesController/services/api-notifications.cjs.map +1 -0
- package/dist/NotificationServicesController/services/{api-notifications.d.ts → api-notifications.d.cts} +2 -2
- package/dist/NotificationServicesController/services/api-notifications.d.cts.map +1 -0
- package/dist/NotificationServicesController/services/api-notifications.d.mts +44 -0
- package/dist/NotificationServicesController/services/api-notifications.d.mts.map +1 -0
- package/dist/NotificationServicesController/services/{api-notifications.js → api-notifications.mjs} +12 -5
- package/dist/NotificationServicesController/services/api-notifications.mjs.map +1 -0
- package/dist/NotificationServicesController/services/feature-announcements.cjs +140 -0
- package/dist/NotificationServicesController/services/feature-announcements.cjs.map +1 -0
- package/dist/NotificationServicesController/services/{feature-announcements.d.ts → 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 +32 -0
- package/dist/NotificationServicesController/services/feature-announcements.d.mts.map +1 -0
- package/dist/NotificationServicesController/services/{feature-announcements.js → feature-announcements.mjs} +5 -5
- package/dist/NotificationServicesController/services/feature-announcements.mjs.map +1 -0
- package/dist/NotificationServicesController/services/notification-config-cache.cjs +61 -0
- package/dist/NotificationServicesController/services/notification-config-cache.cjs.map +1 -0
- package/dist/NotificationServicesController/services/{notification-config-cache.d.ts → notification-config-cache.d.cts} +1 -1
- package/dist/NotificationServicesController/services/notification-config-cache.d.cts.map +1 -0
- package/dist/NotificationServicesController/services/notification-config-cache.d.mts +15 -0
- package/dist/NotificationServicesController/services/notification-config-cache.d.mts.map +1 -0
- package/dist/NotificationServicesController/services/{notification-config-cache.js → notification-config-cache.mjs} +1 -1
- package/dist/NotificationServicesController/services/notification-config-cache.mjs.map +1 -0
- package/dist/NotificationServicesController/services/perp-notifications.cjs +31 -0
- package/dist/NotificationServicesController/services/perp-notifications.cjs.map +1 -0
- package/dist/NotificationServicesController/services/{perp-notifications.d.ts → perp-notifications.d.cts} +2 -2
- package/dist/NotificationServicesController/services/perp-notifications.d.cts.map +1 -0
- package/dist/NotificationServicesController/services/perp-notifications.d.mts +11 -0
- package/dist/NotificationServicesController/services/perp-notifications.d.mts.map +1 -0
- package/dist/NotificationServicesController/services/{perp-notifications.js → perp-notifications.mjs} +2 -2
- package/dist/NotificationServicesController/services/perp-notifications.mjs.map +1 -0
- 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/NotificationServicesController/types/feature-announcement/{feature-announcement.d.ts → 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 +2 -0
- package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.mjs.map +1 -0
- package/dist/NotificationServicesController/types/feature-announcement/index.cjs +3 -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 +2 -0
- package/dist/NotificationServicesController/types/feature-announcement/index.mjs.map +1 -0
- 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/NotificationServicesController/types/feature-announcement/{type-feature-announcement.d.ts → 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 +43 -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 +2 -0
- package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.mjs.map +1 -0
- 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/NotificationServicesController/types/feature-announcement/{type-links.d.ts → 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 +2 -0
- package/dist/NotificationServicesController/types/feature-announcement/type-links.mjs.map +1 -0
- package/dist/NotificationServicesController/types/index.cjs +3 -0
- package/dist/NotificationServicesController/types/index.cjs.map +1 -0
- package/dist/NotificationServicesController/types/index.d.cts +6 -0
- package/dist/NotificationServicesController/types/index.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/index.d.mts +6 -0
- package/dist/NotificationServicesController/types/index.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/index.mjs +2 -0
- package/dist/NotificationServicesController/types/index.mjs.map +1 -0
- package/dist/NotificationServicesController/types/notification/index.cjs +3 -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 +2 -0
- package/dist/NotificationServicesController/types/notification/index.mjs.map +1 -0
- package/dist/NotificationServicesController/types/notification/notification.cjs +3 -0
- package/dist/NotificationServicesController/types/notification/notification.cjs.map +1 -0
- package/dist/NotificationServicesController/types/notification/{notification.d.ts → notification.d.cts} +5 -5
- package/dist/NotificationServicesController/types/notification/notification.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/notification/notification.d.mts +22 -0
- package/dist/NotificationServicesController/types/notification/notification.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/notification/notification.mjs +2 -0
- package/dist/NotificationServicesController/types/notification/notification.mjs.map +1 -0
- package/dist/NotificationServicesController/types/notification-api/index.cjs +3 -0
- package/dist/NotificationServicesController/types/notification-api/index.cjs.map +1 -0
- package/dist/NotificationServicesController/types/notification-api/index.d.cts +3 -0
- package/dist/NotificationServicesController/types/notification-api/index.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/notification-api/index.d.mts +3 -0
- package/dist/NotificationServicesController/types/notification-api/index.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/notification-api/index.mjs +2 -0
- package/dist/NotificationServicesController/types/notification-api/index.mjs.map +1 -0
- package/dist/NotificationServicesController/types/notification-api/notification-api.cjs +4 -0
- package/dist/NotificationServicesController/types/notification-api/notification-api.cjs.map +1 -0
- package/dist/NotificationServicesController/types/notification-api/{notification-api.d.ts → notification-api.d.cts} +4 -4
- package/dist/NotificationServicesController/types/notification-api/notification-api.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/notification-api/notification-api.d.mts +59 -0
- package/dist/NotificationServicesController/types/notification-api/notification-api.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/notification-api/notification-api.mjs +2 -0
- package/dist/NotificationServicesController/types/notification-api/notification-api.mjs.map +1 -0
- package/dist/NotificationServicesController/types/notification-api/schema.cjs +6 -0
- package/dist/NotificationServicesController/types/notification-api/schema.cjs.map +1 -0
- package/dist/NotificationServicesController/types/notification-api/{schema.d.ts → schema.d.cts} +1 -1
- package/dist/NotificationServicesController/types/notification-api/schema.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/notification-api/schema.d.mts +752 -0
- package/dist/NotificationServicesController/types/notification-api/schema.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/notification-api/{schema.js → schema.mjs} +1 -1
- package/dist/NotificationServicesController/types/notification-api/schema.mjs.map +1 -0
- package/dist/NotificationServicesController/types/perps/index.cjs +3 -0
- package/dist/NotificationServicesController/types/perps/index.cjs.map +1 -0
- package/dist/NotificationServicesController/types/perps/index.d.cts +2 -0
- package/dist/NotificationServicesController/types/perps/index.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/perps/index.d.mts +2 -0
- package/dist/NotificationServicesController/types/perps/index.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/perps/index.mjs +2 -0
- package/dist/NotificationServicesController/types/perps/index.mjs.map +1 -0
- package/dist/NotificationServicesController/types/perps/perp-types.cjs +3 -0
- package/dist/NotificationServicesController/types/perps/perp-types.cjs.map +1 -0
- package/dist/NotificationServicesController/types/perps/perp-types.d.cts +3 -0
- package/dist/NotificationServicesController/types/perps/perp-types.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/perps/perp-types.d.mts +3 -0
- package/dist/NotificationServicesController/types/perps/perp-types.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/perps/perp-types.mjs +2 -0
- package/dist/NotificationServicesController/types/perps/perp-types.mjs.map +1 -0
- package/dist/NotificationServicesController/types/perps/schema.cjs +6 -0
- package/dist/NotificationServicesController/types/perps/schema.cjs.map +1 -0
- package/dist/NotificationServicesController/types/perps/{schema.d.ts → schema.d.cts} +1 -1
- package/dist/NotificationServicesController/types/perps/schema.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/perps/schema.d.mts +133 -0
- package/dist/NotificationServicesController/types/perps/schema.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/perps/{schema.js → schema.mjs} +1 -1
- package/dist/NotificationServicesController/types/perps/schema.mjs.map +1 -0
- package/dist/NotificationServicesController/types/snaps/index.cjs +3 -0
- package/dist/NotificationServicesController/types/snaps/index.cjs.map +1 -0
- package/dist/NotificationServicesController/types/snaps/index.d.cts +2 -0
- package/dist/NotificationServicesController/types/snaps/index.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/snaps/index.d.mts +2 -0
- package/dist/NotificationServicesController/types/snaps/index.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/snaps/index.mjs +2 -0
- package/dist/NotificationServicesController/types/snaps/index.mjs.map +1 -0
- package/dist/NotificationServicesController/types/snaps/snaps.cjs +3 -0
- package/dist/NotificationServicesController/types/snaps/snaps.cjs.map +1 -0
- package/dist/NotificationServicesController/types/snaps/{snaps.d.ts → snaps.d.cts} +2 -2
- package/dist/NotificationServicesController/types/snaps/snaps.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/snaps/snaps.d.mts +23 -0
- package/dist/NotificationServicesController/types/snaps/snaps.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/snaps/snaps.mjs +2 -0
- package/dist/NotificationServicesController/types/snaps/snaps.mjs.map +1 -0
- package/dist/NotificationServicesController/types/type-utils.cjs +3 -0
- package/dist/NotificationServicesController/types/type-utils.cjs.map +1 -0
- package/dist/NotificationServicesController/types/{type-utils.d.ts → 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 +2 -0
- package/dist/NotificationServicesController/types/type-utils.mjs.map +1 -0
- package/dist/NotificationServicesController/utils/get-notification-subtype.cjs +33 -0
- package/dist/NotificationServicesController/utils/get-notification-subtype.cjs.map +1 -0
- package/dist/NotificationServicesController/utils/{get-notification-subtype.d.ts → get-notification-subtype.d.cts} +2 -2
- package/dist/NotificationServicesController/utils/get-notification-subtype.d.cts.map +1 -0
- package/dist/NotificationServicesController/utils/get-notification-subtype.d.mts +17 -0
- package/dist/NotificationServicesController/utils/get-notification-subtype.d.mts.map +1 -0
- package/dist/NotificationServicesController/utils/{get-notification-subtype.js → get-notification-subtype.mjs} +3 -3
- package/dist/NotificationServicesController/utils/get-notification-subtype.mjs.map +1 -0
- package/dist/NotificationServicesController/utils/isVersionInBounds.cjs +37 -0
- package/dist/NotificationServicesController/utils/isVersionInBounds.cjs.map +1 -0
- package/dist/NotificationServicesController/utils/{isVersionInBounds.d.ts → isVersionInBounds.d.cts} +1 -1
- package/dist/NotificationServicesController/utils/isVersionInBounds.d.cts.map +1 -0
- package/dist/NotificationServicesController/utils/isVersionInBounds.d.mts +18 -0
- package/dist/NotificationServicesController/utils/isVersionInBounds.d.mts.map +1 -0
- package/dist/NotificationServicesController/utils/{isVersionInBounds.js → isVersionInBounds.mjs} +2 -2
- package/dist/NotificationServicesController/utils/isVersionInBounds.mjs.map +1 -0
- package/dist/NotificationServicesController/utils/should-auto-expire.cjs +12 -0
- package/dist/NotificationServicesController/utils/should-auto-expire.cjs.map +1 -0
- package/dist/NotificationServicesController/utils/{should-auto-expire.d.ts → should-auto-expire.d.cts} +1 -1
- package/dist/NotificationServicesController/utils/should-auto-expire.d.cts.map +1 -0
- package/dist/NotificationServicesController/utils/should-auto-expire.d.mts +2 -0
- package/dist/NotificationServicesController/utils/should-auto-expire.d.mts.map +1 -0
- package/dist/NotificationServicesController/utils/{should-auto-expire.js → should-auto-expire.mjs} +1 -1
- package/dist/NotificationServicesController/utils/should-auto-expire.mjs.map +1 -0
- package/dist/NotificationServicesController/utils/utils.cjs +25 -0
- package/dist/NotificationServicesController/utils/utils.cjs.map +1 -0
- package/dist/NotificationServicesController/utils/{utils.d.ts → utils.d.cts} +1 -1
- package/dist/NotificationServicesController/utils/utils.d.cts.map +1 -0
- package/dist/NotificationServicesController/utils/utils.d.mts +11 -0
- package/dist/NotificationServicesController/utils/utils.d.mts.map +1 -0
- package/dist/NotificationServicesController/utils/{utils.js → utils.mjs} +1 -1
- package/dist/NotificationServicesController/utils/utils.mjs.map +1 -0
- package/dist/NotificationServicesPushController/NotificationServicesPushController-method-action-types.cjs +7 -0
- package/dist/NotificationServicesPushController/NotificationServicesPushController-method-action-types.cjs.map +1 -0
- package/dist/NotificationServicesPushController/{NotificationServicesPushController-method-action-types.d.ts → NotificationServicesPushController-method-action-types.d.cts} +2 -2
- package/dist/NotificationServicesPushController/NotificationServicesPushController-method-action-types.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/NotificationServicesPushController-method-action-types.d.mts +72 -0
- package/dist/NotificationServicesPushController/NotificationServicesPushController-method-action-types.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/{NotificationServicesPushController-method-action-types.js → NotificationServicesPushController-method-action-types.mjs} +1 -1
- package/dist/NotificationServicesPushController/NotificationServicesPushController-method-action-types.mjs.map +1 -0
- package/dist/NotificationServicesPushController/NotificationServicesPushController.cjs +342 -0
- package/dist/NotificationServicesPushController/NotificationServicesPushController.cjs.map +1 -0
- package/dist/NotificationServicesPushController/{NotificationServicesPushController.d.ts → NotificationServicesPushController.d.cts} +9 -9
- package/dist/NotificationServicesPushController/NotificationServicesPushController.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/NotificationServicesPushController.d.mts +123 -0
- package/dist/NotificationServicesPushController/NotificationServicesPushController.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/{NotificationServicesPushController.js → NotificationServicesPushController.mjs} +11 -4
- package/dist/NotificationServicesPushController/NotificationServicesPushController.mjs.map +1 -0
- package/dist/NotificationServicesPushController/index.cjs +37 -0
- package/dist/NotificationServicesPushController/index.cjs.map +1 -0
- package/dist/NotificationServicesPushController/{index.d.ts → index.d.cts} +9 -9
- 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 +8 -0
- package/dist/NotificationServicesPushController/index.mjs.map +1 -0
- package/dist/NotificationServicesPushController/mocks/index.cjs +18 -0
- package/dist/NotificationServicesPushController/mocks/index.cjs.map +1 -0
- package/dist/NotificationServicesPushController/mocks/index.d.cts +2 -0
- package/dist/NotificationServicesPushController/mocks/index.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/mocks/index.d.mts +2 -0
- package/dist/NotificationServicesPushController/mocks/index.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/mocks/index.mjs +2 -0
- package/dist/NotificationServicesPushController/mocks/index.mjs.map +1 -0
- package/dist/NotificationServicesPushController/mocks/mockResponse.cjs +48 -0
- package/dist/NotificationServicesPushController/mocks/mockResponse.cjs.map +1 -0
- package/dist/NotificationServicesPushController/mocks/{mockResponse.d.ts → mockResponse.d.cts} +1 -1
- package/dist/NotificationServicesPushController/mocks/mockResponse.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/mocks/mockResponse.d.mts +22 -0
- package/dist/NotificationServicesPushController/mocks/mockResponse.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/mocks/{mockResponse.js → mockResponse.mjs} +2 -2
- package/dist/NotificationServicesPushController/mocks/mockResponse.mjs.map +1 -0
- package/dist/NotificationServicesPushController/services/endpoints.cjs +13 -0
- package/dist/NotificationServicesPushController/services/endpoints.cjs.map +1 -0
- package/dist/NotificationServicesPushController/services/{endpoints.d.ts → endpoints.d.cts} +1 -1
- package/dist/NotificationServicesPushController/services/endpoints.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/services/endpoints.d.mts +4 -0
- package/dist/NotificationServicesPushController/services/endpoints.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/services/{endpoints.js → endpoints.mjs} +1 -1
- package/dist/NotificationServicesPushController/services/endpoints.mjs.map +1 -0
- package/dist/NotificationServicesPushController/services/services.cjs +133 -0
- package/dist/NotificationServicesPushController/services/services.cjs.map +1 -0
- package/dist/NotificationServicesPushController/services/{services.d.ts → services.d.cts} +4 -4
- package/dist/NotificationServicesPushController/services/services.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/services/services.d.mts +90 -0
- package/dist/NotificationServicesPushController/services/services.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/services/{services.js → services.mjs} +2 -2
- package/dist/NotificationServicesPushController/services/services.mjs.map +1 -0
- package/dist/NotificationServicesPushController/types/firebase.cjs +3 -0
- package/dist/NotificationServicesPushController/types/firebase.cjs.map +1 -0
- package/dist/NotificationServicesPushController/types/{firebase.d.ts → 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 +2 -0
- package/dist/NotificationServicesPushController/types/firebase.mjs.map +1 -0
- package/dist/NotificationServicesPushController/types/index.cjs +3 -0
- package/dist/NotificationServicesPushController/types/index.cjs.map +1 -0
- package/dist/NotificationServicesPushController/types/index.d.cts +4 -0
- package/dist/NotificationServicesPushController/types/index.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/types/index.d.mts +4 -0
- package/dist/NotificationServicesPushController/types/index.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/types/index.mjs +2 -0
- package/dist/NotificationServicesPushController/types/index.mjs.map +1 -0
- package/dist/NotificationServicesPushController/types/push-analytics.cjs +5 -0
- package/dist/NotificationServicesPushController/types/push-analytics.cjs.map +1 -0
- package/dist/NotificationServicesPushController/types/{push-analytics.d.ts → push-analytics.d.cts} +1 -1
- package/dist/NotificationServicesPushController/types/push-analytics.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/types/push-analytics.d.mts +18 -0
- package/dist/NotificationServicesPushController/types/push-analytics.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/types/{push-analytics.js → push-analytics.mjs} +1 -1
- package/dist/NotificationServicesPushController/types/push-analytics.mjs.map +1 -0
- package/dist/NotificationServicesPushController/types/push-service-interface.cjs +3 -0
- package/dist/NotificationServicesPushController/types/push-service-interface.cjs.map +1 -0
- package/dist/NotificationServicesPushController/types/{push-service-interface.d.ts → push-service-interface.d.cts} +2 -2
- package/dist/NotificationServicesPushController/types/push-service-interface.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/types/push-service-interface.d.mts +30 -0
- package/dist/NotificationServicesPushController/types/push-service-interface.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/types/push-service-interface.mjs +2 -0
- package/dist/NotificationServicesPushController/types/push-service-interface.mjs.map +1 -0
- package/dist/NotificationServicesPushController/utils/get-notification-data.cjs +84 -0
- package/dist/NotificationServicesPushController/utils/get-notification-data.cjs.map +1 -0
- package/dist/NotificationServicesPushController/utils/{get-notification-data.d.ts → 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.js → get-notification-data.mjs} +2 -2
- package/dist/NotificationServicesPushController/utils/get-notification-data.mjs.map +1 -0
- package/dist/NotificationServicesPushController/utils/get-notification-message.cjs +171 -0
- package/dist/NotificationServicesPushController/utils/get-notification-message.cjs.map +1 -0
- package/dist/NotificationServicesPushController/utils/{get-notification-message.d.ts → 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 +62 -0
- package/dist/NotificationServicesPushController/utils/get-notification-message.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/utils/{get-notification-message.js → get-notification-message.mjs} +2 -2
- package/dist/NotificationServicesPushController/utils/get-notification-message.mjs.map +1 -0
- package/dist/NotificationServicesPushController/utils/index.cjs +20 -0
- package/dist/NotificationServicesPushController/utils/index.cjs.map +1 -0
- package/dist/NotificationServicesPushController/utils/index.d.cts +4 -0
- package/dist/NotificationServicesPushController/utils/index.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/utils/index.d.mts +4 -0
- package/dist/NotificationServicesPushController/utils/index.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/utils/index.mjs +4 -0
- package/dist/NotificationServicesPushController/utils/index.mjs.map +1 -0
- package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.cjs +26 -0
- package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.cjs.map +1 -0
- package/dist/NotificationServicesPushController/utils/{to-push-analytics-payload.d.ts → to-push-analytics-payload.d.cts} +2 -2
- package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.d.mts +12 -0
- package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/utils/{to-push-analytics-payload.js → to-push-analytics-payload.mjs} +1 -1
- package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.mjs.map +1 -0
- package/dist/NotificationServicesPushController/web/index.cjs +8 -0
- package/dist/NotificationServicesPushController/web/index.cjs.map +1 -0
- package/dist/NotificationServicesPushController/web/index.d.cts +2 -0
- package/dist/NotificationServicesPushController/web/index.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/web/index.d.mts +2 -0
- package/dist/NotificationServicesPushController/web/index.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/web/index.mjs +2 -0
- package/dist/NotificationServicesPushController/web/index.mjs.map +1 -0
- package/dist/NotificationServicesPushController/web/push-utils.cjs +169 -0
- package/dist/NotificationServicesPushController/web/push-utils.cjs.map +1 -0
- package/dist/NotificationServicesPushController/web/{push-utils.d.ts → push-utils.d.cts} +5 -4
- package/dist/NotificationServicesPushController/web/push-utils.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/web/push-utils.d.mts +37 -0
- package/dist/NotificationServicesPushController/web/push-utils.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/web/{push-utils.js → push-utils.mjs} +13 -6
- package/dist/NotificationServicesPushController/web/push-utils.mjs.map +1 -0
- package/dist/index.cjs +34 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +4 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +4 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +4 -0
- package/dist/index.mjs.map +1 -0
- package/dist/shared/index.cjs +20 -0
- package/dist/shared/index.cjs.map +1 -0
- package/dist/shared/index.d.cts +4 -0
- package/dist/shared/index.d.cts.map +1 -0
- package/dist/shared/index.d.mts +4 -0
- package/dist/shared/index.d.mts.map +1 -0
- package/dist/shared/index.mjs +4 -0
- package/dist/shared/index.mjs.map +1 -0
- package/dist/shared/is-onchain-notification.cjs +15 -0
- package/dist/shared/is-onchain-notification.cjs.map +1 -0
- package/dist/shared/{is-onchain-notification.d.ts → is-onchain-notification.d.cts} +2 -2
- package/dist/shared/is-onchain-notification.d.cts.map +1 -0
- package/dist/shared/is-onchain-notification.d.mts +9 -0
- package/dist/shared/is-onchain-notification.d.mts.map +1 -0
- package/dist/shared/{is-onchain-notification.js → is-onchain-notification.mjs} +2 -2
- package/dist/shared/is-onchain-notification.mjs.map +1 -0
- package/dist/shared/notification-api-type-guards.cjs +24 -0
- package/dist/shared/notification-api-type-guards.cjs.map +1 -0
- package/dist/shared/{notification-api-type-guards.d.ts → notification-api-type-guards.d.cts} +2 -2
- package/dist/shared/notification-api-type-guards.d.cts.map +1 -0
- package/dist/shared/notification-api-type-guards.d.mts +16 -0
- package/dist/shared/notification-api-type-guards.d.mts.map +1 -0
- package/dist/shared/{notification-api-type-guards.js → notification-api-type-guards.mjs} +1 -1
- package/dist/shared/notification-api-type-guards.mjs.map +1 -0
- package/dist/shared/to-raw-notification.cjs +30 -0
- package/dist/shared/to-raw-notification.cjs.map +1 -0
- package/dist/shared/{to-raw-notification.d.ts → 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.js → to-raw-notification.mjs} +3 -3
- package/dist/shared/to-raw-notification.mjs.map +1 -0
- package/package.json +58 -24
- package/dist/NotificationServicesController/NotificationServicesController-method-action-types.d.ts.map +0 -1
- package/dist/NotificationServicesController/NotificationServicesController-method-action-types.js.map +0 -1
- package/dist/NotificationServicesController/NotificationServicesController.d.ts.map +0 -1
- package/dist/NotificationServicesController/NotificationServicesController.js.map +0 -1
- package/dist/NotificationServicesController/constants/index.d.ts +0 -2
- package/dist/NotificationServicesController/constants/index.d.ts.map +0 -1
- package/dist/NotificationServicesController/constants/index.js +0 -2
- package/dist/NotificationServicesController/constants/index.js.map +0 -1
- package/dist/NotificationServicesController/constants/notification-schema.d.ts.map +0 -1
- package/dist/NotificationServicesController/constants/notification-schema.js.map +0 -1
- package/dist/NotificationServicesController/index.d.ts.map +0 -1
- package/dist/NotificationServicesController/index.js +0 -13
- package/dist/NotificationServicesController/index.js.map +0 -1
- package/dist/NotificationServicesController/mocks/index.d.ts +0 -5
- package/dist/NotificationServicesController/mocks/index.d.ts.map +0 -1
- package/dist/NotificationServicesController/mocks/index.js +0 -5
- package/dist/NotificationServicesController/mocks/index.js.map +0 -1
- package/dist/NotificationServicesController/mocks/mock-feature-announcements.d.ts.map +0 -1
- package/dist/NotificationServicesController/mocks/mock-feature-announcements.js.map +0 -1
- package/dist/NotificationServicesController/mocks/mock-raw-notifications.d.ts.map +0 -1
- package/dist/NotificationServicesController/mocks/mock-raw-notifications.js.map +0 -1
- package/dist/NotificationServicesController/mocks/mock-snap-notification.d.ts.map +0 -1
- package/dist/NotificationServicesController/mocks/mock-snap-notification.js.map +0 -1
- package/dist/NotificationServicesController/mocks/mockResponses.d.ts.map +0 -1
- package/dist/NotificationServicesController/mocks/mockResponses.js.map +0 -1
- package/dist/NotificationServicesController/processors/index.d.ts +0 -4
- package/dist/NotificationServicesController/processors/index.d.ts.map +0 -1
- package/dist/NotificationServicesController/processors/index.js +0 -4
- package/dist/NotificationServicesController/processors/index.js.map +0 -1
- package/dist/NotificationServicesController/processors/process-api-notifications.d.ts.map +0 -1
- package/dist/NotificationServicesController/processors/process-api-notifications.js.map +0 -1
- package/dist/NotificationServicesController/processors/process-feature-announcement.d.ts.map +0 -1
- package/dist/NotificationServicesController/processors/process-feature-announcement.js.map +0 -1
- package/dist/NotificationServicesController/processors/process-notifications.d.ts.map +0 -1
- package/dist/NotificationServicesController/processors/process-notifications.js.map +0 -1
- package/dist/NotificationServicesController/processors/process-snap-notifications.d.ts.map +0 -1
- package/dist/NotificationServicesController/processors/process-snap-notifications.js.map +0 -1
- package/dist/NotificationServicesController/services/api-notifications.d.ts.map +0 -1
- package/dist/NotificationServicesController/services/api-notifications.js.map +0 -1
- package/dist/NotificationServicesController/services/feature-announcements.d.ts.map +0 -1
- package/dist/NotificationServicesController/services/feature-announcements.js.map +0 -1
- package/dist/NotificationServicesController/services/notification-config-cache.d.ts.map +0 -1
- package/dist/NotificationServicesController/services/notification-config-cache.js.map +0 -1
- package/dist/NotificationServicesController/services/perp-notifications.d.ts.map +0 -1
- package/dist/NotificationServicesController/services/perp-notifications.js.map +0 -1
- package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.d.ts.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.d.ts +0 -4
- package/dist/NotificationServicesController/types/feature-announcement/index.d.ts.map +0 -1
- package/dist/NotificationServicesController/types/feature-announcement/index.js +0 -2
- package/dist/NotificationServicesController/types/feature-announcement/index.js.map +0 -1
- package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.d.ts.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.d.ts.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.d.ts +0 -6
- package/dist/NotificationServicesController/types/index.d.ts.map +0 -1
- package/dist/NotificationServicesController/types/index.js +0 -2
- package/dist/NotificationServicesController/types/index.js.map +0 -1
- package/dist/NotificationServicesController/types/notification/index.d.ts +0 -2
- package/dist/NotificationServicesController/types/notification/index.d.ts.map +0 -1
- package/dist/NotificationServicesController/types/notification/index.js +0 -2
- package/dist/NotificationServicesController/types/notification/index.js.map +0 -1
- package/dist/NotificationServicesController/types/notification/notification.d.ts.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/notification-api/index.d.ts +0 -3
- package/dist/NotificationServicesController/types/notification-api/index.d.ts.map +0 -1
- package/dist/NotificationServicesController/types/notification-api/index.js +0 -2
- package/dist/NotificationServicesController/types/notification-api/index.js.map +0 -1
- package/dist/NotificationServicesController/types/notification-api/notification-api.d.ts.map +0 -1
- package/dist/NotificationServicesController/types/notification-api/notification-api.js +0 -2
- package/dist/NotificationServicesController/types/notification-api/notification-api.js.map +0 -1
- package/dist/NotificationServicesController/types/notification-api/schema.d.ts.map +0 -1
- package/dist/NotificationServicesController/types/notification-api/schema.js.map +0 -1
- package/dist/NotificationServicesController/types/perps/index.d.ts +0 -2
- package/dist/NotificationServicesController/types/perps/index.d.ts.map +0 -1
- package/dist/NotificationServicesController/types/perps/index.js +0 -2
- package/dist/NotificationServicesController/types/perps/index.js.map +0 -1
- package/dist/NotificationServicesController/types/perps/perp-types.d.ts +0 -3
- package/dist/NotificationServicesController/types/perps/perp-types.d.ts.map +0 -1
- package/dist/NotificationServicesController/types/perps/perp-types.js +0 -2
- package/dist/NotificationServicesController/types/perps/perp-types.js.map +0 -1
- package/dist/NotificationServicesController/types/perps/schema.d.ts.map +0 -1
- package/dist/NotificationServicesController/types/perps/schema.js.map +0 -1
- package/dist/NotificationServicesController/types/snaps/index.d.ts +0 -2
- package/dist/NotificationServicesController/types/snaps/index.d.ts.map +0 -1
- package/dist/NotificationServicesController/types/snaps/index.js +0 -2
- package/dist/NotificationServicesController/types/snaps/index.js.map +0 -1
- package/dist/NotificationServicesController/types/snaps/snaps.d.ts.map +0 -1
- package/dist/NotificationServicesController/types/snaps/snaps.js +0 -2
- package/dist/NotificationServicesController/types/snaps/snaps.js.map +0 -1
- package/dist/NotificationServicesController/types/type-utils.d.ts.map +0 -1
- package/dist/NotificationServicesController/types/type-utils.js +0 -2
- package/dist/NotificationServicesController/types/type-utils.js.map +0 -1
- package/dist/NotificationServicesController/utils/get-notification-subtype.d.ts.map +0 -1
- package/dist/NotificationServicesController/utils/get-notification-subtype.js.map +0 -1
- package/dist/NotificationServicesController/utils/isVersionInBounds.d.ts.map +0 -1
- package/dist/NotificationServicesController/utils/isVersionInBounds.js.map +0 -1
- package/dist/NotificationServicesController/utils/should-auto-expire.d.ts.map +0 -1
- package/dist/NotificationServicesController/utils/should-auto-expire.js.map +0 -1
- package/dist/NotificationServicesController/utils/utils.d.ts.map +0 -1
- package/dist/NotificationServicesController/utils/utils.js.map +0 -1
- package/dist/NotificationServicesPushController/NotificationServicesPushController-method-action-types.d.ts.map +0 -1
- package/dist/NotificationServicesPushController/NotificationServicesPushController-method-action-types.js.map +0 -1
- package/dist/NotificationServicesPushController/NotificationServicesPushController.d.ts.map +0 -1
- package/dist/NotificationServicesPushController/NotificationServicesPushController.js.map +0 -1
- package/dist/NotificationServicesPushController/index.d.ts.map +0 -1
- package/dist/NotificationServicesPushController/index.js +0 -8
- package/dist/NotificationServicesPushController/index.js.map +0 -1
- package/dist/NotificationServicesPushController/mocks/index.d.ts +0 -2
- package/dist/NotificationServicesPushController/mocks/index.d.ts.map +0 -1
- package/dist/NotificationServicesPushController/mocks/index.js +0 -2
- package/dist/NotificationServicesPushController/mocks/index.js.map +0 -1
- package/dist/NotificationServicesPushController/mocks/mockResponse.d.ts.map +0 -1
- package/dist/NotificationServicesPushController/mocks/mockResponse.js.map +0 -1
- package/dist/NotificationServicesPushController/services/endpoints.d.ts.map +0 -1
- package/dist/NotificationServicesPushController/services/endpoints.js.map +0 -1
- package/dist/NotificationServicesPushController/services/services.d.ts.map +0 -1
- package/dist/NotificationServicesPushController/services/services.js.map +0 -1
- package/dist/NotificationServicesPushController/types/firebase.d.ts.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.d.ts +0 -4
- package/dist/NotificationServicesPushController/types/index.d.ts.map +0 -1
- package/dist/NotificationServicesPushController/types/index.js +0 -2
- package/dist/NotificationServicesPushController/types/index.js.map +0 -1
- package/dist/NotificationServicesPushController/types/push-analytics.d.ts.map +0 -1
- package/dist/NotificationServicesPushController/types/push-analytics.js.map +0 -1
- package/dist/NotificationServicesPushController/types/push-service-interface.d.ts.map +0 -1
- package/dist/NotificationServicesPushController/types/push-service-interface.js +0 -2
- package/dist/NotificationServicesPushController/types/push-service-interface.js.map +0 -1
- package/dist/NotificationServicesPushController/utils/get-notification-data.d.ts.map +0 -1
- package/dist/NotificationServicesPushController/utils/get-notification-data.js.map +0 -1
- package/dist/NotificationServicesPushController/utils/get-notification-message.d.ts.map +0 -1
- package/dist/NotificationServicesPushController/utils/get-notification-message.js.map +0 -1
- package/dist/NotificationServicesPushController/utils/index.d.ts +0 -4
- package/dist/NotificationServicesPushController/utils/index.d.ts.map +0 -1
- package/dist/NotificationServicesPushController/utils/index.js +0 -4
- package/dist/NotificationServicesPushController/utils/index.js.map +0 -1
- package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.d.ts.map +0 -1
- package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.js.map +0 -1
- package/dist/NotificationServicesPushController/web/index.d.ts +0 -2
- package/dist/NotificationServicesPushController/web/index.d.ts.map +0 -1
- package/dist/NotificationServicesPushController/web/index.js +0 -2
- package/dist/NotificationServicesPushController/web/index.js.map +0 -1
- package/dist/NotificationServicesPushController/web/push-utils.d.ts.map +0 -1
- package/dist/NotificationServicesPushController/web/push-utils.js.map +0 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -4
- package/dist/index.js.map +0 -1
- package/dist/shared/index.d.ts +0 -4
- package/dist/shared/index.d.ts.map +0 -1
- package/dist/shared/index.js +0 -4
- package/dist/shared/index.js.map +0 -1
- package/dist/shared/is-onchain-notification.d.ts.map +0 -1
- package/dist/shared/is-onchain-notification.js.map +0 -1
- package/dist/shared/notification-api-type-guards.d.ts.map +0 -1
- package/dist/shared/notification-api-type-guards.js.map +0 -1
- package/dist/shared/to-raw-notification.d.ts.map +0 -1
- package/dist/shared/to-raw-notification.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/index.ts"],"names":[],"mappings":"AAAA,mDAAkD;AAClD,4CAA2C;AAC3C,gDAA+C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/index.ts"],"names":[],"mappings":"AAAA,mDAAkD;AAClD,4CAA2C;AAC3C,gDAA+C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/index.ts"],"names":[],"mappings":"AAAA,mDAAkD;AAClD,4CAA2C;AAC3C,gDAA+C","sourcesContent":["export * from './process-feature-announcement.js';\nexport * from './process-notifications.js';\nexport * from './process-api-notifications.js';\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.processAPINotifications = void 0;
|
|
4
|
+
const get_notification_subtype_js_1 = require("../utils/get-notification-subtype.cjs");
|
|
5
|
+
const should_auto_expire_js_1 = require("../utils/should-auto-expire.cjs");
|
|
6
|
+
/**
|
|
7
|
+
* Processes API notifications to a normalized INotification shape
|
|
8
|
+
*
|
|
9
|
+
* @param notification - API Notification (On-Chain or Platform Notification)
|
|
10
|
+
* @returns Normalized Notification
|
|
11
|
+
*/
|
|
12
|
+
function processAPINotifications(notification) {
|
|
13
|
+
const createdAtDate = new Date(notification.created_at);
|
|
14
|
+
const expired = (0, should_auto_expire_js_1.shouldAutoExpire)(createdAtDate);
|
|
15
|
+
return {
|
|
16
|
+
...notification,
|
|
17
|
+
id: notification.id,
|
|
18
|
+
notification_subtype: (0, get_notification_subtype_js_1.getNotificationSubtype)(notification),
|
|
19
|
+
createdAt: createdAtDate.toISOString(),
|
|
20
|
+
isRead: expired || !notification.unread,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
exports.processAPINotifications = processAPINotifications;
|
|
24
|
+
//# sourceMappingURL=process-api-notifications.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-api-notifications.cjs","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/process-api-notifications.ts"],"names":[],"mappings":";;;AAEA,uFAA8E;AAC9E,2EAAkE;AAElE;;;;;GAKG;AACH,SAAgB,uBAAuB,CACrC,YAAuC;IAEvC,MAAM,aAAa,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;IACxD,MAAM,OAAO,GAAG,IAAA,wCAAgB,EAAC,aAAa,CAAC,CAAC;IAEhD,OAAO;QACL,GAAG,YAAY;QACf,EAAE,EAAE,YAAY,CAAC,EAAE;QACnB,oBAAoB,EAAE,IAAA,oDAAsB,EAAC,YAAY,CAAC;QAC1D,SAAS,EAAE,aAAa,CAAC,WAAW,EAAE;QACtC,MAAM,EAAE,OAAO,IAAI,CAAC,YAAY,CAAC,MAAM;KACxC,CAAC;AACJ,CAAC;AAbD,0DAaC","sourcesContent":["import type { NormalisedAPINotification } from '../types/notification-api/notification-api.js';\nimport type { INotification } from '../types/notification/notification.js';\nimport { getNotificationSubtype } from '../utils/get-notification-subtype.js';\nimport { shouldAutoExpire } from '../utils/should-auto-expire.js';\n\n/**\n * Processes API notifications to a normalized INotification shape\n *\n * @param notification - API Notification (On-Chain or Platform Notification)\n * @returns Normalized Notification\n */\nexport function processAPINotifications(\n notification: NormalisedAPINotification,\n): INotification {\n const createdAtDate = new Date(notification.created_at);\n const expired = shouldAutoExpire(createdAtDate);\n\n return {\n ...notification,\n id: notification.id,\n notification_subtype: getNotificationSubtype(notification),\n createdAt: createdAtDate.toISOString(),\n isRead: expired || !notification.unread,\n };\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { NormalisedAPINotification } from
|
|
2
|
-
import type { INotification } from
|
|
1
|
+
import type { NormalisedAPINotification } from "../types/notification-api/notification-api.cjs";
|
|
2
|
+
import type { INotification } from "../types/notification/notification.cjs";
|
|
3
3
|
/**
|
|
4
4
|
* Processes API notifications to a normalized INotification shape
|
|
5
5
|
*
|
|
@@ -7,4 +7,4 @@ import type { INotification } from '../types/notification/notification.js';
|
|
|
7
7
|
* @returns Normalized Notification
|
|
8
8
|
*/
|
|
9
9
|
export declare function processAPINotifications(notification: NormalisedAPINotification): INotification;
|
|
10
|
-
//# sourceMappingURL=process-api-notifications.d.
|
|
10
|
+
//# sourceMappingURL=process-api-notifications.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-api-notifications.d.cts","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/process-api-notifications.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,uDAAsD;AAC/F,OAAO,KAAK,EAAE,aAAa,EAAE,+CAA8C;AAI3E;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,YAAY,EAAE,yBAAyB,GACtC,aAAa,CAWf"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { NormalisedAPINotification } from "../types/notification-api/notification-api.mjs";
|
|
2
|
+
import type { INotification } from "../types/notification/notification.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* Processes API notifications to a normalized INotification shape
|
|
5
|
+
*
|
|
6
|
+
* @param notification - API Notification (On-Chain or Platform Notification)
|
|
7
|
+
* @returns Normalized Notification
|
|
8
|
+
*/
|
|
9
|
+
export declare function processAPINotifications(notification: NormalisedAPINotification): INotification;
|
|
10
|
+
//# sourceMappingURL=process-api-notifications.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-api-notifications.d.mts","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/process-api-notifications.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,uDAAsD;AAC/F,OAAO,KAAK,EAAE,aAAa,EAAE,+CAA8C;AAI3E;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,YAAY,EAAE,yBAAyB,GACtC,aAAa,CAWf"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getNotificationSubtype } from
|
|
2
|
-
import { shouldAutoExpire } from
|
|
1
|
+
import { getNotificationSubtype } from "../utils/get-notification-subtype.mjs";
|
|
2
|
+
import { shouldAutoExpire } from "../utils/should-auto-expire.mjs";
|
|
3
3
|
/**
|
|
4
4
|
* Processes API notifications to a normalized INotification shape
|
|
5
5
|
*
|
|
@@ -17,4 +17,4 @@ export function processAPINotifications(notification) {
|
|
|
17
17
|
isRead: expired || !notification.unread,
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
//# sourceMappingURL=process-api-notifications.
|
|
20
|
+
//# sourceMappingURL=process-api-notifications.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-api-notifications.mjs","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/process-api-notifications.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,8CAA6C;AAC9E,OAAO,EAAE,gBAAgB,EAAE,wCAAuC;AAElE;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CACrC,YAAuC;IAEvC,MAAM,aAAa,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;IACxD,MAAM,OAAO,GAAG,gBAAgB,CAAC,aAAa,CAAC,CAAC;IAEhD,OAAO;QACL,GAAG,YAAY;QACf,EAAE,EAAE,YAAY,CAAC,EAAE;QACnB,oBAAoB,EAAE,sBAAsB,CAAC,YAAY,CAAC;QAC1D,SAAS,EAAE,aAAa,CAAC,WAAW,EAAE;QACtC,MAAM,EAAE,OAAO,IAAI,CAAC,YAAY,CAAC,MAAM;KACxC,CAAC;AACJ,CAAC","sourcesContent":["import type { NormalisedAPINotification } from '../types/notification-api/notification-api.js';\nimport type { INotification } from '../types/notification/notification.js';\nimport { getNotificationSubtype } from '../utils/get-notification-subtype.js';\nimport { shouldAutoExpire } from '../utils/should-auto-expire.js';\n\n/**\n * Processes API notifications to a normalized INotification shape\n *\n * @param notification - API Notification (On-Chain or Platform Notification)\n * @returns Normalized Notification\n */\nexport function processAPINotifications(\n notification: NormalisedAPINotification,\n): INotification {\n const createdAtDate = new Date(notification.created_at);\n const expired = shouldAutoExpire(createdAtDate);\n\n return {\n ...notification,\n id: notification.id,\n notification_subtype: getNotificationSubtype(notification),\n createdAt: createdAtDate.toISOString(),\n isRead: expired || !notification.unread,\n };\n}\n"]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.processFeatureAnnouncement = exports.isFeatureAnnouncementRead = void 0;
|
|
4
|
+
const get_notification_subtype_js_1 = require("../utils/get-notification-subtype.cjs");
|
|
5
|
+
const should_auto_expire_js_1 = require("../utils/should-auto-expire.cjs");
|
|
6
|
+
/**
|
|
7
|
+
* Checks if a feature announcement should be read.
|
|
8
|
+
* Checks feature announcement state (from param), as well as if the notification is "expired"
|
|
9
|
+
*
|
|
10
|
+
* @param notification - notification to check
|
|
11
|
+
* @param readPlatformNotificationsList - list of read notifications
|
|
12
|
+
* @returns boolean if notification should be marked as read or unread
|
|
13
|
+
*/
|
|
14
|
+
function isFeatureAnnouncementRead(notification, readPlatformNotificationsList) {
|
|
15
|
+
if (readPlatformNotificationsList.includes(notification.id)) {
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
return (0, should_auto_expire_js_1.shouldAutoExpire)(new Date(notification.createdAt));
|
|
19
|
+
}
|
|
20
|
+
exports.isFeatureAnnouncementRead = isFeatureAnnouncementRead;
|
|
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
|
+
function processFeatureAnnouncement(notification) {
|
|
28
|
+
return {
|
|
29
|
+
type: notification.type,
|
|
30
|
+
id: notification.data.id,
|
|
31
|
+
notification_subtype: (0, get_notification_subtype_js_1.getNotificationSubtype)(notification),
|
|
32
|
+
createdAt: new Date(notification.createdAt).toISOString(),
|
|
33
|
+
data: notification.data,
|
|
34
|
+
isRead: false,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
exports.processFeatureAnnouncement = processFeatureAnnouncement;
|
|
38
|
+
//# sourceMappingURL=process-feature-announcement.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-feature-announcement.cjs","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/process-feature-announcement.ts"],"names":[],"mappings":";;;AAEA,uFAA8E;AAC9E,2EAAkE;AAElE;;;;;;;GAOG;AACH,SAAgB,yBAAyB,CACvC,YAAqD,EACrD,6BAAuC;IAEvC,IAAI,6BAA6B,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,EAAE,CAAC;QAC5D,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,IAAA,wCAAgB,EAAC,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,oBAAoB,EAAE,IAAA,oDAAsB,EAAC,YAAY,CAAC;QAC1D,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;AAXD,gEAWC","sourcesContent":["import type { FeatureAnnouncementRawNotification } from '../types/feature-announcement/feature-announcement.js';\nimport type { INotification } from '../types/notification/notification.js';\nimport { getNotificationSubtype } from '../utils/get-notification-subtype.js';\nimport { shouldAutoExpire } from '../utils/should-auto-expire.js';\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 notification_subtype: getNotificationSubtype(notification),\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,+DAA8D;AAChH,OAAO,KAAK,EAAE,aAAa,EAAE,+CAA8C;AAI3E;;;;;;;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,CASf"}
|
|
@@ -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,+DAA8D;AAChH,OAAO,KAAK,EAAE,aAAa,EAAE,+CAA8C;AAI3E;;;;;;;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,CASf"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getNotificationSubtype } from
|
|
2
|
-
import { shouldAutoExpire } from
|
|
1
|
+
import { getNotificationSubtype } from "../utils/get-notification-subtype.mjs";
|
|
2
|
+
import { shouldAutoExpire } from "../utils/should-auto-expire.mjs";
|
|
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"
|
|
@@ -30,4 +30,4 @@ export function processFeatureAnnouncement(notification) {
|
|
|
30
30
|
isRead: false,
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
-
//# sourceMappingURL=process-feature-announcement.
|
|
33
|
+
//# sourceMappingURL=process-feature-announcement.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-feature-announcement.mjs","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/process-feature-announcement.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,8CAA6C;AAC9E,OAAO,EAAE,gBAAgB,EAAE,wCAAuC;AAElE;;;;;;;GAOG;AACH,MAAM,UAAU,yBAAyB,CACvC,YAAqD,EACrD,6BAAuC;IAEvC,IAAI,6BAA6B,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,EAAE,CAAC;QAC5D,OAAO,IAAI,CAAC;IACd,CAAC;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,oBAAoB,EAAE,sBAAsB,CAAC,YAAY,CAAC;QAC1D,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.js';\nimport type { INotification } from '../types/notification/notification.js';\nimport { getNotificationSubtype } from '../utils/get-notification-subtype.js';\nimport { shouldAutoExpire } from '../utils/should-auto-expire.js';\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 notification_subtype: getNotificationSubtype(notification),\n createdAt: new Date(notification.createdAt).toISOString(),\n data: notification.data,\n isRead: false,\n };\n}\n"]}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.processAndFilterNotifications = exports.safeProcessNotification = exports.processNotification = void 0;
|
|
4
|
+
const notification_schema_js_1 = require("../constants/notification-schema.cjs");
|
|
5
|
+
const process_api_notifications_js_1 = require("./process-api-notifications.cjs");
|
|
6
|
+
const process_feature_announcement_js_1 = require("./process-feature-announcement.cjs");
|
|
7
|
+
const process_snap_notifications_js_1 = require("./process-snap-notifications.cjs");
|
|
8
|
+
const isAPINotification = (notification) => notification_schema_js_1.NOTIFICATION_API_TRIGGER_TYPES_SET.has(notification.type);
|
|
9
|
+
const isFeatureAnnouncement = (notification) => notification.type === notification_schema_js_1.TRIGGER_TYPES.FEATURES_ANNOUNCEMENT;
|
|
10
|
+
const isSnapNotification = (notification) => notification.type === notification_schema_js_1.TRIGGER_TYPES.SNAP;
|
|
11
|
+
/**
|
|
12
|
+
* Process feature announcement and wallet notifications into a shared/normalised notification shape.
|
|
13
|
+
* We can still differentiate notifications by the `type` property
|
|
14
|
+
*
|
|
15
|
+
* @param notification - a feature announcement or on chain notification
|
|
16
|
+
* @param readNotifications - all read notifications currently
|
|
17
|
+
* @returns a processed notification
|
|
18
|
+
*/
|
|
19
|
+
function processNotification(notification, readNotifications = []) {
|
|
20
|
+
const exhaustedAllCases = (_uncheckedCase) => {
|
|
21
|
+
const type = notification?.type;
|
|
22
|
+
throw new Error(`No processor found for notification kind ${type}`);
|
|
23
|
+
};
|
|
24
|
+
if (isFeatureAnnouncement(notification)) {
|
|
25
|
+
const processedNotification = (0, process_feature_announcement_js_1.processFeatureAnnouncement)(notification);
|
|
26
|
+
processedNotification.isRead = (0, process_feature_announcement_js_1.isFeatureAnnouncementRead)(processedNotification, readNotifications);
|
|
27
|
+
return processedNotification;
|
|
28
|
+
}
|
|
29
|
+
if (isSnapNotification(notification)) {
|
|
30
|
+
return (0, process_snap_notifications_js_1.processSnapNotification)(notification);
|
|
31
|
+
}
|
|
32
|
+
if (isAPINotification(notification)) {
|
|
33
|
+
return (0, process_api_notifications_js_1.processAPINotifications)(notification);
|
|
34
|
+
}
|
|
35
|
+
return exhaustedAllCases(notification);
|
|
36
|
+
}
|
|
37
|
+
exports.processNotification = processNotification;
|
|
38
|
+
/**
|
|
39
|
+
* Safe version of processing a notification. Rather than throwing an error if failed to process, it will return the Notification or undefined
|
|
40
|
+
*
|
|
41
|
+
* @param notification - notification to processes
|
|
42
|
+
* @param readNotifications - all read notifications currently
|
|
43
|
+
* @returns a process notification or undefined if failed to process
|
|
44
|
+
*/
|
|
45
|
+
function safeProcessNotification(notification, readNotifications = []) {
|
|
46
|
+
try {
|
|
47
|
+
const processedNotification = processNotification(notification, readNotifications);
|
|
48
|
+
return processedNotification;
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.safeProcessNotification = safeProcessNotification;
|
|
55
|
+
const isNotUndefined = (item) => Boolean(item);
|
|
56
|
+
const processAndFilterNotifications = (notifications, readIds) => notifications
|
|
57
|
+
.map((notification) => safeProcessNotification(notification, readIds))
|
|
58
|
+
.filter(isNotUndefined);
|
|
59
|
+
exports.processAndFilterNotifications = processAndFilterNotifications;
|
|
60
|
+
//# 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,iFAG6C;AAQ7C,kFAAyE;AACzE,wFAG2C;AAC3C,oFAA0E;AAE1E,MAAM,iBAAiB,GAAG,CACxB,YAAkC,EACS,EAAE,CAC7C,2DAAkC,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;AAE5D,MAAM,qBAAqB,GAAG,CAC5B,YAAkC,EACkB,EAAE,CACtD,YAAY,CAAC,IAAI,KAAK,sCAAa,CAAC,qBAAqB,CAAC;AAE5D,MAAM,kBAAkB,GAAG,CACzB,YAAkC,EACG,EAAE,CACvC,YAAY,CAAC,IAAI,KAAK,sCAAa,CAAC,IAAI,CAAC;AAE3C;;;;;;;GAOG;AACH,SAAgB,mBAAmB,CACjC,YAAkC,EAClC,oBAA8B,EAAE;IAEhC,MAAM,iBAAiB,GAAG,CAAC,cAAqB,EAAS,EAAE;QACzD,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,CAAC;QACxC,MAAM,qBAAqB,GAAG,IAAA,4DAA0B,EAAC,YAAY,CAAC,CAAC;QACvE,qBAAqB,CAAC,MAAM,GAAG,IAAA,2DAAyB,EACtD,qBAAqB,EACrB,iBAAiB,CAClB,CAAC;QACF,OAAO,qBAAqB,CAAC;IAC/B,CAAC;IAED,IAAI,kBAAkB,CAAC,YAAY,CAAC,EAAE,CAAC;QACrC,OAAO,IAAA,uDAAuB,EAAC,YAAY,CAAC,CAAC;IAC/C,CAAC;IAED,IAAI,iBAAiB,CAAC,YAAY,CAAC,EAAE,CAAC;QACpC,OAAO,IAAA,sDAAuB,EAAC,YAAY,CAAC,CAAC;IAC/C,CAAC;IAED,OAAO,iBAAiB,CAAC,YAAY,CAAC,CAAC;AACzC,CAAC;AA3BD,kDA2BC;AAED;;;;;;GAMG;AACH,SAAgB,uBAAuB,CACrC,YAAkC,EAClC,oBAA8B,EAAE;IAEhC,IAAI,CAAC;QACH,MAAM,qBAAqB,GAAG,mBAAmB,CAC/C,YAAY,EACZ,iBAAiB,CAClB,CAAC;QACF,OAAO,qBAAqB,CAAC;IAC/B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAbD,0DAaC;AAED,MAAM,cAAc,GAAG,CAAO,IAAW,EAAgB,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACnE,MAAM,6BAA6B,GAAG,CAC3C,aAAqC,EACrC,OAAiB,EACA,EAAE,CACnB,aAAa;KACV,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,uBAAuB,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;KACrE,MAAM,CAAC,cAAc,CAAC,CAAC;AANf,QAAA,6BAA6B,iCAMd","sourcesContent":["import {\n TRIGGER_TYPES,\n NOTIFICATION_API_TRIGGER_TYPES_SET,\n} from '../constants/notification-schema.js';\nimport type { FeatureAnnouncementRawNotification } from '../types/feature-announcement/feature-announcement.js';\nimport type { NormalisedAPINotification } from '../types/notification-api/notification-api.js';\nimport type {\n INotification,\n RawNotificationUnion,\n} from '../types/notification/notification.js';\nimport type { RawSnapNotification } from '../types/snaps/index.js';\nimport { processAPINotifications } from './process-api-notifications.js';\nimport {\n isFeatureAnnouncementRead,\n processFeatureAnnouncement,\n} from './process-feature-announcement.js';\nimport { processSnapNotification } from './process-snap-notifications.js';\n\nconst isAPINotification = (\n notification: RawNotificationUnion,\n): notification is NormalisedAPINotification =>\n NOTIFICATION_API_TRIGGER_TYPES_SET.has(notification.type);\n\nconst isFeatureAnnouncement = (\n notification: RawNotificationUnion,\n): notification is FeatureAnnouncementRawNotification =>\n notification.type === TRIGGER_TYPES.FEATURES_ANNOUNCEMENT;\n\nconst isSnapNotification = (\n notification: RawNotificationUnion,\n): notification is RawSnapNotification =>\n notification.type === TRIGGER_TYPES.SNAP;\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: RawNotificationUnion,\n readNotifications: string[] = [],\n): INotification {\n const exhaustedAllCases = (_uncheckedCase: never): 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 processedNotification = processFeatureAnnouncement(notification);\n processedNotification.isRead = isFeatureAnnouncementRead(\n processedNotification,\n readNotifications,\n );\n return processedNotification;\n }\n\n if (isSnapNotification(notification)) {\n return processSnapNotification(notification);\n }\n\n if (isAPINotification(notification)) {\n return processAPINotifications(notification);\n }\n\n return exhaustedAllCases(notification);\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: RawNotificationUnion,\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\nconst isNotUndefined = <Item>(item?: Item): item is Item => Boolean(item);\nexport const processAndFilterNotifications = (\n notifications: RawNotificationUnion[],\n readIds: string[],\n): INotification[] =>\n notifications\n .map((notification) => safeProcessNotification(notification, readIds))\n .filter(isNotUndefined);\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { INotification, RawNotificationUnion } from
|
|
1
|
+
import type { INotification, RawNotificationUnion } 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
|
|
@@ -17,4 +17,4 @@ export declare function processNotification(notification: RawNotificationUnion,
|
|
|
17
17
|
*/
|
|
18
18
|
export declare function safeProcessNotification(notification: RawNotificationUnion, readNotifications?: string[]): INotification | undefined;
|
|
19
19
|
export declare const processAndFilterNotifications: (notifications: RawNotificationUnion[], readIds: string[]) => INotification[];
|
|
20
|
-
//# sourceMappingURL=process-notifications.d.
|
|
20
|
+
//# 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":"AAMA,OAAO,KAAK,EACV,aAAa,EACb,oBAAoB,EACrB,+CAA8C;AAwB/C;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,YAAY,EAAE,oBAAoB,EAClC,iBAAiB,GAAE,MAAM,EAAO,GAC/B,aAAa,CAwBf;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,YAAY,EAAE,oBAAoB,EAClC,iBAAiB,GAAE,MAAM,EAAO,GAC/B,aAAa,GAAG,SAAS,CAU3B;AAGD,eAAO,MAAM,6BAA6B,kBACzB,oBAAoB,EAAE,WAC5B,MAAM,EAAE,KAChB,aAAa,EAGW,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { INotification, RawNotificationUnion } 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: RawNotificationUnion, 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: RawNotificationUnion, readNotifications?: string[]): INotification | undefined;
|
|
19
|
+
export declare const processAndFilterNotifications: (notifications: RawNotificationUnion[], readIds: string[]) => INotification[];
|
|
20
|
+
//# 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":"AAMA,OAAO,KAAK,EACV,aAAa,EACb,oBAAoB,EACrB,+CAA8C;AAwB/C;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,YAAY,EAAE,oBAAoB,EAClC,iBAAiB,GAAE,MAAM,EAAO,GAC/B,aAAa,CAwBf;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,YAAY,EAAE,oBAAoB,EAClC,iBAAiB,GAAE,MAAM,EAAO,GAC/B,aAAa,GAAG,SAAS,CAU3B;AAGD,eAAO,MAAM,6BAA6B,kBACzB,oBAAoB,EAAE,WAC5B,MAAM,EAAE,KAChB,aAAa,EAGW,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { TRIGGER_TYPES, NOTIFICATION_API_TRIGGER_TYPES_SET
|
|
2
|
-
import { processAPINotifications } from
|
|
3
|
-
import { isFeatureAnnouncementRead, processFeatureAnnouncement
|
|
4
|
-
import { processSnapNotification } from
|
|
1
|
+
import { TRIGGER_TYPES, NOTIFICATION_API_TRIGGER_TYPES_SET } from "../constants/notification-schema.mjs";
|
|
2
|
+
import { processAPINotifications } from "./process-api-notifications.mjs";
|
|
3
|
+
import { isFeatureAnnouncementRead, processFeatureAnnouncement } from "./process-feature-announcement.mjs";
|
|
4
|
+
import { processSnapNotification } from "./process-snap-notifications.mjs";
|
|
5
5
|
const isAPINotification = (notification) => NOTIFICATION_API_TRIGGER_TYPES_SET.has(notification.type);
|
|
6
6
|
const isFeatureAnnouncement = (notification) => notification.type === TRIGGER_TYPES.FEATURES_ANNOUNCEMENT;
|
|
7
7
|
const isSnapNotification = (notification) => notification.type === TRIGGER_TYPES.SNAP;
|
|
@@ -51,4 +51,4 @@ const isNotUndefined = (item) => Boolean(item);
|
|
|
51
51
|
export const processAndFilterNotifications = (notifications, readIds) => notifications
|
|
52
52
|
.map((notification) => safeProcessNotification(notification, readIds))
|
|
53
53
|
.filter(isNotUndefined);
|
|
54
|
-
//# sourceMappingURL=process-notifications.
|
|
54
|
+
//# sourceMappingURL=process-notifications.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-notifications.mjs","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/process-notifications.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,kCAAkC,EACnC,6CAA4C;AAQ7C,OAAO,EAAE,uBAAuB,EAAE,wCAAuC;AACzE,OAAO,EACL,yBAAyB,EACzB,0BAA0B,EAC3B,2CAA0C;AAC3C,OAAO,EAAE,uBAAuB,EAAE,yCAAwC;AAE1E,MAAM,iBAAiB,GAAG,CACxB,YAAkC,EACS,EAAE,CAC7C,kCAAkC,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;AAE5D,MAAM,qBAAqB,GAAG,CAC5B,YAAkC,EACkB,EAAE,CACtD,YAAY,CAAC,IAAI,KAAK,aAAa,CAAC,qBAAqB,CAAC;AAE5D,MAAM,kBAAkB,GAAG,CACzB,YAAkC,EACG,EAAE,CACvC,YAAY,CAAC,IAAI,KAAK,aAAa,CAAC,IAAI,CAAC;AAE3C;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CACjC,YAAkC,EAClC,oBAA8B,EAAE;IAEhC,MAAM,iBAAiB,GAAG,CAAC,cAAqB,EAAS,EAAE;QACzD,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,CAAC;QACxC,MAAM,qBAAqB,GAAG,0BAA0B,CAAC,YAAY,CAAC,CAAC;QACvE,qBAAqB,CAAC,MAAM,GAAG,yBAAyB,CACtD,qBAAqB,EACrB,iBAAiB,CAClB,CAAC;QACF,OAAO,qBAAqB,CAAC;IAC/B,CAAC;IAED,IAAI,kBAAkB,CAAC,YAAY,CAAC,EAAE,CAAC;QACrC,OAAO,uBAAuB,CAAC,YAAY,CAAC,CAAC;IAC/C,CAAC;IAED,IAAI,iBAAiB,CAAC,YAAY,CAAC,EAAE,CAAC;QACpC,OAAO,uBAAuB,CAAC,YAAY,CAAC,CAAC;IAC/C,CAAC;IAED,OAAO,iBAAiB,CAAC,YAAY,CAAC,CAAC;AACzC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CACrC,YAAkC,EAClC,oBAA8B,EAAE;IAEhC,IAAI,CAAC;QACH,MAAM,qBAAqB,GAAG,mBAAmB,CAC/C,YAAY,EACZ,iBAAiB,CAClB,CAAC;QACF,OAAO,qBAAqB,CAAC;IAC/B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED,MAAM,cAAc,GAAG,CAAO,IAAW,EAAgB,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC1E,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAC3C,aAAqC,EACrC,OAAiB,EACA,EAAE,CACnB,aAAa;KACV,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,uBAAuB,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;KACrE,MAAM,CAAC,cAAc,CAAC,CAAC","sourcesContent":["import {\n TRIGGER_TYPES,\n NOTIFICATION_API_TRIGGER_TYPES_SET,\n} from '../constants/notification-schema.js';\nimport type { FeatureAnnouncementRawNotification } from '../types/feature-announcement/feature-announcement.js';\nimport type { NormalisedAPINotification } from '../types/notification-api/notification-api.js';\nimport type {\n INotification,\n RawNotificationUnion,\n} from '../types/notification/notification.js';\nimport type { RawSnapNotification } from '../types/snaps/index.js';\nimport { processAPINotifications } from './process-api-notifications.js';\nimport {\n isFeatureAnnouncementRead,\n processFeatureAnnouncement,\n} from './process-feature-announcement.js';\nimport { processSnapNotification } from './process-snap-notifications.js';\n\nconst isAPINotification = (\n notification: RawNotificationUnion,\n): notification is NormalisedAPINotification =>\n NOTIFICATION_API_TRIGGER_TYPES_SET.has(notification.type);\n\nconst isFeatureAnnouncement = (\n notification: RawNotificationUnion,\n): notification is FeatureAnnouncementRawNotification =>\n notification.type === TRIGGER_TYPES.FEATURES_ANNOUNCEMENT;\n\nconst isSnapNotification = (\n notification: RawNotificationUnion,\n): notification is RawSnapNotification =>\n notification.type === TRIGGER_TYPES.SNAP;\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: RawNotificationUnion,\n readNotifications: string[] = [],\n): INotification {\n const exhaustedAllCases = (_uncheckedCase: never): 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 processedNotification = processFeatureAnnouncement(notification);\n processedNotification.isRead = isFeatureAnnouncementRead(\n processedNotification,\n readNotifications,\n );\n return processedNotification;\n }\n\n if (isSnapNotification(notification)) {\n return processSnapNotification(notification);\n }\n\n if (isAPINotification(notification)) {\n return processAPINotifications(notification);\n }\n\n return exhaustedAllCases(notification);\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: RawNotificationUnion,\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\nconst isNotUndefined = <Item>(item?: Item): item is Item => Boolean(item);\nexport const processAndFilterNotifications = (\n notifications: RawNotificationUnion[],\n readIds: string[],\n): INotification[] =>\n notifications\n .map((notification) => safeProcessNotification(notification, readIds))\n .filter(isNotUndefined);\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.processSnapNotification = void 0;
|
|
4
|
+
const uuid_1 = require("uuid");
|
|
5
|
+
const get_notification_subtype_js_1 = require("../utils/get-notification-subtype.cjs");
|
|
6
|
+
/**
|
|
7
|
+
* Processes a snap notification into a normalized shape.
|
|
8
|
+
*
|
|
9
|
+
* @param snapNotification - A raw snap notification.
|
|
10
|
+
* @returns a normalized snap notification.
|
|
11
|
+
*/
|
|
12
|
+
const processSnapNotification = (snapNotification) => {
|
|
13
|
+
const { data, type, readDate } = snapNotification;
|
|
14
|
+
return {
|
|
15
|
+
id: (0, uuid_1.v4)(),
|
|
16
|
+
notification_subtype: (0, get_notification_subtype_js_1.getNotificationSubtype)(snapNotification),
|
|
17
|
+
readDate,
|
|
18
|
+
createdAt: new Date().toISOString(),
|
|
19
|
+
isRead: false,
|
|
20
|
+
type,
|
|
21
|
+
data,
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
exports.processSnapNotification = processSnapNotification;
|
|
25
|
+
//# sourceMappingURL=process-snap-notifications.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-snap-notifications.cjs","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/process-snap-notifications.ts"],"names":[],"mappings":";;;AAAA,+BAAkC;AAIlC,uFAA8E;AAE9E;;;;;GAKG;AACI,MAAM,uBAAuB,GAAG,CACrC,gBAAqC,EACtB,EAAE;IACjB,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,gBAAgB,CAAC;IAClD,OAAO;QACL,EAAE,EAAE,IAAA,SAAI,GAAE;QACV,oBAAoB,EAAE,IAAA,oDAAsB,EAAC,gBAAgB,CAAC;QAC9D,QAAQ;QACR,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACnC,MAAM,EAAE,KAAK;QACb,IAAI;QACJ,IAAI;KACL,CAAC;AACJ,CAAC,CAAC;AAbW,QAAA,uBAAuB,2BAalC","sourcesContent":["import { v4 as uuid } from 'uuid';\n\nimport type { INotification } from '../types/index.js';\nimport type { RawSnapNotification } from '../types/snaps/index.js';\nimport { getNotificationSubtype } from '../utils/get-notification-subtype.js';\n\n/**\n * Processes a snap notification into a normalized shape.\n *\n * @param snapNotification - A raw snap notification.\n * @returns a normalized snap notification.\n */\nexport const processSnapNotification = (\n snapNotification: RawSnapNotification,\n): INotification => {\n const { data, type, readDate } = snapNotification;\n return {\n id: uuid(),\n notification_subtype: getNotificationSubtype(snapNotification),\n readDate,\n createdAt: new Date().toISOString(),\n isRead: false,\n type,\n data,\n };\n};\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { INotification } from
|
|
2
|
-
import type { RawSnapNotification } from
|
|
1
|
+
import type { INotification } from "../types/index.cjs";
|
|
2
|
+
import type { RawSnapNotification } from "../types/snaps/index.cjs";
|
|
3
3
|
/**
|
|
4
4
|
* Processes a snap notification into a normalized shape.
|
|
5
5
|
*
|
|
@@ -7,4 +7,4 @@ import type { RawSnapNotification } from '../types/snaps/index.js';
|
|
|
7
7
|
* @returns a normalized snap notification.
|
|
8
8
|
*/
|
|
9
9
|
export declare const processSnapNotification: (snapNotification: RawSnapNotification) => INotification;
|
|
10
|
-
//# sourceMappingURL=process-snap-notifications.d.
|
|
10
|
+
//# sourceMappingURL=process-snap-notifications.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-snap-notifications.d.cts","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/process-snap-notifications.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,2BAA0B;AACvD,OAAO,KAAK,EAAE,mBAAmB,EAAE,iCAAgC;AAGnE;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,qBAChB,mBAAmB,KACpC,aAWF,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { INotification } from "../types/index.mjs";
|
|
2
|
+
import type { RawSnapNotification } from "../types/snaps/index.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* Processes a snap notification into a normalized shape.
|
|
5
|
+
*
|
|
6
|
+
* @param snapNotification - A raw snap notification.
|
|
7
|
+
* @returns a normalized snap notification.
|
|
8
|
+
*/
|
|
9
|
+
export declare const processSnapNotification: (snapNotification: RawSnapNotification) => INotification;
|
|
10
|
+
//# sourceMappingURL=process-snap-notifications.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-snap-notifications.d.mts","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/process-snap-notifications.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,2BAA0B;AACvD,OAAO,KAAK,EAAE,mBAAmB,EAAE,iCAAgC;AAGnE;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,qBAChB,mBAAmB,KACpC,aAWF,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { v4 as uuid } from
|
|
2
|
-
import { getNotificationSubtype } from
|
|
1
|
+
import { v4 as uuid } from "uuid";
|
|
2
|
+
import { getNotificationSubtype } from "../utils/get-notification-subtype.mjs";
|
|
3
3
|
/**
|
|
4
4
|
* Processes a snap notification into a normalized shape.
|
|
5
5
|
*
|
|
@@ -18,4 +18,4 @@ export const processSnapNotification = (snapNotification) => {
|
|
|
18
18
|
data,
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
|
-
//# sourceMappingURL=process-snap-notifications.
|
|
21
|
+
//# sourceMappingURL=process-snap-notifications.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-snap-notifications.mjs","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/process-snap-notifications.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,IAAI,IAAI,EAAE,aAAa;AAIlC,OAAO,EAAE,sBAAsB,EAAE,8CAA6C;AAE9E;;;;;GAKG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,gBAAqC,EACtB,EAAE;IACjB,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,gBAAgB,CAAC;IAClD,OAAO;QACL,EAAE,EAAE,IAAI,EAAE;QACV,oBAAoB,EAAE,sBAAsB,CAAC,gBAAgB,CAAC;QAC9D,QAAQ;QACR,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACnC,MAAM,EAAE,KAAK;QACb,IAAI;QACJ,IAAI;KACL,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { v4 as uuid } from 'uuid';\n\nimport type { INotification } from '../types/index.js';\nimport type { RawSnapNotification } from '../types/snaps/index.js';\nimport { getNotificationSubtype } from '../utils/get-notification-subtype.js';\n\n/**\n * Processes a snap notification into a normalized shape.\n *\n * @param snapNotification - A raw snap notification.\n * @returns a normalized snap notification.\n */\nexport const processSnapNotification = (\n snapNotification: RawSnapNotification,\n): INotification => {\n const { data, type, readDate } = snapNotification;\n return {\n id: uuid(),\n notification_subtype: getNotificationSubtype(snapNotification),\n readDate,\n createdAt: new Date().toISOString(),\n isRead: false,\n type,\n data,\n };\n};\n"]}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.markNotificationsAsRead = exports.getAPINotifications = exports.getNotificationsApiConfigCached = exports.NOTIFICATION_API_MARK_ALL_AS_READ_ENDPOINT = exports.NOTIFICATION_API_LIST_ENDPOINT = exports.TRIGGER_API_NOTIFICATIONS_QUERY_ENDPOINT = exports.NOTIFICATION_API = exports.TRIGGER_API = void 0;
|
|
7
|
+
const loglevel_1 = __importDefault(require("loglevel"));
|
|
8
|
+
const to_raw_notification_js_1 = require("../../shared/to-raw-notification.cjs");
|
|
9
|
+
const utils_js_1 = require("../utils/utils.cjs");
|
|
10
|
+
const notification_config_cache_js_1 = require("./notification-config-cache.cjs");
|
|
11
|
+
const TRIGGER_API_ENV = {
|
|
12
|
+
dev: 'https://trigger.dev-api.cx.metamask.io',
|
|
13
|
+
uat: 'https://trigger.uat-api.cx.metamask.io',
|
|
14
|
+
prd: 'https://trigger.api.cx.metamask.io',
|
|
15
|
+
};
|
|
16
|
+
const TRIGGER_API = (env = 'prd') => TRIGGER_API_ENV[env] ?? TRIGGER_API_ENV.prd;
|
|
17
|
+
exports.TRIGGER_API = TRIGGER_API;
|
|
18
|
+
const NOTIFICATION_API_ENV = {
|
|
19
|
+
dev: 'https://notification.dev-api.cx.metamask.io',
|
|
20
|
+
uat: 'https://notification.uat-api.cx.metamask.io',
|
|
21
|
+
prd: 'https://notification.api.cx.metamask.io',
|
|
22
|
+
};
|
|
23
|
+
const NOTIFICATION_API = (env = 'prd') => NOTIFICATION_API_ENV[env] ?? NOTIFICATION_API_ENV.prd;
|
|
24
|
+
exports.NOTIFICATION_API = NOTIFICATION_API;
|
|
25
|
+
// Gets notification settings for each account provided
|
|
26
|
+
const TRIGGER_API_NOTIFICATIONS_QUERY_ENDPOINT = (env = 'prd') => `${(0, exports.TRIGGER_API)(env)}/api/v2/notifications/query`;
|
|
27
|
+
exports.TRIGGER_API_NOTIFICATIONS_QUERY_ENDPOINT = TRIGGER_API_NOTIFICATIONS_QUERY_ENDPOINT;
|
|
28
|
+
// Lists notifications for each address provided
|
|
29
|
+
const NOTIFICATION_API_LIST_ENDPOINT = (env = 'prd') => `${(0, exports.NOTIFICATION_API)(env)}/api/v4/notifications`;
|
|
30
|
+
exports.NOTIFICATION_API_LIST_ENDPOINT = NOTIFICATION_API_LIST_ENDPOINT;
|
|
31
|
+
// Marks notifications as read
|
|
32
|
+
const NOTIFICATION_API_MARK_ALL_AS_READ_ENDPOINT = (env = 'prd') => `${(0, exports.NOTIFICATION_API)(env)}/api/v4/notifications/mark-as-read`;
|
|
33
|
+
exports.NOTIFICATION_API_MARK_ALL_AS_READ_ENDPOINT = NOTIFICATION_API_MARK_ALL_AS_READ_ENDPOINT;
|
|
34
|
+
/**
|
|
35
|
+
* fetches notification config (accounts enabled vs disabled)
|
|
36
|
+
*
|
|
37
|
+
* @param bearerToken - jwt
|
|
38
|
+
* @param addresses - list of addresses to check
|
|
39
|
+
* @param env - the environment to use for the API call
|
|
40
|
+
* NOTE the API will return addresses config with false if they have not been created before.
|
|
41
|
+
* NOTE this is cached for 1s to prevent multiple update calls
|
|
42
|
+
* @returns object of notification config, or null if missing
|
|
43
|
+
*/
|
|
44
|
+
async function getNotificationsApiConfigCached(bearerToken, addresses, env = 'prd') {
|
|
45
|
+
if (addresses.length === 0) {
|
|
46
|
+
return [];
|
|
47
|
+
}
|
|
48
|
+
const normalizedAddresses = addresses.map((addr) => addr.toLowerCase());
|
|
49
|
+
const cached = notification_config_cache_js_1.notificationsConfigCache.get(normalizedAddresses);
|
|
50
|
+
if (cached) {
|
|
51
|
+
return cached;
|
|
52
|
+
}
|
|
53
|
+
const body = normalizedAddresses.map((address) => ({ address }));
|
|
54
|
+
const apiResponse = await (0, utils_js_1.makeApiCall)(bearerToken, (0, exports.TRIGGER_API_NOTIFICATIONS_QUERY_ENDPOINT)(env), 'POST', body)
|
|
55
|
+
.then((response) => (response.ok ? response.json() : null))
|
|
56
|
+
.catch(() => null);
|
|
57
|
+
const result = apiResponse ?? [];
|
|
58
|
+
if (result.length > 0) {
|
|
59
|
+
notification_config_cache_js_1.notificationsConfigCache.set(result);
|
|
60
|
+
}
|
|
61
|
+
return result;
|
|
62
|
+
}
|
|
63
|
+
exports.getNotificationsApiConfigCached = getNotificationsApiConfigCached;
|
|
64
|
+
/**
|
|
65
|
+
* Fetches on-chain notifications for the given addresses
|
|
66
|
+
*
|
|
67
|
+
* @param bearerToken - The JSON Web Token used for authentication in the API call.
|
|
68
|
+
* @param addresses - List of addresses
|
|
69
|
+
* @param locale - to generate translated notifications
|
|
70
|
+
* @param platform - filter notifications for specific platforms ('extension' | 'mobile')
|
|
71
|
+
* @param env - the environment to use for the API call
|
|
72
|
+
* @returns An array of {@link NormalisedAPINotification}. Returns an empty array on transport or parse errors.
|
|
73
|
+
*/
|
|
74
|
+
async function getAPINotifications(bearerToken, addresses, locale, platform, env = 'prd') {
|
|
75
|
+
if (addresses.length === 0) {
|
|
76
|
+
return [];
|
|
77
|
+
}
|
|
78
|
+
const body = {
|
|
79
|
+
addresses: addresses.map((addr) => addr.toLowerCase()),
|
|
80
|
+
locale,
|
|
81
|
+
platform,
|
|
82
|
+
};
|
|
83
|
+
const notifications = await (0, utils_js_1.makeApiCall)(bearerToken, (0, exports.NOTIFICATION_API_LIST_ENDPOINT)(env), 'POST', body)
|
|
84
|
+
.then((response) => response.ok ? response.json() : null)
|
|
85
|
+
.catch(() => null);
|
|
86
|
+
// Transform and sort notifications
|
|
87
|
+
const transformedNotifications = notifications
|
|
88
|
+
?.map((notification) => {
|
|
89
|
+
if (!notification.notification_type) {
|
|
90
|
+
return undefined;
|
|
91
|
+
}
|
|
92
|
+
try {
|
|
93
|
+
return (0, to_raw_notification_js_1.toRawAPINotification)(notification);
|
|
94
|
+
}
|
|
95
|
+
catch {
|
|
96
|
+
return undefined;
|
|
97
|
+
}
|
|
98
|
+
})
|
|
99
|
+
.filter((item) => Boolean(item));
|
|
100
|
+
return transformedNotifications ?? [];
|
|
101
|
+
}
|
|
102
|
+
exports.getAPINotifications = getAPINotifications;
|
|
103
|
+
/**
|
|
104
|
+
* Marks the specified notifications as read.
|
|
105
|
+
* This method sends a POST request to the notifications service to mark the provided notification IDs as read.
|
|
106
|
+
* If the operation is successful, it completes without error. If the operation fails, it throws an error with details.
|
|
107
|
+
*
|
|
108
|
+
* @param bearerToken - The JSON Web Token used for authentication in the API call.
|
|
109
|
+
* @param notificationIds - An array of notification IDs to be marked as read.
|
|
110
|
+
* @param env - the environment to use for the API call
|
|
111
|
+
* @returns A promise that resolves to void. The promise will reject if there's an error during the API call or if the response status is not 200.
|
|
112
|
+
*/
|
|
113
|
+
async function markNotificationsAsRead(bearerToken, notificationIds, env = 'prd') {
|
|
114
|
+
if (notificationIds.length === 0) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
const body = {
|
|
118
|
+
ids: notificationIds,
|
|
119
|
+
};
|
|
120
|
+
try {
|
|
121
|
+
await (0, utils_js_1.makeApiCall)(bearerToken, (0, exports.NOTIFICATION_API_MARK_ALL_AS_READ_ENDPOINT)(env), 'POST', body);
|
|
122
|
+
}
|
|
123
|
+
catch (error) {
|
|
124
|
+
loglevel_1.default.error('Error marking notifications as read:', error);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
exports.markNotificationsAsRead = markNotificationsAsRead;
|
|
128
|
+
//# sourceMappingURL=api-notifications.cjs.map
|