@open-mercato/core 0.4.2-canary-10c7a8bf2a → 0.4.2-canary-c84cff7ed5
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/notification/index.js +57 -0
- package/dist/generated/entities/notification/index.js.map +7 -0
- package/dist/generated/entities.ids.generated.js +5 -1
- package/dist/generated/entities.ids.generated.js.map +2 -2
- package/dist/generated/entity-fields-registry.js +2 -0
- package/dist/generated/entity-fields-registry.js.map +2 -2
- package/dist/modules/api_docs/frontend/docs/api/page.js +3 -2
- 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 +4 -0
- package/dist/modules/attachments/components/AttachmentLibrary.js.map +2 -2
- package/dist/modules/attachments/components/AttachmentPartitionSettings.js +2 -0
- package/dist/modules/attachments/components/AttachmentPartitionSettings.js.map +2 -2
- package/dist/modules/auth/api/admin/nav.js +4 -3
- package/dist/modules/auth/api/admin/nav.js.map +2 -2
- package/dist/modules/auth/api/profile/route.js +157 -0
- package/dist/modules/auth/api/profile/route.js.map +7 -0
- package/dist/modules/auth/api/reset/confirm.js +25 -2
- package/dist/modules/auth/api/reset/confirm.js.map +2 -2
- package/dist/modules/auth/api/reset.js +23 -0
- package/dist/modules/auth/api/reset.js.map +2 -2
- package/dist/modules/auth/api/sidebar/preferences/route.js +14 -9
- package/dist/modules/auth/api/sidebar/preferences/route.js.map +2 -2
- package/dist/modules/auth/api/users/route.js +4 -2
- package/dist/modules/auth/api/users/route.js.map +2 -2
- package/dist/modules/auth/backend/auth/profile/page.js +141 -0
- package/dist/modules/auth/backend/auth/profile/page.js.map +7 -0
- package/dist/modules/auth/backend/auth/profile/page.meta.js +13 -0
- package/dist/modules/auth/backend/auth/profile/page.meta.js.map +7 -0
- 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 +14 -2
- package/dist/modules/auth/backend/users/[id]/edit/page.js.map +2 -2
- package/dist/modules/auth/backend/users/create/page.js +15 -2
- 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 +13 -0
- package/dist/modules/auth/cli.js.map +2 -2
- package/dist/modules/auth/commands/users.js +59 -2
- package/dist/modules/auth/commands/users.js.map +2 -2
- package/dist/modules/auth/data/validators.js +4 -2
- package/dist/modules/auth/data/validators.js.map +2 -2
- package/dist/modules/auth/frontend/reset/[token]/page.js +20 -10
- package/dist/modules/auth/frontend/reset/[token]/page.js.map +2 -2
- package/dist/modules/auth/lib/setup-app.js +3 -0
- package/dist/modules/auth/lib/setup-app.js.map +2 -2
- package/dist/modules/auth/notifications.js +112 -0
- package/dist/modules/auth/notifications.js.map +7 -0
- package/dist/modules/auth/services/authService.js +3 -3
- package/dist/modules/auth/services/authService.js.map +2 -2
- package/dist/modules/business_rules/backend/rules/page.js +4 -0
- package/dist/modules/business_rules/backend/rules/page.js.map +2 -2
- package/dist/modules/business_rules/backend/sets/page.js +3 -0
- package/dist/modules/business_rules/backend/sets/page.js.map +2 -2
- package/dist/modules/business_rules/notifications.js +28 -0
- package/dist/modules/business_rules/notifications.js.map +7 -0
- package/dist/modules/business_rules/subscribers/rule-execution-failed-notification.js +37 -0
- package/dist/modules/business_rules/subscribers/rule-execution-failed-notification.js.map +7 -0
- package/dist/modules/catalog/analytics.js +27 -0
- package/dist/modules/catalog/analytics.js.map +7 -0
- package/dist/modules/catalog/components/PriceKindSettings.js +2 -0
- 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 +2 -0
- package/dist/modules/catalog/components/products/ProductsDataTable.js.map +2 -2
- package/dist/modules/catalog/notifications.js +28 -0
- package/dist/modules/catalog/notifications.js.map +7 -0
- package/dist/modules/catalog/subscribers/low-stock-notification.js +38 -0
- package/dist/modules/catalog/subscribers/low-stock-notification.js.map +7 -0
- package/dist/modules/configs/cli.js +6 -0
- package/dist/modules/configs/cli.js.map +2 -2
- package/dist/modules/configs/lib/upgrade-actions.js +18 -0
- package/dist/modules/configs/lib/upgrade-actions.js.map +2 -2
- package/dist/modules/currencies/backend/currencies/page.js +3 -0
- package/dist/modules/currencies/backend/currencies/page.js.map +2 -2
- package/dist/modules/currencies/backend/exchange-rates/page.js +2 -0
- package/dist/modules/currencies/backend/exchange-rates/page.js.map +2 -2
- package/dist/modules/customers/analytics.js +50 -0
- package/dist/modules/customers/analytics.js.map +7 -0
- package/dist/modules/customers/backend/customers/companies/page.js +3 -0
- package/dist/modules/customers/backend/customers/companies/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/deals/page.js +3 -0
- package/dist/modules/customers/backend/customers/deals/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/people/page.js +3 -0
- package/dist/modules/customers/backend/customers/people/page.js.map +2 -2
- package/dist/modules/customers/commands/deals.js +31 -0
- package/dist/modules/customers/commands/deals.js.map +2 -2
- package/dist/modules/customers/components/CustomerTodosTable.js +1 -0
- package/dist/modules/customers/components/CustomerTodosTable.js.map +2 -2
- package/dist/modules/customers/notifications.js +48 -0
- package/dist/modules/customers/notifications.js.map +7 -0
- package/dist/modules/dashboards/acl.js +2 -1
- package/dist/modules/dashboards/acl.js.map +2 -2
- package/dist/modules/dashboards/api/widgets/data/route.js +187 -0
- package/dist/modules/dashboards/api/widgets/data/route.js.map +7 -0
- package/dist/modules/dashboards/cli.js +173 -1
- package/dist/modules/dashboards/cli.js.map +2 -2
- package/dist/modules/dashboards/di.js +11 -0
- package/dist/modules/dashboards/di.js.map +7 -0
- package/dist/modules/dashboards/lib/aggregations.js +162 -0
- package/dist/modules/dashboards/lib/aggregations.js.map +7 -0
- package/dist/modules/dashboards/lib/formatters.js +34 -0
- package/dist/modules/dashboards/lib/formatters.js.map +7 -0
- package/dist/modules/dashboards/lib/role-widgets.js +58 -0
- package/dist/modules/dashboards/lib/role-widgets.js.map +7 -0
- package/dist/modules/dashboards/seed/analytics.js +383 -0
- package/dist/modules/dashboards/seed/analytics.js.map +7 -0
- package/dist/modules/dashboards/services/analyticsRegistry.js +52 -0
- package/dist/modules/dashboards/services/analyticsRegistry.js.map +7 -0
- package/dist/modules/dashboards/services/widgetDataService.js +207 -0
- package/dist/modules/dashboards/services/widgetDataService.js.map +7 -0
- package/dist/modules/dashboards/widgets/dashboard/aov-kpi/config.js +18 -0
- package/dist/modules/dashboards/widgets/dashboard/aov-kpi/config.js.map +7 -0
- package/dist/modules/dashboards/widgets/dashboard/aov-kpi/widget.client.js +128 -0
- package/dist/modules/dashboards/widgets/dashboard/aov-kpi/widget.client.js.map +7 -0
- package/dist/modules/dashboards/widgets/dashboard/aov-kpi/widget.js +25 -0
- package/dist/modules/dashboards/widgets/dashboard/aov-kpi/widget.js.map +7 -0
- package/dist/modules/dashboards/widgets/dashboard/new-customers-kpi/config.js +18 -0
- package/dist/modules/dashboards/widgets/dashboard/new-customers-kpi/config.js.map +7 -0
- package/dist/modules/dashboards/widgets/dashboard/new-customers-kpi/widget.client.js +126 -0
- package/dist/modules/dashboards/widgets/dashboard/new-customers-kpi/widget.client.js.map +7 -0
- package/dist/modules/dashboards/widgets/dashboard/new-customers-kpi/widget.js +25 -0
- package/dist/modules/dashboards/widgets/dashboard/new-customers-kpi/widget.js.map +7 -0
- package/dist/modules/dashboards/widgets/dashboard/orders-by-status/config.js +18 -0
- package/dist/modules/dashboards/widgets/dashboard/orders-by-status/config.js.map +7 -0
- package/dist/modules/dashboards/widgets/dashboard/orders-by-status/widget.client.js +151 -0
- package/dist/modules/dashboards/widgets/dashboard/orders-by-status/widget.client.js.map +7 -0
- package/dist/modules/dashboards/widgets/dashboard/orders-by-status/widget.js +25 -0
- package/dist/modules/dashboards/widgets/dashboard/orders-by-status/widget.js.map +7 -0
- package/dist/modules/dashboards/widgets/dashboard/orders-kpi/config.js +18 -0
- package/dist/modules/dashboards/widgets/dashboard/orders-kpi/config.js.map +7 -0
- package/dist/modules/dashboards/widgets/dashboard/orders-kpi/widget.client.js +126 -0
- package/dist/modules/dashboards/widgets/dashboard/orders-kpi/widget.client.js.map +7 -0
- package/dist/modules/dashboards/widgets/dashboard/orders-kpi/widget.js +25 -0
- package/dist/modules/dashboards/widgets/dashboard/orders-kpi/widget.js.map +7 -0
- package/dist/modules/dashboards/widgets/dashboard/pipeline-summary/config.js +16 -0
- package/dist/modules/dashboards/widgets/dashboard/pipeline-summary/config.js.map +7 -0
- package/dist/modules/dashboards/widgets/dashboard/pipeline-summary/widget.client.js +123 -0
- package/dist/modules/dashboards/widgets/dashboard/pipeline-summary/widget.client.js.map +7 -0
- package/dist/modules/dashboards/widgets/dashboard/pipeline-summary/widget.js +25 -0
- package/dist/modules/dashboards/widgets/dashboard/pipeline-summary/widget.js.map +7 -0
- package/dist/modules/dashboards/widgets/dashboard/revenue-kpi/config.js +18 -0
- package/dist/modules/dashboards/widgets/dashboard/revenue-kpi/config.js.map +7 -0
- package/dist/modules/dashboards/widgets/dashboard/revenue-kpi/widget.client.js +128 -0
- package/dist/modules/dashboards/widgets/dashboard/revenue-kpi/widget.client.js.map +7 -0
- package/dist/modules/dashboards/widgets/dashboard/revenue-kpi/widget.js +25 -0
- package/dist/modules/dashboards/widgets/dashboard/revenue-kpi/widget.js.map +7 -0
- package/dist/modules/dashboards/widgets/dashboard/revenue-trend/config.js +21 -0
- package/dist/modules/dashboards/widgets/dashboard/revenue-trend/config.js.map +7 -0
- package/dist/modules/dashboards/widgets/dashboard/revenue-trend/widget.client.js +211 -0
- package/dist/modules/dashboards/widgets/dashboard/revenue-trend/widget.client.js.map +7 -0
- package/dist/modules/dashboards/widgets/dashboard/revenue-trend/widget.js +25 -0
- package/dist/modules/dashboards/widgets/dashboard/revenue-trend/widget.js.map +7 -0
- package/dist/modules/dashboards/widgets/dashboard/sales-by-region/config.js +19 -0
- package/dist/modules/dashboards/widgets/dashboard/sales-by-region/config.js.map +7 -0
- package/dist/modules/dashboards/widgets/dashboard/sales-by-region/widget.client.js +131 -0
- package/dist/modules/dashboards/widgets/dashboard/sales-by-region/widget.client.js.map +7 -0
- package/dist/modules/dashboards/widgets/dashboard/sales-by-region/widget.js +25 -0
- package/dist/modules/dashboards/widgets/dashboard/sales-by-region/widget.js.map +7 -0
- package/dist/modules/dashboards/widgets/dashboard/top-customers/config.js +19 -0
- package/dist/modules/dashboards/widgets/dashboard/top-customers/config.js.map +7 -0
- package/dist/modules/dashboards/widgets/dashboard/top-customers/widget.client.js +153 -0
- package/dist/modules/dashboards/widgets/dashboard/top-customers/widget.client.js.map +7 -0
- package/dist/modules/dashboards/widgets/dashboard/top-customers/widget.js +25 -0
- package/dist/modules/dashboards/widgets/dashboard/top-customers/widget.js.map +7 -0
- package/dist/modules/dashboards/widgets/dashboard/top-products/config.js +22 -0
- package/dist/modules/dashboards/widgets/dashboard/top-products/config.js.map +7 -0
- package/dist/modules/dashboards/widgets/dashboard/top-products/widget.client.js +180 -0
- package/dist/modules/dashboards/widgets/dashboard/top-products/widget.client.js.map +7 -0
- package/dist/modules/dashboards/widgets/dashboard/top-products/widget.js +25 -0
- package/dist/modules/dashboards/widgets/dashboard/top-products/widget.js.map +7 -0
- package/dist/modules/dictionaries/components/DictionaryTable.js +2 -0
- 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/notifications/acl.js +11 -0
- package/dist/modules/notifications/acl.js.map +7 -0
- package/dist/modules/notifications/api/[id]/action/route.js +74 -0
- package/dist/modules/notifications/api/[id]/action/route.js.map +7 -0
- package/dist/modules/notifications/api/[id]/dismiss/route.js +15 -0
- package/dist/modules/notifications/api/[id]/dismiss/route.js.map +7 -0
- package/dist/modules/notifications/api/[id]/read/route.js +15 -0
- package/dist/modules/notifications/api/[id]/read/route.js.map +7 -0
- package/dist/modules/notifications/api/[id]/restore/route.js +53 -0
- package/dist/modules/notifications/api/[id]/restore/route.js.map +7 -0
- package/dist/modules/notifications/api/batch/route.js +17 -0
- package/dist/modules/notifications/api/batch/route.js.map +7 -0
- package/dist/modules/notifications/api/feature/route.js +17 -0
- package/dist/modules/notifications/api/feature/route.js.map +7 -0
- package/dist/modules/notifications/api/mark-all-read/route.js +35 -0
- package/dist/modules/notifications/api/mark-all-read/route.js.map +7 -0
- package/dist/modules/notifications/api/openapi.js +76 -0
- package/dist/modules/notifications/api/openapi.js.map +7 -0
- package/dist/modules/notifications/api/role/route.js +17 -0
- package/dist/modules/notifications/api/role/route.js.map +7 -0
- package/dist/modules/notifications/api/route.js +85 -0
- package/dist/modules/notifications/api/route.js.map +7 -0
- package/dist/modules/notifications/api/settings/route.js +155 -0
- package/dist/modules/notifications/api/settings/route.js.map +7 -0
- package/dist/modules/notifications/api/unread-count/route.js +38 -0
- package/dist/modules/notifications/api/unread-count/route.js.map +7 -0
- package/dist/modules/notifications/backend/config/notifications/page.js +10 -0
- package/dist/modules/notifications/backend/config/notifications/page.js.map +7 -0
- package/dist/modules/notifications/backend/config/notifications/page.meta.js +24 -0
- package/dist/modules/notifications/backend/config/notifications/page.meta.js.map +7 -0
- package/dist/modules/notifications/cli.js +16 -0
- package/dist/modules/notifications/cli.js.map +7 -0
- package/dist/modules/notifications/data/entities.js +112 -0
- package/dist/modules/notifications/data/entities.js.map +7 -0
- package/dist/modules/notifications/data/validators.js +94 -0
- package/dist/modules/notifications/data/validators.js.map +7 -0
- package/dist/modules/notifications/di.js +13 -0
- package/dist/modules/notifications/di.js.map +7 -0
- package/dist/modules/notifications/emails/NotificationEmail.js +58 -0
- package/dist/modules/notifications/emails/NotificationEmail.js.map +7 -0
- package/dist/modules/notifications/frontend/NotificationInboxPageClient.js +44 -0
- package/dist/modules/notifications/frontend/NotificationInboxPageClient.js.map +7 -0
- package/dist/modules/notifications/frontend/NotificationSettingsPageClient.js +219 -0
- package/dist/modules/notifications/frontend/NotificationSettingsPageClient.js.map +7 -0
- package/dist/modules/notifications/index.js +14 -0
- package/dist/modules/notifications/index.js.map +7 -0
- package/dist/modules/notifications/lib/deliveryConfig.js +105 -0
- package/dist/modules/notifications/lib/deliveryConfig.js.map +7 -0
- package/dist/modules/notifications/lib/events.js +12 -0
- package/dist/modules/notifications/lib/events.js.map +7 -0
- package/dist/modules/notifications/lib/notificationBuilder.js +66 -0
- package/dist/modules/notifications/lib/notificationBuilder.js.map +7 -0
- package/dist/modules/notifications/lib/notificationFactory.js +54 -0
- package/dist/modules/notifications/lib/notificationFactory.js.map +7 -0
- package/dist/modules/notifications/lib/notificationMapper.js +34 -0
- package/dist/modules/notifications/lib/notificationMapper.js.map +7 -0
- package/dist/modules/notifications/lib/notificationRecipients.js +35 -0
- package/dist/modules/notifications/lib/notificationRecipients.js.map +7 -0
- package/dist/modules/notifications/lib/notificationService.js +279 -0
- package/dist/modules/notifications/lib/notificationService.js.map +7 -0
- package/dist/modules/notifications/lib/routeHelpers.js +101 -0
- package/dist/modules/notifications/lib/routeHelpers.js.map +7 -0
- package/dist/modules/notifications/lib/safeHref.js +24 -0
- package/dist/modules/notifications/lib/safeHref.js.map +7 -0
- package/dist/modules/notifications/migrations/Migration20260123000001.js +70 -0
- package/dist/modules/notifications/migrations/Migration20260123000001.js.map +7 -0
- package/dist/modules/notifications/migrations/Migration20260126150000.js +37 -0
- package/dist/modules/notifications/migrations/Migration20260126150000.js.map +7 -0
- package/dist/modules/notifications/subscribers/deliver-notification.js +139 -0
- package/dist/modules/notifications/subscribers/deliver-notification.js.map +7 -0
- package/dist/modules/notifications/workers/create-notification.worker.js +70 -0
- package/dist/modules/notifications/workers/create-notification.worker.js.map +7 -0
- 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 +7 -1
- 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/analytics.js +67 -0
- package/dist/modules/sales/analytics.js.map +7 -0
- package/dist/modules/sales/backend/sales/channels/offers/page.js +2 -0
- package/dist/modules/sales/backend/sales/channels/offers/page.js.map +2 -2
- package/dist/modules/sales/backend/sales/channels/page.js +2 -0
- package/dist/modules/sales/backend/sales/channels/page.js.map +2 -2
- package/dist/modules/sales/commands/documents.js +53 -0
- package/dist/modules/sales/commands/documents.js.map +2 -2
- package/dist/modules/sales/commands/payments.js +26 -0
- 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 +2 -0
- package/dist/modules/sales/components/channels/SalesChannelOffersPanel.js.map +2 -2
- package/dist/modules/sales/components/documents/AdjustmentsSection.js +2 -0
- package/dist/modules/sales/components/documents/AdjustmentsSection.js.map +2 -2
- package/dist/modules/sales/components/documents/PaymentsSection.js +2 -1
- package/dist/modules/sales/components/documents/PaymentsSection.js.map +2 -2
- package/dist/modules/sales/components/documents/SalesDocumentsTable.js +2 -0
- package/dist/modules/sales/components/documents/SalesDocumentsTable.js.map +2 -2
- package/dist/modules/sales/notifications.client.js +51 -0
- package/dist/modules/sales/notifications.client.js.map +7 -0
- package/dist/modules/sales/notifications.js +88 -0
- package/dist/modules/sales/notifications.js.map +7 -0
- package/dist/modules/sales/subscribers/quote-expiring-notification.js +38 -0
- package/dist/modules/sales/subscribers/quote-expiring-notification.js.map +7 -0
- package/dist/modules/sales/widgets/notifications/SalesOrderCreatedRenderer.js +137 -0
- package/dist/modules/sales/widgets/notifications/SalesOrderCreatedRenderer.js.map +7 -0
- package/dist/modules/sales/widgets/notifications/SalesQuoteCreatedRenderer.js +137 -0
- package/dist/modules/sales/widgets/notifications/SalesQuoteCreatedRenderer.js.map +7 -0
- package/dist/modules/sales/widgets/notifications/index.js +7 -0
- package/dist/modules/sales/widgets/notifications/index.js.map +7 -0
- package/dist/modules/sales/widgets/notifications/useSalesDocumentTotals.js +60 -0
- package/dist/modules/sales/widgets/notifications/useSalesDocumentTotals.js.map +7 -0
- 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 +79 -0
- package/dist/modules/staff/commands/leave-requests.js.map +2 -2
- package/dist/modules/staff/notifications.js +75 -0
- package/dist/modules/staff/notifications.js.map +7 -0
- package/dist/modules/workflows/backend/definitions/page.js +5 -0
- package/dist/modules/workflows/backend/definitions/page.js.map +2 -2
- package/dist/modules/workflows/backend/instances/page.js +3 -0
- package/dist/modules/workflows/backend/instances/page.js.map +2 -2
- package/dist/modules/workflows/backend/tasks/page.js +3 -0
- package/dist/modules/workflows/backend/tasks/page.js.map +2 -2
- package/dist/modules/workflows/notifications.js +28 -0
- package/dist/modules/workflows/notifications.js.map +7 -0
- package/dist/modules/workflows/subscribers/task-assigned-notification.js +38 -0
- package/dist/modules/workflows/subscribers/task-assigned-notification.js.map +7 -0
- package/generated/entities/notification/index.ts +27 -0
- package/generated/entities.ids.generated.ts +5 -1
- package/generated/entity-fields-registry.ts +2 -0
- package/package.json +2 -2
- package/src/modules/api_docs/frontend/docs/api/page.tsx +3 -2
- package/src/modules/api_keys/backend/api-keys/page.tsx +1 -1
- package/src/modules/attachments/components/AttachmentLibrary.tsx +4 -0
- package/src/modules/attachments/components/AttachmentPartitionSettings.tsx +2 -0
- package/src/modules/auth/api/admin/nav.ts +10 -6
- package/src/modules/auth/api/profile/route.ts +163 -0
- package/src/modules/auth/api/reset/confirm.ts +25 -2
- package/src/modules/auth/api/reset.ts +23 -0
- package/src/modules/auth/api/sidebar/preferences/route.ts +21 -12
- package/src/modules/auth/api/users/route.ts +5 -2
- package/src/modules/auth/backend/auth/profile/page.meta.ts +9 -0
- package/src/modules/auth/backend/auth/profile/page.tsx +174 -0
- package/src/modules/auth/backend/roles/page.tsx +3 -3
- package/src/modules/auth/backend/users/[id]/edit/page.tsx +18 -2
- package/src/modules/auth/backend/users/create/page.tsx +19 -2
- package/src/modules/auth/backend/users/page.tsx +3 -3
- package/src/modules/auth/cli.ts +14 -0
- package/src/modules/auth/commands/users.ts +73 -2
- package/src/modules/auth/data/validators.ts +5 -2
- package/src/modules/auth/frontend/reset/[token]/page.tsx +24 -11
- package/src/modules/auth/i18n/de.json +43 -1
- package/src/modules/auth/i18n/en.json +43 -1
- package/src/modules/auth/i18n/es.json +43 -1
- package/src/modules/auth/i18n/pl.json +43 -1
- package/src/modules/auth/lib/setup-app.ts +3 -0
- package/src/modules/auth/notifications.ts +109 -0
- package/src/modules/auth/services/authService.ts +4 -4
- package/src/modules/business_rules/backend/rules/page.tsx +4 -0
- package/src/modules/business_rules/backend/sets/page.tsx +3 -0
- package/src/modules/business_rules/i18n/en.json +3 -1
- package/src/modules/business_rules/notifications.ts +25 -0
- package/src/modules/business_rules/subscribers/rule-execution-failed-notification.ts +50 -0
- package/src/modules/catalog/analytics.ts +24 -0
- package/src/modules/catalog/components/PriceKindSettings.tsx +2 -0
- package/src/modules/catalog/components/categories/CategoriesDataTable.tsx +2 -2
- package/src/modules/catalog/components/products/ProductsDataTable.tsx +2 -0
- package/src/modules/catalog/i18n/en.json +3 -1
- package/src/modules/catalog/notifications.ts +25 -0
- package/src/modules/catalog/subscribers/low-stock-notification.ts +52 -0
- package/src/modules/configs/cli.ts +6 -0
- package/src/modules/configs/lib/upgrade-actions.ts +18 -0
- package/src/modules/currencies/backend/currencies/page.tsx +3 -0
- package/src/modules/currencies/backend/exchange-rates/page.tsx +2 -0
- package/src/modules/customers/analytics.ts +47 -0
- package/src/modules/customers/backend/customers/companies/page.tsx +3 -0
- package/src/modules/customers/backend/customers/deals/page.tsx +3 -0
- package/src/modules/customers/backend/customers/people/page.tsx +3 -0
- package/src/modules/customers/commands/deals.ts +39 -0
- package/src/modules/customers/components/CustomerTodosTable.tsx +1 -0
- package/src/modules/customers/i18n/en.json +5 -1
- package/src/modules/customers/notifications.ts +44 -0
- package/src/modules/dashboards/acl.ts +1 -0
- package/src/modules/dashboards/api/widgets/data/route.ts +221 -0
- package/src/modules/dashboards/cli.ts +204 -1
- package/src/modules/dashboards/di.ts +9 -0
- package/src/modules/dashboards/i18n/de.json +115 -1
- package/src/modules/dashboards/i18n/en.json +115 -1
- package/src/modules/dashboards/i18n/es.json +115 -1
- package/src/modules/dashboards/i18n/pl.json +115 -1
- package/src/modules/dashboards/lib/__tests__/aggregations.test.ts +327 -0
- package/src/modules/dashboards/lib/__tests__/formatters.test.ts +128 -0
- package/src/modules/dashboards/lib/aggregations.ts +225 -0
- package/src/modules/dashboards/lib/formatters.ts +36 -0
- package/src/modules/dashboards/lib/role-widgets.ts +80 -0
- package/src/modules/dashboards/seed/analytics.ts +405 -0
- package/src/modules/dashboards/services/analyticsRegistry.ts +79 -0
- package/src/modules/dashboards/services/widgetDataService.ts +329 -0
- package/src/modules/dashboards/widgets/dashboard/aov-kpi/config.ts +20 -0
- package/src/modules/dashboards/widgets/dashboard/aov-kpi/widget.client.tsx +135 -0
- package/src/modules/dashboards/widgets/dashboard/aov-kpi/widget.ts +24 -0
- package/src/modules/dashboards/widgets/dashboard/new-customers-kpi/config.ts +20 -0
- package/src/modules/dashboards/widgets/dashboard/new-customers-kpi/widget.client.tsx +133 -0
- package/src/modules/dashboards/widgets/dashboard/new-customers-kpi/widget.ts +24 -0
- package/src/modules/dashboards/widgets/dashboard/orders-by-status/config.ts +20 -0
- package/src/modules/dashboards/widgets/dashboard/orders-by-status/widget.client.tsx +154 -0
- package/src/modules/dashboards/widgets/dashboard/orders-by-status/widget.ts +24 -0
- package/src/modules/dashboards/widgets/dashboard/orders-kpi/config.ts +20 -0
- package/src/modules/dashboards/widgets/dashboard/orders-kpi/widget.client.tsx +133 -0
- package/src/modules/dashboards/widgets/dashboard/orders-kpi/widget.ts +24 -0
- package/src/modules/dashboards/widgets/dashboard/pipeline-summary/config.ts +17 -0
- package/src/modules/dashboards/widgets/dashboard/pipeline-summary/widget.client.tsx +137 -0
- package/src/modules/dashboards/widgets/dashboard/pipeline-summary/widget.ts +24 -0
- package/src/modules/dashboards/widgets/dashboard/revenue-kpi/config.ts +20 -0
- package/src/modules/dashboards/widgets/dashboard/revenue-kpi/widget.client.tsx +135 -0
- package/src/modules/dashboards/widgets/dashboard/revenue-kpi/widget.ts +24 -0
- package/src/modules/dashboards/widgets/dashboard/revenue-trend/config.ts +24 -0
- package/src/modules/dashboards/widgets/dashboard/revenue-trend/widget.client.tsx +220 -0
- package/src/modules/dashboards/widgets/dashboard/revenue-trend/widget.ts +24 -0
- package/src/modules/dashboards/widgets/dashboard/sales-by-region/config.ts +21 -0
- package/src/modules/dashboards/widgets/dashboard/sales-by-region/widget.client.tsx +131 -0
- package/src/modules/dashboards/widgets/dashboard/sales-by-region/widget.ts +24 -0
- package/src/modules/dashboards/widgets/dashboard/top-customers/config.ts +21 -0
- package/src/modules/dashboards/widgets/dashboard/top-customers/widget.client.tsx +161 -0
- package/src/modules/dashboards/widgets/dashboard/top-customers/widget.ts +24 -0
- package/src/modules/dashboards/widgets/dashboard/top-products/config.ts +27 -0
- package/src/modules/dashboards/widgets/dashboard/top-products/widget.client.tsx +181 -0
- package/src/modules/dashboards/widgets/dashboard/top-products/widget.ts +24 -0
- package/src/modules/dictionaries/components/DictionaryTable.tsx +2 -0
- 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 +3 -4
- package/src/modules/feature_toggles/components/OverridesTable.tsx +1 -1
- package/src/modules/notifications/acl.ts +7 -0
- package/src/modules/notifications/api/[id]/action/route.ts +75 -0
- package/src/modules/notifications/api/[id]/dismiss/route.ts +12 -0
- package/src/modules/notifications/api/[id]/read/route.ts +12 -0
- package/src/modules/notifications/api/[id]/restore/route.ts +53 -0
- package/src/modules/notifications/api/batch/route.ts +14 -0
- package/src/modules/notifications/api/feature/route.ts +14 -0
- package/src/modules/notifications/api/mark-all-read/route.ts +34 -0
- package/src/modules/notifications/api/openapi.ts +76 -0
- package/src/modules/notifications/api/role/route.ts +14 -0
- package/src/modules/notifications/api/route.ts +92 -0
- package/src/modules/notifications/api/settings/route.ts +157 -0
- package/src/modules/notifications/api/unread-count/route.ts +38 -0
- package/src/modules/notifications/backend/config/notifications/page.meta.ts +22 -0
- package/src/modules/notifications/backend/config/notifications/page.tsx +12 -0
- package/src/modules/notifications/cli.ts +18 -0
- package/src/modules/notifications/data/entities.ts +99 -0
- package/src/modules/notifications/data/validators.ts +110 -0
- package/src/modules/notifications/di.ts +11 -0
- package/src/modules/notifications/emails/NotificationEmail.tsx +98 -0
- package/src/modules/notifications/frontend/NotificationInboxPageClient.tsx +42 -0
- package/src/modules/notifications/frontend/NotificationSettingsPageClient.tsx +231 -0
- package/src/modules/notifications/i18n/de.json +50 -0
- package/src/modules/notifications/i18n/en.json +50 -0
- package/src/modules/notifications/i18n/es.json +50 -0
- package/src/modules/notifications/i18n/pl.json +50 -0
- package/src/modules/notifications/index.ts +12 -0
- package/src/modules/notifications/lib/deliveryConfig.ts +145 -0
- package/src/modules/notifications/lib/events.ts +48 -0
- package/src/modules/notifications/lib/notificationBuilder.ts +121 -0
- package/src/modules/notifications/lib/notificationFactory.ts +76 -0
- package/src/modules/notifications/lib/notificationMapper.ts +33 -0
- package/src/modules/notifications/lib/notificationRecipients.ts +83 -0
- package/src/modules/notifications/lib/notificationService.ts +414 -0
- package/src/modules/notifications/lib/routeHelpers.ts +151 -0
- package/src/modules/notifications/lib/safeHref.ts +29 -0
- package/src/modules/notifications/migrations/.snapshot-open-mercato.json +300 -0
- package/src/modules/notifications/migrations/Migration20260123000001.ts +73 -0
- package/src/modules/notifications/migrations/Migration20260126150000.ts +39 -0
- package/src/modules/notifications/subscribers/deliver-notification.ts +175 -0
- package/src/modules/notifications/workers/create-notification.worker.ts +122 -0
- package/src/modules/planner/backend/planner/availability-rulesets/page.tsx +2 -2
- package/src/modules/query_index/components/QueryIndexesTable.tsx +8 -2
- 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/analytics.ts +64 -0
- package/src/modules/sales/backend/sales/channels/offers/page.tsx +2 -0
- package/src/modules/sales/backend/sales/channels/page.tsx +2 -0
- package/src/modules/sales/commands/documents.ts +65 -0
- package/src/modules/sales/commands/payments.ts +33 -0
- 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 +2 -0
- package/src/modules/sales/components/documents/AdjustmentsSection.tsx +2 -0
- package/src/modules/sales/components/documents/PaymentsSection.tsx +2 -1
- package/src/modules/sales/components/documents/SalesDocumentsTable.tsx +2 -0
- package/src/modules/sales/i18n/de.json +20 -0
- package/src/modules/sales/i18n/en.json +25 -1
- package/src/modules/sales/i18n/es.json +20 -0
- package/src/modules/sales/i18n/pl.json +20 -0
- package/src/modules/sales/notifications.client.ts +65 -0
- package/src/modules/sales/notifications.ts +82 -0
- package/src/modules/sales/subscribers/quote-expiring-notification.ts +53 -0
- package/src/modules/sales/widgets/notifications/SalesOrderCreatedRenderer.tsx +156 -0
- package/src/modules/sales/widgets/notifications/SalesQuoteCreatedRenderer.tsx +156 -0
- package/src/modules/sales/widgets/notifications/index.ts +2 -0
- package/src/modules/sales/widgets/notifications/useSalesDocumentTotals.ts +81 -0
- 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 +94 -0
- package/src/modules/staff/i18n/de.json +4 -0
- package/src/modules/staff/i18n/en.json +9 -1
- package/src/modules/staff/i18n/es.json +4 -0
- package/src/modules/staff/i18n/pl.json +4 -0
- package/src/modules/staff/notifications.ts +71 -0
- package/src/modules/workflows/backend/definitions/page.tsx +5 -0
- package/src/modules/workflows/backend/instances/page.tsx +4 -1
- package/src/modules/workflows/backend/tasks/page.tsx +4 -1
- package/src/modules/workflows/i18n/en.json +3 -1
- package/src/modules/workflows/notifications.ts +25 -0
- package/src/modules/workflows/subscribers/task-assigned-notification.ts +53 -0
|
@@ -163,9 +163,9 @@ function FeatureTogglesTable() {
|
|
|
163
163
|
onPageChange: handlePageChange
|
|
164
164
|
},
|
|
165
165
|
rowActions: (row) => /* @__PURE__ */ jsx(RowActions, { items: [
|
|
166
|
-
{ label: t("common.edit", "Edit"), href: `/backend/feature-toggles/global/${row.id}/edit` },
|
|
167
|
-
{ label: t("common.view", "Overrides"), href: `/backend/feature-toggles/global/${row.id}` },
|
|
168
|
-
{ label: t("common.delete", "Delete"), destructive: true, onSelect: () => {
|
|
166
|
+
{ id: "edit", label: t("common.edit", "Edit"), href: `/backend/feature-toggles/global/${row.id}/edit` },
|
|
167
|
+
{ id: "view", label: t("common.view", "Overrides"), href: `/backend/feature-toggles/global/${row.id}` },
|
|
168
|
+
{ id: "delete", label: t("common.delete", "Delete"), destructive: true, onSelect: () => {
|
|
169
169
|
void handleDelete(row);
|
|
170
170
|
} }
|
|
171
171
|
] })
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/modules/feature_toggles/components/FeatureTogglesTable.tsx"],
|
|
4
|
-
"sourcesContent": ["\"use client\"\nimport { DataTable } from \"@open-mercato/ui/backend/DataTable\";\nimport { RowActions } from \"@open-mercato/ui/backend/RowActions\";\nimport { useT } from \"@open-mercato/shared/lib/i18n/context\";\nimport { apiCall } from '@open-mercato/ui/backend/utils/apiCall'\nimport { raiseCrudError } from '@open-mercato/ui/backend/utils/serverErrors'\nimport { useQuery, useQueryClient } from '@tanstack/react-query'\nimport type { ColumnDef, SortingState } from '@tanstack/react-table'\nimport * as React from 'react'\nimport type { FilterDef, FilterValues } from \"@open-mercato/ui/backend/FilterBar\"\nimport { useMutation } from '@tanstack/react-query'\nimport { deleteCrud, updateCrud } from \"@open-mercato/ui/backend/utils/crud\";\nimport { Button } from \"@open-mercato/ui/primitives/button\";\nimport { Badge } from \"@open-mercato/ui/primitives/badge\";\nimport Link from \"next/link\";\nimport { FeatureToggleType } from \"../data/entities\";\n\ntype Row = {\n id: string\n identifier: string\n name: string\n description: string\n category?: string\n type: FeatureToggleType\n}\n\ntype BadgeVariant = 'default' | 'secondary' | 'destructive' | 'outline' | 'muted'\n\nexport function FeatureTogglesTable() {\n const t = useT()\n const queryClient = useQueryClient()\n\n const featureToggleTypeLabelMap = React.useMemo(() => new Map<FeatureToggleType, { label: string; variant: BadgeVariant }>([\n ['boolean', { label: t('feature_toggles.types.boolean', 'Boolean'), variant: 'default' }],\n ['string', { label: t('feature_toggles.types.string', 'String'), variant: 'secondary' }],\n ['number', { label: t('feature_toggles.types.number', 'Number'), variant: 'outline' }],\n ['json', { label: t('feature_toggles.types.json', 'JSON'), variant: 'destructive' }],\n ]), [t])\n\n const [filterValues, setFilterValues] = React.useState<FilterValues>({})\n const [sorting, setSorting] = React.useState<SortingState>([])\n const [pagination, setPagination] = React.useState({ page: 1, pageSize: 25 })\n\n const categoryFilterValue = typeof filterValues.category === 'string' ? filterValues.category.trim() : ''\n const nameFilterValue = typeof filterValues.name === 'string' ? filterValues.name.trim() : ''\n const identifierFilterValue = typeof filterValues.identifier === 'string' ? filterValues.identifier.trim() : ''\n const typeFilterValue = typeof filterValues.type === 'string' ? filterValues.type.trim() : ''\n const sortField = sorting.length > 0 ? sorting[0].id : 'category'\n const sortDir = sorting.length > 0 && sorting[0].desc ? 'desc' : 'asc'\n\n const queryParams = React.useMemo(() => {\n const params = new URLSearchParams()\n if (categoryFilterValue) params.set('category', categoryFilterValue)\n if (nameFilterValue) params.set('name', nameFilterValue)\n if (identifierFilterValue) params.set('identifier', identifierFilterValue)\n if (typeFilterValue) params.set('type', typeFilterValue)\n\n params.set('sortField', sortField)\n params.set('sortDir', sortDir)\n\n params.set('page', pagination.page.toString())\n params.set('pageSize', pagination.pageSize.toString())\n\n return params.toString()\n }, [categoryFilterValue, identifierFilterValue, nameFilterValue, sortField, sortDir, typeFilterValue, pagination])\n\n const handleSortingChange = React.useCallback((newSorting: SortingState) => {\n setSorting(newSorting)\n }, [])\n\n const handlePageChange = React.useCallback((page: number) => {\n setPagination(prev => ({ ...prev, page }))\n }, [])\n\n const { data: featureTogglesData, isLoading } = useQuery({\n queryKey: ['feature_toggles', queryParams],\n queryFn: async () => {\n const call = await apiCall<{ items: Row[]; total: number; totalPages: number; page: number; pageSize: number; isSuperAdmin?: boolean }>(\n `/api/feature_toggles/global${queryParams ? `?${queryParams}` : ''}`,\n )\n if (!call.ok) {\n await raiseCrudError(call.response, t('feature_toggles.list.error.load', 'Failed to load feature toggles'))\n }\n return call.result ?? { items: [], total: 0, totalPages: 1, page: 1, pageSize: 25 }\n },\n })\n\n const filters = React.useMemo<FilterDef[]>(() => [\n {\n id: 'identifier',\n label: t('feature_toggles.list.filters.identifier', 'Identifier'),\n type: 'text',\n },\n {\n id: 'name',\n label: t('feature_toggles.list.filters.name', 'Name'),\n type: 'text',\n },\n {\n id: 'category',\n label: t('feature_toggles.list.filters.category', 'Category'),\n type: 'text',\n },\n {\n id: 'type',\n label: t('feature_toggles.list.filters.type', 'Type'),\n type: 'select',\n options: [\n { label: t('feature_toggles.types.boolean', 'Boolean'), value: 'boolean' },\n { label: t('feature_toggles.types.string', 'String'), value: 'string' },\n { label: t('feature_toggles.types.number', 'Number'), value: 'number' },\n { label: t('feature_toggles.types.json', 'JSON'), value: 'json' },\n ],\n },\n ], [t])\n\n const handleFiltersApply = React.useCallback((values: FilterValues) => {\n setFilterValues(values)\n }, [])\n\n const handleFiltersClear = React.useCallback(() => {\n setFilterValues({})\n }, [])\n\n const deleteFeatureToggleMutation = useMutation({\n mutationFn: async (row: Row) => {\n await deleteCrud('feature_toggles/global', row.id)\n },\n onSuccess: async () => {\n await queryClient.invalidateQueries({ queryKey: ['feature_toggles'] })\n },\n })\n\n const handleDelete = React.useCallback(async (row: Row) => {\n if (!window.confirm(t('feature_toggles.list.confirmDelete', 'Delete feature toggle \"{identifier}\"?', { identifier: row.identifier }))) return\n await deleteFeatureToggleMutation.mutateAsync(row)\n }, [deleteFeatureToggleMutation, t])\n\n const columns = React.useMemo<ColumnDef<Row>[]>(() => {\n const base: ColumnDef<Row>[] = [\n {\n accessorKey: 'category',\n header: t('feature_toggles.list.headers.category', 'Category'),\n enableSorting: true,\n cell: ({ row }) => {\n return row.original.category || '-'\n },\n },\n {\n accessorKey: 'identifier',\n header: t('feature_toggles.list.headers.identifier', 'Identifier'),\n enableSorting: true\n },\n {\n accessorKey: 'name',\n header: t('feature_toggles.list.headers.name', 'Name'),\n enableSorting: true\n },\n {\n accessorKey: 'type',\n header: t('feature_toggles.list.headers.type', 'Type'),\n enableSorting: true,\n cell: ({ row }) => {\n const typeInfo = featureToggleTypeLabelMap.get(row.original.type)\n if (!typeInfo) return '-'\n\n return (\n <Badge variant={typeInfo.variant}>\n {typeInfo.label}\n </Badge>\n )\n },\n },\n ]\n return base\n }, [t, featureToggleTypeLabelMap])\n\n return (\n <DataTable\n title={t('feature_toggles.global.help.title', 'Feature Toggles')}\n disableRowClick\n actions={\n <Button asChild>\n <Link href=\"/backend/feature-toggles/global/create\">\n {t('common.create', 'Create')}\n </Link>\n </Button>\n }\n columns={columns}\n data={featureTogglesData?.items ?? []}\n isLoading={isLoading}\n filters={filters}\n filterValues={filterValues}\n onFiltersApply={handleFiltersApply}\n onFiltersClear={handleFiltersClear}\n sorting={sorting}\n onSortingChange={handleSortingChange}\n sortable={true}\n pagination={{\n page: featureTogglesData?.page ?? 1,\n pageSize: featureTogglesData?.pageSize ?? 25,\n total: featureTogglesData?.total ?? 0,\n totalPages: featureTogglesData?.totalPages ?? 1,\n onPageChange: handlePageChange,\n }}\n rowActions={(row) => (\n <RowActions items={[\n { label: t('common.edit', 'Edit'), href: `/backend/feature-toggles/global/${row.id}/edit` },\n { label: t('common.view', 'Overrides'), href: `/backend/feature-toggles/global/${row.id}` },\n { label: t('common.delete', 'Delete'), destructive: true, onSelect: () => { void handleDelete(row) } },\n ]} />\n )}\n />\n )\n}\n
|
|
5
|
-
"mappings": ";AAuKY;AAtKZ,SAAS,iBAAiB;AAC1B,SAAS,kBAAkB;AAC3B,SAAS,YAAY;AACrB,SAAS,eAAe;AACxB,SAAS,sBAAsB;AAC/B,SAAS,UAAU,sBAAsB;AAEzC,YAAY,WAAW;AAEvB,SAAS,mBAAmB;AAC5B,SAAS,kBAA8B;AACvC,SAAS,cAAc;AACvB,SAAS,aAAa;AACtB,OAAO,UAAU;AAcV,SAAS,sBAAsB;AACpC,QAAM,IAAI,KAAK;AACf,QAAM,cAAc,eAAe;AAEnC,QAAM,4BAA4B,MAAM,QAAQ,MAAM,oBAAI,IAAiE;AAAA,IACzH,CAAC,WAAW,EAAE,OAAO,EAAE,iCAAiC,SAAS,GAAG,SAAS,UAAU,CAAC;AAAA,IACxF,CAAC,UAAU,EAAE,OAAO,EAAE,gCAAgC,QAAQ,GAAG,SAAS,YAAY,CAAC;AAAA,IACvF,CAAC,UAAU,EAAE,OAAO,EAAE,gCAAgC,QAAQ,GAAG,SAAS,UAAU,CAAC;AAAA,IACrF,CAAC,QAAQ,EAAE,OAAO,EAAE,8BAA8B,MAAM,GAAG,SAAS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,qCAAqC,MAAM;AAAA,QACrD,eAAe;AAAA,QACf,MAAM,CAAC,EAAE,IAAI,MAAM;AACjB,gBAAM,WAAW,0BAA0B,IAAI,IAAI,SAAS,IAAI;AAChE,cAAI,CAAC,SAAU,QAAO;AAEtB,iBACE,oBAAC,SAAM,SAAS,SAAS,SACtB,mBAAS,OACZ;AAAA,QAEJ;AAAA,MACF;AAAA,IACF;AACA,WAAO;AAAA,EACT,GAAG,CAAC,GAAG,yBAAyB,CAAC;AAEjC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAO,EAAE,qCAAqC,iBAAiB;AAAA,MAC/D,iBAAe;AAAA,MACf,SACE,oBAAC,UAAO,SAAO,MACb,8BAAC,QAAK,MAAK,0CACR,YAAE,iBAAiB,QAAQ,GAC9B,GACF;AAAA,MAEF;AAAA,MACA,MAAM,oBAAoB,SAAS,CAAC;AAAA,MACpC;AAAA,MACA;AAAA,MACA;AAAA,MACA,gBAAgB;AAAA,MAChB,gBAAgB;AAAA,MAChB;AAAA,MACA,iBAAiB;AAAA,MACjB,UAAU;AAAA,MACV,YAAY;AAAA,QACV,MAAM,oBAAoB,QAAQ;AAAA,QAClC,UAAU,oBAAoB,YAAY;AAAA,QAC1C,OAAO,oBAAoB,SAAS;AAAA,QACpC,YAAY,oBAAoB,cAAc;AAAA,QAC9C,cAAc;AAAA,MAChB;AAAA,MACA,YAAY,CAAC,QACX,oBAAC,cAAW,OAAO;AAAA,QACjB,EAAE,OAAO,EAAE,eAAe,MAAM,GAAG,MAAM,mCAAmC,IAAI,EAAE,QAAQ;AAAA,
|
|
4
|
+
"sourcesContent": ["\"use client\"\nimport { DataTable } from \"@open-mercato/ui/backend/DataTable\";\nimport { RowActions } from \"@open-mercato/ui/backend/RowActions\";\nimport { useT } from \"@open-mercato/shared/lib/i18n/context\";\nimport { apiCall } from '@open-mercato/ui/backend/utils/apiCall'\nimport { raiseCrudError } from '@open-mercato/ui/backend/utils/serverErrors'\nimport { useQuery, useQueryClient } from '@tanstack/react-query'\nimport type { ColumnDef, SortingState } from '@tanstack/react-table'\nimport * as React from 'react'\nimport type { FilterDef, FilterValues } from \"@open-mercato/ui/backend/FilterBar\"\nimport { useMutation } from '@tanstack/react-query'\nimport { deleteCrud, updateCrud } from \"@open-mercato/ui/backend/utils/crud\";\nimport { Button } from \"@open-mercato/ui/primitives/button\";\nimport { Badge } from \"@open-mercato/ui/primitives/badge\";\nimport Link from \"next/link\";\nimport { FeatureToggleType } from \"../data/entities\";\n\ntype Row = {\n id: string\n identifier: string\n name: string\n description: string\n category?: string\n type: FeatureToggleType\n}\n\ntype BadgeVariant = 'default' | 'secondary' | 'destructive' | 'outline' | 'muted'\n\nexport function FeatureTogglesTable() {\n const t = useT()\n const queryClient = useQueryClient()\n\n const featureToggleTypeLabelMap = React.useMemo(() => new Map<FeatureToggleType, { label: string; variant: BadgeVariant }>([\n ['boolean', { label: t('feature_toggles.types.boolean', 'Boolean'), variant: 'default' }],\n ['string', { label: t('feature_toggles.types.string', 'String'), variant: 'secondary' }],\n ['number', { label: t('feature_toggles.types.number', 'Number'), variant: 'outline' }],\n ['json', { label: t('feature_toggles.types.json', 'JSON'), variant: 'destructive' }],\n ]), [t])\n\n const [filterValues, setFilterValues] = React.useState<FilterValues>({})\n const [sorting, setSorting] = React.useState<SortingState>([])\n const [pagination, setPagination] = React.useState({ page: 1, pageSize: 25 })\n\n const categoryFilterValue = typeof filterValues.category === 'string' ? filterValues.category.trim() : ''\n const nameFilterValue = typeof filterValues.name === 'string' ? filterValues.name.trim() : ''\n const identifierFilterValue = typeof filterValues.identifier === 'string' ? filterValues.identifier.trim() : ''\n const typeFilterValue = typeof filterValues.type === 'string' ? filterValues.type.trim() : ''\n const sortField = sorting.length > 0 ? sorting[0].id : 'category'\n const sortDir = sorting.length > 0 && sorting[0].desc ? 'desc' : 'asc'\n\n const queryParams = React.useMemo(() => {\n const params = new URLSearchParams()\n if (categoryFilterValue) params.set('category', categoryFilterValue)\n if (nameFilterValue) params.set('name', nameFilterValue)\n if (identifierFilterValue) params.set('identifier', identifierFilterValue)\n if (typeFilterValue) params.set('type', typeFilterValue)\n\n params.set('sortField', sortField)\n params.set('sortDir', sortDir)\n\n params.set('page', pagination.page.toString())\n params.set('pageSize', pagination.pageSize.toString())\n\n return params.toString()\n }, [categoryFilterValue, identifierFilterValue, nameFilterValue, sortField, sortDir, typeFilterValue, pagination])\n\n const handleSortingChange = React.useCallback((newSorting: SortingState) => {\n setSorting(newSorting)\n }, [])\n\n const handlePageChange = React.useCallback((page: number) => {\n setPagination(prev => ({ ...prev, page }))\n }, [])\n\n const { data: featureTogglesData, isLoading } = useQuery({\n queryKey: ['feature_toggles', queryParams],\n queryFn: async () => {\n const call = await apiCall<{ items: Row[]; total: number; totalPages: number; page: number; pageSize: number; isSuperAdmin?: boolean }>(\n `/api/feature_toggles/global${queryParams ? `?${queryParams}` : ''}`,\n )\n if (!call.ok) {\n await raiseCrudError(call.response, t('feature_toggles.list.error.load', 'Failed to load feature toggles'))\n }\n return call.result ?? { items: [], total: 0, totalPages: 1, page: 1, pageSize: 25 }\n },\n })\n\n const filters = React.useMemo<FilterDef[]>(() => [\n {\n id: 'identifier',\n label: t('feature_toggles.list.filters.identifier', 'Identifier'),\n type: 'text',\n },\n {\n id: 'name',\n label: t('feature_toggles.list.filters.name', 'Name'),\n type: 'text',\n },\n {\n id: 'category',\n label: t('feature_toggles.list.filters.category', 'Category'),\n type: 'text',\n },\n {\n id: 'type',\n label: t('feature_toggles.list.filters.type', 'Type'),\n type: 'select',\n options: [\n { label: t('feature_toggles.types.boolean', 'Boolean'), value: 'boolean' },\n { label: t('feature_toggles.types.string', 'String'), value: 'string' },\n { label: t('feature_toggles.types.number', 'Number'), value: 'number' },\n { label: t('feature_toggles.types.json', 'JSON'), value: 'json' },\n ],\n },\n ], [t])\n\n const handleFiltersApply = React.useCallback((values: FilterValues) => {\n setFilterValues(values)\n }, [])\n\n const handleFiltersClear = React.useCallback(() => {\n setFilterValues({})\n }, [])\n\n const deleteFeatureToggleMutation = useMutation({\n mutationFn: async (row: Row) => {\n await deleteCrud('feature_toggles/global', row.id)\n },\n onSuccess: async () => {\n await queryClient.invalidateQueries({ queryKey: ['feature_toggles'] })\n },\n })\n\n const handleDelete = React.useCallback(async (row: Row) => {\n if (!window.confirm(t('feature_toggles.list.confirmDelete', 'Delete feature toggle \"{identifier}\"?', { identifier: row.identifier }))) return\n await deleteFeatureToggleMutation.mutateAsync(row)\n }, [deleteFeatureToggleMutation, t])\n\n const columns = React.useMemo<ColumnDef<Row>[]>(() => {\n const base: ColumnDef<Row>[] = [\n {\n accessorKey: 'category',\n header: t('feature_toggles.list.headers.category', 'Category'),\n enableSorting: true,\n cell: ({ row }) => {\n return row.original.category || '-'\n },\n },\n {\n accessorKey: 'identifier',\n header: t('feature_toggles.list.headers.identifier', 'Identifier'),\n enableSorting: true\n },\n {\n accessorKey: 'name',\n header: t('feature_toggles.list.headers.name', 'Name'),\n enableSorting: true\n },\n {\n accessorKey: 'type',\n header: t('feature_toggles.list.headers.type', 'Type'),\n enableSorting: true,\n cell: ({ row }) => {\n const typeInfo = featureToggleTypeLabelMap.get(row.original.type)\n if (!typeInfo) return '-'\n\n return (\n <Badge variant={typeInfo.variant}>\n {typeInfo.label}\n </Badge>\n )\n },\n },\n ]\n return base\n }, [t, featureToggleTypeLabelMap])\n\n return (\n <DataTable\n title={t('feature_toggles.global.help.title', 'Feature Toggles')}\n disableRowClick\n actions={\n <Button asChild>\n <Link href=\"/backend/feature-toggles/global/create\">\n {t('common.create', 'Create')}\n </Link>\n </Button>\n }\n columns={columns}\n data={featureTogglesData?.items ?? []}\n isLoading={isLoading}\n filters={filters}\n filterValues={filterValues}\n onFiltersApply={handleFiltersApply}\n onFiltersClear={handleFiltersClear}\n sorting={sorting}\n onSortingChange={handleSortingChange}\n sortable={true}\n pagination={{\n page: featureTogglesData?.page ?? 1,\n pageSize: featureTogglesData?.pageSize ?? 25,\n total: featureTogglesData?.total ?? 0,\n totalPages: featureTogglesData?.totalPages ?? 1,\n onPageChange: handlePageChange,\n }}\n rowActions={(row) => (\n <RowActions items={[\n { id: 'edit', label: t('common.edit', 'Edit'), href: `/backend/feature-toggles/global/${row.id}/edit` },\n { id: 'view', label: t('common.view', 'Overrides'), href: `/backend/feature-toggles/global/${row.id}` },\n { id: 'delete', label: t('common.delete', 'Delete'), destructive: true, onSelect: () => { void handleDelete(row) } },\n ]} />\n )}\n />\n )\n}\n"],
|
|
5
|
+
"mappings": ";AAuKY;AAtKZ,SAAS,iBAAiB;AAC1B,SAAS,kBAAkB;AAC3B,SAAS,YAAY;AACrB,SAAS,eAAe;AACxB,SAAS,sBAAsB;AAC/B,SAAS,UAAU,sBAAsB;AAEzC,YAAY,WAAW;AAEvB,SAAS,mBAAmB;AAC5B,SAAS,kBAA8B;AACvC,SAAS,cAAc;AACvB,SAAS,aAAa;AACtB,OAAO,UAAU;AAcV,SAAS,sBAAsB;AACpC,QAAM,IAAI,KAAK;AACf,QAAM,cAAc,eAAe;AAEnC,QAAM,4BAA4B,MAAM,QAAQ,MAAM,oBAAI,IAAiE;AAAA,IACzH,CAAC,WAAW,EAAE,OAAO,EAAE,iCAAiC,SAAS,GAAG,SAAS,UAAU,CAAC;AAAA,IACxF,CAAC,UAAU,EAAE,OAAO,EAAE,gCAAgC,QAAQ,GAAG,SAAS,YAAY,CAAC;AAAA,IACvF,CAAC,UAAU,EAAE,OAAO,EAAE,gCAAgC,QAAQ,GAAG,SAAS,UAAU,CAAC;AAAA,IACrF,CAAC,QAAQ,EAAE,OAAO,EAAE,8BAA8B,MAAM,GAAG,SAAS,cAAc,CAAC;AAAA,EACrF,CAAC,GAAG,CAAC,CAAC,CAAC;AAEP,QAAM,CAAC,cAAc,eAAe,IAAI,MAAM,SAAuB,CAAC,CAAC;AACvE,QAAM,CAAC,SAAS,UAAU,IAAI,MAAM,SAAuB,CAAC,CAAC;AAC7D,QAAM,CAAC,YAAY,aAAa,IAAI,MAAM,SAAS,EAAE,MAAM,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AAA,IACF;AACA,WAAO;AAAA,EACT,GAAG,CAAC,GAAG,yBAAyB,CAAC;AAEjC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAO,EAAE,qCAAqC,iBAAiB;AAAA,MAC/D,iBAAe;AAAA,MACf,SACE,oBAAC,UAAO,SAAO,MACb,8BAAC,QAAK,MAAK,0CACR,YAAE,iBAAiB,QAAQ,GAC9B,GACF;AAAA,MAEF;AAAA,MACA,MAAM,oBAAoB,SAAS,CAAC;AAAA,MACpC;AAAA,MACA;AAAA,MACA;AAAA,MACA,gBAAgB;AAAA,MAChB,gBAAgB;AAAA,MAChB;AAAA,MACA,iBAAiB;AAAA,MACjB,UAAU;AAAA,MACV,YAAY;AAAA,QACV,MAAM,oBAAoB,QAAQ;AAAA,QAClC,UAAU,oBAAoB,YAAY;AAAA,QAC1C,OAAO,oBAAoB,SAAS;AAAA,QACpC,YAAY,oBAAoB,cAAc;AAAA,QAC9C,cAAc;AAAA,MAChB;AAAA,MACA,YAAY,CAAC,QACX,oBAAC,cAAW,OAAO;AAAA,QACjB,EAAE,IAAI,QAAQ,OAAO,EAAE,eAAe,MAAM,GAAG,MAAM,mCAAmC,IAAI,EAAE,QAAQ;AAAA,QACtG,EAAE,IAAI,QAAQ,OAAO,EAAE,eAAe,WAAW,GAAG,MAAM,mCAAmC,IAAI,EAAE,GAAG;AAAA,QACtG,EAAE,IAAI,UAAU,OAAO,EAAE,iBAAiB,QAAQ,GAAG,aAAa,MAAM,UAAU,MAAM;AAAE,eAAK,aAAa,GAAG;AAAA,QAAE,EAAE;AAAA,MACrH,GAAG;AAAA;AAAA,EAEP;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -134,7 +134,7 @@ function OverridesTable() {
|
|
|
134
134
|
isRefreshing: isLoading
|
|
135
135
|
},
|
|
136
136
|
rowActions: (row) => /* @__PURE__ */ jsx(RowActions, { items: [
|
|
137
|
-
{ label: t("common.edit", "Edit"), href: `/backend/feature-toggles/global/${row.toggleId}` }
|
|
137
|
+
{ id: "edit", label: t("common.edit", "Edit"), href: `/backend/feature-toggles/global/${row.toggleId}` }
|
|
138
138
|
] }),
|
|
139
139
|
error: error ? error.message : void 0
|
|
140
140
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/modules/feature_toggles/components/OverridesTable.tsx"],
|
|
4
|
-
"sourcesContent": ["\"use client\"\n\nimport { DataTable } from \"@open-mercato/ui/backend/DataTable\";\nimport { useQuery } from \"@tanstack/react-query\";\nimport { apiCall } from \"@open-mercato/ui/backend/utils/apiCall\";\nimport { raiseCrudError } from \"@open-mercato/ui/backend/utils/serverErrors\";\nimport { useT } from \"@open-mercato/shared/lib/i18n/context\";\nimport { useQueryClient } from \"@tanstack/react-query\";\nimport { ColumnDef, SortingState } from \"@tanstack/react-table\";\nimport * as React from 'react'\nimport type { FilterDef, FilterValues } from \"@open-mercato/ui/backend/FilterBar\"\nimport { RowActions } from \"@open-mercato/ui/backend/RowActions\";\nimport { OverrideListResponse } from \"../data/validators\";\n\n\nexport default function OverridesTable() {\n const [filterValues, setFilterValues] = React.useState<FilterValues>({})\n const [sorting, setSorting] = React.useState<SortingState>([])\n const [pagination, setPagination] = React.useState({ page: 1, pageSize: 25 })\n\n const t = useT()\n const queryClient = useQueryClient()\n\n const sortField = sorting.length > 0 ? sorting[0].id : undefined\n const sortDir = sorting.length > 0 && sorting[0].desc ? 'desc' : 'asc'\n\n const queryParams = React.useMemo(() => {\n const params = new URLSearchParams()\n Object.entries(filterValues).forEach(([key, value]) => {\n params.set(key, value as string)\n })\n if (sortField) params.set('sortField', sortField)\n if (sorting.length > 0) params.set('sortDir', sortDir)\n\n params.set('page', pagination.page.toString())\n params.set('pageSize', pagination.pageSize.toString())\n\n return params.toString()\n }, [filterValues, sortField, sortDir, pagination])\n\n const { data: featureTogglesData, isLoading, error } = useQuery({\n queryKey: ['feature_toggle_overrides', queryParams],\n queryFn: async () => {\n const call = await apiCall<{\n items: OverrideListResponse[];\n total: number;\n totalPages: number;\n page: number;\n pageSize: number;\n isSuperAdmin?: boolean\n }>(`/api/feature_toggles/overrides?${queryParams}`)\n if (!call.ok) {\n await raiseCrudError(call.response, t('feature_toggles.list.error.load', 'Failed to load feature toggles'))\n }\n return call.result ?? {\n items: [],\n total: 0,\n totalPages: 1,\n page: 1,\n pageSize: 25\n }\n },\n })\n\n const handleFiltersApply = React.useCallback((values: FilterValues) => {\n setFilterValues(values)\n }, [])\n\n const handleFiltersClear = React.useCallback(() => {\n setFilterValues({})\n }, [])\n\n const handleSortingChange = React.useCallback((newSorting: SortingState) => {\n setSorting(newSorting)\n }, [])\n\n const handlePageChange = React.useCallback((page: number) => {\n setPagination(prev => ({ ...prev, page }))\n }, [])\n\n const handleRefresh = React.useCallback(() => {\n void queryClient.refetchQueries({ queryKey: ['feature_toggle_overrides'] })\n }, [queryClient])\n\n const columns = React.useMemo<ColumnDef<OverrideListResponse>[]>(() => {\n return [\n {\n accessorKey: 'tenantName',\n header: t('feature_toggles.overrides.headers.tenant', 'Tenant'),\n enableSorting: true\n },\n {\n accessorKey: 'identifier',\n header: t('feature_toggles.overrides.headers.identifier', 'Identifier'),\n enableSorting: true\n },\n {\n accessorKey: 'name',\n header: t('feature_toggles.overrides.headers.name', 'Name'),\n enableSorting: true\n },\n {\n accessorKey: 'category',\n header: t('feature_toggles.overrides.headers.category', 'Category'),\n enableSorting: true\n },\n {\n accessorKey: 'isOverride',\n header: t('feature_toggles.overrides.headers.overrideState', 'Override'),\n enableSorting: false,\n cell: ({ row }) => {\n return row.original.isOverride ? t('feature_toggles.overrides.headers.isOverride.true', 'Yes') : t('feature_toggles.overrides.headers.isOverride.false', 'No')\n },\n },\n ]\n }, [])\n\n\n const filters = React.useMemo<FilterDef[]>(() => [\n {\n id: 'identifier',\n label: t('feature_toggles.list.filters.identifier', 'Identifier'),\n type: 'text',\n },\n {\n id: 'name',\n label: t('feature_toggles.list.filters.name', 'Name'),\n type: 'text',\n },\n {\n id: 'category',\n label: t('feature_toggles.list.filters.category', 'Category'),\n type: 'text',\n }\n ], [t])\n\n return (\n <DataTable\n title={t('feature_toggles.overrides.help.title', 'Feature Toggle Overrides')}\n columns={columns}\n filters={filters}\n filterValues={filterValues}\n onFiltersApply={handleFiltersApply}\n onFiltersClear={handleFiltersClear}\n data={featureTogglesData?.items ?? []}\n isLoading={isLoading}\n sorting={sorting}\n onSortingChange={handleSortingChange}\n sortable={true}\n pagination={{\n page: featureTogglesData?.page ?? 1,\n pageSize: featureTogglesData?.pageSize ?? 25,\n total: featureTogglesData?.total ?? 0,\n totalPages: featureTogglesData?.totalPages ?? 1,\n onPageChange: handlePageChange,\n }}\n refreshButton={{\n label: t('feature_toggles.list.table.refresh', 'Refresh'),\n onRefresh: handleRefresh,\n isRefreshing: isLoading,\n }}\n rowActions={(row) => (\n <RowActions items={[\n { label: t('common.edit', 'Edit'), href: `/backend/feature-toggles/global/${row.toggleId}` },\n ]} />\n )}\n error={error ? error.message : undefined}\n />\n )\n}\n"],
|
|
5
|
-
"mappings": ";AAkKgB;AAhKhB,SAAS,iBAAiB;AAC1B,SAAS,gBAAgB;AACzB,SAAS,eAAe;AACxB,SAAS,sBAAsB;AAC/B,SAAS,YAAY;AACrB,SAAS,sBAAsB;AAE/B,YAAY,WAAW;AAEvB,SAAS,kBAAkB;AAIZ,SAAR,iBAAkC;AACrC,QAAM,CAAC,cAAc,eAAe,IAAI,MAAM,SAAuB,CAAC,CAAC;AACvE,QAAM,CAAC,SAAS,UAAU,IAAI,MAAM,SAAuB,CAAC,CAAC;AAC7D,QAAM,CAAC,YAAY,aAAa,IAAI,MAAM,SAAS,EAAE,MAAM,GAAG,UAAU,GAAG,CAAC;AAE5E,QAAM,IAAI,KAAK;AACf,QAAM,cAAc,eAAe;AAEnC,QAAM,YAAY,QAAQ,SAAS,IAAI,QAAQ,CAAC,EAAE,KAAK;AACvD,QAAM,UAAU,QAAQ,SA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AAO,EAAE,yCAAyC,UAAU;AAAA,MAC5D,MAAM;AAAA,IACV;AAAA,EACJ,GAAG,CAAC,CAAC,CAAC;AAEN,SACI;AAAA,IAAC;AAAA;AAAA,MACG,OAAO,EAAE,wCAAwC,0BAA0B;AAAA,MAC3E;AAAA,MACA;AAAA,MACA;AAAA,MACA,gBAAgB;AAAA,MAChB,gBAAgB;AAAA,MAChB,MAAM,oBAAoB,SAAS,CAAC;AAAA,MACpC;AAAA,MACA;AAAA,MACA,iBAAiB;AAAA,MACjB,UAAU;AAAA,MACV,YAAY;AAAA,QACR,MAAM,oBAAoB,QAAQ;AAAA,QAClC,UAAU,oBAAoB,YAAY;AAAA,QAC1C,OAAO,oBAAoB,SAAS;AAAA,QACpC,YAAY,oBAAoB,cAAc;AAAA,QAC9C,cAAc;AAAA,MAClB;AAAA,MACA,eAAe;AAAA,QACX,OAAO,EAAE,sCAAsC,SAAS;AAAA,QACxD,WAAW;AAAA,QACX,cAAc;AAAA,MAClB;AAAA,MACA,YAAY,CAAC,QACT,oBAAC,cAAW,OAAO;AAAA,QACf,EAAE,OAAO,EAAE,eAAe,MAAM,GAAG,MAAM,mCAAmC,IAAI,QAAQ,GAAG;AAAA,
|
|
4
|
+
"sourcesContent": ["\"use client\"\n\nimport { DataTable } from \"@open-mercato/ui/backend/DataTable\";\nimport { useQuery } from \"@tanstack/react-query\";\nimport { apiCall } from \"@open-mercato/ui/backend/utils/apiCall\";\nimport { raiseCrudError } from \"@open-mercato/ui/backend/utils/serverErrors\";\nimport { useT } from \"@open-mercato/shared/lib/i18n/context\";\nimport { useQueryClient } from \"@tanstack/react-query\";\nimport { ColumnDef, SortingState } from \"@tanstack/react-table\";\nimport * as React from 'react'\nimport type { FilterDef, FilterValues } from \"@open-mercato/ui/backend/FilterBar\"\nimport { RowActions } from \"@open-mercato/ui/backend/RowActions\";\nimport { OverrideListResponse } from \"../data/validators\";\n\n\nexport default function OverridesTable() {\n const [filterValues, setFilterValues] = React.useState<FilterValues>({})\n const [sorting, setSorting] = React.useState<SortingState>([])\n const [pagination, setPagination] = React.useState({ page: 1, pageSize: 25 })\n\n const t = useT()\n const queryClient = useQueryClient()\n\n const sortField = sorting.length > 0 ? sorting[0].id : undefined\n const sortDir = sorting.length > 0 && sorting[0].desc ? 'desc' : 'asc'\n\n const queryParams = React.useMemo(() => {\n const params = new URLSearchParams()\n Object.entries(filterValues).forEach(([key, value]) => {\n params.set(key, value as string)\n })\n if (sortField) params.set('sortField', sortField)\n if (sorting.length > 0) params.set('sortDir', sortDir)\n\n params.set('page', pagination.page.toString())\n params.set('pageSize', pagination.pageSize.toString())\n\n return params.toString()\n }, [filterValues, sortField, sortDir, pagination])\n\n const { data: featureTogglesData, isLoading, error } = useQuery({\n queryKey: ['feature_toggle_overrides', queryParams],\n queryFn: async () => {\n const call = await apiCall<{\n items: OverrideListResponse[];\n total: number;\n totalPages: number;\n page: number;\n pageSize: number;\n isSuperAdmin?: boolean\n }>(`/api/feature_toggles/overrides?${queryParams}`)\n if (!call.ok) {\n await raiseCrudError(call.response, t('feature_toggles.list.error.load', 'Failed to load feature toggles'))\n }\n return call.result ?? {\n items: [],\n total: 0,\n totalPages: 1,\n page: 1,\n pageSize: 25\n }\n },\n })\n\n const handleFiltersApply = React.useCallback((values: FilterValues) => {\n setFilterValues(values)\n }, [])\n\n const handleFiltersClear = React.useCallback(() => {\n setFilterValues({})\n }, [])\n\n const handleSortingChange = React.useCallback((newSorting: SortingState) => {\n setSorting(newSorting)\n }, [])\n\n const handlePageChange = React.useCallback((page: number) => {\n setPagination(prev => ({ ...prev, page }))\n }, [])\n\n const handleRefresh = React.useCallback(() => {\n void queryClient.refetchQueries({ queryKey: ['feature_toggle_overrides'] })\n }, [queryClient])\n\n const columns = React.useMemo<ColumnDef<OverrideListResponse>[]>(() => {\n return [\n {\n accessorKey: 'tenantName',\n header: t('feature_toggles.overrides.headers.tenant', 'Tenant'),\n enableSorting: true\n },\n {\n accessorKey: 'identifier',\n header: t('feature_toggles.overrides.headers.identifier', 'Identifier'),\n enableSorting: true\n },\n {\n accessorKey: 'name',\n header: t('feature_toggles.overrides.headers.name', 'Name'),\n enableSorting: true\n },\n {\n accessorKey: 'category',\n header: t('feature_toggles.overrides.headers.category', 'Category'),\n enableSorting: true\n },\n {\n accessorKey: 'isOverride',\n header: t('feature_toggles.overrides.headers.overrideState', 'Override'),\n enableSorting: false,\n cell: ({ row }) => {\n return row.original.isOverride ? t('feature_toggles.overrides.headers.isOverride.true', 'Yes') : t('feature_toggles.overrides.headers.isOverride.false', 'No')\n },\n },\n ]\n }, [])\n\n\n const filters = React.useMemo<FilterDef[]>(() => [\n {\n id: 'identifier',\n label: t('feature_toggles.list.filters.identifier', 'Identifier'),\n type: 'text',\n },\n {\n id: 'name',\n label: t('feature_toggles.list.filters.name', 'Name'),\n type: 'text',\n },\n {\n id: 'category',\n label: t('feature_toggles.list.filters.category', 'Category'),\n type: 'text',\n }\n ], [t])\n\n return (\n <DataTable\n title={t('feature_toggles.overrides.help.title', 'Feature Toggle Overrides')}\n columns={columns}\n filters={filters}\n filterValues={filterValues}\n onFiltersApply={handleFiltersApply}\n onFiltersClear={handleFiltersClear}\n data={featureTogglesData?.items ?? []}\n isLoading={isLoading}\n sorting={sorting}\n onSortingChange={handleSortingChange}\n sortable={true}\n pagination={{\n page: featureTogglesData?.page ?? 1,\n pageSize: featureTogglesData?.pageSize ?? 25,\n total: featureTogglesData?.total ?? 0,\n totalPages: featureTogglesData?.totalPages ?? 1,\n onPageChange: handlePageChange,\n }}\n refreshButton={{\n label: t('feature_toggles.list.table.refresh', 'Refresh'),\n onRefresh: handleRefresh,\n isRefreshing: isLoading,\n }}\n rowActions={(row) => (\n <RowActions items={[\n { id: 'edit', label: t('common.edit', 'Edit'), href: `/backend/feature-toggles/global/${row.toggleId}` },\n ]} />\n )}\n error={error ? error.message : undefined}\n />\n )\n}\n"],
|
|
5
|
+
"mappings": ";AAkKgB;AAhKhB,SAAS,iBAAiB;AAC1B,SAAS,gB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AI,QAAQ,GAAG;AAAA,MAC3G,GAAG;AAAA,MAEP,OAAO,QAAQ,MAAM,UAAU;AAAA;AAAA,EACnC;AAER;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
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
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
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
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
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
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
}
|