@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,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"devices.errors.already_registered": "Dieses Gerät ist bereits registriert",
|
|
3
|
+
"devices.errors.delete_failed": "Gerät konnte nicht gelöscht werden",
|
|
4
|
+
"devices.errors.forbidden": "Zugriff verweigert",
|
|
5
|
+
"devices.errors.invalid_id": "Ungültige Geräte-ID",
|
|
6
|
+
"devices.errors.invalid_payload": "Ungültige Gerätedaten",
|
|
7
|
+
"devices.errors.load_failed": "Gerät konnte nicht geladen werden",
|
|
8
|
+
"devices.errors.not_found": "Gerät nicht gefunden",
|
|
9
|
+
"devices.errors.register_failed": "Gerät konnte nicht registriert werden",
|
|
10
|
+
"devices.errors.unauthorized": "Nicht autorisiert",
|
|
11
|
+
"devices.errors.update_failed": "Gerät konnte nicht aktualisiert werden",
|
|
12
|
+
"devices.errors.user_not_found": "Zielbenutzer in diesem Mandanten nicht gefunden",
|
|
13
|
+
"devices.form.appVersion": "App-Version",
|
|
14
|
+
"devices.form.createTitle": "Gerät registrieren",
|
|
15
|
+
"devices.form.details": "Gerät",
|
|
16
|
+
"devices.form.deviceId": "Geräte-ID",
|
|
17
|
+
"devices.form.editTitle": "Gerät bearbeiten",
|
|
18
|
+
"devices.form.error.loadFailed": "Gerät konnte nicht geladen werden",
|
|
19
|
+
"devices.form.osVersion": "OS-Version",
|
|
20
|
+
"devices.form.platform": "Plattform",
|
|
21
|
+
"devices.form.pushProvider": "Push-Anbieter",
|
|
22
|
+
"devices.form.pushToken": "Push-Token",
|
|
23
|
+
"devices.form.pushTokenHint": "Optional. Sicher gespeichert und nie wieder angezeigt.",
|
|
24
|
+
"devices.form.success.created": "Gerät registriert",
|
|
25
|
+
"devices.form.success.updated": "Gerät aktualisiert",
|
|
26
|
+
"devices.form.userId": "Benutzer-ID",
|
|
27
|
+
"devices.form.userIdHint": "UUID des Benutzers, dem dieses Gerät gehört.",
|
|
28
|
+
"devices.list.actions.deactivate": "Deaktivieren",
|
|
29
|
+
"devices.list.actions.edit": "Bearbeiten",
|
|
30
|
+
"devices.list.actions.register": "Gerät registrieren",
|
|
31
|
+
"devices.list.columns.appVersion": "App-Version",
|
|
32
|
+
"devices.list.columns.device": "Geräte-ID",
|
|
33
|
+
"devices.list.columns.lastSeen": "Zuletzt gesehen",
|
|
34
|
+
"devices.list.columns.osVersion": "OS-Version",
|
|
35
|
+
"devices.list.columns.platform": "Plattform",
|
|
36
|
+
"devices.list.columns.pushProvider": "Push-Anbieter",
|
|
37
|
+
"devices.list.columns.user": "Benutzer",
|
|
38
|
+
"devices.list.confirmDeactivate": "Dieses Gerät deaktivieren?",
|
|
39
|
+
"devices.list.error.deactivateFailed": "Gerät konnte nicht deaktiviert werden",
|
|
40
|
+
"devices.list.error.loadFailed": "Geräte konnten nicht geladen werden",
|
|
41
|
+
"devices.list.noValue": "—",
|
|
42
|
+
"devices.list.success.deactivated": "Gerät deaktiviert",
|
|
43
|
+
"devices.list.title": "Geräte",
|
|
44
|
+
"devices.nav.devices": "Geräte"
|
|
45
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"devices.errors.already_registered": "This device is already registered",
|
|
3
|
+
"devices.errors.delete_failed": "Failed to delete device",
|
|
4
|
+
"devices.errors.forbidden": "Access denied",
|
|
5
|
+
"devices.errors.invalid_id": "Invalid device id",
|
|
6
|
+
"devices.errors.invalid_payload": "Invalid device payload",
|
|
7
|
+
"devices.errors.load_failed": "Failed to load device",
|
|
8
|
+
"devices.errors.not_found": "Device not found",
|
|
9
|
+
"devices.errors.register_failed": "Failed to register device",
|
|
10
|
+
"devices.errors.unauthorized": "Unauthorized",
|
|
11
|
+
"devices.errors.update_failed": "Failed to update device",
|
|
12
|
+
"devices.errors.user_not_found": "Target user not found in this tenant",
|
|
13
|
+
"devices.form.appVersion": "App version",
|
|
14
|
+
"devices.form.createTitle": "Register device",
|
|
15
|
+
"devices.form.details": "Device",
|
|
16
|
+
"devices.form.deviceId": "Device ID",
|
|
17
|
+
"devices.form.editTitle": "Edit device",
|
|
18
|
+
"devices.form.error.loadFailed": "Failed to load device",
|
|
19
|
+
"devices.form.osVersion": "OS version",
|
|
20
|
+
"devices.form.platform": "Platform",
|
|
21
|
+
"devices.form.pushProvider": "Push provider",
|
|
22
|
+
"devices.form.pushToken": "Push token",
|
|
23
|
+
"devices.form.pushTokenHint": "Optional. Stored securely and never shown again.",
|
|
24
|
+
"devices.form.success.created": "Device registered",
|
|
25
|
+
"devices.form.success.updated": "Device updated",
|
|
26
|
+
"devices.form.userId": "User ID",
|
|
27
|
+
"devices.form.userIdHint": "UUID of the user who owns this device.",
|
|
28
|
+
"devices.list.actions.deactivate": "Deactivate",
|
|
29
|
+
"devices.list.actions.edit": "Edit",
|
|
30
|
+
"devices.list.actions.register": "Register device",
|
|
31
|
+
"devices.list.columns.appVersion": "App version",
|
|
32
|
+
"devices.list.columns.device": "Device ID",
|
|
33
|
+
"devices.list.columns.lastSeen": "Last seen",
|
|
34
|
+
"devices.list.columns.osVersion": "OS version",
|
|
35
|
+
"devices.list.columns.platform": "Platform",
|
|
36
|
+
"devices.list.columns.pushProvider": "Push provider",
|
|
37
|
+
"devices.list.columns.user": "User",
|
|
38
|
+
"devices.list.confirmDeactivate": "Deactivate this device?",
|
|
39
|
+
"devices.list.error.deactivateFailed": "Failed to deactivate device",
|
|
40
|
+
"devices.list.error.loadFailed": "Failed to load devices",
|
|
41
|
+
"devices.list.noValue": "—",
|
|
42
|
+
"devices.list.success.deactivated": "Device deactivated",
|
|
43
|
+
"devices.list.title": "Devices",
|
|
44
|
+
"devices.nav.devices": "Devices"
|
|
45
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"devices.errors.already_registered": "Este dispositivo ya está registrado",
|
|
3
|
+
"devices.errors.delete_failed": "No se pudo eliminar el dispositivo",
|
|
4
|
+
"devices.errors.forbidden": "Acceso denegado",
|
|
5
|
+
"devices.errors.invalid_id": "ID de dispositivo no válido",
|
|
6
|
+
"devices.errors.invalid_payload": "Datos de dispositivo no válidos",
|
|
7
|
+
"devices.errors.load_failed": "No se pudo cargar el dispositivo",
|
|
8
|
+
"devices.errors.not_found": "Dispositivo no encontrado",
|
|
9
|
+
"devices.errors.register_failed": "No se pudo registrar el dispositivo",
|
|
10
|
+
"devices.errors.unauthorized": "No autorizado",
|
|
11
|
+
"devices.errors.update_failed": "No se pudo actualizar el dispositivo",
|
|
12
|
+
"devices.errors.user_not_found": "Usuario de destino no encontrado en este inquilino",
|
|
13
|
+
"devices.form.appVersion": "Versión de la app",
|
|
14
|
+
"devices.form.createTitle": "Registrar dispositivo",
|
|
15
|
+
"devices.form.details": "Dispositivo",
|
|
16
|
+
"devices.form.deviceId": "ID de dispositivo",
|
|
17
|
+
"devices.form.editTitle": "Editar dispositivo",
|
|
18
|
+
"devices.form.error.loadFailed": "No se pudo cargar el dispositivo",
|
|
19
|
+
"devices.form.osVersion": "Versión del SO",
|
|
20
|
+
"devices.form.platform": "Plataforma",
|
|
21
|
+
"devices.form.pushProvider": "Proveedor de push",
|
|
22
|
+
"devices.form.pushToken": "Token de push",
|
|
23
|
+
"devices.form.pushTokenHint": "Opcional. Se almacena de forma segura y no se vuelve a mostrar.",
|
|
24
|
+
"devices.form.success.created": "Dispositivo registrado",
|
|
25
|
+
"devices.form.success.updated": "Dispositivo actualizado",
|
|
26
|
+
"devices.form.userId": "ID de usuario",
|
|
27
|
+
"devices.form.userIdHint": "UUID del usuario propietario de este dispositivo.",
|
|
28
|
+
"devices.list.actions.deactivate": "Desactivar",
|
|
29
|
+
"devices.list.actions.edit": "Editar",
|
|
30
|
+
"devices.list.actions.register": "Registrar dispositivo",
|
|
31
|
+
"devices.list.columns.appVersion": "Versión de la app",
|
|
32
|
+
"devices.list.columns.device": "ID de dispositivo",
|
|
33
|
+
"devices.list.columns.lastSeen": "Última conexión",
|
|
34
|
+
"devices.list.columns.osVersion": "Versión del SO",
|
|
35
|
+
"devices.list.columns.platform": "Plataforma",
|
|
36
|
+
"devices.list.columns.pushProvider": "Proveedor de push",
|
|
37
|
+
"devices.list.columns.user": "Usuario",
|
|
38
|
+
"devices.list.confirmDeactivate": "¿Desactivar este dispositivo?",
|
|
39
|
+
"devices.list.error.deactivateFailed": "No se pudo desactivar el dispositivo",
|
|
40
|
+
"devices.list.error.loadFailed": "No se pudieron cargar los dispositivos",
|
|
41
|
+
"devices.list.noValue": "—",
|
|
42
|
+
"devices.list.success.deactivated": "Dispositivo desactivado",
|
|
43
|
+
"devices.list.title": "Dispositivos",
|
|
44
|
+
"devices.nav.devices": "Dispositivos"
|
|
45
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"devices.errors.already_registered": "이미 등록된 기기입니다",
|
|
3
|
+
"devices.errors.delete_failed": "기기를 삭제하지 못했습니다",
|
|
4
|
+
"devices.errors.forbidden": "접근이 거부되었습니다",
|
|
5
|
+
"devices.errors.invalid_id": "잘못된 기기 ID입니다",
|
|
6
|
+
"devices.errors.invalid_payload": "잘못된 기기 데이터입니다",
|
|
7
|
+
"devices.errors.load_failed": "기기를 불러오지 못했습니다",
|
|
8
|
+
"devices.errors.not_found": "기기를 찾을 수 없습니다",
|
|
9
|
+
"devices.errors.register_failed": "기기를 등록하지 못했습니다",
|
|
10
|
+
"devices.errors.unauthorized": "권한이 없습니다",
|
|
11
|
+
"devices.errors.update_failed": "기기를 수정하지 못했습니다",
|
|
12
|
+
"devices.errors.user_not_found": "이 테넌트에서 대상 사용자를 찾을 수 없습니다",
|
|
13
|
+
"devices.form.appVersion": "앱 버전",
|
|
14
|
+
"devices.form.createTitle": "기기 등록",
|
|
15
|
+
"devices.form.details": "기기",
|
|
16
|
+
"devices.form.deviceId": "기기 ID",
|
|
17
|
+
"devices.form.editTitle": "기기 수정",
|
|
18
|
+
"devices.form.error.loadFailed": "기기를 불러오지 못했습니다",
|
|
19
|
+
"devices.form.osVersion": "OS 버전",
|
|
20
|
+
"devices.form.platform": "플랫폼",
|
|
21
|
+
"devices.form.pushProvider": "푸시 제공자",
|
|
22
|
+
"devices.form.pushToken": "푸시 토큰",
|
|
23
|
+
"devices.form.pushTokenHint": "선택 사항입니다. 안전하게 저장되며 다시 표시되지 않습니다.",
|
|
24
|
+
"devices.form.success.created": "기기가 등록되었습니다",
|
|
25
|
+
"devices.form.success.updated": "기기가 수정되었습니다",
|
|
26
|
+
"devices.form.userId": "사용자 ID",
|
|
27
|
+
"devices.form.userIdHint": "이 기기를 소유한 사용자의 UUID입니다.",
|
|
28
|
+
"devices.list.actions.deactivate": "비활성화",
|
|
29
|
+
"devices.list.actions.edit": "수정",
|
|
30
|
+
"devices.list.actions.register": "기기 등록",
|
|
31
|
+
"devices.list.columns.appVersion": "앱 버전",
|
|
32
|
+
"devices.list.columns.device": "기기 ID",
|
|
33
|
+
"devices.list.columns.lastSeen": "마지막 접속",
|
|
34
|
+
"devices.list.columns.osVersion": "OS 버전",
|
|
35
|
+
"devices.list.columns.platform": "플랫폼",
|
|
36
|
+
"devices.list.columns.pushProvider": "푸시 제공자",
|
|
37
|
+
"devices.list.columns.user": "사용자",
|
|
38
|
+
"devices.list.confirmDeactivate": "이 기기를 비활성화할까요?",
|
|
39
|
+
"devices.list.error.deactivateFailed": "기기를 비활성화하지 못했습니다",
|
|
40
|
+
"devices.list.error.loadFailed": "기기 목록을 불러오지 못했습니다",
|
|
41
|
+
"devices.list.noValue": "—",
|
|
42
|
+
"devices.list.success.deactivated": "기기가 비활성화되었습니다",
|
|
43
|
+
"devices.list.title": "기기",
|
|
44
|
+
"devices.nav.devices": "기기"
|
|
45
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"devices.errors.already_registered": "To urządzenie jest już zarejestrowane",
|
|
3
|
+
"devices.errors.delete_failed": "Nie udało się usunąć urządzenia",
|
|
4
|
+
"devices.errors.forbidden": "Odmowa dostępu",
|
|
5
|
+
"devices.errors.invalid_id": "Nieprawidłowy identyfikator urządzenia",
|
|
6
|
+
"devices.errors.invalid_payload": "Nieprawidłowe dane urządzenia",
|
|
7
|
+
"devices.errors.load_failed": "Nie udało się załadować urządzenia",
|
|
8
|
+
"devices.errors.not_found": "Nie znaleziono urządzenia",
|
|
9
|
+
"devices.errors.register_failed": "Nie udało się zarejestrować urządzenia",
|
|
10
|
+
"devices.errors.unauthorized": "Brak autoryzacji",
|
|
11
|
+
"devices.errors.update_failed": "Nie udało się zaktualizować urządzenia",
|
|
12
|
+
"devices.errors.user_not_found": "Nie znaleziono użytkownika docelowego w tym najemcy",
|
|
13
|
+
"devices.form.appVersion": "Wersja aplikacji",
|
|
14
|
+
"devices.form.createTitle": "Zarejestruj urządzenie",
|
|
15
|
+
"devices.form.details": "Urządzenie",
|
|
16
|
+
"devices.form.deviceId": "ID urządzenia",
|
|
17
|
+
"devices.form.editTitle": "Edytuj urządzenie",
|
|
18
|
+
"devices.form.error.loadFailed": "Nie udało się załadować urządzenia",
|
|
19
|
+
"devices.form.osVersion": "Wersja systemu",
|
|
20
|
+
"devices.form.platform": "Platforma",
|
|
21
|
+
"devices.form.pushProvider": "Dostawca push",
|
|
22
|
+
"devices.form.pushToken": "Token push",
|
|
23
|
+
"devices.form.pushTokenHint": "Opcjonalne. Token jest przechowywany bezpiecznie i nigdy więcej niewyświetlany.",
|
|
24
|
+
"devices.form.success.created": "Urządzenie zarejestrowane",
|
|
25
|
+
"devices.form.success.updated": "Urządzenie zaktualizowane",
|
|
26
|
+
"devices.form.userId": "ID użytkownika",
|
|
27
|
+
"devices.form.userIdHint": "UUID użytkownika, do którego należy to urządzenie.",
|
|
28
|
+
"devices.list.actions.deactivate": "Dezaktywuj",
|
|
29
|
+
"devices.list.actions.edit": "Edytuj",
|
|
30
|
+
"devices.list.actions.register": "Zarejestruj urządzenie",
|
|
31
|
+
"devices.list.columns.appVersion": "Wersja aplikacji",
|
|
32
|
+
"devices.list.columns.device": "Identyfikator urządzenia",
|
|
33
|
+
"devices.list.columns.lastSeen": "Ostatnio widziane",
|
|
34
|
+
"devices.list.columns.osVersion": "Wersja systemu",
|
|
35
|
+
"devices.list.columns.platform": "Platforma",
|
|
36
|
+
"devices.list.columns.pushProvider": "Dostawca push",
|
|
37
|
+
"devices.list.columns.user": "Użytkownik",
|
|
38
|
+
"devices.list.confirmDeactivate": "Dezaktywować to urządzenie?",
|
|
39
|
+
"devices.list.error.deactivateFailed": "Nie udało się dezaktywować urządzenia",
|
|
40
|
+
"devices.list.error.loadFailed": "Nie udało się załadować urządzeń",
|
|
41
|
+
"devices.list.noValue": "—",
|
|
42
|
+
"devices.list.success.deactivated": "Urządzenie dezaktywowane",
|
|
43
|
+
"devices.list.title": "Urządzenia",
|
|
44
|
+
"devices.nav.devices": "Urządzenia"
|
|
45
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ModuleInfo } from '@open-mercato/shared/modules/registry'
|
|
2
|
+
import './commands'
|
|
3
|
+
|
|
4
|
+
export const metadata: ModuleInfo = {
|
|
5
|
+
name: 'devices',
|
|
6
|
+
title: 'Devices',
|
|
7
|
+
version: '0.1.0',
|
|
8
|
+
description: 'Per-tenant user device registry (platform, app/OS metadata, push token storage).',
|
|
9
|
+
author: 'Open Mercato Team',
|
|
10
|
+
license: 'MIT',
|
|
11
|
+
requires: ['auth'],
|
|
12
|
+
ejectable: true,
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { features } from './acl'
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { serializeOperationMetadata } from '@open-mercato/shared/lib/commands/operationMetadata'
|
|
2
|
+
|
|
3
|
+
type OperationLogEntry = {
|
|
4
|
+
id?: string | null
|
|
5
|
+
undoToken?: string | null
|
|
6
|
+
commandId?: string | null
|
|
7
|
+
actionLabel?: string | null
|
|
8
|
+
resourceKind?: string | null
|
|
9
|
+
resourceId?: string | null
|
|
10
|
+
createdAt?: Date | null
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Attaches the `x-om-operation` undo header to a response when the command produced an
|
|
15
|
+
* undoable log entry. No-op otherwise.
|
|
16
|
+
*/
|
|
17
|
+
export function attachOperationMetadataHeader(
|
|
18
|
+
response: Response,
|
|
19
|
+
logEntry: OperationLogEntry | null | undefined,
|
|
20
|
+
fallback: { resourceKind: string; resourceId: string },
|
|
21
|
+
): void {
|
|
22
|
+
if (!logEntry?.undoToken || !logEntry.id || !logEntry.commandId) return
|
|
23
|
+
response.headers.set(
|
|
24
|
+
'x-om-operation',
|
|
25
|
+
serializeOperationMetadata({
|
|
26
|
+
id: logEntry.id,
|
|
27
|
+
undoToken: logEntry.undoToken,
|
|
28
|
+
commandId: logEntry.commandId,
|
|
29
|
+
actionLabel: logEntry.actionLabel ?? null,
|
|
30
|
+
resourceKind: logEntry.resourceKind ?? fallback.resourceKind,
|
|
31
|
+
resourceId: logEntry.resourceId ?? fallback.resourceId,
|
|
32
|
+
executedAt: logEntry.createdAt instanceof Date ? logEntry.createdAt.toISOString() : new Date().toISOString(),
|
|
33
|
+
}),
|
|
34
|
+
)
|
|
35
|
+
}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
{
|
|
2
|
+
"namespaces": [
|
|
3
|
+
"public"
|
|
4
|
+
],
|
|
5
|
+
"name": "public",
|
|
6
|
+
"tables": [
|
|
7
|
+
{
|
|
8
|
+
"columns": {
|
|
9
|
+
"id": {
|
|
10
|
+
"name": "id",
|
|
11
|
+
"type": "uuid",
|
|
12
|
+
"unsigned": false,
|
|
13
|
+
"autoincrement": false,
|
|
14
|
+
"primary": false,
|
|
15
|
+
"nullable": false,
|
|
16
|
+
"default": "gen_random_uuid()",
|
|
17
|
+
"mappedType": "uuid"
|
|
18
|
+
},
|
|
19
|
+
"tenant_id": {
|
|
20
|
+
"name": "tenant_id",
|
|
21
|
+
"type": "uuid",
|
|
22
|
+
"unsigned": false,
|
|
23
|
+
"autoincrement": false,
|
|
24
|
+
"primary": false,
|
|
25
|
+
"nullable": false,
|
|
26
|
+
"mappedType": "uuid"
|
|
27
|
+
},
|
|
28
|
+
"organization_id": {
|
|
29
|
+
"name": "organization_id",
|
|
30
|
+
"type": "uuid",
|
|
31
|
+
"unsigned": false,
|
|
32
|
+
"autoincrement": false,
|
|
33
|
+
"primary": false,
|
|
34
|
+
"nullable": true,
|
|
35
|
+
"mappedType": "uuid"
|
|
36
|
+
},
|
|
37
|
+
"user_id": {
|
|
38
|
+
"name": "user_id",
|
|
39
|
+
"type": "uuid",
|
|
40
|
+
"unsigned": false,
|
|
41
|
+
"autoincrement": false,
|
|
42
|
+
"primary": false,
|
|
43
|
+
"nullable": false,
|
|
44
|
+
"mappedType": "uuid"
|
|
45
|
+
},
|
|
46
|
+
"device_id": {
|
|
47
|
+
"name": "device_id",
|
|
48
|
+
"type": "text",
|
|
49
|
+
"unsigned": false,
|
|
50
|
+
"autoincrement": false,
|
|
51
|
+
"primary": false,
|
|
52
|
+
"nullable": false,
|
|
53
|
+
"mappedType": "text"
|
|
54
|
+
},
|
|
55
|
+
"platform": {
|
|
56
|
+
"name": "platform",
|
|
57
|
+
"type": "text",
|
|
58
|
+
"unsigned": false,
|
|
59
|
+
"autoincrement": false,
|
|
60
|
+
"primary": false,
|
|
61
|
+
"nullable": false,
|
|
62
|
+
"mappedType": "text"
|
|
63
|
+
},
|
|
64
|
+
"client_app_version": {
|
|
65
|
+
"name": "client_app_version",
|
|
66
|
+
"type": "text",
|
|
67
|
+
"unsigned": false,
|
|
68
|
+
"autoincrement": false,
|
|
69
|
+
"primary": false,
|
|
70
|
+
"nullable": true,
|
|
71
|
+
"mappedType": "text"
|
|
72
|
+
},
|
|
73
|
+
"os_version": {
|
|
74
|
+
"name": "os_version",
|
|
75
|
+
"type": "text",
|
|
76
|
+
"unsigned": false,
|
|
77
|
+
"autoincrement": false,
|
|
78
|
+
"primary": false,
|
|
79
|
+
"nullable": true,
|
|
80
|
+
"mappedType": "text"
|
|
81
|
+
},
|
|
82
|
+
"locale": {
|
|
83
|
+
"name": "locale",
|
|
84
|
+
"type": "text",
|
|
85
|
+
"unsigned": false,
|
|
86
|
+
"autoincrement": false,
|
|
87
|
+
"primary": false,
|
|
88
|
+
"nullable": true,
|
|
89
|
+
"mappedType": "text"
|
|
90
|
+
},
|
|
91
|
+
"push_token": {
|
|
92
|
+
"name": "push_token",
|
|
93
|
+
"type": "text",
|
|
94
|
+
"unsigned": false,
|
|
95
|
+
"autoincrement": false,
|
|
96
|
+
"primary": false,
|
|
97
|
+
"nullable": true,
|
|
98
|
+
"mappedType": "text"
|
|
99
|
+
},
|
|
100
|
+
"push_provider": {
|
|
101
|
+
"name": "push_provider",
|
|
102
|
+
"type": "text",
|
|
103
|
+
"unsigned": false,
|
|
104
|
+
"autoincrement": false,
|
|
105
|
+
"primary": false,
|
|
106
|
+
"nullable": true,
|
|
107
|
+
"mappedType": "text"
|
|
108
|
+
},
|
|
109
|
+
"push_token_updated_at": {
|
|
110
|
+
"name": "push_token_updated_at",
|
|
111
|
+
"type": "timestamptz",
|
|
112
|
+
"unsigned": false,
|
|
113
|
+
"autoincrement": false,
|
|
114
|
+
"primary": false,
|
|
115
|
+
"nullable": true,
|
|
116
|
+
"length": 6,
|
|
117
|
+
"mappedType": "datetime"
|
|
118
|
+
},
|
|
119
|
+
"last_seen_at": {
|
|
120
|
+
"name": "last_seen_at",
|
|
121
|
+
"type": "timestamptz",
|
|
122
|
+
"unsigned": false,
|
|
123
|
+
"autoincrement": false,
|
|
124
|
+
"primary": false,
|
|
125
|
+
"nullable": false,
|
|
126
|
+
"length": 6,
|
|
127
|
+
"mappedType": "datetime"
|
|
128
|
+
},
|
|
129
|
+
"created_at": {
|
|
130
|
+
"name": "created_at",
|
|
131
|
+
"type": "timestamptz",
|
|
132
|
+
"unsigned": false,
|
|
133
|
+
"autoincrement": false,
|
|
134
|
+
"primary": false,
|
|
135
|
+
"nullable": false,
|
|
136
|
+
"length": 6,
|
|
137
|
+
"mappedType": "datetime"
|
|
138
|
+
},
|
|
139
|
+
"updated_at": {
|
|
140
|
+
"name": "updated_at",
|
|
141
|
+
"type": "timestamptz",
|
|
142
|
+
"unsigned": false,
|
|
143
|
+
"autoincrement": false,
|
|
144
|
+
"primary": false,
|
|
145
|
+
"nullable": false,
|
|
146
|
+
"length": 6,
|
|
147
|
+
"mappedType": "datetime"
|
|
148
|
+
},
|
|
149
|
+
"deleted_at": {
|
|
150
|
+
"name": "deleted_at",
|
|
151
|
+
"type": "timestamptz",
|
|
152
|
+
"unsigned": false,
|
|
153
|
+
"autoincrement": false,
|
|
154
|
+
"primary": false,
|
|
155
|
+
"nullable": true,
|
|
156
|
+
"length": 6,
|
|
157
|
+
"mappedType": "datetime"
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
"name": "user_devices",
|
|
161
|
+
"schema": "public",
|
|
162
|
+
"indexes": [
|
|
163
|
+
{
|
|
164
|
+
"keyName": "user_devices_tenant_user_idx",
|
|
165
|
+
"columnNames": [
|
|
166
|
+
"tenant_id",
|
|
167
|
+
"user_id"
|
|
168
|
+
],
|
|
169
|
+
"composite": true,
|
|
170
|
+
"constraint": false,
|
|
171
|
+
"primary": false,
|
|
172
|
+
"unique": false
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"columnNames": [],
|
|
176
|
+
"composite": false,
|
|
177
|
+
"constraint": false,
|
|
178
|
+
"keyName": "user_devices_tenant_org_user_device_active_unique",
|
|
179
|
+
"primary": false,
|
|
180
|
+
"unique": false,
|
|
181
|
+
"expression": "create unique index \"user_devices_tenant_org_user_device_active_unique\" on \"user_devices\" (\"tenant_id\", \"organization_id\", \"user_id\", \"device_id\") nulls not distinct where deleted_at is null"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"keyName": "user_devices_pkey",
|
|
185
|
+
"columnNames": [
|
|
186
|
+
"id"
|
|
187
|
+
],
|
|
188
|
+
"composite": false,
|
|
189
|
+
"constraint": true,
|
|
190
|
+
"primary": true,
|
|
191
|
+
"unique": true
|
|
192
|
+
}
|
|
193
|
+
],
|
|
194
|
+
"checks": [],
|
|
195
|
+
"foreignKeys": {},
|
|
196
|
+
"nativeEnums": {}
|
|
197
|
+
}
|
|
198
|
+
],
|
|
199
|
+
"nativeEnums": {}
|
|
200
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Migration } from '@mikro-orm/migrations';
|
|
2
|
+
|
|
3
|
+
export class Migration20260602120000 extends Migration {
|
|
4
|
+
|
|
5
|
+
override async up(): Promise<void> {
|
|
6
|
+
this.addSql(`create table "user_devices" ("id" uuid not null default gen_random_uuid(), "tenant_id" uuid not null, "organization_id" uuid null, "user_id" uuid not null, "device_id" text not null, "platform" text not null, "client_app_version" text null, "os_version" text null, "push_token" text null, "push_provider" text null, "push_token_updated_at" timestamptz null, "last_seen_at" timestamptz not null, "created_at" timestamptz not null, "updated_at" timestamptz not null, "deleted_at" timestamptz null, constraint "user_devices_pkey" primary key ("id"));`);
|
|
7
|
+
this.addSql(`create index "user_devices_tenant_user_idx" on "user_devices" ("tenant_id", "user_id");`);
|
|
8
|
+
this.addSql(`create unique index "user_devices_tenant_user_device_active_unique" on "user_devices" ("tenant_id", "user_id", "device_id") where deleted_at is null;`);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
override async down(): Promise<void> {
|
|
12
|
+
this.addSql(`drop table if exists "user_devices" cascade;`);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Migration } from '@mikro-orm/migrations';
|
|
2
|
+
|
|
3
|
+
// Make device identity organization-aware: replace the (tenant, user, device) active-unique index
|
|
4
|
+
// with (tenant, org, user, device). organization_id is nullable, so coalesce null to the nil UUID —
|
|
5
|
+
// otherwise Postgres treats NULLs as distinct and would allow duplicate null-org rows for the same
|
|
6
|
+
// (tenant, user, device). Split out as its own migration so existing databases that already ran the
|
|
7
|
+
// table-creation migration pick up the new index instead of silently keeping the old one.
|
|
8
|
+
export class Migration20260630120000 extends Migration {
|
|
9
|
+
|
|
10
|
+
override async up(): Promise<void> {
|
|
11
|
+
this.addSql(`drop index if exists "user_devices_tenant_user_device_active_unique";`);
|
|
12
|
+
this.addSql(`create unique index "user_devices_tenant_org_user_device_active_unique" on "user_devices" ("tenant_id", coalesce("organization_id", '00000000-0000-0000-0000-000000000000'::uuid), "user_id", "device_id") where deleted_at is null;`);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
override async down(): Promise<void> {
|
|
16
|
+
this.addSql(`drop index if exists "user_devices_tenant_org_user_device_active_unique";`);
|
|
17
|
+
this.addSql(`create unique index "user_devices_tenant_user_device_active_unique" on "user_devices" ("tenant_id", "user_id", "device_id") where deleted_at is null;`);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Migration } from '@mikro-orm/migrations';
|
|
2
|
+
|
|
3
|
+
export class Migration20260701120000 extends Migration {
|
|
4
|
+
|
|
5
|
+
override async up(): Promise<void> {
|
|
6
|
+
this.addSql(`alter table "user_devices" add column "locale" text null;`);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
override async down(): Promise<void> {
|
|
10
|
+
this.addSql(`alter table "user_devices" drop column "locale";`);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Migration } from '@mikro-orm/migrations';
|
|
2
|
+
|
|
3
|
+
// Simplify the device active-unique index: replace the nil-UUID coalesce sentinel with a native
|
|
4
|
+
// NULLS NOT DISTINCT clause (Postgres 15+). Both express the same intent — dedupe null-org rows for
|
|
5
|
+
// the same (tenant, user, device) — but NULLS NOT DISTINCT drops the magic sentinel entirely.
|
|
6
|
+
export class Migration20260721120000 extends Migration {
|
|
7
|
+
|
|
8
|
+
override async up(): Promise<void> {
|
|
9
|
+
this.addSql(`drop index if exists "user_devices_tenant_org_user_device_active_unique";`);
|
|
10
|
+
this.addSql(`create unique index "user_devices_tenant_org_user_device_active_unique" on "user_devices" ("tenant_id", "organization_id", "user_id", "device_id") nulls not distinct where deleted_at is null;`);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
override async down(): Promise<void> {
|
|
14
|
+
this.addSql(`drop index if exists "user_devices_tenant_org_user_device_active_unique";`);
|
|
15
|
+
this.addSql(`create unique index "user_devices_tenant_org_user_device_active_unique" on "user_devices" ("tenant_id", coalesce("organization_id", '00000000-0000-0000-0000-000000000000'::uuid), "user_id", "device_id") where deleted_at is null;`);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ModuleSetupConfig } from '@open-mercato/shared/modules/setup'
|
|
2
|
+
|
|
3
|
+
export const setup: ModuleSetupConfig = {
|
|
4
|
+
defaultRoleFeatures: {
|
|
5
|
+
superadmin: ['devices.*'],
|
|
6
|
+
admin: ['devices.*'],
|
|
7
|
+
employee: ['devices.view', 'devices.manage'],
|
|
8
|
+
},
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default setup
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getCliModules, getDefaultEncryptionMaps, type Module, type ModuleCli } from '@open-mercato/shared/modules/registry'
|
|
2
|
+
import type { ModuleEncryptionMap } from '@open-mercato/shared/modules/encryption'
|
|
2
3
|
import { createRequestContainer } from '@open-mercato/shared/lib/di/container'
|
|
3
4
|
import type { CacheStrategy } from '@open-mercato/cache/types'
|
|
4
5
|
import { CustomEntity, CustomFieldDef, EncryptionMap } from './data/entities'
|
|
@@ -280,8 +281,17 @@ function getSystemScopedEntityIds(): Set<string> {
|
|
|
280
281
|
)
|
|
281
282
|
}
|
|
282
283
|
|
|
283
|
-
|
|
284
|
-
|
|
284
|
+
// Idempotently upsert a specific set of encryption-map specs for one (tenant, org) scope. Exported so
|
|
285
|
+
// upgrade actions can backfill a newly-added encrypted entity for pre-existing tenants (whose maps were
|
|
286
|
+
// seeded once at tenant creation and never re-run) without depending on the full CLI module registry.
|
|
287
|
+
export async function upsertEncryptionMapSpecs(
|
|
288
|
+
em: any,
|
|
289
|
+
tenantId: string,
|
|
290
|
+
organizationId: string | null,
|
|
291
|
+
specs: ModuleEncryptionMap[],
|
|
292
|
+
logger: (msg: string) => void = () => {},
|
|
293
|
+
) {
|
|
294
|
+
for (const spec of specs) {
|
|
285
295
|
if (spec.keyScope === 'system') {
|
|
286
296
|
logger(`Skipping ${spec.entityId}: system-scoped map, resolved from module code rather than a tenant row.`)
|
|
287
297
|
continue
|
|
@@ -312,6 +322,10 @@ async function upsertEncryptionMaps(em: any, tenantId: string, organizationId: s
|
|
|
312
322
|
}
|
|
313
323
|
}
|
|
314
324
|
|
|
325
|
+
async function upsertEncryptionMaps(em: any, tenantId: string, organizationId: string | null, logger: (msg: string) => void) {
|
|
326
|
+
await upsertEncryptionMapSpecs(em, tenantId, organizationId, getDefaultEncryptionMaps(resolveEncryptionMapModules()), logger)
|
|
327
|
+
}
|
|
328
|
+
|
|
315
329
|
const seedEncryptionMaps: ModuleCli = {
|
|
316
330
|
command: 'seed-encryption',
|
|
317
331
|
async run(rest) {
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Migration } from '@mikro-orm/migrations';
|
|
2
|
+
|
|
3
|
+
// Backfill the `devices:user_device` encryption map for every pre-existing (tenant, org) scope that
|
|
4
|
+
// already has active encryption maps. The devices push-token feature adds a new encrypted entity, but
|
|
5
|
+
// encryption maps are seeded only at tenant creation (`entities seed-encryption`) — so without this an
|
|
6
|
+
// existing tenant that upgrades has no map for the device entity, `encryptEntityPayload` no-ops, and
|
|
7
|
+
// `push_token` is written as PLAINTEXT. Restricting the insert to scopes that ALREADY have maps mirrors
|
|
8
|
+
// what seed-encryption does and correctly skips tenants with encryption disabled (which have no maps at
|
|
9
|
+
// all). Idempotent via the NOT EXISTS guard, so it matches the runtime `upsertEncryptionMapSpecs` helper
|
|
10
|
+
// and the `devices.seed-push-token-encryption-map` upgrade action; re-runs are a no-op.
|
|
11
|
+
export class Migration20260722120000 extends Migration {
|
|
12
|
+
|
|
13
|
+
override async up(): Promise<void> {
|
|
14
|
+
this.addSql(`
|
|
15
|
+
insert into "encryption_maps" ("id", "entity_id", "tenant_id", "organization_id", "fields_json", "is_active", "created_at", "updated_at")
|
|
16
|
+
select gen_random_uuid(), 'devices:user_device', src."tenant_id", src."organization_id", '[{"field":"push_token"}]'::jsonb, true, now(), now()
|
|
17
|
+
from (
|
|
18
|
+
select distinct "tenant_id", "organization_id"
|
|
19
|
+
from "encryption_maps"
|
|
20
|
+
where "is_active" = true and "deleted_at" is null
|
|
21
|
+
) src
|
|
22
|
+
where not exists (
|
|
23
|
+
select 1 from "encryption_maps" existing
|
|
24
|
+
where existing."entity_id" = 'devices:user_device'
|
|
25
|
+
and existing."tenant_id" is not distinct from src."tenant_id"
|
|
26
|
+
and existing."organization_id" is not distinct from src."organization_id"
|
|
27
|
+
and existing."deleted_at" is null
|
|
28
|
+
);
|
|
29
|
+
`);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
override async down(): Promise<void> {
|
|
33
|
+
// Reverts the feature's encryption map. `devices:user_device` maps have no source other than this
|
|
34
|
+
// feature, so deleting them all returns the schema to its pre-feature state.
|
|
35
|
+
this.addSql(`delete from "encryption_maps" where "entity_id" = 'devices:user_device';`);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
}
|
|
@@ -192,5 +192,6 @@
|
|
|
192
192
|
"inbox_ops.translate.show_original": "Original anzeigen",
|
|
193
193
|
"inbox_ops.translate.translate": "\u00dcbersetzen",
|
|
194
194
|
"inbox_ops.untitled_proposal": "Unbenannter Vorschlag",
|
|
195
|
-
"inbox_ops.view_in_messages": "In Nachrichten anzeigen"
|
|
195
|
+
"inbox_ops.view_in_messages": "In Nachrichten anzeigen",
|
|
196
|
+
"notifications.categories.inbox_ops": "Posteingang"
|
|
196
197
|
}
|