@open-mercato/core 0.4.2-canary-ab36fbd8f2 → 0.4.2-canary-da2b080494
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/generated/entities.ids.generated.js +1 -5
- package/dist/generated/entities.ids.generated.js.map +2 -2
- package/dist/generated/entity-fields-registry.js +0 -2
- package/dist/generated/entity-fields-registry.js.map +2 -2
- package/dist/modules/api_docs/frontend/docs/api/page.js +2 -3
- package/dist/modules/api_docs/frontend/docs/api/page.js.map +2 -2
- package/dist/modules/api_keys/backend/api-keys/page.js +1 -1
- package/dist/modules/api_keys/backend/api-keys/page.js.map +2 -2
- package/dist/modules/attachments/components/AttachmentLibrary.js +0 -4
- package/dist/modules/attachments/components/AttachmentLibrary.js.map +2 -2
- package/dist/modules/attachments/components/AttachmentPartitionSettings.js +0 -2
- package/dist/modules/attachments/components/AttachmentPartitionSettings.js.map +2 -2
- package/dist/modules/auth/api/admin/nav.js +3 -4
- package/dist/modules/auth/api/admin/nav.js.map +2 -2
- package/dist/modules/auth/api/reset/confirm.js +2 -25
- package/dist/modules/auth/api/reset/confirm.js.map +2 -2
- package/dist/modules/auth/api/reset.js +0 -23
- package/dist/modules/auth/api/reset.js.map +2 -2
- package/dist/modules/auth/api/sidebar/preferences/route.js +9 -14
- package/dist/modules/auth/api/sidebar/preferences/route.js.map +2 -2
- package/dist/modules/auth/api/users/route.js +2 -4
- package/dist/modules/auth/api/users/route.js.map +2 -2
- package/dist/modules/auth/backend/roles/[id]/edit/page.js +1 -4
- package/dist/modules/auth/backend/roles/[id]/edit/page.js.map +2 -2
- package/dist/modules/auth/backend/roles/page.js +3 -3
- package/dist/modules/auth/backend/roles/page.js.map +2 -2
- package/dist/modules/auth/backend/users/[id]/edit/page.js +3 -18
- package/dist/modules/auth/backend/users/[id]/edit/page.js.map +2 -2
- package/dist/modules/auth/backend/users/create/page.js +2 -15
- package/dist/modules/auth/backend/users/create/page.js.map +2 -2
- package/dist/modules/auth/backend/users/page.js +3 -3
- package/dist/modules/auth/backend/users/page.js.map +2 -2
- package/dist/modules/auth/cli.js +11 -25
- package/dist/modules/auth/cli.js.map +2 -2
- package/dist/modules/auth/commands/users.js +2 -59
- package/dist/modules/auth/commands/users.js.map +2 -2
- package/dist/modules/auth/data/validators.js +2 -4
- package/dist/modules/auth/data/validators.js.map +2 -2
- package/dist/modules/auth/frontend/reset/[token]/page.js +10 -20
- package/dist/modules/auth/frontend/reset/[token]/page.js.map +2 -2
- package/dist/modules/auth/lib/setup-app.js +0 -1
- package/dist/modules/auth/lib/setup-app.js.map +2 -2
- package/dist/modules/auth/services/authService.js +3 -3
- package/dist/modules/auth/services/authService.js.map +2 -2
- package/dist/modules/business_rules/api/execute/route.js +1 -7
- package/dist/modules/business_rules/api/execute/route.js.map +2 -2
- package/dist/modules/business_rules/backend/rules/page.js +0 -4
- package/dist/modules/business_rules/backend/rules/page.js.map +2 -2
- package/dist/modules/business_rules/backend/sets/page.js +0 -3
- package/dist/modules/business_rules/backend/sets/page.js.map +2 -2
- package/dist/modules/business_rules/lib/rule-engine.js +3 -33
- package/dist/modules/business_rules/lib/rule-engine.js.map +2 -2
- package/dist/modules/catalog/components/PriceKindSettings.js +0 -2
- package/dist/modules/catalog/components/PriceKindSettings.js.map +2 -2
- package/dist/modules/catalog/components/categories/CategoriesDataTable.js +2 -2
- package/dist/modules/catalog/components/categories/CategoriesDataTable.js.map +2 -2
- package/dist/modules/catalog/components/products/ProductsDataTable.js +0 -2
- package/dist/modules/catalog/components/products/ProductsDataTable.js.map +2 -2
- package/dist/modules/configs/cli.js +0 -6
- package/dist/modules/configs/cli.js.map +2 -2
- package/dist/modules/configs/components/CachePanel.js +4 -4
- package/dist/modules/configs/components/CachePanel.js.map +2 -2
- package/dist/modules/configs/lib/system-status.js +1 -48
- package/dist/modules/configs/lib/system-status.js.map +2 -2
- package/dist/modules/configs/lib/upgrade-actions.js +0 -18
- package/dist/modules/configs/lib/upgrade-actions.js.map +2 -2
- package/dist/modules/currencies/backend/currencies/page.js +0 -3
- package/dist/modules/currencies/backend/currencies/page.js.map +2 -2
- package/dist/modules/currencies/backend/exchange-rates/page.js +0 -2
- package/dist/modules/currencies/backend/exchange-rates/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/companies/page.js +0 -3
- package/dist/modules/customers/backend/customers/companies/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/deals/page.js +0 -3
- package/dist/modules/customers/backend/customers/deals/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/people/page.js +0 -3
- package/dist/modules/customers/backend/customers/people/page.js.map +2 -2
- package/dist/modules/customers/commands/deals.js +0 -31
- package/dist/modules/customers/commands/deals.js.map +2 -2
- package/dist/modules/customers/components/CustomerTodosTable.js +0 -1
- package/dist/modules/customers/components/CustomerTodosTable.js.map +2 -2
- package/dist/modules/dashboards/cli.js +5 -44
- package/dist/modules/dashboards/cli.js.map +2 -2
- package/dist/modules/dashboards/components/WidgetVisibilityEditor.js +11 -16
- package/dist/modules/dashboards/components/WidgetVisibilityEditor.js.map +3 -3
- package/dist/modules/dashboards/services/widgetDataService.js +3 -132
- package/dist/modules/dashboards/services/widgetDataService.js.map +2 -2
- package/dist/modules/dictionaries/components/DictionaryTable.js +0 -2
- package/dist/modules/dictionaries/components/DictionaryTable.js.map +2 -2
- package/dist/modules/directory/backend/directory/organizations/page.js +2 -2
- package/dist/modules/directory/backend/directory/organizations/page.js.map +2 -2
- package/dist/modules/directory/backend/directory/tenants/page.js +2 -2
- package/dist/modules/directory/backend/directory/tenants/page.js.map +2 -2
- package/dist/modules/entities/backend/entities/user/[entityId]/records/page.js +2 -2
- package/dist/modules/entities/backend/entities/user/[entityId]/records/page.js.map +2 -2
- package/dist/modules/entities/components/SystemEntitiesTable.js +1 -1
- package/dist/modules/entities/components/SystemEntitiesTable.js.map +2 -2
- package/dist/modules/entities/components/UserEntitiesTable.js +2 -2
- package/dist/modules/entities/components/UserEntitiesTable.js.map +2 -2
- package/dist/modules/feature_toggles/components/FeatureTogglesTable.js +3 -3
- package/dist/modules/feature_toggles/components/FeatureTogglesTable.js.map +2 -2
- package/dist/modules/feature_toggles/components/OverridesTable.js +1 -1
- package/dist/modules/feature_toggles/components/OverridesTable.js.map +2 -2
- package/dist/modules/planner/backend/planner/availability-rulesets/page.js +2 -2
- package/dist/modules/planner/backend/planner/availability-rulesets/page.js.map +2 -2
- package/dist/modules/query_index/components/QueryIndexesTable.js +1 -7
- package/dist/modules/query_index/components/QueryIndexesTable.js.map +2 -2
- package/dist/modules/resources/backend/resources/resource-types/page.js +2 -2
- package/dist/modules/resources/backend/resources/resource-types/page.js.map +2 -2
- package/dist/modules/resources/backend/resources/resources/page.js +2 -2
- package/dist/modules/resources/backend/resources/resources/page.js.map +2 -2
- package/dist/modules/sales/backend/sales/channels/offers/page.js +0 -2
- package/dist/modules/sales/backend/sales/channels/offers/page.js.map +2 -2
- package/dist/modules/sales/backend/sales/channels/page.js +0 -2
- package/dist/modules/sales/backend/sales/channels/page.js.map +2 -2
- package/dist/modules/sales/commands/documents.js +0 -53
- package/dist/modules/sales/commands/documents.js.map +2 -2
- package/dist/modules/sales/commands/payments.js +0 -26
- package/dist/modules/sales/commands/payments.js.map +2 -2
- package/dist/modules/sales/components/AdjustmentKindSettings.js +2 -2
- package/dist/modules/sales/components/AdjustmentKindSettings.js.map +2 -2
- package/dist/modules/sales/components/PaymentMethodsSettings.js +2 -2
- package/dist/modules/sales/components/PaymentMethodsSettings.js.map +2 -2
- package/dist/modules/sales/components/ShippingMethodsSettings.js +2 -2
- package/dist/modules/sales/components/ShippingMethodsSettings.js.map +2 -2
- package/dist/modules/sales/components/TaxRatesSettings.js +2 -2
- package/dist/modules/sales/components/TaxRatesSettings.js.map +2 -2
- package/dist/modules/sales/components/channels/SalesChannelOffersPanel.js +0 -2
- package/dist/modules/sales/components/channels/SalesChannelOffersPanel.js.map +2 -2
- package/dist/modules/sales/components/documents/AdjustmentsSection.js +0 -2
- package/dist/modules/sales/components/documents/AdjustmentsSection.js.map +2 -2
- package/dist/modules/sales/components/documents/PaymentsSection.js +1 -2
- package/dist/modules/sales/components/documents/PaymentsSection.js.map +2 -2
- package/dist/modules/sales/components/documents/SalesDocumentsTable.js +0 -2
- package/dist/modules/sales/components/documents/SalesDocumentsTable.js.map +2 -2
- package/dist/modules/staff/backend/staff/team-members/page.js +1 -1
- package/dist/modules/staff/backend/staff/team-members/page.js.map +2 -2
- package/dist/modules/staff/backend/staff/team-roles/page.js +2 -2
- package/dist/modules/staff/backend/staff/team-roles/page.js.map +2 -2
- package/dist/modules/staff/backend/staff/teams/[id]/edit/page.js +2 -2
- package/dist/modules/staff/backend/staff/teams/[id]/edit/page.js.map +2 -2
- package/dist/modules/staff/backend/staff/teams/page.js +2 -2
- package/dist/modules/staff/backend/staff/teams/page.js.map +2 -2
- package/dist/modules/staff/commands/leave-requests.js +0 -79
- package/dist/modules/staff/commands/leave-requests.js.map +2 -2
- package/dist/modules/workflows/backend/definitions/page.js +0 -5
- package/dist/modules/workflows/backend/definitions/page.js.map +2 -2
- package/dist/modules/workflows/backend/instances/page.js +0 -3
- package/dist/modules/workflows/backend/instances/page.js.map +2 -2
- package/dist/modules/workflows/backend/tasks/page.js +0 -3
- package/dist/modules/workflows/backend/tasks/page.js.map +2 -2
- package/dist/modules/workflows/lib/transition-handler.js +6 -14
- package/dist/modules/workflows/lib/transition-handler.js.map +2 -2
- package/generated/entities.ids.generated.ts +1 -5
- package/generated/entity-fields-registry.ts +0 -2
- package/package.json +2 -2
- package/src/modules/api_docs/frontend/docs/api/page.tsx +2 -3
- package/src/modules/api_keys/backend/api-keys/page.tsx +1 -1
- package/src/modules/attachments/components/AttachmentLibrary.tsx +0 -4
- package/src/modules/attachments/components/AttachmentPartitionSettings.tsx +0 -2
- package/src/modules/auth/README.md +1 -1
- package/src/modules/auth/__tests__/cli-setup-acl.test.ts +1 -1
- package/src/modules/auth/api/admin/nav.ts +6 -10
- package/src/modules/auth/api/reset/confirm.ts +2 -25
- package/src/modules/auth/api/reset.ts +0 -23
- package/src/modules/auth/api/sidebar/preferences/route.ts +12 -21
- package/src/modules/auth/api/users/route.ts +2 -5
- package/src/modules/auth/backend/roles/[id]/edit/page.tsx +1 -4
- package/src/modules/auth/backend/roles/page.tsx +3 -3
- package/src/modules/auth/backend/users/[id]/edit/page.tsx +3 -22
- package/src/modules/auth/backend/users/create/page.tsx +2 -19
- package/src/modules/auth/backend/users/page.tsx +3 -3
- package/src/modules/auth/cli.ts +11 -38
- package/src/modules/auth/commands/users.ts +2 -73
- package/src/modules/auth/data/validators.ts +2 -5
- package/src/modules/auth/frontend/reset/[token]/page.tsx +11 -24
- package/src/modules/auth/i18n/de.json +1 -43
- package/src/modules/auth/i18n/en.json +1 -43
- package/src/modules/auth/i18n/es.json +1 -43
- package/src/modules/auth/i18n/pl.json +1 -43
- package/src/modules/auth/lib/setup-app.ts +0 -1
- package/src/modules/auth/services/authService.ts +4 -4
- package/src/modules/business_rules/api/execute/route.ts +1 -8
- package/src/modules/business_rules/backend/rules/page.tsx +0 -4
- package/src/modules/business_rules/backend/sets/page.tsx +0 -3
- package/src/modules/business_rules/i18n/en.json +1 -3
- package/src/modules/business_rules/lib/__tests__/rule-engine.test.ts +0 -51
- package/src/modules/business_rules/lib/rule-engine.ts +3 -57
- package/src/modules/catalog/components/PriceKindSettings.tsx +0 -2
- package/src/modules/catalog/components/categories/CategoriesDataTable.tsx +2 -2
- package/src/modules/catalog/components/products/ProductsDataTable.tsx +0 -2
- package/src/modules/catalog/i18n/en.json +1 -3
- package/src/modules/configs/cli.ts +0 -6
- package/src/modules/configs/components/CachePanel.tsx +4 -4
- package/src/modules/configs/i18n/en.json +2 -12
- package/src/modules/configs/i18n/pl.json +2 -12
- package/src/modules/configs/lib/system-status.ts +1 -48
- package/src/modules/configs/lib/system-status.types.ts +0 -1
- package/src/modules/configs/lib/upgrade-actions.ts +0 -18
- package/src/modules/currencies/backend/currencies/page.tsx +0 -3
- package/src/modules/currencies/backend/exchange-rates/page.tsx +0 -2
- package/src/modules/customers/backend/customers/companies/page.tsx +0 -3
- package/src/modules/customers/backend/customers/deals/page.tsx +0 -3
- package/src/modules/customers/backend/customers/people/page.tsx +0 -3
- package/src/modules/customers/commands/deals.ts +0 -39
- package/src/modules/customers/components/CustomerTodosTable.tsx +0 -1
- package/src/modules/customers/i18n/en.json +1 -5
- package/src/modules/dashboards/cli.ts +5 -55
- package/src/modules/dashboards/components/WidgetVisibilityEditor.tsx +11 -22
- package/src/modules/dashboards/services/widgetDataService.ts +4 -157
- package/src/modules/dictionaries/components/DictionaryTable.tsx +0 -2
- package/src/modules/directory/backend/directory/organizations/page.tsx +2 -2
- package/src/modules/directory/backend/directory/tenants/page.tsx +2 -2
- package/src/modules/entities/backend/entities/user/[entityId]/records/page.tsx +2 -2
- package/src/modules/entities/components/SystemEntitiesTable.tsx +1 -1
- package/src/modules/entities/components/UserEntitiesTable.tsx +2 -2
- package/src/modules/feature_toggles/components/FeatureTogglesTable.tsx +4 -3
- package/src/modules/feature_toggles/components/OverridesTable.tsx +1 -1
- package/src/modules/planner/backend/planner/availability-rulesets/page.tsx +2 -2
- package/src/modules/query_index/components/QueryIndexesTable.tsx +2 -8
- package/src/modules/resources/backend/resources/resource-types/page.tsx +2 -2
- package/src/modules/resources/backend/resources/resources/page.tsx +2 -2
- package/src/modules/sales/backend/sales/channels/offers/page.tsx +0 -2
- package/src/modules/sales/backend/sales/channels/page.tsx +0 -2
- package/src/modules/sales/commands/documents.ts +0 -65
- package/src/modules/sales/commands/payments.ts +0 -33
- package/src/modules/sales/components/AdjustmentKindSettings.tsx +2 -2
- package/src/modules/sales/components/PaymentMethodsSettings.tsx +2 -2
- package/src/modules/sales/components/ShippingMethodsSettings.tsx +2 -2
- package/src/modules/sales/components/TaxRatesSettings.tsx +2 -2
- package/src/modules/sales/components/channels/SalesChannelOffersPanel.tsx +0 -2
- package/src/modules/sales/components/documents/AdjustmentsSection.tsx +0 -2
- package/src/modules/sales/components/documents/PaymentsSection.tsx +1 -2
- package/src/modules/sales/components/documents/SalesDocumentsTable.tsx +0 -2
- package/src/modules/sales/i18n/de.json +0 -20
- package/src/modules/sales/i18n/en.json +1 -25
- package/src/modules/sales/i18n/es.json +0 -20
- package/src/modules/sales/i18n/pl.json +0 -20
- package/src/modules/staff/backend/staff/team-members/page.tsx +1 -1
- package/src/modules/staff/backend/staff/team-roles/page.tsx +2 -2
- package/src/modules/staff/backend/staff/teams/[id]/edit/page.tsx +2 -2
- package/src/modules/staff/backend/staff/teams/page.tsx +2 -2
- package/src/modules/staff/commands/leave-requests.ts +0 -94
- package/src/modules/staff/i18n/de.json +0 -4
- package/src/modules/staff/i18n/en.json +1 -9
- package/src/modules/staff/i18n/es.json +0 -4
- package/src/modules/staff/i18n/pl.json +0 -4
- package/src/modules/workflows/backend/definitions/page.tsx +0 -5
- package/src/modules/workflows/backend/instances/page.tsx +1 -4
- package/src/modules/workflows/backend/tasks/page.tsx +1 -4
- package/src/modules/workflows/i18n/en.json +1 -3
- package/src/modules/workflows/lib/transition-handler.ts +6 -18
- package/dist/generated/entities/notification/index.js +0 -57
- package/dist/generated/entities/notification/index.js.map +0 -7
- package/dist/modules/auth/api/profile/route.js +0 -157
- package/dist/modules/auth/api/profile/route.js.map +0 -7
- package/dist/modules/auth/backend/auth/profile/page.js +0 -141
- package/dist/modules/auth/backend/auth/profile/page.js.map +0 -7
- package/dist/modules/auth/backend/auth/profile/page.meta.js +0 -13
- package/dist/modules/auth/backend/auth/profile/page.meta.js.map +0 -7
- package/dist/modules/auth/notifications.js +0 -112
- package/dist/modules/auth/notifications.js.map +0 -7
- package/dist/modules/business_rules/notifications.js +0 -28
- package/dist/modules/business_rules/notifications.js.map +0 -7
- package/dist/modules/business_rules/subscribers/rule-execution-failed-notification.js +0 -37
- package/dist/modules/business_rules/subscribers/rule-execution-failed-notification.js.map +0 -7
- package/dist/modules/catalog/notifications.js +0 -28
- package/dist/modules/catalog/notifications.js.map +0 -7
- package/dist/modules/catalog/subscribers/low-stock-notification.js +0 -38
- package/dist/modules/catalog/subscribers/low-stock-notification.js.map +0 -7
- package/dist/modules/customers/notifications.js +0 -48
- package/dist/modules/customers/notifications.js.map +0 -7
- package/dist/modules/dashboards/lib/role-widgets.js +0 -58
- package/dist/modules/dashboards/lib/role-widgets.js.map +0 -7
- package/dist/modules/notifications/acl.js +0 -11
- package/dist/modules/notifications/acl.js.map +0 -7
- package/dist/modules/notifications/api/[id]/action/route.js +0 -74
- package/dist/modules/notifications/api/[id]/action/route.js.map +0 -7
- package/dist/modules/notifications/api/[id]/dismiss/route.js +0 -15
- package/dist/modules/notifications/api/[id]/dismiss/route.js.map +0 -7
- package/dist/modules/notifications/api/[id]/read/route.js +0 -15
- package/dist/modules/notifications/api/[id]/read/route.js.map +0 -7
- package/dist/modules/notifications/api/[id]/restore/route.js +0 -53
- package/dist/modules/notifications/api/[id]/restore/route.js.map +0 -7
- package/dist/modules/notifications/api/batch/route.js +0 -17
- package/dist/modules/notifications/api/batch/route.js.map +0 -7
- package/dist/modules/notifications/api/feature/route.js +0 -17
- package/dist/modules/notifications/api/feature/route.js.map +0 -7
- package/dist/modules/notifications/api/mark-all-read/route.js +0 -35
- package/dist/modules/notifications/api/mark-all-read/route.js.map +0 -7
- package/dist/modules/notifications/api/openapi.js +0 -76
- package/dist/modules/notifications/api/openapi.js.map +0 -7
- package/dist/modules/notifications/api/role/route.js +0 -17
- package/dist/modules/notifications/api/role/route.js.map +0 -7
- package/dist/modules/notifications/api/route.js +0 -85
- package/dist/modules/notifications/api/route.js.map +0 -7
- package/dist/modules/notifications/api/settings/route.js +0 -155
- package/dist/modules/notifications/api/settings/route.js.map +0 -7
- package/dist/modules/notifications/api/unread-count/route.js +0 -38
- package/dist/modules/notifications/api/unread-count/route.js.map +0 -7
- package/dist/modules/notifications/backend/config/notifications/page.js +0 -10
- package/dist/modules/notifications/backend/config/notifications/page.js.map +0 -7
- package/dist/modules/notifications/backend/config/notifications/page.meta.js +0 -24
- package/dist/modules/notifications/backend/config/notifications/page.meta.js.map +0 -7
- package/dist/modules/notifications/cli.js +0 -16
- package/dist/modules/notifications/cli.js.map +0 -7
- package/dist/modules/notifications/data/entities.js +0 -112
- package/dist/modules/notifications/data/entities.js.map +0 -7
- package/dist/modules/notifications/data/validators.js +0 -98
- package/dist/modules/notifications/data/validators.js.map +0 -7
- package/dist/modules/notifications/di.js +0 -13
- package/dist/modules/notifications/di.js.map +0 -7
- package/dist/modules/notifications/emails/NotificationEmail.js +0 -58
- package/dist/modules/notifications/emails/NotificationEmail.js.map +0 -7
- package/dist/modules/notifications/frontend/NotificationInboxPageClient.js +0 -44
- package/dist/modules/notifications/frontend/NotificationInboxPageClient.js.map +0 -7
- package/dist/modules/notifications/frontend/NotificationSettingsPageClient.js +0 -220
- package/dist/modules/notifications/frontend/NotificationSettingsPageClient.js.map +0 -7
- package/dist/modules/notifications/index.js +0 -14
- package/dist/modules/notifications/index.js.map +0 -7
- package/dist/modules/notifications/lib/deliveryConfig.js +0 -107
- package/dist/modules/notifications/lib/deliveryConfig.js.map +0 -7
- package/dist/modules/notifications/lib/deliveryStrategies.js +0 -14
- package/dist/modules/notifications/lib/deliveryStrategies.js.map +0 -7
- package/dist/modules/notifications/lib/events.js +0 -12
- package/dist/modules/notifications/lib/events.js.map +0 -7
- package/dist/modules/notifications/lib/notificationBuilder.js +0 -66
- package/dist/modules/notifications/lib/notificationBuilder.js.map +0 -7
- package/dist/modules/notifications/lib/notificationFactory.js +0 -54
- package/dist/modules/notifications/lib/notificationFactory.js.map +0 -7
- package/dist/modules/notifications/lib/notificationMapper.js +0 -34
- package/dist/modules/notifications/lib/notificationMapper.js.map +0 -7
- package/dist/modules/notifications/lib/notificationRecipients.js +0 -35
- package/dist/modules/notifications/lib/notificationRecipients.js.map +0 -7
- package/dist/modules/notifications/lib/notificationService.js +0 -279
- package/dist/modules/notifications/lib/notificationService.js.map +0 -7
- package/dist/modules/notifications/lib/routeHelpers.js +0 -101
- package/dist/modules/notifications/lib/routeHelpers.js.map +0 -7
- package/dist/modules/notifications/lib/safeHref.js +0 -24
- package/dist/modules/notifications/lib/safeHref.js.map +0 -7
- package/dist/modules/notifications/migrations/Migration20260123000001.js +0 -70
- package/dist/modules/notifications/migrations/Migration20260123000001.js.map +0 -7
- package/dist/modules/notifications/migrations/Migration20260126150000.js +0 -37
- package/dist/modules/notifications/migrations/Migration20260126150000.js.map +0 -7
- package/dist/modules/notifications/subscribers/deliver-notification.js +0 -165
- package/dist/modules/notifications/subscribers/deliver-notification.js.map +0 -7
- package/dist/modules/notifications/workers/create-notification.worker.js +0 -70
- package/dist/modules/notifications/workers/create-notification.worker.js.map +0 -7
- package/dist/modules/sales/notifications.client.js +0 -51
- package/dist/modules/sales/notifications.client.js.map +0 -7
- package/dist/modules/sales/notifications.js +0 -88
- package/dist/modules/sales/notifications.js.map +0 -7
- package/dist/modules/sales/subscribers/quote-expiring-notification.js +0 -38
- package/dist/modules/sales/subscribers/quote-expiring-notification.js.map +0 -7
- package/dist/modules/sales/widgets/notifications/SalesOrderCreatedRenderer.js +0 -137
- package/dist/modules/sales/widgets/notifications/SalesOrderCreatedRenderer.js.map +0 -7
- package/dist/modules/sales/widgets/notifications/SalesQuoteCreatedRenderer.js +0 -137
- package/dist/modules/sales/widgets/notifications/SalesQuoteCreatedRenderer.js.map +0 -7
- package/dist/modules/sales/widgets/notifications/index.js +0 -7
- package/dist/modules/sales/widgets/notifications/index.js.map +0 -7
- package/dist/modules/sales/widgets/notifications/useSalesDocumentTotals.js +0 -60
- package/dist/modules/sales/widgets/notifications/useSalesDocumentTotals.js.map +0 -7
- package/dist/modules/staff/notifications.js +0 -75
- package/dist/modules/staff/notifications.js.map +0 -7
- package/dist/modules/workflows/notifications.js +0 -28
- package/dist/modules/workflows/notifications.js.map +0 -7
- package/dist/modules/workflows/subscribers/task-assigned-notification.js +0 -38
- package/dist/modules/workflows/subscribers/task-assigned-notification.js.map +0 -7
- package/generated/entities/notification/index.ts +0 -27
- package/src/modules/auth/api/profile/route.ts +0 -163
- package/src/modules/auth/backend/auth/profile/page.meta.ts +0 -9
- package/src/modules/auth/backend/auth/profile/page.tsx +0 -174
- package/src/modules/auth/notifications.ts +0 -109
- package/src/modules/business_rules/notifications.ts +0 -25
- package/src/modules/business_rules/subscribers/rule-execution-failed-notification.ts +0 -50
- package/src/modules/catalog/notifications.ts +0 -25
- package/src/modules/catalog/subscribers/low-stock-notification.ts +0 -52
- package/src/modules/customers/notifications.ts +0 -44
- package/src/modules/dashboards/lib/role-widgets.ts +0 -80
- package/src/modules/notifications/__tests__/deliver-notification.test.ts +0 -195
- package/src/modules/notifications/__tests__/deliveryStrategies.test.ts +0 -19
- package/src/modules/notifications/__tests__/notificationService.test.ts +0 -208
- package/src/modules/notifications/acl.ts +0 -7
- package/src/modules/notifications/api/[id]/action/route.ts +0 -75
- package/src/modules/notifications/api/[id]/dismiss/route.ts +0 -12
- package/src/modules/notifications/api/[id]/read/route.ts +0 -12
- package/src/modules/notifications/api/[id]/restore/route.ts +0 -53
- package/src/modules/notifications/api/batch/route.ts +0 -14
- package/src/modules/notifications/api/feature/route.ts +0 -14
- package/src/modules/notifications/api/mark-all-read/route.ts +0 -34
- package/src/modules/notifications/api/openapi.ts +0 -76
- package/src/modules/notifications/api/role/route.ts +0 -14
- package/src/modules/notifications/api/route.ts +0 -92
- package/src/modules/notifications/api/settings/route.ts +0 -157
- package/src/modules/notifications/api/unread-count/route.ts +0 -38
- package/src/modules/notifications/backend/config/notifications/page.meta.ts +0 -22
- package/src/modules/notifications/backend/config/notifications/page.tsx +0 -12
- package/src/modules/notifications/cli.ts +0 -18
- package/src/modules/notifications/data/entities.ts +0 -99
- package/src/modules/notifications/data/validators.ts +0 -115
- package/src/modules/notifications/di.ts +0 -11
- package/src/modules/notifications/emails/NotificationEmail.tsx +0 -98
- package/src/modules/notifications/frontend/NotificationInboxPageClient.tsx +0 -42
- package/src/modules/notifications/frontend/NotificationSettingsPageClient.tsx +0 -233
- package/src/modules/notifications/i18n/de.json +0 -50
- package/src/modules/notifications/i18n/en.json +0 -50
- package/src/modules/notifications/i18n/es.json +0 -50
- package/src/modules/notifications/i18n/pl.json +0 -50
- package/src/modules/notifications/index.ts +0 -12
- package/src/modules/notifications/lib/deliveryConfig.ts +0 -153
- package/src/modules/notifications/lib/deliveryStrategies.ts +0 -50
- package/src/modules/notifications/lib/events.ts +0 -48
- package/src/modules/notifications/lib/notificationBuilder.ts +0 -121
- package/src/modules/notifications/lib/notificationFactory.ts +0 -76
- package/src/modules/notifications/lib/notificationMapper.ts +0 -33
- package/src/modules/notifications/lib/notificationRecipients.ts +0 -83
- package/src/modules/notifications/lib/notificationService.ts +0 -414
- package/src/modules/notifications/lib/routeHelpers.ts +0 -151
- package/src/modules/notifications/lib/safeHref.ts +0 -29
- package/src/modules/notifications/migrations/.snapshot-open-mercato.json +0 -300
- package/src/modules/notifications/migrations/Migration20260123000001.ts +0 -73
- package/src/modules/notifications/migrations/Migration20260126150000.ts +0 -39
- package/src/modules/notifications/subscribers/deliver-notification.ts +0 -204
- package/src/modules/notifications/workers/create-notification.worker.ts +0 -122
- package/src/modules/sales/notifications.client.ts +0 -65
- package/src/modules/sales/notifications.ts +0 -82
- package/src/modules/sales/subscribers/quote-expiring-notification.ts +0 -53
- package/src/modules/sales/widgets/notifications/SalesOrderCreatedRenderer.tsx +0 -156
- package/src/modules/sales/widgets/notifications/SalesQuoteCreatedRenderer.tsx +0 -156
- package/src/modules/sales/widgets/notifications/index.ts +0 -2
- package/src/modules/sales/widgets/notifications/useSalesDocumentTotals.ts +0 -81
- package/src/modules/staff/notifications.ts +0 -71
- package/src/modules/workflows/notifications.ts +0 -25
- package/src/modules/workflows/subscribers/task-assigned-notification.ts +0 -53
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { resolveNotificationService } from "../../notifications/lib/notificationService.js";
|
|
2
|
-
import { buildFeatureNotificationFromType } from "../../notifications/lib/notificationBuilder.js";
|
|
3
|
-
import { notificationTypes } from "../notifications.js";
|
|
4
|
-
const metadata = {
|
|
5
|
-
event: "catalog.product.stock_low",
|
|
6
|
-
persistent: true,
|
|
7
|
-
id: "catalog:low-stock-notification"
|
|
8
|
-
};
|
|
9
|
-
async function handle(payload, ctx) {
|
|
10
|
-
try {
|
|
11
|
-
const notificationService = resolveNotificationService(ctx);
|
|
12
|
-
const typeDef = notificationTypes.find((type) => type.type === "catalog.product.low_stock");
|
|
13
|
-
if (!typeDef) return;
|
|
14
|
-
const notificationInput = buildFeatureNotificationFromType(typeDef, {
|
|
15
|
-
requiredFeature: "catalog.products.manage",
|
|
16
|
-
bodyVariables: {
|
|
17
|
-
productName: payload.productName,
|
|
18
|
-
sku: payload.sku ?? "",
|
|
19
|
-
currentStock: String(payload.currentStock),
|
|
20
|
-
threshold: String(payload.threshold)
|
|
21
|
-
},
|
|
22
|
-
sourceEntityType: "catalog:product",
|
|
23
|
-
sourceEntityId: payload.productId,
|
|
24
|
-
linkHref: `/backend/catalog/products/${payload.productId}`
|
|
25
|
-
});
|
|
26
|
-
await notificationService.createForFeature(notificationInput, {
|
|
27
|
-
tenantId: payload.tenantId,
|
|
28
|
-
organizationId: payload.organizationId ?? null
|
|
29
|
-
});
|
|
30
|
-
} catch (err) {
|
|
31
|
-
console.error("[catalog:low-stock-notification] Failed to create notification:", err);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
export {
|
|
35
|
-
handle as default,
|
|
36
|
-
metadata
|
|
37
|
-
};
|
|
38
|
-
//# sourceMappingURL=low-stock-notification.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/modules/catalog/subscribers/low-stock-notification.ts"],
|
|
4
|
-
"sourcesContent": ["import type { EntityManager } from '@mikro-orm/postgresql'\nimport { resolveNotificationService } from '../../notifications/lib/notificationService'\nimport { buildFeatureNotificationFromType } from '../../notifications/lib/notificationBuilder'\nimport { notificationTypes } from '../notifications'\n\nexport const metadata = {\n event: 'catalog.product.stock_low',\n persistent: true,\n id: 'catalog:low-stock-notification',\n}\n\ntype LowStockPayload = {\n productId: string\n productName: string\n sku?: string | null\n currentStock: number\n threshold: number\n tenantId: string\n organizationId?: string | null\n}\n\ntype ResolverContext = {\n resolve: <T = unknown>(name: string) => T\n}\n\nexport default async function handle(payload: LowStockPayload, ctx: ResolverContext) {\n try {\n const notificationService = resolveNotificationService(ctx)\n const typeDef = notificationTypes.find((type) => type.type === 'catalog.product.low_stock')\n if (!typeDef) return\n\n const notificationInput = buildFeatureNotificationFromType(typeDef, {\n requiredFeature: 'catalog.products.manage',\n bodyVariables: {\n productName: payload.productName,\n sku: payload.sku ?? '',\n currentStock: String(payload.currentStock),\n threshold: String(payload.threshold),\n },\n sourceEntityType: 'catalog:product',\n sourceEntityId: payload.productId,\n linkHref: `/backend/catalog/products/${payload.productId}`,\n })\n\n await notificationService.createForFeature(notificationInput, {\n tenantId: payload.tenantId,\n organizationId: payload.organizationId ?? null,\n })\n } catch (err) {\n console.error('[catalog:low-stock-notification] Failed to create notification:', err)\n }\n}\n"],
|
|
5
|
-
"mappings": "AACA,SAAS,kCAAkC;AAC3C,SAAS,wCAAwC;AACjD,SAAS,yBAAyB;AAE3B,MAAM,WAAW;AAAA,EACtB,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,IAAI;AACN;AAgBA,eAAO,OAA8B,SAA0B,KAAsB;AACnF,MAAI;AACF,UAAM,sBAAsB,2BAA2B,GAAG;AAC1D,UAAM,UAAU,kBAAkB,KAAK,CAAC,SAAS,KAAK,SAAS,2BAA2B;AAC1F,QAAI,CAAC,QAAS;AAEd,UAAM,oBAAoB,iCAAiC,SAAS;AAAA,MAClE,iBAAiB;AAAA,MACjB,eAAe;AAAA,QACb,aAAa,QAAQ;AAAA,QACrB,KAAK,QAAQ,OAAO;AAAA,QACpB,cAAc,OAAO,QAAQ,YAAY;AAAA,QACzC,WAAW,OAAO,QAAQ,SAAS;AAAA,MACrC;AAAA,MACA,kBAAkB;AAAA,MAClB,gBAAgB,QAAQ;AAAA,MACxB,UAAU,6BAA6B,QAAQ,SAAS;AAAA,IAC1D,CAAC;AAED,UAAM,oBAAoB,iBAAiB,mBAAmB;AAAA,MAC5D,UAAU,QAAQ;AAAA,MAClB,gBAAgB,QAAQ,kBAAkB;AAAA,IAC5C,CAAC;AAAA,EACH,SAAS,KAAK;AACZ,YAAQ,MAAM,mEAAmE,GAAG;AAAA,EACtF;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
const notificationTypes = [
|
|
2
|
-
{
|
|
3
|
-
type: "customers.deal.won",
|
|
4
|
-
module: "customers",
|
|
5
|
-
titleKey: "customers.notifications.deal.won.title",
|
|
6
|
-
bodyKey: "customers.notifications.deal.won.body",
|
|
7
|
-
icon: "trophy",
|
|
8
|
-
severity: "success",
|
|
9
|
-
actions: [
|
|
10
|
-
{
|
|
11
|
-
id: "view",
|
|
12
|
-
labelKey: "common.view",
|
|
13
|
-
variant: "outline",
|
|
14
|
-
href: "/backend/customers/deals/{sourceEntityId}",
|
|
15
|
-
icon: "external-link"
|
|
16
|
-
}
|
|
17
|
-
],
|
|
18
|
-
linkHref: "/backend/customers/deals/{sourceEntityId}",
|
|
19
|
-
expiresAfterHours: 168
|
|
20
|
-
// 7 days
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
type: "customers.deal.lost",
|
|
24
|
-
module: "customers",
|
|
25
|
-
titleKey: "customers.notifications.deal.lost.title",
|
|
26
|
-
bodyKey: "customers.notifications.deal.lost.body",
|
|
27
|
-
icon: "x-circle",
|
|
28
|
-
severity: "warning",
|
|
29
|
-
actions: [
|
|
30
|
-
{
|
|
31
|
-
id: "view",
|
|
32
|
-
labelKey: "common.view",
|
|
33
|
-
variant: "outline",
|
|
34
|
-
href: "/backend/customers/deals/{sourceEntityId}",
|
|
35
|
-
icon: "external-link"
|
|
36
|
-
}
|
|
37
|
-
],
|
|
38
|
-
linkHref: "/backend/customers/deals/{sourceEntityId}",
|
|
39
|
-
expiresAfterHours: 168
|
|
40
|
-
// 7 days
|
|
41
|
-
}
|
|
42
|
-
];
|
|
43
|
-
var notifications_default = notificationTypes;
|
|
44
|
-
export {
|
|
45
|
-
notifications_default as default,
|
|
46
|
-
notificationTypes
|
|
47
|
-
};
|
|
48
|
-
//# sourceMappingURL=notifications.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/modules/customers/notifications.ts"],
|
|
4
|
-
"sourcesContent": ["import type { NotificationTypeDefinition } from '@open-mercato/shared/modules/notifications/types'\n\nexport const notificationTypes: NotificationTypeDefinition[] = [\n {\n type: 'customers.deal.won',\n module: 'customers',\n titleKey: 'customers.notifications.deal.won.title',\n bodyKey: 'customers.notifications.deal.won.body',\n icon: 'trophy',\n severity: 'success',\n actions: [\n {\n id: 'view',\n labelKey: 'common.view',\n variant: 'outline',\n href: '/backend/customers/deals/{sourceEntityId}',\n icon: 'external-link',\n },\n ],\n linkHref: '/backend/customers/deals/{sourceEntityId}',\n expiresAfterHours: 168, // 7 days\n },\n {\n type: 'customers.deal.lost',\n module: 'customers',\n titleKey: 'customers.notifications.deal.lost.title',\n bodyKey: 'customers.notifications.deal.lost.body',\n icon: 'x-circle',\n severity: 'warning',\n actions: [\n {\n id: 'view',\n labelKey: 'common.view',\n variant: 'outline',\n href: '/backend/customers/deals/{sourceEntityId}',\n icon: 'external-link',\n },\n ],\n linkHref: '/backend/customers/deals/{sourceEntityId}',\n expiresAfterHours: 168, // 7 days\n },\n]\n\nexport default notificationTypes\n"],
|
|
5
|
-
"mappings": "AAEO,MAAM,oBAAkD;AAAA,EAC7D;AAAA,IACE,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,SAAS;AAAA,IACT,MAAM;AAAA,IACN,UAAU;AAAA,IACV,SAAS;AAAA,MACP;AAAA,QACE,IAAI;AAAA,QACJ,UAAU;AAAA,QACV,SAAS;AAAA,QACT,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,UAAU;AAAA,IACV,mBAAmB;AAAA;AAAA,EACrB;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,SAAS;AAAA,IACT,MAAM;AAAA,IACN,UAAU;AAAA,IACV,SAAS;AAAA,MACP;AAAA,QACE,IAAI;AAAA,QACJ,UAAU;AAAA,QACV,SAAS;AAAA,QACT,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,UAAU;AAAA,IACV,mBAAmB;AAAA;AAAA,EACrB;AACF;AAEA,IAAO,wBAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { Role } from "@open-mercato/core/modules/auth/data/entities";
|
|
2
|
-
import { DashboardRoleWidgets } from "../data/entities.js";
|
|
3
|
-
import { loadAllWidgets } from "./widgets.js";
|
|
4
|
-
async function findRoleByName(em, roleName, tenantId) {
|
|
5
|
-
const tenantRole = await em.findOne(Role, { name: roleName, tenantId });
|
|
6
|
-
if (tenantRole) return tenantRole;
|
|
7
|
-
return em.findOne(Role, { name: roleName, tenantId: null });
|
|
8
|
-
}
|
|
9
|
-
async function resolveAnalyticsWidgetIds() {
|
|
10
|
-
const widgets = await loadAllWidgets();
|
|
11
|
-
return widgets.filter((widget) => widget.metadata.category === "analytics" || widget.metadata.id.startsWith("dashboards.analytics.")).map((widget) => widget.metadata.id);
|
|
12
|
-
}
|
|
13
|
-
async function appendWidgetsToRoles(em, { tenantId, organizationId = null, roleNames, widgetIds }) {
|
|
14
|
-
const trimmedTenantId = tenantId.trim();
|
|
15
|
-
const widgets = await loadAllWidgets();
|
|
16
|
-
const validWidgetIds = new Set(widgets.map((widget) => widget.metadata.id));
|
|
17
|
-
const resolvedWidgetIds = widgetIds.filter((id) => validWidgetIds.has(id));
|
|
18
|
-
if (!resolvedWidgetIds.length) return false;
|
|
19
|
-
let updated = false;
|
|
20
|
-
await em.transactional(async (tem) => {
|
|
21
|
-
for (const roleName of roleNames) {
|
|
22
|
-
const role = await findRoleByName(tem, roleName, trimmedTenantId);
|
|
23
|
-
if (!role) continue;
|
|
24
|
-
const record = await tem.findOne(DashboardRoleWidgets, {
|
|
25
|
-
roleId: String(role.id),
|
|
26
|
-
tenantId: trimmedTenantId,
|
|
27
|
-
organizationId,
|
|
28
|
-
deletedAt: null
|
|
29
|
-
});
|
|
30
|
-
const roleRecord = record ?? (organizationId ? await tem.findOne(DashboardRoleWidgets, {
|
|
31
|
-
roleId: String(role.id),
|
|
32
|
-
tenantId: trimmedTenantId,
|
|
33
|
-
organizationId: null,
|
|
34
|
-
deletedAt: null
|
|
35
|
-
}) : null);
|
|
36
|
-
if (!roleRecord) continue;
|
|
37
|
-
const current = Array.isArray(roleRecord.widgetIdsJson) ? roleRecord.widgetIdsJson : [];
|
|
38
|
-
const next = [...current];
|
|
39
|
-
const existing = new Set(current);
|
|
40
|
-
for (const widgetId of resolvedWidgetIds) {
|
|
41
|
-
if (existing.has(widgetId)) continue;
|
|
42
|
-
existing.add(widgetId);
|
|
43
|
-
next.push(widgetId);
|
|
44
|
-
}
|
|
45
|
-
if (next.length === current.length) continue;
|
|
46
|
-
roleRecord.widgetIdsJson = next;
|
|
47
|
-
roleRecord.updatedAt = /* @__PURE__ */ new Date();
|
|
48
|
-
tem.persist(roleRecord);
|
|
49
|
-
updated = true;
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
return updated;
|
|
53
|
-
}
|
|
54
|
-
export {
|
|
55
|
-
appendWidgetsToRoles,
|
|
56
|
-
resolveAnalyticsWidgetIds
|
|
57
|
-
};
|
|
58
|
-
//# sourceMappingURL=role-widgets.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/modules/dashboards/lib/role-widgets.ts"],
|
|
4
|
-
"sourcesContent": ["import type { EntityManager } from '@mikro-orm/postgresql'\nimport { Role } from '@open-mercato/core/modules/auth/data/entities'\nimport { DashboardRoleWidgets } from '../data/entities'\nimport { loadAllWidgets } from './widgets'\n\ntype RoleWidgetScope = {\n tenantId: string\n organizationId?: string | null\n roleNames: string[]\n widgetIds: string[]\n}\n\nasync function findRoleByName(\n em: EntityManager,\n roleName: string,\n tenantId: string,\n): Promise<Role | null> {\n const tenantRole = await em.findOne(Role, { name: roleName, tenantId })\n if (tenantRole) return tenantRole\n return em.findOne(Role, { name: roleName, tenantId: null })\n}\n\nexport async function resolveAnalyticsWidgetIds(): Promise<string[]> {\n const widgets = await loadAllWidgets()\n return widgets\n .filter((widget) => widget.metadata.category === 'analytics' || widget.metadata.id.startsWith('dashboards.analytics.'))\n .map((widget) => widget.metadata.id)\n}\n\nexport async function appendWidgetsToRoles(\n em: EntityManager,\n { tenantId, organizationId = null, roleNames, widgetIds }: RoleWidgetScope,\n): Promise<boolean> {\n const trimmedTenantId = tenantId.trim()\n const widgets = await loadAllWidgets()\n const validWidgetIds = new Set(widgets.map((widget) => widget.metadata.id))\n const resolvedWidgetIds = widgetIds.filter((id) => validWidgetIds.has(id))\n if (!resolvedWidgetIds.length) return false\n\n let updated = false\n await em.transactional(async (tem) => {\n for (const roleName of roleNames) {\n const role = await findRoleByName(tem, roleName, trimmedTenantId)\n if (!role) continue\n\n const record = await tem.findOne(DashboardRoleWidgets, {\n roleId: String(role.id),\n tenantId: trimmedTenantId,\n organizationId,\n deletedAt: null,\n })\n const roleRecord = record ?? (organizationId\n ? await tem.findOne(DashboardRoleWidgets, {\n roleId: String(role.id),\n tenantId: trimmedTenantId,\n organizationId: null,\n deletedAt: null,\n })\n : null)\n if (!roleRecord) continue\n\n const current = Array.isArray(roleRecord.widgetIdsJson) ? roleRecord.widgetIdsJson : []\n const next = [...current]\n const existing = new Set(current)\n for (const widgetId of resolvedWidgetIds) {\n if (existing.has(widgetId)) continue\n existing.add(widgetId)\n next.push(widgetId)\n }\n\n if (next.length === current.length) continue\n roleRecord.widgetIdsJson = next\n roleRecord.updatedAt = new Date()\n tem.persist(roleRecord)\n updated = true\n }\n })\n\n return updated\n}\n"],
|
|
5
|
-
"mappings": "AACA,SAAS,YAAY;AACrB,SAAS,4BAA4B;AACrC,SAAS,sBAAsB;AAS/B,eAAe,eACb,IACA,UACA,UACsB;AACtB,QAAM,aAAa,MAAM,GAAG,QAAQ,MAAM,EAAE,MAAM,UAAU,SAAS,CAAC;AACtE,MAAI,WAAY,QAAO;AACvB,SAAO,GAAG,QAAQ,MAAM,EAAE,MAAM,UAAU,UAAU,KAAK,CAAC;AAC5D;AAEA,eAAsB,4BAA+C;AACnE,QAAM,UAAU,MAAM,eAAe;AACrC,SAAO,QACJ,OAAO,CAAC,WAAW,OAAO,SAAS,aAAa,eAAe,OAAO,SAAS,GAAG,WAAW,uBAAuB,CAAC,EACrH,IAAI,CAAC,WAAW,OAAO,SAAS,EAAE;AACvC;AAEA,eAAsB,qBACpB,IACA,EAAE,UAAU,iBAAiB,MAAM,WAAW,UAAU,GACtC;AAClB,QAAM,kBAAkB,SAAS,KAAK;AACtC,QAAM,UAAU,MAAM,eAAe;AACrC,QAAM,iBAAiB,IAAI,IAAI,QAAQ,IAAI,CAAC,WAAW,OAAO,SAAS,EAAE,CAAC;AAC1E,QAAM,oBAAoB,UAAU,OAAO,CAAC,OAAO,eAAe,IAAI,EAAE,CAAC;AACzE,MAAI,CAAC,kBAAkB,OAAQ,QAAO;AAEtC,MAAI,UAAU;AACd,QAAM,GAAG,cAAc,OAAO,QAAQ;AACpC,eAAW,YAAY,WAAW;AAChC,YAAM,OAAO,MAAM,eAAe,KAAK,UAAU,eAAe;AAChE,UAAI,CAAC,KAAM;AAEX,YAAM,SAAS,MAAM,IAAI,QAAQ,sBAAsB;AAAA,QACrD,QAAQ,OAAO,KAAK,EAAE;AAAA,QACtB,UAAU;AAAA,QACV;AAAA,QACA,WAAW;AAAA,MACb,CAAC;AACD,YAAM,aAAa,WAAW,iBAC1B,MAAM,IAAI,QAAQ,sBAAsB;AAAA,QACxC,QAAQ,OAAO,KAAK,EAAE;AAAA,QACtB,UAAU;AAAA,QACV,gBAAgB;AAAA,QAChB,WAAW;AAAA,MACb,CAAC,IACC;AACJ,UAAI,CAAC,WAAY;AAEjB,YAAM,UAAU,MAAM,QAAQ,WAAW,aAAa,IAAI,WAAW,gBAAgB,CAAC;AACtF,YAAM,OAAO,CAAC,GAAG,OAAO;AACxB,YAAM,WAAW,IAAI,IAAI,OAAO;AAChC,iBAAW,YAAY,mBAAmB;AACxC,YAAI,SAAS,IAAI,QAAQ,EAAG;AAC5B,iBAAS,IAAI,QAAQ;AACrB,aAAK,KAAK,QAAQ;AAAA,MACpB;AAEA,UAAI,KAAK,WAAW,QAAQ,OAAQ;AACpC,iBAAW,gBAAgB;AAC3B,iBAAW,YAAY,oBAAI,KAAK;AAChC,UAAI,QAAQ,UAAU;AACtB,gBAAU;AAAA,IACZ;AAAA,EACF,CAAC;AAED,SAAO;AACT;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
const features = [
|
|
2
|
-
{ id: "notifications.view", title: "View own notifications", module: "notifications" },
|
|
3
|
-
{ id: "notifications.create", title: "Create notifications for others", module: "notifications" },
|
|
4
|
-
{ id: "notifications.manage", title: "Manage all notifications", module: "notifications" }
|
|
5
|
-
];
|
|
6
|
-
var acl_default = features;
|
|
7
|
-
export {
|
|
8
|
-
acl_default as default,
|
|
9
|
-
features
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=acl.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/modules/notifications/acl.ts"],
|
|
4
|
-
"sourcesContent": ["export const features = [\n { id: 'notifications.view', title: 'View own notifications', module: 'notifications' },\n { id: 'notifications.create', title: 'Create notifications for others', module: 'notifications' },\n { id: 'notifications.manage', title: 'Manage all notifications', module: 'notifications' },\n]\n\nexport default features\n"],
|
|
5
|
-
"mappings": "AAAO,MAAM,WAAW;AAAA,EACtB,EAAE,IAAI,sBAAsB,OAAO,0BAA0B,QAAQ,gBAAgB;AAAA,EACrF,EAAE,IAAI,wBAAwB,OAAO,mCAAmC,QAAQ,gBAAgB;AAAA,EAChG,EAAE,IAAI,wBAAwB,OAAO,4BAA4B,QAAQ,gBAAgB;AAC3F;AAEA,IAAO,cAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { executeActionSchema } from "../../../data/validators.js";
|
|
2
|
-
import { actionResultResponseSchema, errorResponseSchema } from "../../openapi.js";
|
|
3
|
-
import { resolveNotificationContext } from "../../../lib/routeHelpers.js";
|
|
4
|
-
import { resolveTranslations } from "@open-mercato/shared/lib/i18n/server";
|
|
5
|
-
const metadata = {
|
|
6
|
-
POST: { requireAuth: true }
|
|
7
|
-
};
|
|
8
|
-
async function POST(req, { params }) {
|
|
9
|
-
const { id } = await params;
|
|
10
|
-
const { service, scope } = await resolveNotificationContext(req);
|
|
11
|
-
const body = await req.json().catch(() => ({}));
|
|
12
|
-
const input = executeActionSchema.parse(body);
|
|
13
|
-
try {
|
|
14
|
-
const { notification, result } = await service.executeAction(id, input, scope);
|
|
15
|
-
const action = notification.actionData?.actions?.find((a) => a.id === input.actionId);
|
|
16
|
-
const href = action?.href?.replace("{sourceEntityId}", notification.sourceEntityId ?? "");
|
|
17
|
-
return Response.json({
|
|
18
|
-
ok: true,
|
|
19
|
-
result,
|
|
20
|
-
href
|
|
21
|
-
});
|
|
22
|
-
} catch (error) {
|
|
23
|
-
const { t } = await resolveTranslations();
|
|
24
|
-
const fallback = t("notifications.error.action", "Failed to execute action");
|
|
25
|
-
const message = error instanceof Error && error.message ? error.message : fallback;
|
|
26
|
-
return Response.json({ error: message }, { status: 400 });
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
const openApi = {
|
|
30
|
-
POST: {
|
|
31
|
-
summary: "Execute notification action",
|
|
32
|
-
tags: ["Notifications"],
|
|
33
|
-
parameters: [
|
|
34
|
-
{
|
|
35
|
-
name: "id",
|
|
36
|
-
in: "path",
|
|
37
|
-
required: true,
|
|
38
|
-
schema: { type: "string", format: "uuid" }
|
|
39
|
-
}
|
|
40
|
-
],
|
|
41
|
-
requestBody: {
|
|
42
|
-
required: true,
|
|
43
|
-
content: {
|
|
44
|
-
"application/json": {
|
|
45
|
-
schema: executeActionSchema
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
responses: {
|
|
50
|
-
200: {
|
|
51
|
-
description: "Action executed successfully",
|
|
52
|
-
content: {
|
|
53
|
-
"application/json": {
|
|
54
|
-
schema: actionResultResponseSchema
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
400: {
|
|
59
|
-
description: "Action not found or failed",
|
|
60
|
-
content: {
|
|
61
|
-
"application/json": {
|
|
62
|
-
schema: errorResponseSchema
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
export {
|
|
70
|
-
POST,
|
|
71
|
-
metadata,
|
|
72
|
-
openApi
|
|
73
|
-
};
|
|
74
|
-
//# sourceMappingURL=route.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../src/modules/notifications/api/%5Bid%5D/action/route.ts"],
|
|
4
|
-
"sourcesContent": ["import { executeActionSchema } from '../../../data/validators'\nimport { actionResultResponseSchema, errorResponseSchema } from '../../openapi'\nimport { resolveNotificationContext } from '../../../lib/routeHelpers'\nimport { resolveTranslations } from '@open-mercato/shared/lib/i18n/server'\n\nexport const metadata = {\n POST: { requireAuth: true },\n}\n\nexport async function POST(req: Request, { params }: { params: Promise<{ id: string }> }) {\n const { id } = await params\n const { service, scope } = await resolveNotificationContext(req)\n\n const body = await req.json().catch(() => ({}))\n const input = executeActionSchema.parse(body)\n\n try {\n const { notification, result } = await service.executeAction(id, input, scope)\n\n const action = notification.actionData?.actions?.find((a) => a.id === input.actionId)\n const href = action?.href?.replace('{sourceEntityId}', notification.sourceEntityId ?? '')\n\n return Response.json({\n ok: true,\n result,\n href,\n })\n } catch (error) {\n const { t } = await resolveTranslations()\n const fallback = t('notifications.error.action', 'Failed to execute action')\n const message = error instanceof Error && error.message ? error.message : fallback\n return Response.json({ error: message }, { status: 400 })\n }\n}\n\nexport const openApi = {\n POST: {\n summary: 'Execute notification action',\n tags: ['Notifications'],\n parameters: [\n {\n name: 'id',\n in: 'path',\n required: true,\n schema: { type: 'string', format: 'uuid' },\n },\n ],\n requestBody: {\n required: true,\n content: {\n 'application/json': {\n schema: executeActionSchema,\n },\n },\n },\n responses: {\n 200: {\n description: 'Action executed successfully',\n content: {\n 'application/json': {\n schema: actionResultResponseSchema,\n },\n },\n },\n 400: {\n description: 'Action not found or failed',\n content: {\n 'application/json': {\n schema: errorResponseSchema,\n },\n },\n },\n },\n },\n}\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,2BAA2B;AACpC,SAAS,4BAA4B,2BAA2B;AAChE,SAAS,kCAAkC;AAC3C,SAAS,2BAA2B;AAE7B,MAAM,WAAW;AAAA,EACtB,MAAM,EAAE,aAAa,KAAK;AAC5B;AAEA,eAAsB,KAAK,KAAc,EAAE,OAAO,GAAwC;AACxF,QAAM,EAAE,GAAG,IAAI,MAAM;AACrB,QAAM,EAAE,SAAS,MAAM,IAAI,MAAM,2BAA2B,GAAG;AAE/D,QAAM,OAAO,MAAM,IAAI,KAAK,EAAE,MAAM,OAAO,CAAC,EAAE;AAC9C,QAAM,QAAQ,oBAAoB,MAAM,IAAI;AAE5C,MAAI;AACF,UAAM,EAAE,cAAc,OAAO,IAAI,MAAM,QAAQ,cAAc,IAAI,OAAO,KAAK;AAE7E,UAAM,SAAS,aAAa,YAAY,SAAS,KAAK,CAAC,MAAM,EAAE,OAAO,MAAM,QAAQ;AACpF,UAAM,OAAO,QAAQ,MAAM,QAAQ,oBAAoB,aAAa,kBAAkB,EAAE;AAExF,WAAO,SAAS,KAAK;AAAA,MACnB,IAAI;AAAA,MACJ;AAAA,MACA;AAAA,IACF,CAAC;AAAA,EACH,SAAS,OAAO;AACd,UAAM,EAAE,EAAE,IAAI,MAAM,oBAAoB;AACxC,UAAM,WAAW,EAAE,8BAA8B,0BAA0B;AAC3E,UAAM,UAAU,iBAAiB,SAAS,MAAM,UAAU,MAAM,UAAU;AAC1E,WAAO,SAAS,KAAK,EAAE,OAAO,QAAQ,GAAG,EAAE,QAAQ,IAAI,CAAC;AAAA,EAC1D;AACF;AAEO,MAAM,UAAU;AAAA,EACrB,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,MAAM,CAAC,eAAe;AAAA,IACtB,YAAY;AAAA,MACV;AAAA,QACE,MAAM;AAAA,QACN,IAAI;AAAA,QACJ,UAAU;AAAA,QACV,QAAQ,EAAE,MAAM,UAAU,QAAQ,OAAO;AAAA,MAC3C;AAAA,IACF;AAAA,IACA,aAAa;AAAA,MACX,UAAU;AAAA,MACV,SAAS;AAAA,QACP,oBAAoB;AAAA,UAClB,QAAQ;AAAA,QACV;AAAA,MACF;AAAA,IACF;AAAA,IACA,WAAW;AAAA,MACT,KAAK;AAAA,QACH,aAAa;AAAA,QACb,SAAS;AAAA,UACP,oBAAoB;AAAA,YAClB,QAAQ;AAAA,UACV;AAAA,QACF;AAAA,MACF;AAAA,MACA,KAAK;AAAA,QACH,aAAa;AAAA,QACb,SAAS;AAAA,UACP,oBAAoB;AAAA,YAClB,QAAQ;AAAA,UACV;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { createSingleNotificationActionRoute, createSingleNotificationActionOpenApi } from "../../../lib/routeHelpers.js";
|
|
2
|
-
const metadata = {
|
|
3
|
-
PUT: { requireAuth: true }
|
|
4
|
-
};
|
|
5
|
-
const PUT = createSingleNotificationActionRoute("dismiss");
|
|
6
|
-
const openApi = createSingleNotificationActionOpenApi(
|
|
7
|
-
"Dismiss notification",
|
|
8
|
-
"Notification dismissed"
|
|
9
|
-
);
|
|
10
|
-
export {
|
|
11
|
-
PUT,
|
|
12
|
-
metadata,
|
|
13
|
-
openApi
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=route.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../src/modules/notifications/api/%5Bid%5D/dismiss/route.ts"],
|
|
4
|
-
"sourcesContent": ["import { createSingleNotificationActionRoute, createSingleNotificationActionOpenApi } from '../../../lib/routeHelpers'\n\nexport const metadata = {\n PUT: { requireAuth: true },\n}\n\nexport const PUT = createSingleNotificationActionRoute('dismiss')\n\nexport const openApi = createSingleNotificationActionOpenApi(\n 'Dismiss notification',\n 'Notification dismissed'\n)\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,qCAAqC,6CAA6C;AAEpF,MAAM,WAAW;AAAA,EACtB,KAAK,EAAE,aAAa,KAAK;AAC3B;AAEO,MAAM,MAAM,oCAAoC,SAAS;AAEzD,MAAM,UAAU;AAAA,EACrB;AAAA,EACA;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { createSingleNotificationActionRoute, createSingleNotificationActionOpenApi } from "../../../lib/routeHelpers.js";
|
|
2
|
-
const metadata = {
|
|
3
|
-
PUT: { requireAuth: true }
|
|
4
|
-
};
|
|
5
|
-
const PUT = createSingleNotificationActionRoute("markAsRead");
|
|
6
|
-
const openApi = createSingleNotificationActionOpenApi(
|
|
7
|
-
"Mark notification as read",
|
|
8
|
-
"Notification marked as read"
|
|
9
|
-
);
|
|
10
|
-
export {
|
|
11
|
-
PUT,
|
|
12
|
-
metadata,
|
|
13
|
-
openApi
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=route.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../src/modules/notifications/api/%5Bid%5D/read/route.ts"],
|
|
4
|
-
"sourcesContent": ["import { createSingleNotificationActionRoute, createSingleNotificationActionOpenApi } from '../../../lib/routeHelpers'\n\nexport const metadata = {\n PUT: { requireAuth: true },\n}\n\nexport const PUT = createSingleNotificationActionRoute('markAsRead')\n\nexport const openApi = createSingleNotificationActionOpenApi(\n 'Mark notification as read',\n 'Notification marked as read'\n)\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,qCAAqC,6CAA6C;AAEpF,MAAM,WAAW;AAAA,EACtB,KAAK,EAAE,aAAa,KAAK;AAC3B;AAEO,MAAM,MAAM,oCAAoC,YAAY;AAE5D,MAAM,UAAU;AAAA,EACrB;AAAA,EACA;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { restoreNotificationSchema } from "../../../data/validators.js";
|
|
3
|
-
import { resolveNotificationContext } from "../../../lib/routeHelpers.js";
|
|
4
|
-
const metadata = {
|
|
5
|
-
PUT: { requireAuth: true }
|
|
6
|
-
};
|
|
7
|
-
async function PUT(req, { params }) {
|
|
8
|
-
const { id } = await params;
|
|
9
|
-
const { service, scope } = await resolveNotificationContext(req);
|
|
10
|
-
const body = await req.json().catch(() => ({}));
|
|
11
|
-
const input = restoreNotificationSchema.parse(body);
|
|
12
|
-
await service.restoreDismissed(id, input.status, scope);
|
|
13
|
-
return Response.json({ ok: true });
|
|
14
|
-
}
|
|
15
|
-
const openApi = {
|
|
16
|
-
PUT: {
|
|
17
|
-
summary: "Restore dismissed notification",
|
|
18
|
-
description: "Undo a dismissal and restore a notification to read or unread.",
|
|
19
|
-
tags: ["Notifications"],
|
|
20
|
-
parameters: [
|
|
21
|
-
{
|
|
22
|
-
name: "id",
|
|
23
|
-
in: "path",
|
|
24
|
-
required: true,
|
|
25
|
-
schema: { type: "string", format: "uuid" }
|
|
26
|
-
}
|
|
27
|
-
],
|
|
28
|
-
requestBody: {
|
|
29
|
-
required: false,
|
|
30
|
-
content: {
|
|
31
|
-
"application/json": {
|
|
32
|
-
schema: restoreNotificationSchema
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
responses: {
|
|
37
|
-
200: {
|
|
38
|
-
description: "Notification restored",
|
|
39
|
-
content: {
|
|
40
|
-
"application/json": {
|
|
41
|
-
schema: z.object({ ok: z.boolean() })
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
export {
|
|
49
|
-
PUT,
|
|
50
|
-
metadata,
|
|
51
|
-
openApi
|
|
52
|
-
};
|
|
53
|
-
//# sourceMappingURL=route.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../src/modules/notifications/api/%5Bid%5D/restore/route.ts"],
|
|
4
|
-
"sourcesContent": ["import { z } from 'zod'\nimport { restoreNotificationSchema } from '../../../data/validators'\nimport { resolveNotificationContext } from '../../../lib/routeHelpers'\n\nexport const metadata = {\n PUT: { requireAuth: true },\n}\n\nexport async function PUT(req: Request, { params }: { params: Promise<{ id: string }> }) {\n const { id } = await params\n const { service, scope } = await resolveNotificationContext(req)\n\n const body = await req.json().catch(() => ({}))\n const input = restoreNotificationSchema.parse(body)\n\n await service.restoreDismissed(id, input.status, scope)\n\n return Response.json({ ok: true })\n}\n\nexport const openApi = {\n PUT: {\n summary: 'Restore dismissed notification',\n description: 'Undo a dismissal and restore a notification to read or unread.',\n tags: ['Notifications'],\n parameters: [\n {\n name: 'id',\n in: 'path',\n required: true,\n schema: { type: 'string', format: 'uuid' },\n },\n ],\n requestBody: {\n required: false,\n content: {\n 'application/json': {\n schema: restoreNotificationSchema,\n },\n },\n },\n responses: {\n 200: {\n description: 'Notification restored',\n content: {\n 'application/json': {\n schema: z.object({ ok: z.boolean() }),\n },\n },\n },\n },\n },\n}\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,SAAS;AAClB,SAAS,iCAAiC;AAC1C,SAAS,kCAAkC;AAEpC,MAAM,WAAW;AAAA,EACtB,KAAK,EAAE,aAAa,KAAK;AAC3B;AAEA,eAAsB,IAAI,KAAc,EAAE,OAAO,GAAwC;AACvF,QAAM,EAAE,GAAG,IAAI,MAAM;AACrB,QAAM,EAAE,SAAS,MAAM,IAAI,MAAM,2BAA2B,GAAG;AAE/D,QAAM,OAAO,MAAM,IAAI,KAAK,EAAE,MAAM,OAAO,CAAC,EAAE;AAC9C,QAAM,QAAQ,0BAA0B,MAAM,IAAI;AAElD,QAAM,QAAQ,iBAAiB,IAAI,MAAM,QAAQ,KAAK;AAEtD,SAAO,SAAS,KAAK,EAAE,IAAI,KAAK,CAAC;AACnC;AAEO,MAAM,UAAU;AAAA,EACrB,KAAK;AAAA,IACH,SAAS;AAAA,IACT,aAAa;AAAA,IACb,MAAM,CAAC,eAAe;AAAA,IACtB,YAAY;AAAA,MACV;AAAA,QACE,MAAM;AAAA,QACN,IAAI;AAAA,QACJ,UAAU;AAAA,QACV,QAAQ,EAAE,MAAM,UAAU,QAAQ,OAAO;AAAA,MAC3C;AAAA,IACF;AAAA,IACA,aAAa;AAAA,MACX,UAAU;AAAA,MACV,SAAS;AAAA,QACP,oBAAoB;AAAA,UAClB,QAAQ;AAAA,QACV;AAAA,MACF;AAAA,IACF;AAAA,IACA,WAAW;AAAA,MACT,KAAK;AAAA,QACH,aAAa;AAAA,QACb,SAAS;AAAA,UACP,oBAAoB;AAAA,YAClB,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;AAAA,UACtC;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { createBatchNotificationSchema } from "../../data/validators.js";
|
|
2
|
-
import { createBulkNotificationRoute, createBulkNotificationOpenApi } from "../../lib/routeHelpers.js";
|
|
3
|
-
const metadata = {
|
|
4
|
-
POST: { requireAuth: true, requireFeatures: ["notifications.create"] }
|
|
5
|
-
};
|
|
6
|
-
const POST = createBulkNotificationRoute(createBatchNotificationSchema, "createBatch");
|
|
7
|
-
const openApi = createBulkNotificationOpenApi(
|
|
8
|
-
createBatchNotificationSchema,
|
|
9
|
-
"Create batch notifications",
|
|
10
|
-
"Send the same notification to multiple users"
|
|
11
|
-
);
|
|
12
|
-
export {
|
|
13
|
-
POST,
|
|
14
|
-
metadata,
|
|
15
|
-
openApi
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=route.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../src/modules/notifications/api/batch/route.ts"],
|
|
4
|
-
"sourcesContent": ["import { createBatchNotificationSchema } from '../../data/validators'\nimport { createBulkNotificationRoute, createBulkNotificationOpenApi } from '../../lib/routeHelpers'\n\nexport const metadata = {\n POST: { requireAuth: true, requireFeatures: ['notifications.create'] },\n}\n\nexport const POST = createBulkNotificationRoute(createBatchNotificationSchema, 'createBatch')\n\nexport const openApi = createBulkNotificationOpenApi(\n createBatchNotificationSchema,\n 'Create batch notifications',\n 'Send the same notification to multiple users'\n)\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,qCAAqC;AAC9C,SAAS,6BAA6B,qCAAqC;AAEpE,MAAM,WAAW;AAAA,EACtB,MAAM,EAAE,aAAa,MAAM,iBAAiB,CAAC,sBAAsB,EAAE;AACvE;AAEO,MAAM,OAAO,4BAA4B,+BAA+B,aAAa;AAErF,MAAM,UAAU;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { createFeatureNotificationSchema } from "../../data/validators.js";
|
|
2
|
-
import { createBulkNotificationRoute, createBulkNotificationOpenApi } from "../../lib/routeHelpers.js";
|
|
3
|
-
const metadata = {
|
|
4
|
-
POST: { requireAuth: true, requireFeatures: ["notifications.create"] }
|
|
5
|
-
};
|
|
6
|
-
const POST = createBulkNotificationRoute(createFeatureNotificationSchema, "createForFeature");
|
|
7
|
-
const openApi = createBulkNotificationOpenApi(
|
|
8
|
-
createFeatureNotificationSchema,
|
|
9
|
-
"Create notifications for all users with a specific feature/permission",
|
|
10
|
-
"Send the same notification to all users who have the specified feature permission (via role ACL or user ACL). Supports wildcard matching."
|
|
11
|
-
);
|
|
12
|
-
export {
|
|
13
|
-
POST,
|
|
14
|
-
metadata,
|
|
15
|
-
openApi
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=route.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../src/modules/notifications/api/feature/route.ts"],
|
|
4
|
-
"sourcesContent": ["import { createFeatureNotificationSchema } from '../../data/validators'\nimport { createBulkNotificationRoute, createBulkNotificationOpenApi } from '../../lib/routeHelpers'\n\nexport const metadata = {\n POST: { requireAuth: true, requireFeatures: ['notifications.create'] },\n}\n\nexport const POST = createBulkNotificationRoute(createFeatureNotificationSchema, 'createForFeature')\n\nexport const openApi = createBulkNotificationOpenApi(\n createFeatureNotificationSchema,\n 'Create notifications for all users with a specific feature/permission',\n 'Send the same notification to all users who have the specified feature permission (via role ACL or user ACL). Supports wildcard matching.'\n)\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,uCAAuC;AAChD,SAAS,6BAA6B,qCAAqC;AAEpE,MAAM,WAAW;AAAA,EACtB,MAAM,EAAE,aAAa,MAAM,iBAAiB,CAAC,sBAAsB,EAAE;AACvE;AAEO,MAAM,OAAO,4BAA4B,iCAAiC,kBAAkB;AAE5F,MAAM,UAAU;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { resolveNotificationContext } from "../../lib/routeHelpers.js";
|
|
3
|
-
const metadata = {
|
|
4
|
-
PUT: { requireAuth: true }
|
|
5
|
-
};
|
|
6
|
-
async function PUT(req) {
|
|
7
|
-
const { service, scope } = await resolveNotificationContext(req);
|
|
8
|
-
const count = await service.markAllAsRead(scope);
|
|
9
|
-
return Response.json({ ok: true, count });
|
|
10
|
-
}
|
|
11
|
-
const openApi = {
|
|
12
|
-
PUT: {
|
|
13
|
-
summary: "Mark all notifications as read",
|
|
14
|
-
tags: ["Notifications"],
|
|
15
|
-
responses: {
|
|
16
|
-
200: {
|
|
17
|
-
description: "All notifications marked as read",
|
|
18
|
-
content: {
|
|
19
|
-
"application/json": {
|
|
20
|
-
schema: z.object({
|
|
21
|
-
ok: z.boolean(),
|
|
22
|
-
count: z.number()
|
|
23
|
-
})
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
export {
|
|
31
|
-
PUT,
|
|
32
|
-
metadata,
|
|
33
|
-
openApi
|
|
34
|
-
};
|
|
35
|
-
//# sourceMappingURL=route.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../src/modules/notifications/api/mark-all-read/route.ts"],
|
|
4
|
-
"sourcesContent": ["import { z } from 'zod'\nimport { resolveNotificationContext } from '../../lib/routeHelpers'\n\nexport const metadata = {\n PUT: { requireAuth: true },\n}\n\nexport async function PUT(req: Request) {\n const { service, scope } = await resolveNotificationContext(req)\n\n const count = await service.markAllAsRead(scope)\n\n return Response.json({ ok: true, count })\n}\n\nexport const openApi = {\n PUT: {\n summary: 'Mark all notifications as read',\n tags: ['Notifications'],\n responses: {\n 200: {\n description: 'All notifications marked as read',\n content: {\n 'application/json': {\n schema: z.object({\n ok: z.boolean(),\n count: z.number(),\n }),\n },\n },\n },\n },\n },\n}\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,SAAS;AAClB,SAAS,kCAAkC;AAEpC,MAAM,WAAW;AAAA,EACtB,KAAK,EAAE,aAAa,KAAK;AAC3B;AAEA,eAAsB,IAAI,KAAc;AACtC,QAAM,EAAE,SAAS,MAAM,IAAI,MAAM,2BAA2B,GAAG;AAE/D,QAAM,QAAQ,MAAM,QAAQ,cAAc,KAAK;AAE/C,SAAO,SAAS,KAAK,EAAE,IAAI,MAAM,MAAM,CAAC;AAC1C;AAEO,MAAM,UAAU;AAAA,EACrB,KAAK;AAAA,IACH,SAAS;AAAA,IACT,MAAM,CAAC,eAAe;AAAA,IACtB,WAAW;AAAA,MACT,KAAK;AAAA,QACH,aAAa;AAAA,QACb,SAAS;AAAA,UACP,oBAAoB;AAAA,YAClB,QAAQ,EAAE,OAAO;AAAA,cACf,IAAI,EAAE,QAAQ;AAAA,cACd,OAAO,EAAE,OAAO;AAAA,YAClB,CAAC;AAAA,UACH;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { createCrudOpenApiFactory, createPagedListResponseSchema } from "@open-mercato/shared/lib/openapi/crud";
|
|
3
|
-
import {
|
|
4
|
-
listNotificationsSchema,
|
|
5
|
-
createNotificationSchema,
|
|
6
|
-
executeActionSchema,
|
|
7
|
-
notificationDeliveryConfigSchema
|
|
8
|
-
} from "../data/validators.js";
|
|
9
|
-
const buildNotificationsCrudOpenApi = createCrudOpenApiFactory({
|
|
10
|
-
defaultTag: "Notifications"
|
|
11
|
-
});
|
|
12
|
-
const notificationItemSchema = z.object({
|
|
13
|
-
id: z.string().uuid(),
|
|
14
|
-
type: z.string(),
|
|
15
|
-
title: z.string(),
|
|
16
|
-
body: z.string().nullable().optional(),
|
|
17
|
-
titleKey: z.string().nullable().optional(),
|
|
18
|
-
bodyKey: z.string().nullable().optional(),
|
|
19
|
-
titleVariables: z.record(z.string(), z.string()).nullable().optional(),
|
|
20
|
-
bodyVariables: z.record(z.string(), z.string()).nullable().optional(),
|
|
21
|
-
icon: z.string().nullable().optional(),
|
|
22
|
-
severity: z.string(),
|
|
23
|
-
status: z.string(),
|
|
24
|
-
actions: z.array(z.object({
|
|
25
|
-
id: z.string(),
|
|
26
|
-
label: z.string(),
|
|
27
|
-
labelKey: z.string().optional(),
|
|
28
|
-
variant: z.string().optional(),
|
|
29
|
-
icon: z.string().optional()
|
|
30
|
-
})),
|
|
31
|
-
primaryActionId: z.string().optional(),
|
|
32
|
-
sourceModule: z.string().nullable().optional(),
|
|
33
|
-
sourceEntityType: z.string().nullable().optional(),
|
|
34
|
-
sourceEntityId: z.string().uuid().nullable().optional(),
|
|
35
|
-
linkHref: z.string().nullable().optional(),
|
|
36
|
-
createdAt: z.string(),
|
|
37
|
-
readAt: z.string().nullable().optional(),
|
|
38
|
-
actionTaken: z.string().nullable().optional()
|
|
39
|
-
});
|
|
40
|
-
const okResponseSchema = z.object({
|
|
41
|
-
ok: z.boolean()
|
|
42
|
-
});
|
|
43
|
-
const errorResponseSchema = z.object({
|
|
44
|
-
error: z.string()
|
|
45
|
-
});
|
|
46
|
-
const unreadCountResponseSchema = z.object({
|
|
47
|
-
unreadCount: z.number()
|
|
48
|
-
});
|
|
49
|
-
const actionResultResponseSchema = z.object({
|
|
50
|
-
ok: z.boolean(),
|
|
51
|
-
result: z.unknown().optional(),
|
|
52
|
-
href: z.string().optional()
|
|
53
|
-
});
|
|
54
|
-
const notificationSettingsResponseSchema = z.object({
|
|
55
|
-
settings: notificationDeliveryConfigSchema
|
|
56
|
-
});
|
|
57
|
-
const notificationSettingsUpdateResponseSchema = z.object({
|
|
58
|
-
ok: z.boolean(),
|
|
59
|
-
settings: notificationDeliveryConfigSchema
|
|
60
|
-
});
|
|
61
|
-
export {
|
|
62
|
-
actionResultResponseSchema,
|
|
63
|
-
buildNotificationsCrudOpenApi,
|
|
64
|
-
createNotificationSchema,
|
|
65
|
-
createPagedListResponseSchema,
|
|
66
|
-
errorResponseSchema,
|
|
67
|
-
executeActionSchema,
|
|
68
|
-
listNotificationsSchema,
|
|
69
|
-
notificationDeliveryConfigSchema,
|
|
70
|
-
notificationItemSchema,
|
|
71
|
-
notificationSettingsResponseSchema,
|
|
72
|
-
notificationSettingsUpdateResponseSchema,
|
|
73
|
-
okResponseSchema,
|
|
74
|
-
unreadCountResponseSchema
|
|
75
|
-
};
|
|
76
|
-
//# sourceMappingURL=openapi.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/modules/notifications/api/openapi.ts"],
|
|
4
|
-
"sourcesContent": ["import { z } from 'zod'\nimport { createCrudOpenApiFactory, createPagedListResponseSchema } from '@open-mercato/shared/lib/openapi/crud'\nimport {\n listNotificationsSchema,\n createNotificationSchema,\n executeActionSchema,\n notificationDeliveryConfigSchema,\n} from '../data/validators'\n\nexport const buildNotificationsCrudOpenApi = createCrudOpenApiFactory({\n defaultTag: 'Notifications',\n})\n\nexport const notificationItemSchema = z.object({\n id: z.string().uuid(),\n type: z.string(),\n title: z.string(),\n body: z.string().nullable().optional(),\n titleKey: z.string().nullable().optional(),\n bodyKey: z.string().nullable().optional(),\n titleVariables: z.record(z.string(), z.string()).nullable().optional(),\n bodyVariables: z.record(z.string(), z.string()).nullable().optional(),\n icon: z.string().nullable().optional(),\n severity: z.string(),\n status: z.string(),\n actions: z.array(z.object({\n id: z.string(),\n label: z.string(),\n labelKey: z.string().optional(),\n variant: z.string().optional(),\n icon: z.string().optional(),\n })),\n primaryActionId: z.string().optional(),\n sourceModule: z.string().nullable().optional(),\n sourceEntityType: z.string().nullable().optional(),\n sourceEntityId: z.string().uuid().nullable().optional(),\n linkHref: z.string().nullable().optional(),\n createdAt: z.string(),\n readAt: z.string().nullable().optional(),\n actionTaken: z.string().nullable().optional(),\n})\n\nexport const okResponseSchema = z.object({\n ok: z.boolean(),\n})\n\nexport const errorResponseSchema = z.object({\n error: z.string(),\n})\n\nexport const unreadCountResponseSchema = z.object({\n unreadCount: z.number(),\n})\n\nexport const actionResultResponseSchema = z.object({\n ok: z.boolean(),\n result: z.unknown().optional(),\n href: z.string().optional(),\n})\n\nexport const notificationSettingsResponseSchema = z.object({\n settings: notificationDeliveryConfigSchema,\n})\n\nexport const notificationSettingsUpdateResponseSchema = z.object({\n ok: z.boolean(),\n settings: notificationDeliveryConfigSchema,\n})\n\nexport {\n createPagedListResponseSchema,\n listNotificationsSchema,\n createNotificationSchema,\n executeActionSchema,\n notificationDeliveryConfigSchema,\n}\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,SAAS;AAClB,SAAS,0BAA0B,qCAAqC;AACxE;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEA,MAAM,gCAAgC,yBAAyB;AAAA,EACpE,YAAY;AACd,CAAC;AAEM,MAAM,yBAAyB,EAAE,OAAO;AAAA,EAC7C,IAAI,EAAE,OAAO,EAAE,KAAK;AAAA,EACpB,MAAM,EAAE,OAAO;AAAA,EACf,OAAO,EAAE,OAAO;AAAA,EAChB,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS;AAAA,EACrC,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS;AAAA,EACzC,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS;AAAA,EACxC,gBAAgB,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,EAAE,SAAS,EAAE,SAAS;AAAA,EACrE,eAAe,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,EAAE,SAAS,EAAE,SAAS;AAAA,EACpE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS;AAAA,EACrC,UAAU,EAAE,OAAO;AAAA,EACnB,QAAQ,EAAE,OAAO;AAAA,EACjB,SAAS,EAAE,MAAM,EAAE,OAAO;AAAA,IACxB,IAAI,EAAE,OAAO;AAAA,IACb,OAAO,EAAE,OAAO;AAAA,IAChB,UAAU,EAAE,OAAO,EAAE,SAAS;AAAA,IAC9B,SAAS,EAAE,OAAO,EAAE,SAAS;AAAA,IAC7B,MAAM,EAAE,OAAO,EAAE,SAAS;AAAA,EAC5B,CAAC,CAAC;AAAA,EACF,iBAAiB,EAAE,OAAO,EAAE,SAAS;AAAA,EACrC,cAAc,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS;AAAA,EAC7C,kBAAkB,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS;AAAA,EACjD,gBAAgB,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS;AAAA,EACtD,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS;AAAA,EACzC,WAAW,EAAE,OAAO;AAAA,EACpB,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS;AAAA,EACvC,aAAa,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS;AAC9C,CAAC;AAEM,MAAM,mBAAmB,EAAE,OAAO;AAAA,EACvC,IAAI,EAAE,QAAQ;AAChB,CAAC;AAEM,MAAM,sBAAsB,EAAE,OAAO;AAAA,EAC1C,OAAO,EAAE,OAAO;AAClB,CAAC;AAEM,MAAM,4BAA4B,EAAE,OAAO;AAAA,EAChD,aAAa,EAAE,OAAO;AACxB,CAAC;AAEM,MAAM,6BAA6B,EAAE,OAAO;AAAA,EACjD,IAAI,EAAE,QAAQ;AAAA,EACd,QAAQ,EAAE,QAAQ,EAAE,SAAS;AAAA,EAC7B,MAAM,EAAE,OAAO,EAAE,SAAS;AAC5B,CAAC;AAEM,MAAM,qCAAqC,EAAE,OAAO;AAAA,EACzD,UAAU;AACZ,CAAC;AAEM,MAAM,2CAA2C,EAAE,OAAO;AAAA,EAC/D,IAAI,EAAE,QAAQ;AAAA,EACd,UAAU;AACZ,CAAC;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { createRoleNotificationSchema } from "../../data/validators.js";
|
|
2
|
-
import { createBulkNotificationRoute, createBulkNotificationOpenApi } from "../../lib/routeHelpers.js";
|
|
3
|
-
const metadata = {
|
|
4
|
-
POST: { requireAuth: true, requireFeatures: ["notifications.create"] }
|
|
5
|
-
};
|
|
6
|
-
const POST = createBulkNotificationRoute(createRoleNotificationSchema, "createForRole");
|
|
7
|
-
const openApi = createBulkNotificationOpenApi(
|
|
8
|
-
createRoleNotificationSchema,
|
|
9
|
-
"Create notifications for all users in a role",
|
|
10
|
-
"Send the same notification to all users who have the specified role within the organization"
|
|
11
|
-
);
|
|
12
|
-
export {
|
|
13
|
-
POST,
|
|
14
|
-
metadata,
|
|
15
|
-
openApi
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=route.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../src/modules/notifications/api/role/route.ts"],
|
|
4
|
-
"sourcesContent": ["import { createRoleNotificationSchema } from '../../data/validators'\nimport { createBulkNotificationRoute, createBulkNotificationOpenApi } from '../../lib/routeHelpers'\n\nexport const metadata = {\n POST: { requireAuth: true, requireFeatures: ['notifications.create'] },\n}\n\nexport const POST = createBulkNotificationRoute(createRoleNotificationSchema, 'createForRole')\n\nexport const openApi = createBulkNotificationOpenApi(\n createRoleNotificationSchema,\n 'Create notifications for all users in a role',\n 'Send the same notification to all users who have the specified role within the organization'\n)\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,oCAAoC;AAC7C,SAAS,6BAA6B,qCAAqC;AAEpE,MAAM,WAAW;AAAA,EACtB,MAAM,EAAE,aAAa,MAAM,iBAAiB,CAAC,sBAAsB,EAAE;AACvE;AAEO,MAAM,OAAO,4BAA4B,8BAA8B,eAAe;AAEtF,MAAM,UAAU;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|