@open-mercato/core 0.6.8-develop.6983.1.e4f794099e → 0.6.8-develop.6985.1.fb93574faa
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/.turbo/turbo-build.log +2 -2
- package/dist/generated/entities/notification/index.js +6 -0
- package/dist/generated/entities/notification/index.js.map +2 -2
- package/dist/generated/entities/notification_preference/index.js +19 -0
- package/dist/generated/entities/notification_preference/index.js.map +7 -0
- package/dist/generated/entities/notification_type/index.js +21 -0
- package/dist/generated/entities/notification_type/index.js.map +7 -0
- package/dist/generated/entities/notification_type_override/index.js +17 -0
- package/dist/generated/entities/notification_type_override/index.js.map +7 -0
- package/dist/generated/entities/push_notification_delivery/index.js +41 -0
- package/dist/generated/entities/push_notification_delivery/index.js.map +7 -0
- package/dist/generated/entities/user_device/index.js +35 -0
- package/dist/generated/entities/user_device/index.js.map +7 -0
- package/dist/generated/entities.ids.generated.js +12 -1
- package/dist/generated/entities.ids.generated.js.map +2 -2
- package/dist/generated/entity-fields-registry.js +72 -0
- package/dist/generated/entity-fields-registry.js.map +2 -2
- package/dist/helpers/integration/api.js +2 -1
- package/dist/helpers/integration/api.js.map +2 -2
- package/dist/helpers/integration/appRoot.js +9 -0
- package/dist/helpers/integration/appRoot.js.map +7 -0
- package/dist/helpers/integration/dbFixtures.js +1 -4
- package/dist/helpers/integration/dbFixtures.js.map +2 -2
- package/dist/helpers/integration/pushFake.js +126 -0
- package/dist/helpers/integration/pushFake.js.map +7 -0
- package/dist/modules/auth/notifications.js +16 -0
- package/dist/modules/auth/notifications.js.map +2 -2
- package/dist/modules/business_rules/notifications.js +2 -0
- package/dist/modules/business_rules/notifications.js.map +2 -2
- package/dist/modules/catalog/notifications.js +2 -0
- package/dist/modules/catalog/notifications.js.map +2 -2
- package/dist/modules/communication_channels/acl.js +9 -0
- package/dist/modules/communication_channels/acl.js.map +2 -2
- package/dist/modules/communication_channels/api/delete/admin/channels/[id]/route.js +133 -0
- package/dist/modules/communication_channels/api/delete/admin/channels/[id]/route.js.map +7 -0
- package/dist/modules/communication_channels/api/get/channels/[id]/health/route.js +6 -2
- package/dist/modules/communication_channels/api/get/channels/[id]/health/route.js.map +2 -2
- package/dist/modules/communication_channels/api/get/channels/[id]/route.js +6 -2
- package/dist/modules/communication_channels/api/get/channels/[id]/route.js.map +2 -2
- package/dist/modules/communication_channels/api/get/channels/route.js +2 -1
- package/dist/modules/communication_channels/api/get/channels/route.js.map +2 -2
- package/dist/modules/communication_channels/api/post/channels/[id]/test-send/route.js +10 -5
- package/dist/modules/communication_channels/api/post/channels/[id]/test-send/route.js.map +2 -2
- package/dist/modules/communication_channels/api/post/channels/connect/credentials/route.js +29 -1
- package/dist/modules/communication_channels/api/post/channels/connect/credentials/route.js.map +2 -2
- package/dist/modules/communication_channels/api/post/channels/connect/tenant-credentials/route.js +157 -0
- package/dist/modules/communication_channels/api/post/channels/connect/tenant-credentials/route.js.map +7 -0
- package/dist/modules/communication_channels/backend/communication_channels/channels/page.js +8 -1
- package/dist/modules/communication_channels/backend/communication_channels/channels/page.js.map +2 -2
- package/dist/modules/communication_channels/commands/admin-delete-channel.js +141 -0
- package/dist/modules/communication_channels/commands/admin-delete-channel.js.map +7 -0
- package/dist/modules/communication_channels/commands/connect-credential-channel.js +25 -8
- package/dist/modules/communication_channels/commands/connect-credential-channel.js.map +2 -2
- package/dist/modules/communication_channels/commands/deliver-outbound-message.js +2 -2
- package/dist/modules/communication_channels/commands/deliver-outbound-message.js.map +2 -2
- package/dist/modules/communication_channels/commands/push-register.js +1 -1
- package/dist/modules/communication_channels/commands/push-register.js.map +2 -2
- package/dist/modules/communication_channels/commands/push-unregister.js +4 -3
- package/dist/modules/communication_channels/commands/push-unregister.js.map +2 -2
- package/dist/modules/communication_channels/data/entities.js +4 -0
- package/dist/modules/communication_channels/data/entities.js.map +2 -2
- package/dist/modules/communication_channels/data/validators.js +2 -1
- package/dist/modules/communication_channels/data/validators.js.map +2 -2
- package/dist/modules/communication_channels/lib/access-control.js +11 -1
- package/dist/modules/communication_channels/lib/access-control.js.map +2 -2
- package/dist/modules/communication_channels/lib/connect-channel.js +20 -12
- package/dist/modules/communication_channels/lib/connect-channel.js.map +2 -2
- package/dist/modules/communication_channels/lib/push-adapter.js +68 -0
- package/dist/modules/communication_channels/lib/push-adapter.js.map +7 -0
- package/dist/modules/communication_channels/lib/push-capabilities.js +31 -0
- package/dist/modules/communication_channels/lib/push-capabilities.js.map +7 -0
- package/dist/modules/communication_channels/lib/push-connect-error.js +20 -0
- package/dist/modules/communication_channels/lib/push-connect-error.js.map +7 -0
- package/dist/modules/communication_channels/lib/push-credential-errors.js +41 -0
- package/dist/modules/communication_channels/lib/push-credential-errors.js.map +7 -0
- package/dist/modules/communication_channels/lib/push-envelope.js +46 -0
- package/dist/modules/communication_channels/lib/push-envelope.js.map +7 -0
- package/dist/modules/communication_channels/lib/refcounted-client-cache.js +64 -0
- package/dist/modules/communication_channels/lib/refcounted-client-cache.js.map +7 -0
- package/dist/modules/communication_channels/migrations/Migration20260703123630_communication_channels.js +13 -0
- package/dist/modules/communication_channels/migrations/Migration20260703123630_communication_channels.js.map +7 -0
- package/dist/modules/communication_channels/notifications.js +4 -0
- package/dist/modules/communication_channels/notifications.js.map +2 -2
- package/dist/modules/communication_channels/setup.js +2 -0
- package/dist/modules/communication_channels/setup.js.map +2 -2
- package/dist/modules/configs/lib/upgrade-actions.js +21 -0
- package/dist/modules/configs/lib/upgrade-actions.js.map +2 -2
- package/dist/modules/customer_accounts/notifications.js +12 -0
- package/dist/modules/customer_accounts/notifications.js.map +2 -2
- package/dist/modules/customers/notifications.js +4 -0
- package/dist/modules/customers/notifications.js.map +2 -2
- package/dist/modules/devices/acl.js +11 -0
- package/dist/modules/devices/acl.js.map +7 -0
- package/dist/modules/devices/api/[id]/route.js +167 -0
- package/dist/modules/devices/api/[id]/route.js.map +7 -0
- package/dist/modules/devices/api/admin/devices/[id]/route.js +219 -0
- package/dist/modules/devices/api/admin/devices/[id]/route.js.map +7 -0
- package/dist/modules/devices/api/admin/devices/route.js +140 -0
- package/dist/modules/devices/api/admin/devices/route.js.map +7 -0
- package/dist/modules/devices/api/auth.js +9 -0
- package/dist/modules/devices/api/auth.js.map +7 -0
- package/dist/modules/devices/api/deviceList.js +53 -0
- package/dist/modules/devices/api/deviceList.js.map +7 -0
- package/dist/modules/devices/api/deviceOps.js +118 -0
- package/dist/modules/devices/api/deviceOps.js.map +7 -0
- package/dist/modules/devices/api/openapi.js +19 -0
- package/dist/modules/devices/api/openapi.js.map +7 -0
- package/dist/modules/devices/api/route.js +143 -0
- package/dist/modules/devices/api/route.js.map +7 -0
- package/dist/modules/devices/backend/devices/[id]/page.js +135 -0
- package/dist/modules/devices/backend/devices/[id]/page.js.map +7 -0
- package/dist/modules/devices/backend/devices/[id]/page.meta.js +16 -0
- package/dist/modules/devices/backend/devices/[id]/page.meta.js.map +7 -0
- package/dist/modules/devices/backend/devices/create/page.js +68 -0
- package/dist/modules/devices/backend/devices/create/page.js.map +7 -0
- package/dist/modules/devices/backend/devices/create/page.meta.js +16 -0
- package/dist/modules/devices/backend/devices/create/page.meta.js.map +7 -0
- package/dist/modules/devices/backend/devices/page.js +235 -0
- package/dist/modules/devices/backend/devices/page.js.map +7 -0
- package/dist/modules/devices/backend/devices/page.meta.js +23 -0
- package/dist/modules/devices/backend/devices/page.meta.js.map +7 -0
- package/dist/modules/devices/commands/deactivate.js +107 -0
- package/dist/modules/devices/commands/deactivate.js.map +7 -0
- package/dist/modules/devices/commands/index.js +4 -0
- package/dist/modules/devices/commands/index.js.map +7 -0
- package/dist/modules/devices/commands/register.js +183 -0
- package/dist/modules/devices/commands/register.js.map +7 -0
- package/dist/modules/devices/commands/shared.js +74 -0
- package/dist/modules/devices/commands/shared.js.map +7 -0
- package/dist/modules/devices/commands/update.js +126 -0
- package/dist/modules/devices/commands/update.js.map +7 -0
- package/dist/modules/devices/data/entities.js +83 -0
- package/dist/modules/devices/data/entities.js.map +7 -0
- package/dist/modules/devices/data/validators.js +49 -0
- package/dist/modules/devices/data/validators.js.map +7 -0
- package/dist/modules/devices/di.js +11 -0
- package/dist/modules/devices/di.js.map +7 -0
- package/dist/modules/devices/encryption.js +12 -0
- package/dist/modules/devices/encryption.js.map +7 -0
- package/dist/modules/devices/events.js +19 -0
- package/dist/modules/devices/events.js.map +7 -0
- package/dist/modules/devices/index.js +17 -0
- package/dist/modules/devices/index.js.map +7 -0
- package/dist/modules/devices/lib/operationMetadata.js +20 -0
- package/dist/modules/devices/lib/operationMetadata.js.map +7 -0
- package/dist/modules/devices/migrations/Migration20260602120000.js +15 -0
- package/dist/modules/devices/migrations/Migration20260602120000.js.map +7 -0
- package/dist/modules/devices/migrations/Migration20260630120000.js +15 -0
- package/dist/modules/devices/migrations/Migration20260630120000.js.map +7 -0
- package/dist/modules/devices/migrations/Migration20260701120000.js +13 -0
- package/dist/modules/devices/migrations/Migration20260701120000.js.map +7 -0
- package/dist/modules/devices/migrations/Migration20260721120000.js +15 -0
- package/dist/modules/devices/migrations/Migration20260721120000.js.map +7 -0
- package/dist/modules/devices/setup.js +13 -0
- package/dist/modules/devices/setup.js.map +7 -0
- package/dist/modules/entities/cli.js +8 -3
- package/dist/modules/entities/cli.js.map +2 -2
- package/dist/modules/entities/migrations/Migration20260722120000.js +28 -0
- package/dist/modules/entities/migrations/Migration20260722120000.js.map +7 -0
- package/dist/modules/inbox_ops/notifications.js +2 -0
- package/dist/modules/inbox_ops/notifications.js.map +2 -2
- package/dist/modules/messages/notifications.js +2 -0
- package/dist/modules/messages/notifications.js.map +2 -2
- package/dist/modules/notifications/acl.js +3 -1
- package/dist/modules/notifications/acl.js.map +2 -2
- package/dist/modules/notifications/api/admin/preferences/route.js +167 -0
- package/dist/modules/notifications/api/admin/preferences/route.js.map +7 -0
- package/dist/modules/notifications/api/channels/route.js +54 -0
- package/dist/modules/notifications/api/channels/route.js.map +7 -0
- package/dist/modules/notifications/api/preferences/route.js +126 -0
- package/dist/modules/notifications/api/preferences/route.js.map +7 -0
- package/dist/modules/notifications/api/route.js +8 -1
- package/dist/modules/notifications/api/route.js.map +2 -2
- package/dist/modules/notifications/api/types/[id]/channels/[channel]/route.js +187 -0
- package/dist/modules/notifications/api/types/[id]/channels/[channel]/route.js.map +7 -0
- package/dist/modules/notifications/api/types/route.js +225 -0
- package/dist/modules/notifications/api/types/route.js.map +7 -0
- package/dist/modules/notifications/api/unread-count/route.js +5 -1
- package/dist/modules/notifications/api/unread-count/route.js.map +2 -2
- package/dist/modules/notifications/backend/notifications/user-preferences/page.js +10 -0
- package/dist/modules/notifications/backend/notifications/user-preferences/page.js.map +7 -0
- package/dist/modules/notifications/backend/notifications/user-preferences/page.meta.js +28 -0
- package/dist/modules/notifications/backend/notifications/user-preferences/page.meta.js.map +7 -0
- package/dist/modules/notifications/backend/profile/notification-preferences/page.js +10 -0
- package/dist/modules/notifications/backend/profile/notification-preferences/page.js.map +7 -0
- package/dist/modules/notifications/backend/profile/notification-preferences/page.meta.js +33 -0
- package/dist/modules/notifications/backend/profile/notification-preferences/page.meta.js.map +7 -0
- package/dist/modules/notifications/data/entities.js +128 -1
- package/dist/modules/notifications/data/entities.js.map +2 -2
- package/dist/modules/notifications/data/validators.js +95 -2
- package/dist/modules/notifications/data/validators.js.map +2 -2
- package/dist/modules/notifications/di.js +7 -0
- package/dist/modules/notifications/di.js.map +2 -2
- package/dist/modules/notifications/events.js +17 -0
- package/dist/modules/notifications/events.js.map +2 -2
- package/dist/modules/notifications/frontend/NotificationPreferenceMatrix.js +190 -0
- package/dist/modules/notifications/frontend/NotificationPreferenceMatrix.js.map +7 -0
- package/dist/modules/notifications/frontend/NotificationPreferencesPageClient.js +124 -0
- package/dist/modules/notifications/frontend/NotificationPreferencesPageClient.js.map +7 -0
- package/dist/modules/notifications/frontend/NotificationSettingsPageClient.js +166 -1
- package/dist/modules/notifications/frontend/NotificationSettingsPageClient.js.map +2 -2
- package/dist/modules/notifications/frontend/NotificationUserPreferencesAdminPageClient.js +172 -0
- package/dist/modules/notifications/frontend/NotificationUserPreferencesAdminPageClient.js.map +7 -0
- package/dist/modules/notifications/generators.js +63 -0
- package/dist/modules/notifications/generators.js.map +7 -0
- package/dist/modules/notifications/lib/delivery-strategies-registry.js +19 -0
- package/dist/modules/notifications/lib/delivery-strategies-registry.js.map +7 -0
- package/dist/modules/notifications/lib/deliveryStrategies.js.map +2 -2
- package/dist/modules/notifications/lib/derive-category.js +8 -0
- package/dist/modules/notifications/lib/derive-category.js.map +7 -0
- package/dist/modules/notifications/lib/notification-channel-registry.js +35 -0
- package/dist/modules/notifications/lib/notification-channel-registry.js.map +7 -0
- package/dist/modules/notifications/lib/notification-type-registry.js +87 -0
- package/dist/modules/notifications/lib/notification-type-registry.js.map +7 -0
- package/dist/modules/notifications/lib/notificationCopy.js +14 -0
- package/dist/modules/notifications/lib/notificationCopy.js.map +7 -0
- package/dist/modules/notifications/lib/notificationFactory.js +4 -1
- package/dist/modules/notifications/lib/notificationFactory.js.map +2 -2
- package/dist/modules/notifications/lib/notificationMapper.js +2 -0
- package/dist/modules/notifications/lib/notificationMapper.js.map +2 -2
- package/dist/modules/notifications/lib/notificationPreferenceService.js +83 -0
- package/dist/modules/notifications/lib/notificationPreferenceService.js.map +7 -0
- package/dist/modules/notifications/lib/notificationService.js +83 -28
- package/dist/modules/notifications/lib/notificationService.js.map +2 -2
- package/dist/modules/notifications/lib/notificationVisibility.js +24 -0
- package/dist/modules/notifications/lib/notificationVisibility.js.map +7 -0
- package/dist/modules/notifications/lib/routeHelpers.js +11 -1
- package/dist/modules/notifications/lib/routeHelpers.js.map +2 -2
- package/dist/modules/notifications/lib/shouldDeliver.js +46 -0
- package/dist/modules/notifications/lib/shouldDeliver.js.map +7 -0
- package/dist/modules/notifications/lib/strategies/email-delivery-strategy.js +54 -0
- package/dist/modules/notifications/lib/strategies/email-delivery-strategy.js.map +7 -0
- package/dist/modules/notifications/lib/strategies/in-app-delivery-strategy.js +12 -0
- package/dist/modules/notifications/lib/strategies/in-app-delivery-strategy.js.map +7 -0
- package/dist/modules/notifications/lib/typeCatalogue.js +71 -0
- package/dist/modules/notifications/lib/typeCatalogue.js.map +7 -0
- package/dist/modules/notifications/lib/typeChannelSettings.js +12 -0
- package/dist/modules/notifications/lib/typeChannelSettings.js.map +7 -0
- package/dist/modules/notifications/lib/typeOverrides.js +19 -0
- package/dist/modules/notifications/lib/typeOverrides.js.map +7 -0
- package/dist/modules/notifications/migrations/Migration20260625122947_notifications.js +14 -0
- package/dist/modules/notifications/migrations/Migration20260625122947_notifications.js.map +7 -0
- package/dist/modules/notifications/migrations/Migration20260626120500_notifications_push_payload.js +15 -0
- package/dist/modules/notifications/migrations/Migration20260626120500_notifications_push_payload.js.map +7 -0
- package/dist/modules/notifications/migrations/Migration20260626130000_notifications_non_opt_out.js +13 -0
- package/dist/modules/notifications/migrations/Migration20260626130000_notifications_non_opt_out.js.map +7 -0
- package/dist/modules/notifications/migrations/Migration20260626140000_notifications_type_category_silent.js +15 -0
- package/dist/modules/notifications/migrations/Migration20260626140000_notifications_type_category_silent.js.map +7 -0
- package/dist/modules/notifications/migrations/Migration20260706120000_notifications_channels.js +13 -0
- package/dist/modules/notifications/migrations/Migration20260706120000_notifications_channels.js.map +7 -0
- package/dist/modules/notifications/migrations/Migration20260716123121_notifications.js +14 -0
- package/dist/modules/notifications/migrations/Migration20260716123121_notifications.js.map +7 -0
- package/dist/modules/notifications/notification-channels.js +26 -0
- package/dist/modules/notifications/notification-channels.js.map +7 -0
- package/dist/modules/notifications/notifications.delivery-strategies.js +12 -0
- package/dist/modules/notifications/notifications.delivery-strategies.js.map +7 -0
- package/dist/modules/notifications/setup.js +16 -1
- package/dist/modules/notifications/setup.js.map +2 -2
- package/dist/modules/notifications/subscribers/deliver-notification.js +66 -57
- package/dist/modules/notifications/subscribers/deliver-notification.js.map +2 -2
- package/dist/modules/notifications/subscribers/sync-notification-types.js +16 -0
- package/dist/modules/notifications/subscribers/sync-notification-types.js.map +7 -0
- package/dist/modules/notifications/widgets/injection/profile-preferences-menu/widget.js +23 -0
- package/dist/modules/notifications/widgets/injection/profile-preferences-menu/widget.js.map +7 -0
- package/dist/modules/notifications/widgets/injection-table.js +14 -0
- package/dist/modules/notifications/widgets/injection-table.js.map +7 -0
- package/dist/modules/push_notifications/acl.js +13 -0
- package/dist/modules/push_notifications/acl.js.map +7 -0
- package/dist/modules/push_notifications/api/custom-send/route.js +141 -0
- package/dist/modules/push_notifications/api/custom-send/route.js.map +7 -0
- package/dist/modules/push_notifications/api/deliveries/[id]/route.js +110 -0
- package/dist/modules/push_notifications/api/deliveries/[id]/route.js.map +7 -0
- package/dist/modules/push_notifications/api/deliveries/route.js +56 -0
- package/dist/modules/push_notifications/api/deliveries/route.js.map +7 -0
- package/dist/modules/push_notifications/api/openapi.js +19 -0
- package/dist/modules/push_notifications/api/openapi.js.map +7 -0
- package/dist/modules/push_notifications/backend/push_notifications/[id]/page.js +103 -0
- package/dist/modules/push_notifications/backend/push_notifications/[id]/page.js.map +7 -0
- package/dist/modules/push_notifications/backend/push_notifications/[id]/page.meta.js +13 -0
- package/dist/modules/push_notifications/backend/push_notifications/[id]/page.meta.js.map +7 -0
- package/dist/modules/push_notifications/backend/push_notifications/page.js +213 -0
- package/dist/modules/push_notifications/backend/push_notifications/page.js.map +7 -0
- package/dist/modules/push_notifications/backend/push_notifications/page.meta.js +23 -0
- package/dist/modules/push_notifications/backend/push_notifications/page.meta.js.map +7 -0
- package/dist/modules/push_notifications/backend/push_notifications/send/page.js +245 -0
- package/dist/modules/push_notifications/backend/push_notifications/send/page.js.map +7 -0
- package/dist/modules/push_notifications/backend/push_notifications/send/page.meta.js +26 -0
- package/dist/modules/push_notifications/backend/push_notifications/send/page.meta.js.map +7 -0
- package/dist/modules/push_notifications/data/entities.js +92 -0
- package/dist/modules/push_notifications/data/entities.js.map +7 -0
- package/dist/modules/push_notifications/data/extensions.js +23 -0
- package/dist/modules/push_notifications/data/extensions.js.map +7 -0
- package/dist/modules/push_notifications/data/validators.js +89 -0
- package/dist/modules/push_notifications/data/validators.js.map +7 -0
- package/dist/modules/push_notifications/di.js +17 -0
- package/dist/modules/push_notifications/di.js.map +7 -0
- package/dist/modules/push_notifications/events.js +24 -0
- package/dist/modules/push_notifications/events.js.map +7 -0
- package/dist/modules/push_notifications/index.js +16 -0
- package/dist/modules/push_notifications/index.js.map +7 -0
- package/dist/modules/push_notifications/lib/fake-provider-recorder.js +80 -0
- package/dist/modules/push_notifications/lib/fake-provider-recorder.js.map +7 -0
- package/dist/modules/push_notifications/lib/push-delivery-strategy.js +54 -0
- package/dist/modules/push_notifications/lib/push-delivery-strategy.js.map +7 -0
- package/dist/modules/push_notifications/lib/push-delivery.js +297 -0
- package/dist/modules/push_notifications/lib/push-delivery.js.map +7 -0
- package/dist/modules/push_notifications/lib/push-fanout.js +138 -0
- package/dist/modules/push_notifications/lib/push-fanout.js.map +7 -0
- package/dist/modules/push_notifications/lib/push-health.js +32 -0
- package/dist/modules/push_notifications/lib/push-health.js.map +7 -0
- package/dist/modules/push_notifications/lib/push-reaper.js +87 -0
- package/dist/modules/push_notifications/lib/push-reaper.js.map +7 -0
- package/dist/modules/push_notifications/lib/push-receipt-reaper.js +136 -0
- package/dist/modules/push_notifications/lib/push-receipt-reaper.js.map +7 -0
- package/dist/modules/push_notifications/lib/push-stub-adapter.js +63 -0
- package/dist/modules/push_notifications/lib/push-stub-adapter.js.map +7 -0
- package/dist/modules/push_notifications/lib/queue.js +53 -0
- package/dist/modules/push_notifications/lib/queue.js.map +7 -0
- package/dist/modules/push_notifications/lib/reclaim-window.js +13 -0
- package/dist/modules/push_notifications/lib/reclaim-window.js.map +7 -0
- package/dist/modules/push_notifications/lib/send-custom-push.js +48 -0
- package/dist/modules/push_notifications/lib/send-custom-push.js.map +7 -0
- package/dist/modules/push_notifications/migrations/Migration20260625150049_push_notifications.js +16 -0
- package/dist/modules/push_notifications/migrations/Migration20260625150049_push_notifications.js.map +7 -0
- package/dist/modules/push_notifications/migrations/Migration20260626120000_push_notifications_silent.js +13 -0
- package/dist/modules/push_notifications/migrations/Migration20260626120000_push_notifications_silent.js.map +7 -0
- package/dist/modules/push_notifications/notifications.delivery-strategies.js +8 -0
- package/dist/modules/push_notifications/notifications.delivery-strategies.js.map +7 -0
- package/dist/modules/push_notifications/notifications.js +40 -0
- package/dist/modules/push_notifications/notifications.js.map +7 -0
- package/dist/modules/push_notifications/setup.js +52 -0
- package/dist/modules/push_notifications/setup.js.map +7 -0
- package/dist/modules/push_notifications/workers/reclaim-stuck.worker.js +57 -0
- package/dist/modules/push_notifications/workers/reclaim-stuck.worker.js.map +7 -0
- package/dist/modules/push_notifications/workers/send-push.worker.js +27 -0
- package/dist/modules/push_notifications/workers/send-push.worker.js.map +7 -0
- package/dist/modules/sales/notifications.js +8 -0
- package/dist/modules/sales/notifications.js.map +2 -2
- package/dist/modules/staff/notifications.js +6 -0
- package/dist/modules/staff/notifications.js.map +2 -2
- package/dist/modules/workflows/notifications.js +2 -0
- package/dist/modules/workflows/notifications.js.map +2 -2
- package/generated/entities/notification/index.ts +3 -0
- package/generated/entities/notification_preference/index.ts +8 -0
- package/generated/entities/notification_type/index.ts +9 -0
- package/generated/entities/notification_type_override/index.ts +7 -0
- package/generated/entities/push_notification_delivery/index.ts +19 -0
- package/generated/entities/user_device/index.ts +16 -0
- package/generated/entities.ids.generated.ts +12 -1
- package/generated/entity-fields-registry.ts +72 -0
- package/package.json +7 -7
- package/src/helpers/integration/api.ts +2 -1
- package/src/helpers/integration/appRoot.ts +13 -0
- package/src/helpers/integration/dbFixtures.ts +1 -5
- package/src/helpers/integration/pushFake.ts +219 -0
- package/src/modules/auth/i18n/de.json +1 -0
- package/src/modules/auth/i18n/en.json +1 -0
- package/src/modules/auth/i18n/es.json +1 -0
- package/src/modules/auth/i18n/ko.json +1 -0
- package/src/modules/auth/i18n/pl.json +1 -0
- package/src/modules/auth/notifications.ts +16 -0
- package/src/modules/business_rules/i18n/de.json +2 -1
- package/src/modules/business_rules/i18n/en.json +2 -1
- package/src/modules/business_rules/i18n/es.json +2 -1
- package/src/modules/business_rules/i18n/ko.json +2 -1
- package/src/modules/business_rules/i18n/pl.json +2 -1
- package/src/modules/business_rules/notifications.ts +2 -0
- package/src/modules/catalog/i18n/de.json +2 -1
- package/src/modules/catalog/i18n/en.json +2 -1
- package/src/modules/catalog/i18n/es.json +2 -1
- package/src/modules/catalog/i18n/ko.json +2 -1
- package/src/modules/catalog/i18n/pl.json +2 -1
- package/src/modules/catalog/notifications.ts +2 -0
- package/src/modules/communication_channels/acl.ts +9 -0
- package/src/modules/communication_channels/api/delete/admin/channels/[id]/route.ts +168 -0
- package/src/modules/communication_channels/api/get/channels/[id]/health/route.ts +6 -2
- package/src/modules/communication_channels/api/get/channels/[id]/route.ts +6 -2
- package/src/modules/communication_channels/api/get/channels/route.ts +2 -1
- package/src/modules/communication_channels/api/post/channels/[id]/test-send/route.ts +16 -5
- package/src/modules/communication_channels/api/post/channels/connect/credentials/route.ts +37 -1
- package/src/modules/communication_channels/api/post/channels/connect/tenant-credentials/route.ts +175 -0
- package/src/modules/communication_channels/backend/communication_channels/channels/page.tsx +11 -1
- package/src/modules/communication_channels/commands/admin-delete-channel.ts +203 -0
- package/src/modules/communication_channels/commands/connect-credential-channel.ts +63 -15
- package/src/modules/communication_channels/commands/deliver-outbound-message.ts +10 -2
- package/src/modules/communication_channels/commands/push-register.ts +7 -1
- package/src/modules/communication_channels/commands/push-unregister.ts +14 -3
- package/src/modules/communication_channels/data/entities.ts +10 -0
- package/src/modules/communication_channels/data/validators.ts +1 -0
- package/src/modules/communication_channels/i18n/de.json +35 -1
- package/src/modules/communication_channels/i18n/en.json +35 -1
- package/src/modules/communication_channels/i18n/es.json +35 -1
- package/src/modules/communication_channels/i18n/ko.json +35 -1
- package/src/modules/communication_channels/i18n/pl.json +35 -1
- package/src/modules/communication_channels/lib/access-control.ts +42 -0
- package/src/modules/communication_channels/lib/adapter.ts +25 -0
- package/src/modules/communication_channels/lib/connect-channel.ts +61 -26
- package/src/modules/communication_channels/lib/push-adapter.ts +139 -0
- package/src/modules/communication_channels/lib/push-capabilities.ts +42 -0
- package/src/modules/communication_channels/lib/push-connect-error.ts +52 -0
- package/src/modules/communication_channels/lib/push-credential-errors.ts +58 -0
- package/src/modules/communication_channels/lib/push-envelope.ts +104 -0
- package/src/modules/communication_channels/lib/refcounted-client-cache.ts +123 -0
- package/src/modules/communication_channels/migrations/.snapshot-open-mercato.json +9 -0
- package/src/modules/communication_channels/migrations/Migration20260703123630_communication_channels.ts +20 -0
- package/src/modules/communication_channels/notifications.ts +4 -0
- package/src/modules/communication_channels/setup.ts +2 -0
- package/src/modules/configs/i18n/de.json +5 -1
- package/src/modules/configs/i18n/en.json +5 -1
- package/src/modules/configs/i18n/es.json +5 -1
- package/src/modules/configs/i18n/ko.json +5 -1
- package/src/modules/configs/i18n/pl.json +5 -1
- package/src/modules/configs/lib/upgrade-actions.ts +21 -0
- package/src/modules/customer_accounts/i18n/de.json +2 -1
- package/src/modules/customer_accounts/i18n/en.json +2 -1
- package/src/modules/customer_accounts/i18n/es.json +2 -1
- package/src/modules/customer_accounts/i18n/ko.json +2 -1
- package/src/modules/customer_accounts/i18n/pl.json +2 -1
- package/src/modules/customer_accounts/notifications.ts +12 -0
- package/src/modules/customers/i18n/de.json +2 -1
- package/src/modules/customers/i18n/en.json +2 -1
- package/src/modules/customers/i18n/es.json +2 -1
- package/src/modules/customers/i18n/ko.json +2 -1
- package/src/modules/customers/i18n/pl.json +2 -1
- package/src/modules/customers/notifications.ts +4 -0
- package/src/modules/devices/AGENTS.md +101 -0
- package/src/modules/devices/acl.ts +7 -0
- package/src/modules/devices/api/[id]/route.ts +180 -0
- package/src/modules/devices/api/admin/devices/[id]/route.ts +235 -0
- package/src/modules/devices/api/admin/devices/route.ts +160 -0
- package/src/modules/devices/api/auth.ts +13 -0
- package/src/modules/devices/api/deviceList.ts +54 -0
- package/src/modules/devices/api/deviceOps.ts +186 -0
- package/src/modules/devices/api/openapi.ts +23 -0
- package/src/modules/devices/api/route.ts +165 -0
- package/src/modules/devices/backend/devices/[id]/page.meta.ts +12 -0
- package/src/modules/devices/backend/devices/[id]/page.tsx +164 -0
- package/src/modules/devices/backend/devices/create/page.meta.ts +12 -0
- package/src/modules/devices/backend/devices/create/page.tsx +81 -0
- package/src/modules/devices/backend/devices/page.meta.ts +21 -0
- package/src/modules/devices/backend/devices/page.tsx +259 -0
- package/src/modules/devices/commands/deactivate.ts +126 -0
- package/src/modules/devices/commands/index.ts +3 -0
- package/src/modules/devices/commands/register.ts +199 -0
- package/src/modules/devices/commands/shared.ts +119 -0
- package/src/modules/devices/commands/update.ts +142 -0
- package/src/modules/devices/data/entities.ts +79 -0
- package/src/modules/devices/data/validators.ts +65 -0
- package/src/modules/devices/di.ts +9 -0
- package/src/modules/devices/encryption.ts +15 -0
- package/src/modules/devices/events.ts +16 -0
- package/src/modules/devices/i18n/de.json +45 -0
- package/src/modules/devices/i18n/en.json +45 -0
- package/src/modules/devices/i18n/es.json +45 -0
- package/src/modules/devices/i18n/ko.json +45 -0
- package/src/modules/devices/i18n/pl.json +45 -0
- package/src/modules/devices/index.ts +15 -0
- package/src/modules/devices/lib/operationMetadata.ts +35 -0
- package/src/modules/devices/migrations/.snapshot-open-mercato.json +200 -0
- package/src/modules/devices/migrations/Migration20260602120000.ts +15 -0
- package/src/modules/devices/migrations/Migration20260630120000.ts +20 -0
- package/src/modules/devices/migrations/Migration20260701120000.ts +13 -0
- package/src/modules/devices/migrations/Migration20260721120000.ts +18 -0
- package/src/modules/devices/setup.ts +11 -0
- package/src/modules/entities/cli.ts +16 -2
- package/src/modules/entities/migrations/Migration20260722120000.ts +38 -0
- package/src/modules/inbox_ops/i18n/de.json +2 -1
- package/src/modules/inbox_ops/i18n/en.json +2 -1
- package/src/modules/inbox_ops/i18n/es.json +2 -1
- package/src/modules/inbox_ops/i18n/ko.json +2 -1
- package/src/modules/inbox_ops/i18n/pl.json +2 -1
- package/src/modules/inbox_ops/notifications.ts +2 -0
- package/src/modules/messages/i18n/de.json +2 -1
- package/src/modules/messages/i18n/en.json +2 -1
- package/src/modules/messages/i18n/es.json +2 -1
- package/src/modules/messages/i18n/ko.json +2 -1
- package/src/modules/messages/i18n/pl.json +2 -1
- package/src/modules/messages/notifications.ts +2 -0
- package/src/modules/notifications/AGENTS.md +54 -0
- package/src/modules/notifications/acl.ts +2 -0
- package/src/modules/notifications/api/admin/preferences/route.ts +193 -0
- package/src/modules/notifications/api/channels/route.ts +54 -0
- package/src/modules/notifications/api/preferences/route.ts +131 -0
- package/src/modules/notifications/api/route.ts +8 -1
- package/src/modules/notifications/api/types/[id]/channels/[channel]/route.ts +226 -0
- package/src/modules/notifications/api/types/route.ts +239 -0
- package/src/modules/notifications/api/unread-count/route.ts +5 -1
- package/src/modules/notifications/backend/notifications/user-preferences/page.meta.ts +26 -0
- package/src/modules/notifications/backend/notifications/user-preferences/page.tsx +12 -0
- package/src/modules/notifications/backend/profile/notification-preferences/page.meta.ts +31 -0
- package/src/modules/notifications/backend/profile/notification-preferences/page.tsx +12 -0
- package/src/modules/notifications/data/entities.ts +144 -0
- package/src/modules/notifications/data/validators.ts +116 -0
- package/src/modules/notifications/di.ts +7 -0
- package/src/modules/notifications/events.ts +23 -0
- package/src/modules/notifications/frontend/NotificationPreferenceMatrix.tsx +287 -0
- package/src/modules/notifications/frontend/NotificationPreferencesPageClient.tsx +155 -0
- package/src/modules/notifications/frontend/NotificationSettingsPageClient.tsx +273 -2
- package/src/modules/notifications/frontend/NotificationUserPreferencesAdminPageClient.tsx +214 -0
- package/src/modules/notifications/generators.ts +82 -0
- package/src/modules/notifications/i18n/de.json +43 -0
- package/src/modules/notifications/i18n/en.json +43 -0
- package/src/modules/notifications/i18n/es.json +43 -0
- package/src/modules/notifications/i18n/ko.json +43 -0
- package/src/modules/notifications/i18n/pl.json +44 -1
- package/src/modules/notifications/lib/delivery-strategies-registry.ts +30 -0
- package/src/modules/notifications/lib/deliveryStrategies.ts +40 -4
- package/src/modules/notifications/lib/derive-category.ts +15 -0
- package/src/modules/notifications/lib/notification-channel-registry.ts +59 -0
- package/src/modules/notifications/lib/notification-type-registry.ts +182 -0
- package/src/modules/notifications/lib/notificationCopy.ts +34 -0
- package/src/modules/notifications/lib/notificationFactory.ts +5 -1
- package/src/modules/notifications/lib/notificationMapper.ts +2 -0
- package/src/modules/notifications/lib/notificationPreferenceService.ts +138 -0
- package/src/modules/notifications/lib/notificationService.ts +129 -25
- package/src/modules/notifications/lib/notificationVisibility.ts +48 -0
- package/src/modules/notifications/lib/routeHelpers.ts +14 -1
- package/src/modules/notifications/lib/shouldDeliver.ts +112 -0
- package/src/modules/notifications/lib/strategies/email-delivery-strategy.ts +63 -0
- package/src/modules/notifications/lib/strategies/in-app-delivery-strategy.ts +21 -0
- package/src/modules/notifications/lib/typeCatalogue.ts +141 -0
- package/src/modules/notifications/lib/typeChannelSettings.ts +29 -0
- package/src/modules/notifications/lib/typeOverrides.ts +46 -0
- package/src/modules/notifications/migrations/.snapshot-open-mercato.json +874 -100
- package/src/modules/notifications/migrations/Migration20260625122947_notifications.ts +14 -0
- package/src/modules/notifications/migrations/Migration20260626120500_notifications_push_payload.ts +15 -0
- package/src/modules/notifications/migrations/Migration20260626130000_notifications_non_opt_out.ts +13 -0
- package/src/modules/notifications/migrations/Migration20260626140000_notifications_type_category_silent.ts +15 -0
- package/src/modules/notifications/migrations/Migration20260706120000_notifications_channels.ts +13 -0
- package/src/modules/notifications/migrations/Migration20260716123121_notifications.ts +14 -0
- package/src/modules/notifications/notification-channels.ts +30 -0
- package/src/modules/notifications/notifications.delivery-strategies.ts +15 -0
- package/src/modules/notifications/setup.ts +23 -1
- package/src/modules/notifications/subscribers/deliver-notification.ts +105 -71
- package/src/modules/notifications/subscribers/sync-notification-types.ts +18 -0
- package/src/modules/notifications/widgets/injection/profile-preferences-menu/widget.ts +35 -0
- package/src/modules/notifications/widgets/injection-table.ts +18 -0
- package/src/modules/push_notifications/AGENTS.md +92 -0
- package/src/modules/push_notifications/acl.ts +9 -0
- package/src/modules/push_notifications/api/custom-send/route.ts +175 -0
- package/src/modules/push_notifications/api/deliveries/[id]/route.ts +122 -0
- package/src/modules/push_notifications/api/deliveries/route.ts +58 -0
- package/src/modules/push_notifications/api/openapi.ts +22 -0
- package/src/modules/push_notifications/backend/push_notifications/[id]/page.meta.ts +9 -0
- package/src/modules/push_notifications/backend/push_notifications/[id]/page.tsx +149 -0
- package/src/modules/push_notifications/backend/push_notifications/page.meta.ts +21 -0
- package/src/modules/push_notifications/backend/push_notifications/page.tsx +239 -0
- package/src/modules/push_notifications/backend/push_notifications/send/page.meta.ts +24 -0
- package/src/modules/push_notifications/backend/push_notifications/send/page.tsx +327 -0
- package/src/modules/push_notifications/data/entities.ts +111 -0
- package/src/modules/push_notifications/data/extensions.ts +29 -0
- package/src/modules/push_notifications/data/validators.ts +102 -0
- package/src/modules/push_notifications/di.ts +20 -0
- package/src/modules/push_notifications/events.ts +21 -0
- package/src/modules/push_notifications/i18n/de.json +79 -0
- package/src/modules/push_notifications/i18n/en.json +79 -0
- package/src/modules/push_notifications/i18n/es.json +79 -0
- package/src/modules/push_notifications/i18n/ko.json +79 -0
- package/src/modules/push_notifications/i18n/pl.json +79 -0
- package/src/modules/push_notifications/index.ts +15 -0
- package/src/modules/push_notifications/lib/fake-provider-recorder.ts +154 -0
- package/src/modules/push_notifications/lib/push-delivery-strategy.ts +90 -0
- package/src/modules/push_notifications/lib/push-delivery.ts +455 -0
- package/src/modules/push_notifications/lib/push-fanout.ts +237 -0
- package/src/modules/push_notifications/lib/push-health.ts +47 -0
- package/src/modules/push_notifications/lib/push-reaper.ts +140 -0
- package/src/modules/push_notifications/lib/push-receipt-reaper.ts +210 -0
- package/src/modules/push_notifications/lib/push-stub-adapter.ts +80 -0
- package/src/modules/push_notifications/lib/queue.ts +74 -0
- package/src/modules/push_notifications/lib/reclaim-window.ts +16 -0
- package/src/modules/push_notifications/lib/send-custom-push.ts +100 -0
- package/src/modules/push_notifications/migrations/.snapshot-open-mercato.json +386 -0
- package/src/modules/push_notifications/migrations/Migration20260625150049_push_notifications.ts +16 -0
- package/src/modules/push_notifications/migrations/Migration20260626120000_push_notifications_silent.ts +13 -0
- package/src/modules/push_notifications/notifications.delivery-strategies.ts +8 -0
- package/src/modules/push_notifications/notifications.ts +50 -0
- package/src/modules/push_notifications/setup.ts +92 -0
- package/src/modules/push_notifications/workers/reclaim-stuck.worker.ts +78 -0
- package/src/modules/push_notifications/workers/send-push.worker.ts +34 -0
- package/src/modules/sales/i18n/de.json +1 -0
- package/src/modules/sales/i18n/en.json +1 -0
- package/src/modules/sales/i18n/es.json +1 -0
- package/src/modules/sales/i18n/ko.json +1 -0
- package/src/modules/sales/i18n/pl.json +1 -0
- package/src/modules/sales/notifications.ts +8 -0
- package/src/modules/staff/i18n/de.json +1 -0
- package/src/modules/staff/i18n/en.json +1 -0
- package/src/modules/staff/i18n/es.json +1 -0
- package/src/modules/staff/i18n/ko.json +1 -0
- package/src/modules/staff/i18n/pl.json +1 -0
- package/src/modules/staff/notifications.ts +6 -0
- package/src/modules/workflows/i18n/de.json +1 -0
- package/src/modules/workflows/i18n/en.json +1 -0
- package/src/modules/workflows/i18n/es.json +1 -0
- package/src/modules/workflows/i18n/ko.json +1 -0
- package/src/modules/workflows/i18n/pl.json +1 -0
- package/src/modules/workflows/notifications.ts +2 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
{
|
|
2
|
+
"push_notifications.deliveries.columns.attempts": "Próby",
|
|
3
|
+
"push_notifications.deliveries.columns.created": "Utworzono",
|
|
4
|
+
"push_notifications.deliveries.columns.provider": "Dostawca",
|
|
5
|
+
"push_notifications.deliveries.columns.sent": "Wysłano",
|
|
6
|
+
"push_notifications.deliveries.columns.status": "Status",
|
|
7
|
+
"push_notifications.deliveries.columns.type": "Typ",
|
|
8
|
+
"push_notifications.deliveries.columns.user": "Użytkownik",
|
|
9
|
+
"push_notifications.deliveries.detail.device": "Urządzenie",
|
|
10
|
+
"push_notifications.deliveries.detail.lastError": "Ostatni błąd",
|
|
11
|
+
"push_notifications.deliveries.detail.loading": "Wczytywanie dostarczenia…",
|
|
12
|
+
"push_notifications.deliveries.detail.nextRetry": "Następna próba",
|
|
13
|
+
"push_notifications.deliveries.detail.pageTitle": "Dostarczenie push",
|
|
14
|
+
"push_notifications.deliveries.detail.payload": "Payload",
|
|
15
|
+
"push_notifications.deliveries.detail.providerResponse": "Odpowiedź dostawcy",
|
|
16
|
+
"push_notifications.deliveries.detail.tokenSnapshot": "Token (ostatnie 8)",
|
|
17
|
+
"push_notifications.deliveries.empty": "Brak dostarczeń push",
|
|
18
|
+
"push_notifications.deliveries.error.loadFailed": "Nie udało się wczytać dostarczeń push",
|
|
19
|
+
"push_notifications.deliveries.filters.created": "Utworzono",
|
|
20
|
+
"push_notifications.deliveries.filters.from": "Od",
|
|
21
|
+
"push_notifications.deliveries.filters.to": "Do",
|
|
22
|
+
"push_notifications.deliveries.noValue": "—",
|
|
23
|
+
"push_notifications.deliveries.pageTitle": "Dostarczenia push",
|
|
24
|
+
"push_notifications.deliveries.status.expired": "Wygasłe",
|
|
25
|
+
"push_notifications.deliveries.status.failed": "Nieudane",
|
|
26
|
+
"push_notifications.deliveries.status.pending": "Oczekujące",
|
|
27
|
+
"push_notifications.deliveries.status.sending": "Wysyłanie",
|
|
28
|
+
"push_notifications.deliveries.status.sent": "Wysłane",
|
|
29
|
+
"push_notifications.deliveries.status.skipped": "Pominięte",
|
|
30
|
+
"push_notifications.deliveries.title": "Dostarczenia push",
|
|
31
|
+
"push_notifications.errors.forbidden": "Brak dostępu",
|
|
32
|
+
"push_notifications.errors.invalid_id": "Nieprawidłowy identyfikator dostarczenia",
|
|
33
|
+
"push_notifications.errors.invalid_payload": "Nieprawidłowe żądanie",
|
|
34
|
+
"push_notifications.errors.not_found": "Nie znaleziono dostarczenia",
|
|
35
|
+
"push_notifications.errors.send_failed": "Nie udało się wysłać powiadomienia push",
|
|
36
|
+
"push_notifications.errors.server_error": "Coś poszło nie tak",
|
|
37
|
+
"push_notifications.errors.unauthorized": "Brak autoryzacji",
|
|
38
|
+
"push_notifications.send.badge": "Liczba na odznace",
|
|
39
|
+
"push_notifications.send.body": "Treść",
|
|
40
|
+
"push_notifications.send.channelId": "ID kanału Android",
|
|
41
|
+
"push_notifications.send.data": "Dane (własne klucze/wartości)",
|
|
42
|
+
"push_notifications.send.dataAdd": "Dodaj pole",
|
|
43
|
+
"push_notifications.send.dataEmpty": "Brak własnych danych.",
|
|
44
|
+
"push_notifications.send.dataHint": "Dostarczane w payloadzie push — odczytuje je Twoja aplikacja. Dla cichego push to całość danych.",
|
|
45
|
+
"push_notifications.send.dataKey": "klucz",
|
|
46
|
+
"push_notifications.send.dataRemove": "Usuń pole",
|
|
47
|
+
"push_notifications.send.dataValue": "wartość",
|
|
48
|
+
"push_notifications.send.device": "Urządzenie",
|
|
49
|
+
"push_notifications.send.deviceAll": "Wszystkie urządzenia",
|
|
50
|
+
"push_notifications.send.deviceHint": "Wyślij na to konkretne urządzenie lub na wszystkie urządzenia odbiorcy.",
|
|
51
|
+
"push_notifications.send.deviceNone": "Ten odbiorca nie ma urządzeń obsługujących push",
|
|
52
|
+
"push_notifications.send.deviceSelectUserFirst": "Najpierw wybierz odbiorcę",
|
|
53
|
+
"push_notifications.send.image": "URL obrazu",
|
|
54
|
+
"push_notifications.send.message": "Wiadomość",
|
|
55
|
+
"push_notifications.send.mode": "Dostarczenie",
|
|
56
|
+
"push_notifications.send.modeHint": "Widoczne pokazuje baner; ciche to dane w tle bez baneru.",
|
|
57
|
+
"push_notifications.send.modeSilent": "Ciche (w tle)",
|
|
58
|
+
"push_notifications.send.modeVisible": "Widoczne",
|
|
59
|
+
"push_notifications.send.options": "Opcje push",
|
|
60
|
+
"push_notifications.send.optionsHint": "Opcjonalne ustawienia dostawcy. Dźwięk/odznaka/obraz dotyczą powiadomień widocznych.",
|
|
61
|
+
"push_notifications.send.pageTitle": "Wyślij push",
|
|
62
|
+
"push_notifications.send.priority": "Priorytet",
|
|
63
|
+
"push_notifications.send.priorityDefault": "Domyślny",
|
|
64
|
+
"push_notifications.send.priorityHigh": "Wysoki",
|
|
65
|
+
"push_notifications.send.priorityNormal": "Normalny",
|
|
66
|
+
"push_notifications.send.sound": "Dźwięk",
|
|
67
|
+
"push_notifications.send.submit": "Wyślij push",
|
|
68
|
+
"push_notifications.send.success": "Push zakolejkowany do wysłania",
|
|
69
|
+
"push_notifications.send.title": "Tytuł",
|
|
70
|
+
"push_notifications.send.userId": "Odbiorca",
|
|
71
|
+
"push_notifications.send.userIdHint": "Wyszukaj po nazwie lub e-mailu — push trafi na jego urządzenia.",
|
|
72
|
+
"push_notifications.types.admin_custom_message.body": "Masz nową wiadomość.",
|
|
73
|
+
"push_notifications.types.admin_custom_message.label": "Wiadomość administratora",
|
|
74
|
+
"push_notifications.types.admin_custom_message.title": "Wiadomość administratora",
|
|
75
|
+
"push_notifications.types.admin_custom_silent.body": "Aktualizacja w tle.",
|
|
76
|
+
"push_notifications.types.admin_custom_silent.label": "Ciche powiadomienie administratora",
|
|
77
|
+
"push_notifications.types.admin_custom_silent.title": "Ciche powiadomienie",
|
|
78
|
+
"push_notifications.warnings.no_matching_devices_in_scope": "Żadne urządzenie odbiorcy obsługujące powiadomienia push nie pasowało do wybranego zakresu, więc nic nie wysłano."
|
|
79
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ModuleInfo } from '@open-mercato/shared/modules/registry'
|
|
2
|
+
|
|
3
|
+
export const metadata: ModuleInfo = {
|
|
4
|
+
name: 'push_notifications',
|
|
5
|
+
title: 'Push Notifications',
|
|
6
|
+
version: '0.1.0',
|
|
7
|
+
description:
|
|
8
|
+
'Push delivery rails: a `push` notification delivery strategy that fans out to registered devices and sends through the communication_channels hub.',
|
|
9
|
+
author: 'Open Mercato Team',
|
|
10
|
+
license: 'MIT',
|
|
11
|
+
requires: ['auth', 'devices', 'notifications', 'communication_channels', 'integrations'],
|
|
12
|
+
ejectable: true,
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { features } from './acl'
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { randomBytes } from 'node:crypto'
|
|
2
|
+
import fs from 'node:fs'
|
|
3
|
+
import path from 'node:path'
|
|
4
|
+
import { parseBooleanToken } from '@open-mercato/shared/lib/boolean'
|
|
5
|
+
import { createLogger } from '@open-mercato/shared/lib/logger'
|
|
6
|
+
|
|
7
|
+
const logger = createLogger('push_notifications')
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Test-only sink recording the **provider-native** message each push adapter handed its SDK client.
|
|
11
|
+
*
|
|
12
|
+
* The `channel-{fcm,apns,expo}` fakes replace the SDK *client*, not the adapter — so the real adapter
|
|
13
|
+
* builds the native message, but nothing persists it: no adapter returns `metadata` on success, and
|
|
14
|
+
* APNs deliberately reports an empty `externalMessageId` (its value reaches the admin-exposed
|
|
15
|
+
* `provider_response`, which must never carry token material). The message is therefore written here,
|
|
16
|
+
* out of band.
|
|
17
|
+
*
|
|
18
|
+
* **Why a file and not an in-memory recorder.** The adapter does not run in the spec's process, and
|
|
19
|
+
* *which* process it runs in is not fixed: the send happens in the Next.js app server (which may
|
|
20
|
+
* process the job inline), in a drain child that `drainIntegrationQueue` spawns whenever
|
|
21
|
+
* `OM_TEST_APP_ROOT` is set, or — only in the monorepo path — in the Playwright process itself. A
|
|
22
|
+
* module-level array would live in whichever of those three ran the adapter, and the spec could read it
|
|
23
|
+
* in just one. The queue already crosses exactly these boundaries through `QUEUE_BASE_DIR`, so the sink
|
|
24
|
+
* rides the same directory rather than inventing a second IPC channel.
|
|
25
|
+
*
|
|
26
|
+
* Production safety: every entry point is a no-op unless `OM_PUSH_FAKE_PROVIDERS` is set. Mirrors
|
|
27
|
+
* `ensurePushStubAdapterRegistered()` in ./push-stub-adapter.ts.
|
|
28
|
+
*/
|
|
29
|
+
export const PUSH_FAKE_PROVIDERS_ENV = 'OM_PUSH_FAKE_PROVIDERS'
|
|
30
|
+
|
|
31
|
+
const LOG_FILE_NAME = 'push-fake-messages.jsonl'
|
|
32
|
+
|
|
33
|
+
export type FakePushProvider = 'fcm' | 'apns' | 'expo'
|
|
34
|
+
|
|
35
|
+
export type FakePushEntry = {
|
|
36
|
+
provider: FakePushProvider
|
|
37
|
+
tokenTail: string
|
|
38
|
+
native: Record<string, unknown>
|
|
39
|
+
at: string
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function isPushFakeProvidersEnabled(): boolean {
|
|
43
|
+
return parseBooleanToken(process.env[PUSH_FAKE_PROVIDERS_ENV]) === true
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const warnedFakeProviders = new Set<FakePushProvider>()
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Loudly flag — exactly once per provider per process — that a push adapter is running against the
|
|
50
|
+
* network-free fake instead of the real SDK. `OM_PUSH_FAKE_PROVIDERS` is a test-harness flag, and a
|
|
51
|
+
* legitimate-but-misplaced `=1` (e.g. a staging env block promoted to prod) would otherwise report
|
|
52
|
+
* every push as `sent` with no delivery, no log line, and no admin signal for days. This warn plus the
|
|
53
|
+
* `degraded` health status (see `makePushClientConfigHealthCheck`) make that misconfiguration visible.
|
|
54
|
+
*/
|
|
55
|
+
export function warnPushFakeProvidersActive(provider: FakePushProvider): void {
|
|
56
|
+
if (!isPushFakeProvidersEnabled() || warnedFakeProviders.has(provider)) return
|
|
57
|
+
warnedFakeProviders.add(provider)
|
|
58
|
+
logger.warn(
|
|
59
|
+
`${provider} push adapter is running in FAKE mode (${PUSH_FAKE_PROVIDERS_ENV} is set): messages are recorded, NOT delivered. This must never be set in production.`,
|
|
60
|
+
{ provider, env: PUSH_FAKE_PROVIDERS_ENV },
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* The one place the queue base dir is resolved. The worker process, the drain child, and the spec must
|
|
66
|
+
* all agree, so every caller goes through this: `QUEUE_BASE_DIR` when set (the harness always sets it,
|
|
67
|
+
* and `drainIntegrationQueue` propagates it to its child), else `<appRoot>/.mercato/queue`.
|
|
68
|
+
*
|
|
69
|
+
* In the app/worker process `cwd` IS the app root. The Playwright process runs from the repo root, so
|
|
70
|
+
* `helpers/integration/pushFake` sets `QUEUE_BASE_DIR` before anything reads it — this fallback is never
|
|
71
|
+
* reached there.
|
|
72
|
+
*/
|
|
73
|
+
export function resolveQueueBaseDir(): string {
|
|
74
|
+
const explicit = process.env.QUEUE_BASE_DIR?.trim()
|
|
75
|
+
if (explicit) return explicit
|
|
76
|
+
return path.resolve(process.env.OM_TEST_APP_ROOT?.trim() || process.cwd(), '.mercato/queue')
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function resolveFakePushLogPath(): string {
|
|
80
|
+
return path.join(resolveQueueBaseDir(), LOG_FILE_NAME)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** Token tail used to key entries — never the raw token (mirrors `token_snapshot` on the delivery row). */
|
|
84
|
+
export function pushTokenTail(token: string): string {
|
|
85
|
+
return token.slice(-8)
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* An 8-char token tail unique to this run.
|
|
90
|
+
*
|
|
91
|
+
* The sink is append-only and is NOT truncated between runs on the reused-environment path
|
|
92
|
+
* (`tryReuseExistingEnvironment` does not wipe `QUEUE_BASE_DIR`, unlike the fresh path). A compile-time
|
|
93
|
+
* constant tail would therefore let a *previous* run's entry satisfy an assertion before this run's
|
|
94
|
+
* worker had written anything — a false pass. Uniqueness also isolates specs running in parallel.
|
|
95
|
+
*/
|
|
96
|
+
export function uniquePushTokenTail(): string {
|
|
97
|
+
return randomBytes(4).toString('hex').toUpperCase()
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export function recordFakePush(provider: FakePushProvider, token: string, native: Record<string, unknown>): void {
|
|
101
|
+
if (!isPushFakeProvidersEnabled()) return
|
|
102
|
+
const entry: FakePushEntry = {
|
|
103
|
+
provider,
|
|
104
|
+
tokenTail: pushTokenTail(token),
|
|
105
|
+
native,
|
|
106
|
+
at: new Date().toISOString(),
|
|
107
|
+
}
|
|
108
|
+
const filePath = resolveFakePushLogPath()
|
|
109
|
+
fs.mkdirSync(path.dirname(filePath), { recursive: true })
|
|
110
|
+
// A single `O_APPEND` write of one short line — concurrent deliveries interleave by line, not within one.
|
|
111
|
+
fs.appendFileSync(filePath, `${JSON.stringify(entry)}\n`, 'utf8')
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function parseEntry(line: string): FakePushEntry | null {
|
|
115
|
+
try {
|
|
116
|
+
return JSON.parse(line) as FakePushEntry
|
|
117
|
+
} catch {
|
|
118
|
+
// A reader can observe a line the writer has not finished appending. Skipping it lets the caller
|
|
119
|
+
// poll again; throwing would permanently fail the enclosing `expect.poll`.
|
|
120
|
+
return null
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export function readFakePushLog(): FakePushEntry[] {
|
|
125
|
+
const filePath = resolveFakePushLogPath()
|
|
126
|
+
if (!fs.existsSync(filePath)) return []
|
|
127
|
+
return fs
|
|
128
|
+
.readFileSync(filePath, 'utf8')
|
|
129
|
+
.split('\n')
|
|
130
|
+
.filter((line) => line.trim().length > 0)
|
|
131
|
+
.map(parseEntry)
|
|
132
|
+
.filter((entry): entry is FakePushEntry => entry !== null)
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Find the message a spec's own device produced. `tokenTail` should come from
|
|
137
|
+
* {@link uniquePushTokenTail}; `sinceIso` additionally rejects entries predating the caller, so a stale
|
|
138
|
+
* sink can never satisfy an assertion.
|
|
139
|
+
*/
|
|
140
|
+
export function findFakePush(
|
|
141
|
+
provider: FakePushProvider,
|
|
142
|
+
tokenTail: string,
|
|
143
|
+
sinceIso?: string,
|
|
144
|
+
): FakePushEntry | undefined {
|
|
145
|
+
return readFakePushLog()
|
|
146
|
+
.filter((entry) => entry.provider === provider && entry.tokenTail === tokenTail)
|
|
147
|
+
.filter((entry) => !sinceIso || entry.at >= sinceIso)
|
|
148
|
+
.pop()
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export function clearFakePushLog(): void {
|
|
152
|
+
const filePath = resolveFakePushLogPath()
|
|
153
|
+
if (fs.existsSync(filePath)) fs.rmSync(filePath)
|
|
154
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { EntityManager } from '@mikro-orm/postgresql'
|
|
2
|
+
import type { NotificationDeliveryStrategy } from '@open-mercato/core/modules/notifications/lib/deliveryStrategies'
|
|
3
|
+
import { getNotificationType } from '@open-mercato/core/modules/notifications/lib/notification-type-registry'
|
|
4
|
+
import type { PushOptions } from '@open-mercato/core/modules/communication_channels/lib/push-envelope'
|
|
5
|
+
import type { NotificationCopySource } from '@open-mercato/core/modules/notifications/lib/notificationCopy'
|
|
6
|
+
import { fanOutPushDeliveries, PUSH_CHANNEL, type PushFanoutPayload } from './push-fanout'
|
|
7
|
+
|
|
8
|
+
export { PUSH_CHANNEL } from './push-fanout'
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* `push` notification delivery strategy.
|
|
12
|
+
*
|
|
13
|
+
* Registered into the notifications strategy seam (see notifications.delivery-strategies.ts).
|
|
14
|
+
* Runs inside the persistent `notifications:deliver` subscriber for every created notification.
|
|
15
|
+
* It only enqueues fast work — the actual provider send (with retry/backoff) happens in the
|
|
16
|
+
* `send-push` worker, so a slow/unavailable provider never blocks notification creation.
|
|
17
|
+
*
|
|
18
|
+
* Whether a push is silent (content-available wake-up) is a property of the registered
|
|
19
|
+
* notification TYPE (`NotificationTypeDefinition.silent`), never a per-call flag. `silent`
|
|
20
|
+
* controls only HOW the device is notified (background wake-up vs visible alert); it does not
|
|
21
|
+
* imply the push is non-opt-out. Silent types still respect the recipient's per-channel
|
|
22
|
+
* preference unless the type is `nonOptOut` — to force a silent push, mark the type
|
|
23
|
+
* `nonOptOut: true`. A silent push is therefore just a notification created through the normal
|
|
24
|
+
* `notificationService.create()` flow whose type is `silent: true`; there is no separate helper.
|
|
25
|
+
*
|
|
26
|
+
* The shared device/channel fan-out lives in {@link fanOutPushDeliveries}.
|
|
27
|
+
*/
|
|
28
|
+
export const mobilePushDeliveryStrategy: NotificationDeliveryStrategy = {
|
|
29
|
+
id: PUSH_CHANNEL,
|
|
30
|
+
label: 'Mobile push',
|
|
31
|
+
// Attempt push whenever a tenant has a push channel configured; the fan-out short-circuits
|
|
32
|
+
// (no rows, no enqueue) when push is not set up for the tenant/recipient.
|
|
33
|
+
defaultEnabled: true,
|
|
34
|
+
async deliver(ctx) {
|
|
35
|
+
const { notification } = ctx
|
|
36
|
+
const tenantId = notification.tenantId
|
|
37
|
+
const userId = notification.recipientUserId
|
|
38
|
+
const organizationId = notification.organizationId ?? null
|
|
39
|
+
|
|
40
|
+
// Skip unknown types (the catalogue is the source of truth for what can notify a user).
|
|
41
|
+
const type = getNotificationType(notification.type)
|
|
42
|
+
if (!type) return
|
|
43
|
+
|
|
44
|
+
const em = ctx.resolve('em') as EntityManager
|
|
45
|
+
const silent = type.silent === true
|
|
46
|
+
|
|
47
|
+
// Per-channel opt-out / `nonOptOut` is enforced once, upstream, at create time: the dispatcher
|
|
48
|
+
// only invokes this strategy when `push ∈ notification.channels` (the resolved target snapshot).
|
|
49
|
+
// `silent` still controls delivery STYLE only (content-available wake-up vs visible alert).
|
|
50
|
+
|
|
51
|
+
// App-readable data payload: caller-supplied custom fields plus the system identifiers.
|
|
52
|
+
const data: Record<string, string> = { ...(notification.data ?? {}) }
|
|
53
|
+
data.notificationId = notification.id
|
|
54
|
+
data.type = notification.type
|
|
55
|
+
if (notification.linkHref) data.linkHref = notification.linkHref
|
|
56
|
+
|
|
57
|
+
const payload: PushFanoutPayload = {
|
|
58
|
+
data,
|
|
59
|
+
options: (notification.pushOptions ?? undefined) as PushOptions | undefined,
|
|
60
|
+
silent,
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// For visible notifications, hand the raw copy down so the fan-out can translate title/body per
|
|
64
|
+
// device locale. `ctx.title`/`ctx.body` are already resolved in the default locale and serve as
|
|
65
|
+
// the fallback. Silent pushes carry no user-facing copy, so they skip translation entirely.
|
|
66
|
+
const copy: NotificationCopySource | undefined = silent
|
|
67
|
+
? undefined
|
|
68
|
+
: {
|
|
69
|
+
titleKey: notification.titleKey ?? null,
|
|
70
|
+
bodyKey: notification.bodyKey ?? null,
|
|
71
|
+
titleVariables: notification.titleVariables ?? null,
|
|
72
|
+
bodyVariables: notification.bodyVariables ?? null,
|
|
73
|
+
title: ctx.title,
|
|
74
|
+
body: ctx.body,
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
await fanOutPushDeliveries({
|
|
78
|
+
em,
|
|
79
|
+
resolve: ctx.resolve,
|
|
80
|
+
scope: { tenantId, organizationId },
|
|
81
|
+
userId,
|
|
82
|
+
notificationId: notification.id,
|
|
83
|
+
notificationTypeId: notification.type,
|
|
84
|
+
payload,
|
|
85
|
+
copy,
|
|
86
|
+
})
|
|
87
|
+
},
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export default mobilePushDeliveryStrategy
|