@open-mercato/core 0.6.7-develop.6862.1.c11a64ce0a → 0.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +2 -2
- package/AGENTS.md +3 -3
- package/agentic/standalone-guide.md +0 -13
- package/dist/bootstrap.js +1 -16
- package/dist/bootstrap.js.map +2 -2
- package/dist/generated/entities/customer_deal_person_link/index.js +0 -2
- package/dist/generated/entities/customer_deal_person_link/index.js.map +2 -2
- package/dist/generated/entities/customer_user_invitation/index.js +0 -2
- package/dist/generated/entities/customer_user_invitation/index.js.map +2 -2
- package/dist/generated/entities/gateway_payment_operation/index.js +0 -2
- package/dist/generated/entities/gateway_payment_operation/index.js.map +2 -2
- package/dist/generated/entities/gateway_transaction/index.js +0 -2
- package/dist/generated/entities/gateway_transaction/index.js.map +2 -2
- package/dist/generated/entities/organization/index.js +0 -2
- package/dist/generated/entities/organization/index.js.map +2 -2
- package/dist/generated/entities/resources_resource/index.js +0 -2
- package/dist/generated/entities/resources_resource/index.js.map +2 -2
- package/dist/generated/entities.ids.generated.js +1 -3
- package/dist/generated/entities.ids.generated.js.map +2 -2
- package/dist/generated/entity-fields-registry.js +0 -23
- package/dist/generated/entity-fields-registry.js.map +2 -2
- package/dist/helpers/integration/salesFixtures.js +2 -31
- package/dist/helpers/integration/salesFixtures.js.map +2 -2
- package/dist/helpers/integration/salesUi.js +0 -5
- package/dist/helpers/integration/salesUi.js.map +2 -2
- package/dist/modules/api_keys/backend/api-keys/page.js +1 -2
- package/dist/modules/api_keys/backend/api-keys/page.js.map +2 -2
- package/dist/modules/attachments/api/route.js +10 -120
- package/dist/modules/attachments/api/route.js.map +2 -2
- package/dist/modules/attachments/data/entities.js +1 -67
- package/dist/modules/attachments/data/entities.js.map +2 -2
- package/dist/modules/attachments/di.js +1 -7
- package/dist/modules/attachments/di.js.map +2 -2
- package/dist/modules/attachments/fields/attachment.js +1 -1
- package/dist/modules/attachments/fields/attachment.js.map +2 -2
- package/dist/modules/attachments/lib/drivers/index.js.map +1 -1
- package/dist/modules/attachments/lib/drivers/localDriver.js +6 -19
- package/dist/modules/attachments/lib/drivers/localDriver.js.map +2 -2
- package/dist/modules/attachments/lib/upload-limits.js +0 -33
- package/dist/modules/attachments/lib/upload-limits.js.map +2 -2
- package/dist/modules/audit_logs/api/audit-logs/access/route.js +1 -5
- package/dist/modules/audit_logs/api/audit-logs/access/route.js.map +2 -2
- package/dist/modules/audit_logs/api/audit-logs/actions/export/route.js +1 -5
- package/dist/modules/audit_logs/api/audit-logs/actions/export/route.js.map +2 -2
- package/dist/modules/audit_logs/api/audit-logs/actions/route.js +1 -5
- package/dist/modules/audit_logs/api/audit-logs/actions/route.js.map +2 -2
- package/dist/modules/audit_logs/components/AccessLogsTable.js +1 -2
- package/dist/modules/audit_logs/components/AccessLogsTable.js.map +2 -2
- package/dist/modules/audit_logs/components/AuditLogsActions.js +1 -2
- package/dist/modules/audit_logs/components/AuditLogsActions.js.map +2 -2
- package/dist/modules/auth/api/admin/nav.js +4 -17
- package/dist/modules/auth/api/admin/nav.js.map +2 -2
- package/dist/modules/auth/api/profile/route.js +2 -8
- package/dist/modules/auth/api/profile/route.js.map +2 -2
- package/dist/modules/auth/api/users/route.js +19 -8
- package/dist/modules/auth/api/users/route.js.map +2 -2
- package/dist/modules/auth/backend/auth/profile/page.js.map +2 -2
- package/dist/modules/auth/backend/profile/change-password/page.js.map +2 -2
- package/dist/modules/auth/backend/roles/page.js +1 -2
- package/dist/modules/auth/backend/roles/page.js.map +2 -2
- package/dist/modules/auth/backend/settings/page.js +9 -14
- package/dist/modules/auth/backend/settings/page.js.map +2 -2
- package/dist/modules/auth/backend/users/page.js +1 -2
- package/dist/modules/auth/backend/users/page.js.map +2 -2
- package/dist/modules/auth/cli.js +1 -1
- package/dist/modules/auth/cli.js.map +2 -2
- package/dist/modules/auth/components/UserConsentsPanel.js +9 -9
- package/dist/modules/auth/components/UserConsentsPanel.js.map +2 -2
- package/dist/modules/auth/frontend/login.js +5 -6
- package/dist/modules/auth/frontend/login.js.map +2 -2
- package/dist/modules/auth/frontend/reset.js +2 -2
- package/dist/modules/auth/frontend/reset.js.map +2 -2
- package/dist/modules/auth/lib/backendChrome.js +29 -45
- package/dist/modules/auth/lib/backendChrome.js.map +2 -2
- package/dist/modules/auth/lib/setup-app.js +2 -17
- package/dist/modules/auth/lib/setup-app.js.map +2 -2
- package/dist/modules/auth/lib/tenantAccess.js +0 -7
- package/dist/modules/auth/lib/tenantAccess.js.map +2 -2
- package/dist/modules/auth/services/rbacService.js +44 -29
- package/dist/modules/auth/services/rbacService.js.map +2 -2
- package/dist/modules/business_rules/api/rules/route.js +4 -71
- package/dist/modules/business_rules/api/rules/route.js.map +2 -2
- package/dist/modules/business_rules/backend/rules/page.js +1 -2
- package/dist/modules/business_rules/backend/rules/page.js.map +2 -2
- package/dist/modules/business_rules/components/ActionBuilder.js +4 -47
- package/dist/modules/business_rules/components/ActionBuilder.js.map +3 -3
- package/dist/modules/business_rules/components/ActionRow.js +16 -106
- package/dist/modules/business_rules/components/ActionRow.js.map +2 -2
- package/dist/modules/business_rules/components/ConditionRow.js +4 -8
- package/dist/modules/business_rules/components/ConditionRow.js.map +2 -2
- package/dist/modules/business_rules/components/utils/actionValidation.js +0 -6
- package/dist/modules/business_rules/components/utils/actionValidation.js.map +2 -2
- package/dist/modules/business_rules/lib/action-executor.js +0 -148
- package/dist/modules/business_rules/lib/action-executor.js.map +2 -2
- package/dist/modules/business_rules/lib/rule-engine.js +1 -5
- package/dist/modules/business_rules/lib/rule-engine.js.map +2 -2
- package/dist/modules/catalog/backend/catalog/products/[id]/page.js +5 -6
- package/dist/modules/catalog/backend/catalog/products/[id]/page.js.map +2 -2
- package/dist/modules/catalog/backend/catalog/products/create/page.js +6 -7
- package/dist/modules/catalog/backend/catalog/products/create/page.js.map +2 -2
- package/dist/modules/catalog/components/PriceKindSettings.js +3 -3
- package/dist/modules/catalog/components/PriceKindSettings.js.map +2 -2
- package/dist/modules/catalog/components/categories/CategoriesDataTable.js +1 -2
- package/dist/modules/catalog/components/categories/CategoriesDataTable.js.map +2 -2
- package/dist/modules/catalog/components/products/ProductCategorizeSection.js +3 -3
- package/dist/modules/catalog/components/products/ProductCategorizeSection.js.map +2 -2
- package/dist/modules/catalog/components/products/ProductMediaManager.js +1 -1
- package/dist/modules/catalog/components/products/ProductMediaManager.js.map +2 -2
- package/dist/modules/catalog/components/products/ProductsDataTable.js +2 -3
- package/dist/modules/catalog/components/products/ProductsDataTable.js.map +2 -2
- package/dist/modules/catalog/components/products/VariantBuilder.js +5 -5
- package/dist/modules/catalog/components/products/VariantBuilder.js.map +2 -2
- package/dist/modules/catalog/events.js +0 -1
- package/dist/modules/catalog/events.js.map +2 -2
- package/dist/modules/catalog/widgets/injection/product-seo/widget.js +1 -1
- package/dist/modules/catalog/widgets/injection/product-seo/widget.js.map +2 -2
- package/dist/modules/communication_channels/api/post/test-seed/route.js +2 -52
- package/dist/modules/communication_channels/api/post/test-seed/route.js.map +2 -2
- package/dist/modules/communication_channels/api/post/webhook/[provider]/route.js +1 -11
- package/dist/modules/communication_channels/api/post/webhook/[provider]/route.js.map +2 -2
- package/dist/modules/communication_channels/api/post/webhooks/gmail/route.js +6 -11
- package/dist/modules/communication_channels/api/post/webhooks/gmail/route.js.map +2 -2
- package/dist/modules/communication_channels/backend/communication_channels/channels/page.js +1 -2
- package/dist/modules/communication_channels/backend/communication_channels/channels/page.js.map +2 -2
- package/dist/modules/communication_channels/backend/profile/communication-channels/page.js +3 -4
- package/dist/modules/communication_channels/backend/profile/communication-channels/page.js.map +2 -2
- package/dist/modules/communication_channels/data/enrichers.js +4 -4
- package/dist/modules/communication_channels/data/enrichers.js.map +2 -2
- package/dist/modules/communication_channels/lib/access-control.js +2 -2
- package/dist/modules/communication_channels/lib/access-control.js.map +2 -2
- package/dist/modules/configs/backend/config/system-status/page.js +1 -2
- package/dist/modules/configs/backend/config/system-status/page.js.map +2 -2
- package/dist/modules/configs/lib/upgrade-actions.js +0 -12
- package/dist/modules/configs/lib/upgrade-actions.js.map +2 -2
- package/dist/modules/currencies/backend/currencies/page.js +1 -2
- package/dist/modules/currencies/backend/currencies/page.js.map +2 -2
- package/dist/modules/currencies/backend/exchange-rates/page.js +1 -2
- package/dist/modules/currencies/backend/exchange-rates/page.js.map +2 -2
- package/dist/modules/currencies/di.js +0 -4
- package/dist/modules/currencies/di.js.map +2 -2
- package/dist/modules/customer_accounts/api/admin/users/[id].js +1 -10
- package/dist/modules/customer_accounts/api/admin/users/[id].js.map +2 -2
- package/dist/modules/customer_accounts/api/admin/users-invite.js +4 -63
- package/dist/modules/customer_accounts/api/admin/users-invite.js.map +2 -2
- package/dist/modules/customer_accounts/api/invitations/accept.js +2 -1
- package/dist/modules/customer_accounts/api/invitations/accept.js.map +2 -2
- package/dist/modules/customer_accounts/api/login.js +2 -4
- package/dist/modules/customer_accounts/api/login.js.map +2 -2
- package/dist/modules/customer_accounts/api/magic-link/verify.js +2 -4
- package/dist/modules/customer_accounts/api/magic-link/verify.js.map +2 -2
- package/dist/modules/customer_accounts/api/portal/feature-check.js +4 -5
- package/dist/modules/customer_accounts/api/portal/feature-check.js.map +2 -2
- package/dist/modules/customer_accounts/api/portal/nav.js +4 -6
- package/dist/modules/customer_accounts/api/portal/nav.js.map +2 -2
- package/dist/modules/customer_accounts/api/portal/profile.js +1 -5
- package/dist/modules/customer_accounts/api/portal/profile.js.map +2 -2
- package/dist/modules/customer_accounts/api/portal/sessions-refresh.js +3 -3
- package/dist/modules/customer_accounts/api/portal/sessions-refresh.js.map +2 -2
- package/dist/modules/customer_accounts/api/portal/users-invite.js +2 -22
- package/dist/modules/customer_accounts/api/portal/users-invite.js.map +2 -2
- package/dist/modules/customer_accounts/backend/customer_accounts/roles/page.js +1 -2
- package/dist/modules/customer_accounts/backend/customer_accounts/roles/page.js.map +2 -2
- package/dist/modules/customer_accounts/backend/customer_accounts/users/page.js +1 -2
- package/dist/modules/customer_accounts/backend/customer_accounts/users/page.js.map +2 -2
- package/dist/modules/customer_accounts/data/entities.js +0 -3
- package/dist/modules/customer_accounts/data/entities.js.map +2 -2
- package/dist/modules/customer_accounts/data/validators.js +0 -1
- package/dist/modules/customer_accounts/data/validators.js.map +2 -2
- package/dist/modules/customer_accounts/lib/customerAuth.js +2 -7
- package/dist/modules/customer_accounts/lib/customerAuth.js.map +2 -2
- package/dist/modules/customer_accounts/lib/customerAuthServer.js +1 -2
- package/dist/modules/customer_accounts/lib/customerAuthServer.js.map +2 -2
- package/dist/modules/customer_accounts/lib/customerEntityOwnership.js +3 -29
- package/dist/modules/customer_accounts/lib/customerEntityOwnership.js.map +2 -2
- package/dist/modules/customer_accounts/lib/customerUrl.js +10 -19
- package/dist/modules/customer_accounts/lib/customerUrl.js.map +2 -2
- package/dist/modules/customer_accounts/services/customerInvitationService.js +2 -32
- package/dist/modules/customer_accounts/services/customerInvitationService.js.map +2 -2
- package/dist/modules/customer_accounts/services/customerRbacService.js +3 -12
- package/dist/modules/customer_accounts/services/customerRbacService.js.map +2 -2
- package/dist/modules/customer_accounts/setup.js +0 -6
- package/dist/modules/customer_accounts/setup.js.map +2 -2
- package/dist/modules/customer_accounts/subscribers/autoLinkCrm.js +7 -47
- package/dist/modules/customer_accounts/subscribers/autoLinkCrm.js.map +2 -2
- package/dist/modules/customer_accounts/widgets/injection/account-status/widget.client.js +2 -2
- package/dist/modules/customer_accounts/widgets/injection/account-status/widget.client.js.map +2 -2
- package/dist/modules/customer_accounts/widgets/injection/portal-ai-assistant-trigger/widget.client.js +1 -1
- package/dist/modules/customer_accounts/widgets/injection/portal-ai-assistant-trigger/widget.client.js.map +2 -2
- package/dist/modules/customer_accounts/widgets/injection-table.js +1 -1
- package/dist/modules/customer_accounts/widgets/injection-table.js.map +2 -2
- package/dist/modules/customers/analytics.js +1 -4
- package/dist/modules/customers/analytics.js.map +2 -2
- package/dist/modules/customers/api/companies/[id]/route.js +4 -3
- package/dist/modules/customers/api/companies/[id]/route.js.map +2 -2
- package/dist/modules/customers/api/deals/[id]/people/route.js +2 -4
- package/dist/modules/customers/api/deals/[id]/people/route.js.map +2 -2
- package/dist/modules/customers/api/deals/[id]/route.js +3 -7
- package/dist/modules/customers/api/deals/[id]/route.js.map +2 -2
- package/dist/modules/customers/api/deals/aggregate/route.js +4 -5
- package/dist/modules/customers/api/deals/aggregate/route.js.map +2 -2
- package/dist/modules/customers/api/deals/summary/route.js +119 -14
- package/dist/modules/customers/api/deals/summary/route.js.map +2 -2
- package/dist/modules/customers/api/people/[id]/companies/enriched/route.js +2 -3
- package/dist/modules/customers/api/people/[id]/companies/enriched/route.js.map +2 -2
- package/dist/modules/customers/api/utils.js +18 -12
- package/dist/modules/customers/api/utils.js.map +2 -2
- package/dist/modules/customers/backend/customers/companies/[id]/page.js +1 -2
- package/dist/modules/customers/backend/customers/companies/[id]/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/companies/page.js +1 -2
- package/dist/modules/customers/backend/customers/companies/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/companies-v2/[id]/page.js +5 -16
- package/dist/modules/customers/backend/customers/companies-v2/[id]/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/deals/[id]/page.js +11 -18
- package/dist/modules/customers/backend/customers/deals/[id]/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/deals/page.js +1 -2
- package/dist/modules/customers/backend/customers/deals/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/deals/pipeline/components/QuickDealDialog.js +3 -17
- package/dist/modules/customers/backend/customers/deals/pipeline/components/QuickDealDialog.js.map +2 -2
- package/dist/modules/customers/backend/customers/deals/pipeline/page.js +1 -7
- package/dist/modules/customers/backend/customers/deals/pipeline/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/people/[id]/page.js +1 -2
- package/dist/modules/customers/backend/customers/people/[id]/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/people/page.js +1 -2
- package/dist/modules/customers/backend/customers/people/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/people-v2/[id]/page.js +10 -26
- package/dist/modules/customers/backend/customers/people-v2/[id]/page.js.map +2 -2
- package/dist/modules/customers/cli.js +11 -28
- package/dist/modules/customers/cli.js.map +2 -2
- package/dist/modules/customers/commands/deals.js +10 -48
- package/dist/modules/customers/commands/deals.js.map +2 -2
- package/dist/modules/customers/commands/people.js +0 -2
- package/dist/modules/customers/commands/people.js.map +2 -2
- package/dist/modules/customers/components/CustomerTodosTable.js +1 -2
- package/dist/modules/customers/components/CustomerTodosTable.js.map +2 -2
- package/dist/modules/customers/components/detail/ActiveDealCard.js +1 -2
- package/dist/modules/customers/components/detail/ActiveDealCard.js.map +2 -2
- package/dist/modules/customers/components/detail/ActivitiesDayStrip.js +3 -2
- package/dist/modules/customers/components/detail/ActivitiesDayStrip.js.map +2 -2
- package/dist/modules/customers/components/detail/CompanyDetailTabs.js +6 -26
- package/dist/modules/customers/components/detail/CompanyDetailTabs.js.map +2 -2
- package/dist/modules/customers/components/detail/CompanyKpiBar.js +5 -6
- package/dist/modules/customers/components/detail/CompanyKpiBar.js.map +2 -2
- package/dist/modules/customers/components/detail/ConfirmDealLostDialog.js +1 -1
- package/dist/modules/customers/components/detail/ConfirmDealLostDialog.js.map +1 -1
- package/dist/modules/customers/components/detail/DealDetailTabs.js +8 -30
- package/dist/modules/customers/components/detail/DealDetailTabs.js.map +2 -2
- package/dist/modules/customers/components/detail/DealForm.js +1 -2
- package/dist/modules/customers/components/detail/DealForm.js.map +2 -2
- package/dist/modules/customers/components/detail/DealsSection.js +1 -1
- package/dist/modules/customers/components/detail/DealsSection.js.map +2 -2
- package/dist/modules/customers/components/detail/PersonDetailTabs.js +8 -30
- package/dist/modules/customers/components/detail/PersonDetailTabs.js.map +2 -2
- package/dist/modules/customers/components/detail/ScheduleActivityDialog.js +216 -231
- package/dist/modules/customers/components/detail/ScheduleActivityDialog.js.map +2 -2
- package/dist/modules/customers/components/detail/dashboard/helpers.js +3 -4
- package/dist/modules/customers/components/detail/dashboard/helpers.js.map +2 -2
- package/dist/modules/customers/components/formConfig.js +10 -14
- package/dist/modules/customers/components/formConfig.js.map +2 -2
- package/dist/modules/customers/data/entities.js +0 -8
- package/dist/modules/customers/data/entities.js.map +2 -2
- package/dist/modules/customers/data/validators.js +2 -5
- package/dist/modules/customers/data/validators.js.map +2 -2
- package/dist/modules/customers/lib/calendar/format.js +4 -8
- package/dist/modules/customers/lib/calendar/format.js.map +2 -2
- package/dist/modules/customers/lib/visibilityFilter.js +4 -6
- package/dist/modules/customers/lib/visibilityFilter.js.map +2 -2
- package/dist/modules/customers/search.js +29 -50
- package/dist/modules/customers/search.js.map +2 -2
- package/dist/modules/dashboards/api/layout/[itemId]/route.js +3 -6
- package/dist/modules/dashboards/api/layout/[itemId]/route.js.map +2 -2
- package/dist/modules/dashboards/api/layout/route.js +9 -22
- package/dist/modules/dashboards/api/layout/route.js.map +2 -2
- package/dist/modules/dashboards/api/roles/widgets/route.js +3 -9
- package/dist/modules/dashboards/api/roles/widgets/route.js.map +2 -2
- package/dist/modules/dashboards/api/users/widgets/route.js +3 -9
- package/dist/modules/dashboards/api/users/widgets/route.js.map +2 -2
- package/dist/modules/dashboards/api/widgets/catalog.js +3 -6
- package/dist/modules/dashboards/api/widgets/catalog.js.map +2 -2
- package/dist/modules/dashboards/api/widgets/data/batch/route.js +3 -12
- package/dist/modules/dashboards/api/widgets/data/batch/route.js.map +2 -2
- package/dist/modules/dashboards/api/widgets/data/route.js +3 -28
- package/dist/modules/dashboards/api/widgets/data/route.js.map +2 -2
- package/dist/modules/dashboards/api/widgets/data/schema.js +18 -28
- package/dist/modules/dashboards/api/widgets/data/schema.js.map +2 -2
- package/dist/modules/dashboards/lib/access.js +3 -5
- package/dist/modules/dashboards/lib/access.js.map +2 -2
- package/dist/modules/dashboards/lib/aggregations.js +46 -113
- package/dist/modules/dashboards/lib/aggregations.js.map +2 -2
- package/dist/modules/dashboards/lib/formatters.js +11 -84
- package/dist/modules/dashboards/lib/formatters.js.map +2 -2
- package/dist/modules/dashboards/services/widgetDataService.js +14 -316
- package/dist/modules/dashboards/services/widgetDataService.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/aov-kpi/widget.client.js +3 -9
- package/dist/modules/dashboards/widgets/dashboard/aov-kpi/widget.client.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/pipeline-summary/config.js +2 -52
- package/dist/modules/dashboards/widgets/dashboard/pipeline-summary/config.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/pipeline-summary/widget.client.js +30 -52
- package/dist/modules/dashboards/widgets/dashboard/pipeline-summary/widget.client.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/pipeline-summary/widget.js +2 -2
- package/dist/modules/dashboards/widgets/dashboard/pipeline-summary/widget.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/revenue-kpi/widget.client.js +3 -9
- package/dist/modules/dashboards/widgets/dashboard/revenue-kpi/widget.client.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/revenue-trend/widget.client.js +3 -8
- package/dist/modules/dashboards/widgets/dashboard/revenue-trend/widget.client.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/sales-by-region/widget.client.js +18 -26
- package/dist/modules/dashboards/widgets/dashboard/sales-by-region/widget.client.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/top-customers/widget.client.js +14 -22
- package/dist/modules/dashboards/widgets/dashboard/top-customers/widget.client.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/top-products/widget.client.js +4 -10
- package/dist/modules/dashboards/widgets/dashboard/top-products/widget.client.js.map +2 -2
- package/dist/modules/data_sync/api/mappings/[id]/route.js +9 -22
- package/dist/modules/data_sync/api/mappings/[id]/route.js.map +2 -2
- package/dist/modules/data_sync/api/mappings/route.js +4 -13
- package/dist/modules/data_sync/api/mappings/route.js.map +2 -2
- package/dist/modules/data_sync/api/options.js +2 -7
- package/dist/modules/data_sync/api/options.js.map +2 -2
- package/dist/modules/data_sync/api/run.js +2 -7
- package/dist/modules/data_sync/api/run.js.map +2 -2
- package/dist/modules/data_sync/api/runs/[id]/cancel.js +3 -8
- package/dist/modules/data_sync/api/runs/[id]/cancel.js.map +2 -2
- package/dist/modules/data_sync/api/runs/[id]/retry.js +2 -7
- package/dist/modules/data_sync/api/runs/[id]/retry.js.map +2 -2
- package/dist/modules/data_sync/api/runs/[id]/route.js +3 -8
- package/dist/modules/data_sync/api/runs/[id]/route.js.map +2 -2
- package/dist/modules/data_sync/api/runs.js +2 -7
- package/dist/modules/data_sync/api/runs.js.map +2 -2
- package/dist/modules/data_sync/api/schedules/[id]/route.js +6 -19
- package/dist/modules/data_sync/api/schedules/[id]/route.js.map +2 -2
- package/dist/modules/data_sync/api/schedules/route.js +4 -13
- package/dist/modules/data_sync/api/schedules/route.js.map +2 -2
- package/dist/modules/data_sync/api/validate.js +4 -9
- package/dist/modules/data_sync/api/validate.js.map +2 -2
- package/dist/modules/data_sync/backend/data-sync/page.js +1 -2
- package/dist/modules/data_sync/backend/data-sync/page.js.map +2 -2
- package/dist/modules/data_sync/lib/queue.js +1 -16
- package/dist/modules/data_sync/lib/queue.js.map +2 -2
- package/dist/modules/data_sync/lib/start-run.js +1 -2
- package/dist/modules/data_sync/lib/start-run.js.map +2 -2
- package/dist/modules/data_sync/lib/sync-engine.js +2 -35
- package/dist/modules/data_sync/lib/sync-engine.js.map +2 -2
- package/dist/modules/data_sync/lib/sync-run-service.js +2 -70
- package/dist/modules/data_sync/lib/sync-run-service.js.map +2 -2
- package/dist/modules/data_sync/workers/sync-export.js +2 -9
- package/dist/modules/data_sync/workers/sync-export.js.map +2 -2
- package/dist/modules/data_sync/workers/sync-import.js +2 -9
- package/dist/modules/data_sync/workers/sync-import.js.map +2 -2
- package/dist/modules/dictionaries/api/[dictionaryId]/entries/route.js +12 -34
- package/dist/modules/dictionaries/api/[dictionaryId]/entries/route.js.map +2 -2
- package/dist/modules/dictionaries/api/openapi.js +2 -15
- package/dist/modules/dictionaries/api/openapi.js.map +2 -2
- package/dist/modules/dictionaries/components/DictionaryEntrySelect.js +1 -1
- package/dist/modules/dictionaries/components/DictionaryEntrySelect.js.map +2 -2
- package/dist/modules/dictionaries/components/hooks/useDictionaryEntries.js +29 -30
- package/dist/modules/dictionaries/components/hooks/useDictionaryEntries.js.map +2 -2
- package/dist/modules/dictionaries/data/validators.js +0 -7
- package/dist/modules/dictionaries/data/validators.js.map +2 -2
- package/dist/modules/dictionaries/lib/clientEntries.js +3 -4
- package/dist/modules/dictionaries/lib/clientEntries.js.map +2 -2
- package/dist/modules/directory/api/organization-branding/route.js +3 -10
- package/dist/modules/directory/api/organization-branding/route.js.map +2 -2
- package/dist/modules/directory/api/organization-switcher/route.js +20 -84
- package/dist/modules/directory/api/organization-switcher/route.js.map +2 -2
- package/dist/modules/directory/api/organizations/route.js +0 -7
- package/dist/modules/directory/api/organizations/route.js.map +3 -3
- package/dist/modules/directory/api/tenants/route.js +2 -8
- package/dist/modules/directory/api/tenants/route.js.map +2 -2
- package/dist/modules/directory/backend/directory/branding/page.js +8 -31
- package/dist/modules/directory/backend/directory/branding/page.js.map +2 -2
- package/dist/modules/directory/backend/directory/organizations/[id]/edit/page.js +16 -7
- package/dist/modules/directory/backend/directory/organizations/[id]/edit/page.js.map +2 -2
- package/dist/modules/directory/backend/directory/organizations/page.js +1 -2
- package/dist/modules/directory/backend/directory/organizations/page.js.map +2 -2
- package/dist/modules/directory/backend/directory/tenants/page.js +1 -2
- package/dist/modules/directory/backend/directory/tenants/page.js.map +2 -2
- package/dist/modules/directory/commands/organizations.js +1 -8
- package/dist/modules/directory/commands/organizations.js.map +2 -2
- package/dist/modules/directory/commands/tenants.js +0 -6
- package/dist/modules/directory/commands/tenants.js.map +2 -2
- package/dist/modules/directory/data/entities.js +0 -4
- package/dist/modules/directory/data/entities.js.map +2 -2
- package/dist/modules/directory/data/validators.js +0 -2
- package/dist/modules/directory/data/validators.js.map +2 -2
- package/dist/modules/directory/subscribers/invalidateOrgScopeCache.js +1 -5
- package/dist/modules/directory/subscribers/invalidateOrgScopeCache.js.map +2 -2
- package/dist/modules/directory/utils/organizationScope.js +3 -11
- package/dist/modules/directory/utils/organizationScope.js.map +2 -2
- package/dist/modules/entities/api/definitions.js +3 -53
- package/dist/modules/entities/api/definitions.js.map +2 -2
- package/dist/modules/entities/api/entities.js +2 -21
- package/dist/modules/entities/api/entities.js.map +2 -2
- package/dist/modules/entities/api/entity-settings.js +9 -59
- package/dist/modules/entities/api/entity-settings.js.map +2 -2
- package/dist/modules/entities/api/records.js +24 -3
- package/dist/modules/entities/api/records.js.map +2 -2
- package/dist/modules/entities/api/relations/options.js +16 -11
- package/dist/modules/entities/api/relations/options.js.map +2 -2
- package/dist/modules/entities/api/sidebar-entities.js +12 -34
- package/dist/modules/entities/api/sidebar-entities.js.map +2 -2
- package/dist/modules/entities/backend/entities/user/[entityId]/records/page.js +4 -23
- package/dist/modules/entities/backend/entities/user/[entityId]/records/page.js.map +2 -2
- package/dist/modules/entities/backend/entities/user/create/page.js +7 -16
- package/dist/modules/entities/backend/entities/user/create/page.js.map +2 -2
- package/dist/modules/entities/cli.js +19 -193
- package/dist/modules/entities/cli.js.map +2 -2
- package/dist/modules/entities/components/SystemEntitiesTable.js +1 -2
- package/dist/modules/entities/components/SystemEntitiesTable.js.map +2 -2
- package/dist/modules/entities/components/UserEntitiesTable.js +1 -2
- package/dist/modules/entities/components/UserEntitiesTable.js.map +2 -2
- package/dist/modules/entities/lib/entityAcl.js +9 -87
- package/dist/modules/entities/lib/entityAcl.js.map +3 -3
- package/dist/modules/feature_toggles/components/FeatureGuard.js +2 -3
- package/dist/modules/feature_toggles/components/FeatureGuard.js.map +2 -2
- package/dist/modules/feature_toggles/components/hooks/useFeatureFlagBoolean.js +2 -5
- package/dist/modules/feature_toggles/components/hooks/useFeatureFlagBoolean.js.map +2 -2
- package/dist/modules/feature_toggles/components/hooks/useFeatureFlagJson.js +2 -5
- package/dist/modules/feature_toggles/components/hooks/useFeatureFlagJson.js.map +2 -2
- package/dist/modules/feature_toggles/components/hooks/useFeatureFlagNumber.js +2 -5
- package/dist/modules/feature_toggles/components/hooks/useFeatureFlagNumber.js.map +2 -2
- package/dist/modules/feature_toggles/components/hooks/useFeatureFlagString.js +2 -5
- package/dist/modules/feature_toggles/components/hooks/useFeatureFlagString.js.map +2 -2
- package/dist/modules/inbox_ops/ai-tools.js +2 -5
- package/dist/modules/inbox_ops/ai-tools.js.map +2 -2
- package/dist/modules/inbox_ops/api/proposals/[id]/actions/[actionId]/route.js +1 -14
- package/dist/modules/inbox_ops/api/proposals/[id]/actions/[actionId]/route.js.map +2 -2
- package/dist/modules/inbox_ops/api/proposals/route.js +1 -16
- package/dist/modules/inbox_ops/api/proposals/route.js.map +2 -2
- package/dist/modules/inbox_ops/api/webhook/inbound.js +10 -14
- package/dist/modules/inbox_ops/api/webhook/inbound.js.map +2 -2
- package/dist/modules/inbox_ops/backend/inbox-ops/log/page.js +6 -6
- package/dist/modules/inbox_ops/backend/inbox-ops/log/page.js.map +2 -2
- package/dist/modules/inbox_ops/components/proposals/EditActionDialog.js +20 -25
- package/dist/modules/inbox_ops/components/proposals/EditActionDialog.js.map +2 -2
- package/dist/modules/inbox_ops/search.js +4 -15
- package/dist/modules/inbox_ops/search.js.map +2 -2
- package/dist/modules/integrations/api/[id]/credentials/route.js +5 -11
- package/dist/modules/integrations/api/[id]/credentials/route.js.map +2 -2
- package/dist/modules/integrations/api/[id]/health/route.js +3 -6
- package/dist/modules/integrations/api/[id]/health/route.js.map +2 -2
- package/dist/modules/integrations/api/[id]/route.js +3 -6
- package/dist/modules/integrations/api/[id]/route.js.map +2 -2
- package/dist/modules/integrations/api/[id]/state/route.js +3 -6
- package/dist/modules/integrations/api/[id]/state/route.js.map +2 -2
- package/dist/modules/integrations/api/[id]/version/route.js +3 -6
- package/dist/modules/integrations/api/[id]/version/route.js.map +2 -2
- package/dist/modules/integrations/api/logs/route.js +3 -6
- package/dist/modules/integrations/api/logs/route.js.map +2 -2
- package/dist/modules/integrations/api/route.js +3 -6
- package/dist/modules/integrations/api/route.js.map +2 -2
- package/dist/modules/integrations/api/umes-read.js +2 -2
- package/dist/modules/integrations/api/umes-read.js.map +2 -2
- package/dist/modules/integrations/backend/integrations/[id]/page.js +4 -2
- package/dist/modules/integrations/backend/integrations/[id]/page.js.map +2 -2
- package/dist/modules/integrations/lib/organization-scope.js +9 -2
- package/dist/modules/integrations/lib/organization-scope.js.map +2 -2
- package/dist/modules/integrations/widgets/injection/external-ids/widget.client.js +5 -0
- package/dist/modules/integrations/widgets/injection/external-ids/widget.client.js.map +2 -2
- package/dist/modules/messages/api/[id]/route.js +0 -15
- package/dist/modules/messages/api/[id]/route.js.map +2 -2
- package/dist/modules/messages/api/route.js +8 -77
- package/dist/modules/messages/api/route.js.map +2 -2
- package/dist/modules/messages/components/ComposeMessagePageClient.js +1 -2
- package/dist/modules/messages/components/ComposeMessagePageClient.js.map +2 -2
- package/dist/modules/messages/components/MessageDetailPageClient.js +2 -3
- package/dist/modules/messages/components/MessageDetailPageClient.js.map +2 -2
- package/dist/modules/messages/components/MessagesInboxPageClient.js +1 -2
- package/dist/modules/messages/components/MessagesInboxPageClient.js.map +2 -2
- package/dist/modules/messages/components/message-detail/panels/dialogs.js +1 -1
- package/dist/modules/messages/components/message-detail/panels/dialogs.js.map +1 -1
- package/dist/modules/messages/lib/routeHelpers.js +3 -1
- package/dist/modules/messages/lib/routeHelpers.js.map +2 -2
- package/dist/modules/messages/lib/searchLookup.js +16 -8
- package/dist/modules/messages/lib/searchLookup.js.map +2 -2
- package/dist/modules/messages/search.js +5 -10
- package/dist/modules/messages/search.js.map +2 -2
- package/dist/modules/notifications/api/route.js +4 -83
- package/dist/modules/notifications/api/route.js.map +2 -2
- package/dist/modules/notifications/api/unread-count/route.js +6 -25
- package/dist/modules/notifications/api/unread-count/route.js.map +2 -2
- package/dist/modules/notifications/di.js +1 -1
- package/dist/modules/notifications/di.js.map +2 -2
- package/dist/modules/notifications/events.js +2 -4
- package/dist/modules/notifications/events.js.map +2 -2
- package/dist/modules/notifications/lib/notificationRecipients.js +7 -6
- package/dist/modules/notifications/lib/notificationRecipients.js.map +2 -2
- package/dist/modules/notifications/lib/notificationService.js +4 -48
- package/dist/modules/notifications/lib/notificationService.js.map +2 -2
- package/dist/modules/notifications/lib/routeHelpers.js +2 -16
- package/dist/modules/notifications/lib/routeHelpers.js.map +2 -2
- package/dist/modules/payment_gateways/api/capture/route.js +1 -1
- package/dist/modules/payment_gateways/api/capture/route.js.map +2 -2
- package/dist/modules/payment_gateways/api/sessions/route.js +3 -6
- package/dist/modules/payment_gateways/api/sessions/route.js.map +2 -2
- package/dist/modules/payment_gateways/api/webhook/[provider]/route.js +1 -11
- package/dist/modules/payment_gateways/api/webhook/[provider]/route.js.map +2 -2
- package/dist/modules/payment_gateways/backend/payment-gateways/page.js +2 -3
- package/dist/modules/payment_gateways/backend/payment-gateways/page.js.map +2 -2
- package/dist/modules/payment_gateways/data/entities.js +0 -11
- package/dist/modules/payment_gateways/data/entities.js.map +2 -2
- package/dist/modules/payment_gateways/di.js +1 -17
- package/dist/modules/payment_gateways/di.js.map +2 -2
- package/dist/modules/payment_gateways/lib/gateway-service.js +14 -93
- package/dist/modules/payment_gateways/lib/gateway-service.js.map +2 -2
- package/dist/modules/payment_gateways/lib/payment-operation-idempotency.js +0 -1
- package/dist/modules/payment_gateways/lib/payment-operation-idempotency.js.map +2 -2
- package/dist/modules/payment_gateways/lib/session-idempotency.js +0 -33
- package/dist/modules/payment_gateways/lib/session-idempotency.js.map +2 -2
- package/dist/modules/payment_gateways/setup.js +0 -47
- package/dist/modules/payment_gateways/setup.js.map +2 -2
- package/dist/modules/planner/components/AvailabilityRulesEditor.js +4 -4
- package/dist/modules/planner/components/AvailabilityRulesEditor.js.map +2 -2
- package/dist/modules/planner/components/unavailabilityReasons.js +3 -3
- package/dist/modules/planner/components/unavailabilityReasons.js.map +2 -2
- package/dist/modules/portal/frontend/[orgSlug]/portal/dashboard/page.js +3 -3
- package/dist/modules/portal/frontend/[orgSlug]/portal/dashboard/page.js.map +2 -2
- package/dist/modules/portal/frontend/[orgSlug]/portal/login/page.js +3 -3
- package/dist/modules/portal/frontend/[orgSlug]/portal/login/page.js.map +2 -2
- package/dist/modules/portal/frontend/[orgSlug]/portal/page.js +3 -3
- package/dist/modules/portal/frontend/[orgSlug]/portal/page.js.map +2 -2
- package/dist/modules/portal/frontend/[orgSlug]/portal/profile/page.js +3 -3
- package/dist/modules/portal/frontend/[orgSlug]/portal/profile/page.js.map +2 -2
- package/dist/modules/portal/frontend/[orgSlug]/portal/reset-password/page.js +3 -3
- package/dist/modules/portal/frontend/[orgSlug]/portal/reset-password/page.js.map +2 -2
- package/dist/modules/portal/frontend/[orgSlug]/portal/signup/page.js +3 -3
- package/dist/modules/portal/frontend/[orgSlug]/portal/signup/page.js.map +2 -2
- package/dist/modules/progress/lib/progressService.js +0 -2
- package/dist/modules/progress/lib/progressService.js.map +2 -2
- package/dist/modules/progress/lib/progressServiceImpl.js +104 -322
- package/dist/modules/progress/lib/progressServiceImpl.js.map +2 -2
- package/dist/modules/query_index/api/openapi.js +1 -13
- package/dist/modules/query_index/api/openapi.js.map +2 -2
- package/dist/modules/query_index/api/reindex.js +0 -10
- package/dist/modules/query_index/api/reindex.js.map +2 -2
- package/dist/modules/query_index/api/status.js +105 -165
- package/dist/modules/query_index/api/status.js.map +2 -2
- package/dist/modules/query_index/cli.js +1 -125
- package/dist/modules/query_index/cli.js.map +2 -2
- package/dist/modules/query_index/components/QueryIndexesTable.js +42 -130
- package/dist/modules/query_index/components/QueryIndexesTable.js.map +2 -2
- package/dist/modules/query_index/data/entities.js +1 -2
- package/dist/modules/query_index/data/entities.js.map +2 -2
- package/dist/modules/query_index/di.js +0 -3
- package/dist/modules/query_index/di.js.map +2 -2
- package/dist/modules/query_index/lib/batch.js +4 -11
- package/dist/modules/query_index/lib/batch.js.map +2 -2
- package/dist/modules/query_index/lib/coverage.js +9 -21
- package/dist/modules/query_index/lib/coverage.js.map +2 -2
- package/dist/modules/query_index/lib/document.js +5 -12
- package/dist/modules/query_index/lib/document.js.map +2 -2
- package/dist/modules/query_index/lib/engine.js +48 -105
- package/dist/modules/query_index/lib/engine.js.map +2 -2
- package/dist/modules/query_index/lib/indexer.js +19 -95
- package/dist/modules/query_index/lib/indexer.js.map +2 -2
- package/dist/modules/query_index/lib/reindexer.js +37 -43
- package/dist/modules/query_index/lib/reindexer.js.map +2 -2
- package/dist/modules/query_index/lib/search-tokens.js +15 -34
- package/dist/modules/query_index/lib/search-tokens.js.map +2 -2
- package/dist/modules/query_index/lib/subscriber-scope.js +3 -2
- package/dist/modules/query_index/lib/subscriber-scope.js.map +2 -2
- package/dist/modules/query_index/subscribers/coverage_refresh.js +0 -4
- package/dist/modules/query_index/subscribers/coverage_refresh.js.map +2 -2
- package/dist/modules/query_index/subscribers/delete_one.js +1 -53
- package/dist/modules/query_index/subscribers/delete_one.js.map +3 -3
- package/dist/modules/query_index/subscribers/upsert_one.js +0 -60
- package/dist/modules/query_index/subscribers/upsert_one.js.map +3 -3
- package/dist/modules/resources/api/resources.js +0 -2
- package/dist/modules/resources/api/resources.js.map +2 -2
- package/dist/modules/resources/backend/resources/resource-types/page.js +1 -2
- package/dist/modules/resources/backend/resources/resource-types/page.js.map +2 -2
- package/dist/modules/resources/backend/resources/resources/[id]/page.js +2 -3
- package/dist/modules/resources/backend/resources/resources/[id]/page.js.map +2 -2
- package/dist/modules/resources/backend/resources/resources/page.js +1 -2
- package/dist/modules/resources/backend/resources/resources/page.js.map +2 -2
- package/dist/modules/resources/commands/resources.js +0 -9
- package/dist/modules/resources/commands/resources.js.map +2 -2
- package/dist/modules/resources/components/detail/dictionaries.js +3 -3
- package/dist/modules/resources/components/detail/dictionaries.js.map +2 -2
- package/dist/modules/resources/data/entities.js +0 -3
- package/dist/modules/resources/data/entities.js.map +2 -2
- package/dist/modules/resources/data/validators.js +2 -6
- package/dist/modules/resources/data/validators.js.map +2 -2
- package/dist/modules/resources/lib/seeds.js +9 -16
- package/dist/modules/resources/lib/seeds.js.map +2 -2
- package/dist/modules/sales/analytics.js +3 -7
- package/dist/modules/sales/analytics.js.map +2 -2
- package/dist/modules/sales/api/document-history/route.js +1 -2
- package/dist/modules/sales/api/document-history/route.js.map +2 -2
- package/dist/modules/sales/api/documents/factory.js +3 -14
- package/dist/modules/sales/api/documents/factory.js.map +2 -2
- package/dist/modules/sales/backend/sales/documents/[id]/page.js +3 -11
- package/dist/modules/sales/backend/sales/documents/[id]/page.js.map +2 -2
- package/dist/modules/sales/backend/sales/documents/create/page.js +14 -11
- package/dist/modules/sales/backend/sales/documents/create/page.js.map +2 -2
- package/dist/modules/sales/commands/documents.js +23 -184
- package/dist/modules/sales/commands/documents.js.map +2 -2
- package/dist/modules/sales/components/documents/ItemsSection.js +10 -20
- package/dist/modules/sales/components/documents/ItemsSection.js.map +2 -2
- package/dist/modules/sales/components/documents/LineItemDialog.js +5 -12
- package/dist/modules/sales/components/documents/LineItemDialog.js.map +2 -2
- package/dist/modules/sales/components/documents/SalesDocumentForm.js +2 -48
- package/dist/modules/sales/components/documents/SalesDocumentForm.js.map +2 -2
- package/dist/modules/sales/components/documents/SalesDocumentsTable.js +1 -4
- package/dist/modules/sales/components/documents/SalesDocumentsTable.js.map +2 -2
- package/dist/modules/sales/components/useSalesChannelsEnabled.js +35 -2
- package/dist/modules/sales/components/useSalesChannelsEnabled.js.map +2 -2
- package/dist/modules/sales/data/validators.js +5 -32
- package/dist/modules/sales/data/validators.js.map +2 -2
- package/dist/modules/sales/di.js +0 -7
- package/dist/modules/sales/di.js.map +2 -2
- package/dist/modules/sales/events.js +0 -1
- package/dist/modules/sales/events.js.map +2 -2
- package/dist/modules/sales/lib/historyHelpers.js +1 -69
- package/dist/modules/sales/lib/historyHelpers.js.map +2 -2
- package/dist/modules/sales/widgets/injection/document-history/widget.client.js +2 -51
- package/dist/modules/sales/widgets/injection/document-history/widget.client.js.map +2 -2
- package/dist/modules/sales/workflows.js +7 -10
- package/dist/modules/sales/workflows.js.map +2 -2
- package/dist/modules/shipping_carriers/api/webhook/[provider]/route.js +1 -11
- package/dist/modules/shipping_carriers/api/webhook/[provider]/route.js.map +2 -2
- package/dist/modules/shipping_carriers/lib/shipment-wizard/components/PackageEditor.js +1 -1
- package/dist/modules/shipping_carriers/lib/shipment-wizard/components/PackageEditor.js.map +1 -1
- package/dist/modules/staff/api/interceptors.js +3 -5
- package/dist/modules/staff/api/interceptors.js.map +2 -2
- package/dist/modules/staff/api/leave-requests.js +42 -45
- package/dist/modules/staff/api/leave-requests.js.map +2 -2
- package/dist/modules/staff/components/detail/dictionaries.js +3 -3
- package/dist/modules/staff/components/detail/dictionaries.js.map +2 -2
- package/dist/modules/sync_excel/api/upload/route.js +2 -15
- package/dist/modules/sync_excel/api/upload/route.js.map +2 -2
- package/dist/modules/wms/components/backend/ReleaseReservationDialog.js +1 -1
- package/dist/modules/wms/components/backend/ReleaseReservationDialog.js.map +1 -1
- package/dist/modules/wms/components/backend/WmsConfigurationPage.js +4 -5
- package/dist/modules/wms/components/backend/WmsConfigurationPage.js.map +2 -2
- package/dist/modules/wms/components/backend/WmsInventoryConsolePage.js +3 -4
- package/dist/modules/wms/components/backend/WmsInventoryConsolePage.js.map +2 -2
- package/dist/modules/wms/components/backend/WmsLocationDetailPage.js +2 -3
- package/dist/modules/wms/components/backend/WmsLocationDetailPage.js.map +2 -2
- package/dist/modules/wms/components/backend/WmsLotDetailPage.js +2 -3
- package/dist/modules/wms/components/backend/WmsLotDetailPage.js.map +2 -2
- package/dist/modules/wms/components/backend/WmsLotsListPage.js +1 -2
- package/dist/modules/wms/components/backend/WmsLotsListPage.js.map +2 -2
- package/dist/modules/wms/components/backend/WmsSkuDetailPage.js +2 -3
- package/dist/modules/wms/components/backend/WmsSkuDetailPage.js.map +2 -2
- package/dist/modules/workflows/backend/definitions/page.js +2 -3
- package/dist/modules/workflows/backend/definitions/page.js.map +2 -2
- package/dist/modules/workflows/backend/definitions/visual-editor/page.js +3 -6
- package/dist/modules/workflows/backend/definitions/visual-editor/page.js.map +2 -2
- package/dist/modules/workflows/backend/instances/page.js +9 -10
- package/dist/modules/workflows/backend/instances/page.js.map +2 -2
- package/dist/modules/workflows/backend/tasks/page.js +7 -8
- package/dist/modules/workflows/backend/tasks/page.js.map +2 -2
- package/dist/modules/workflows/components/ActivitiesEditor.js +13 -69
- package/dist/modules/workflows/components/ActivitiesEditor.js.map +2 -2
- package/dist/modules/workflows/components/BusinessRulesSelector.js +1 -1
- package/dist/modules/workflows/components/BusinessRulesSelector.js.map +2 -2
- package/dist/modules/workflows/components/DefinitionTriggersEditor.js +2 -2
- package/dist/modules/workflows/components/DefinitionTriggersEditor.js.map +2 -2
- package/dist/modules/workflows/components/EdgeEditDialogCrudForm.js +2 -1
- package/dist/modules/workflows/components/EdgeEditDialogCrudForm.js.map +2 -2
- package/dist/modules/workflows/components/NodeEditDialogCrudForm.js +2 -1
- package/dist/modules/workflows/components/NodeEditDialogCrudForm.js.map +2 -2
- package/dist/modules/workflows/components/StepsEditor.js +2 -2
- package/dist/modules/workflows/components/StepsEditor.js.map +2 -2
- package/dist/modules/workflows/components/TransitionsEditor.js +165 -207
- package/dist/modules/workflows/components/TransitionsEditor.js.map +2 -2
- package/dist/modules/workflows/components/WorkflowLegend.js +1 -1
- package/dist/modules/workflows/components/WorkflowLegend.js.map +2 -2
- package/dist/modules/workflows/components/WorkflowSelector.js +1 -1
- package/dist/modules/workflows/components/WorkflowSelector.js.map +2 -2
- package/dist/modules/workflows/components/fields/BusinessRuleConditionsEditor.js +1 -1
- package/dist/modules/workflows/components/fields/BusinessRuleConditionsEditor.js.map +2 -2
- package/dist/modules/workflows/components/fields/FormFieldArrayEditor.js +1 -1
- package/dist/modules/workflows/components/fields/FormFieldArrayEditor.js.map +2 -2
- package/dist/modules/workflows/components/fields/MappingArrayEditor.js +1 -1
- package/dist/modules/workflows/components/fields/MappingArrayEditor.js.map +2 -2
- package/dist/modules/workflows/components/fields/StartPreConditionsEditor.js +1 -1
- package/dist/modules/workflows/components/fields/StartPreConditionsEditor.js.map +2 -2
- package/dist/modules/workflows/components/fields/WorkflowSelectorField.js +4 -4
- package/dist/modules/workflows/components/fields/WorkflowSelectorField.js.map +2 -2
- package/dist/modules/workflows/data/validators.js +1 -34
- package/dist/modules/workflows/data/validators.js.map +3 -3
- package/dist/modules/workflows/events.js +0 -1
- package/dist/modules/workflows/events.js.map +2 -2
- package/dist/modules/workflows/lib/activity-executor.js +14 -59
- package/dist/modules/workflows/lib/activity-executor.js.map +2 -2
- package/dist/modules/workflows/lib/format-validation-error.js +1 -46
- package/dist/modules/workflows/lib/format-validation-error.js.map +2 -2
- package/dist/modules/workflows/widgets/injection/order-approval/widget.client.js +10 -21
- package/dist/modules/workflows/widgets/injection/order-approval/widget.client.js.map +2 -2
- package/generated/entities/customer_deal_person_link/index.ts +0 -1
- package/generated/entities/customer_user_invitation/index.ts +0 -1
- package/generated/entities/gateway_payment_operation/index.ts +0 -1
- package/generated/entities/gateway_transaction/index.ts +0 -1
- package/generated/entities/organization/index.ts +0 -1
- package/generated/entities/resources_resource/index.ts +0 -1
- package/generated/entities.ids.generated.ts +1 -3
- package/generated/entity-fields-registry.ts +0 -23
- package/package.json +18 -19
- package/src/bootstrap.ts +2 -17
- package/src/helpers/integration/salesFixtures.ts +2 -34
- package/src/helpers/integration/salesUi.ts +0 -8
- package/src/modules/api_keys/backend/api-keys/page.tsx +1 -2
- package/src/modules/attachments/api/route.ts +9 -130
- package/src/modules/attachments/data/entities.ts +0 -59
- package/src/modules/attachments/di.ts +1 -9
- package/src/modules/attachments/fields/attachment.tsx +1 -1
- package/src/modules/attachments/i18n/de.json +0 -15
- package/src/modules/attachments/i18n/en.json +0 -15
- package/src/modules/attachments/i18n/es.json +0 -15
- package/src/modules/attachments/i18n/pl.json +0 -15
- package/src/modules/attachments/lib/drivers/index.ts +1 -1
- package/src/modules/attachments/lib/drivers/localDriver.ts +8 -23
- package/src/modules/attachments/lib/drivers/types.ts +0 -5
- package/src/modules/attachments/lib/upload-limits.ts +0 -35
- package/src/modules/attachments/migrations/.snapshot-open-mercato.json +120 -648
- package/src/modules/audit_logs/api/audit-logs/access/route.ts +0 -5
- package/src/modules/audit_logs/api/audit-logs/actions/export/route.ts +0 -5
- package/src/modules/audit_logs/api/audit-logs/actions/route.ts +0 -5
- package/src/modules/audit_logs/components/AccessLogsTable.tsx +1 -2
- package/src/modules/audit_logs/components/AuditLogsActions.tsx +1 -2
- package/src/modules/auth/AGENTS.md +8 -12
- package/src/modules/auth/api/admin/nav.ts +4 -28
- package/src/modules/auth/api/profile/route.ts +2 -8
- package/src/modules/auth/api/users/route.ts +28 -8
- package/src/modules/auth/backend/auth/profile/page.tsx +0 -1
- package/src/modules/auth/backend/profile/change-password/page.tsx +0 -1
- package/src/modules/auth/backend/roles/page.tsx +1 -2
- package/src/modules/auth/backend/settings/page.tsx +8 -17
- package/src/modules/auth/backend/users/page.tsx +1 -2
- package/src/modules/auth/cli.ts +1 -1
- package/src/modules/auth/components/UserConsentsPanel.tsx +9 -9
- package/src/modules/auth/frontend/login.tsx +4 -5
- package/src/modules/auth/frontend/reset.tsx +2 -2
- package/src/modules/auth/i18n/de.json +0 -1
- package/src/modules/auth/i18n/en.json +0 -1
- package/src/modules/auth/i18n/es.json +0 -1
- package/src/modules/auth/i18n/pl.json +0 -1
- package/src/modules/auth/lib/backendChrome.tsx +33 -71
- package/src/modules/auth/lib/setup-app.ts +2 -21
- package/src/modules/auth/lib/tenantAccess.ts +0 -8
- package/src/modules/auth/services/rbacService.ts +46 -41
- package/src/modules/business_rules/api/rules/route.ts +4 -92
- package/src/modules/business_rules/backend/rules/page.tsx +1 -2
- package/src/modules/business_rules/components/ActionBuilder.tsx +5 -54
- package/src/modules/business_rules/components/ActionRow.tsx +18 -156
- package/src/modules/business_rules/components/ConditionRow.tsx +6 -9
- package/src/modules/business_rules/components/utils/actionValidation.ts +0 -6
- package/src/modules/business_rules/i18n/de.json +0 -12
- package/src/modules/business_rules/i18n/en.json +0 -12
- package/src/modules/business_rules/i18n/es.json +0 -12
- package/src/modules/business_rules/i18n/pl.json +0 -12
- package/src/modules/business_rules/lib/action-executor.ts +0 -198
- package/src/modules/business_rules/lib/rule-engine.ts +0 -4
- package/src/modules/catalog/backend/catalog/products/[id]/page.tsx +5 -6
- package/src/modules/catalog/backend/catalog/products/create/page.tsx +6 -7
- package/src/modules/catalog/components/PriceKindSettings.tsx +3 -3
- package/src/modules/catalog/components/categories/CategoriesDataTable.tsx +1 -2
- package/src/modules/catalog/components/products/ProductCategorizeSection.tsx +3 -3
- package/src/modules/catalog/components/products/ProductMediaManager.tsx +1 -1
- package/src/modules/catalog/components/products/ProductsDataTable.tsx +2 -3
- package/src/modules/catalog/components/products/VariantBuilder.tsx +5 -5
- package/src/modules/catalog/events.ts +0 -1
- package/src/modules/catalog/i18n/de.json +0 -18
- package/src/modules/catalog/i18n/en.json +0 -18
- package/src/modules/catalog/i18n/es.json +0 -18
- package/src/modules/catalog/i18n/pl.json +0 -18
- package/src/modules/catalog/widgets/injection/product-seo/widget.ts +1 -1
- package/src/modules/communication_channels/api/post/test-seed/route.ts +2 -69
- package/src/modules/communication_channels/api/post/webhook/[provider]/route.ts +1 -11
- package/src/modules/communication_channels/api/post/webhooks/gmail/route.ts +11 -17
- package/src/modules/communication_channels/backend/communication_channels/channels/page.tsx +1 -2
- package/src/modules/communication_channels/backend/profile/communication-channels/page.tsx +3 -4
- package/src/modules/communication_channels/data/enrichers.ts +26 -6
- package/src/modules/communication_channels/lib/access-control.ts +3 -3
- package/src/modules/configs/backend/config/system-status/page.tsx +1 -2
- package/src/modules/configs/lib/upgrade-actions.ts +0 -14
- package/src/modules/currencies/backend/currencies/page.tsx +1 -2
- package/src/modules/currencies/backend/exchange-rates/page.tsx +1 -2
- package/src/modules/currencies/di.ts +1 -4
- package/src/modules/currencies/i18n/de.json +0 -1
- package/src/modules/currencies/i18n/en.json +0 -1
- package/src/modules/currencies/i18n/es.json +0 -1
- package/src/modules/currencies/i18n/pl.json +0 -1
- package/src/modules/customer_accounts/AGENTS.md +3 -3
- package/src/modules/customer_accounts/api/admin/users/[id].ts +1 -16
- package/src/modules/customer_accounts/api/admin/users-invite.ts +3 -81
- package/src/modules/customer_accounts/api/invitations/accept.ts +2 -1
- package/src/modules/customer_accounts/api/login.ts +2 -4
- package/src/modules/customer_accounts/api/magic-link/verify.ts +2 -4
- package/src/modules/customer_accounts/api/portal/feature-check.ts +7 -5
- package/src/modules/customer_accounts/api/portal/nav.ts +3 -5
- package/src/modules/customer_accounts/api/portal/profile.ts +1 -5
- package/src/modules/customer_accounts/api/portal/sessions-refresh.ts +3 -3
- package/src/modules/customer_accounts/api/portal/users-invite.ts +1 -25
- package/src/modules/customer_accounts/backend/customer_accounts/roles/page.tsx +1 -2
- package/src/modules/customer_accounts/backend/customer_accounts/users/page.tsx +1 -2
- package/src/modules/customer_accounts/data/entities.ts +0 -3
- package/src/modules/customer_accounts/data/validators.ts +0 -1
- package/src/modules/customer_accounts/i18n/de.json +0 -6
- package/src/modules/customer_accounts/i18n/en.json +0 -6
- package/src/modules/customer_accounts/i18n/es.json +0 -6
- package/src/modules/customer_accounts/i18n/pl.json +0 -6
- package/src/modules/customer_accounts/lib/customerAuth.ts +2 -8
- package/src/modules/customer_accounts/lib/customerAuthServer.ts +0 -1
- package/src/modules/customer_accounts/lib/customerEntityOwnership.ts +2 -68
- package/src/modules/customer_accounts/lib/customerUrl.ts +11 -27
- package/src/modules/customer_accounts/migrations/.snapshot-open-mercato.json +0 -16
- package/src/modules/customer_accounts/services/customerInvitationService.ts +3 -56
- package/src/modules/customer_accounts/services/customerRbacService.ts +3 -16
- package/src/modules/customer_accounts/setup.ts +0 -7
- package/src/modules/customer_accounts/subscribers/autoLinkCrm.ts +8 -75
- package/src/modules/customer_accounts/widgets/injection/account-status/widget.client.tsx +2 -2
- package/src/modules/customer_accounts/widgets/injection/portal-ai-assistant-trigger/widget.client.tsx +3 -1
- package/src/modules/customer_accounts/widgets/injection-table.ts +1 -4
- package/src/modules/customers/analytics.ts +0 -3
- package/src/modules/customers/api/companies/[id]/route.ts +4 -3
- package/src/modules/customers/api/deals/[id]/people/route.ts +0 -3
- package/src/modules/customers/api/deals/[id]/route.ts +2 -10
- package/src/modules/customers/api/deals/aggregate/route.ts +4 -5
- package/src/modules/customers/api/deals/summary/route.ts +162 -15
- package/src/modules/customers/api/people/[id]/companies/enriched/route.ts +2 -3
- package/src/modules/customers/api/utils.ts +31 -12
- package/src/modules/customers/backend/customers/companies/[id]/page.tsx +1 -2
- package/src/modules/customers/backend/customers/companies/page.tsx +1 -2
- package/src/modules/customers/backend/customers/companies-v2/[id]/page.tsx +5 -17
- package/src/modules/customers/backend/customers/deals/[id]/hooks/types.ts +0 -1
- package/src/modules/customers/backend/customers/deals/[id]/page.tsx +12 -19
- package/src/modules/customers/backend/customers/deals/page.tsx +1 -2
- package/src/modules/customers/backend/customers/deals/pipeline/components/QuickDealDialog.tsx +3 -35
- package/src/modules/customers/backend/customers/deals/pipeline/page.tsx +1 -10
- package/src/modules/customers/backend/customers/people/[id]/page.tsx +1 -2
- package/src/modules/customers/backend/customers/people/page.tsx +1 -2
- package/src/modules/customers/backend/customers/people-v2/[id]/page.tsx +10 -29
- package/src/modules/customers/cli.ts +11 -28
- package/src/modules/customers/commands/deals.ts +9 -50
- package/src/modules/customers/commands/people.ts +0 -3
- package/src/modules/customers/components/CustomerTodosTable.tsx +1 -2
- package/src/modules/customers/components/detail/ActiveDealCard.tsx +1 -2
- package/src/modules/customers/components/detail/ActivitiesDayStrip.tsx +3 -2
- package/src/modules/customers/components/detail/CompanyDetailTabs.tsx +7 -30
- package/src/modules/customers/components/detail/CompanyKpiBar.tsx +5 -6
- package/src/modules/customers/components/detail/ConfirmDealLostDialog.tsx +1 -1
- package/src/modules/customers/components/detail/DealDetailTabs.tsx +9 -34
- package/src/modules/customers/components/detail/DealForm.tsx +1 -5
- package/src/modules/customers/components/detail/DealsSection.tsx +1 -1
- package/src/modules/customers/components/detail/PersonDetailTabs.tsx +9 -34
- package/src/modules/customers/components/detail/ScheduleActivityDialog.tsx +13 -28
- package/src/modules/customers/components/detail/dashboard/helpers.ts +3 -4
- package/src/modules/customers/components/formConfig.tsx +8 -12
- package/src/modules/customers/data/entities.ts +1 -9
- package/src/modules/customers/data/validators.ts +1 -6
- package/src/modules/customers/i18n/de.json +0 -72
- package/src/modules/customers/i18n/en.json +0 -72
- package/src/modules/customers/i18n/es.json +0 -72
- package/src/modules/customers/i18n/pl.json +0 -72
- package/src/modules/customers/lib/calendar/format.ts +4 -10
- package/src/modules/customers/lib/visibilityFilter.ts +5 -7
- package/src/modules/customers/migrations/.snapshot-open-mercato.json +1 -27
- package/src/modules/customers/search.ts +27 -59
- package/src/modules/dashboards/api/layout/[itemId]/route.ts +3 -6
- package/src/modules/dashboards/api/layout/route.ts +9 -22
- package/src/modules/dashboards/api/roles/widgets/route.ts +3 -9
- package/src/modules/dashboards/api/users/widgets/route.ts +3 -9
- package/src/modules/dashboards/api/widgets/catalog.ts +3 -6
- package/src/modules/dashboards/api/widgets/data/batch/route.ts +1 -12
- package/src/modules/dashboards/api/widgets/data/route.ts +1 -29
- package/src/modules/dashboards/api/widgets/data/schema.ts +19 -49
- package/src/modules/dashboards/i18n/de.json +0 -5
- package/src/modules/dashboards/i18n/en.json +0 -5
- package/src/modules/dashboards/i18n/es.json +0 -5
- package/src/modules/dashboards/i18n/pl.json +0 -5
- package/src/modules/dashboards/lib/access.ts +3 -5
- package/src/modules/dashboards/lib/aggregations.ts +48 -198
- package/src/modules/dashboards/lib/formatters.ts +12 -137
- package/src/modules/dashboards/services/widgetDataService.ts +12 -453
- package/src/modules/dashboards/widgets/dashboard/aov-kpi/widget.client.tsx +3 -9
- package/src/modules/dashboards/widgets/dashboard/pipeline-summary/config.ts +0 -86
- package/src/modules/dashboards/widgets/dashboard/pipeline-summary/widget.client.tsx +21 -42
- package/src/modules/dashboards/widgets/dashboard/pipeline-summary/widget.ts +2 -2
- package/src/modules/dashboards/widgets/dashboard/revenue-kpi/widget.client.tsx +3 -9
- package/src/modules/dashboards/widgets/dashboard/revenue-trend/widget.client.tsx +2 -7
- package/src/modules/dashboards/widgets/dashboard/sales-by-region/widget.client.tsx +15 -25
- package/src/modules/dashboards/widgets/dashboard/top-customers/widget.client.tsx +11 -21
- package/src/modules/dashboards/widgets/dashboard/top-products/widget.client.tsx +3 -9
- package/src/modules/data_sync/AGENTS.md +0 -1
- package/src/modules/data_sync/api/mappings/[id]/route.ts +9 -22
- package/src/modules/data_sync/api/mappings/route.ts +4 -13
- package/src/modules/data_sync/api/options.ts +2 -7
- package/src/modules/data_sync/api/run.ts +2 -7
- package/src/modules/data_sync/api/runs/[id]/cancel.ts +3 -8
- package/src/modules/data_sync/api/runs/[id]/retry.ts +2 -7
- package/src/modules/data_sync/api/runs/[id]/route.ts +3 -8
- package/src/modules/data_sync/api/runs.ts +2 -7
- package/src/modules/data_sync/api/schedules/[id]/route.ts +6 -19
- package/src/modules/data_sync/api/schedules/route.ts +4 -13
- package/src/modules/data_sync/api/validate.ts +4 -9
- package/src/modules/data_sync/backend/data-sync/page.tsx +1 -2
- package/src/modules/data_sync/lib/adapter.ts +0 -18
- package/src/modules/data_sync/lib/queue.ts +1 -19
- package/src/modules/data_sync/lib/start-run.ts +1 -2
- package/src/modules/data_sync/lib/sync-engine.ts +0 -46
- package/src/modules/data_sync/lib/sync-run-service.ts +1 -82
- package/src/modules/data_sync/workers/sync-export.ts +1 -8
- package/src/modules/data_sync/workers/sync-import.ts +1 -8
- package/src/modules/dictionaries/api/[dictionaryId]/entries/route.ts +11 -39
- package/src/modules/dictionaries/api/openapi.ts +0 -19
- package/src/modules/dictionaries/components/DictionaryEntrySelect.tsx +1 -1
- package/src/modules/dictionaries/components/hooks/useDictionaryEntries.ts +36 -35
- package/src/modules/dictionaries/data/validators.ts +0 -14
- package/src/modules/dictionaries/lib/clientEntries.ts +3 -4
- package/src/modules/directory/api/organization-branding/route.ts +1 -12
- package/src/modules/directory/api/organization-switcher/route.ts +26 -97
- package/src/modules/directory/api/organizations/route.ts +0 -7
- package/src/modules/directory/api/tenants/route.ts +1 -9
- package/src/modules/directory/backend/directory/branding/page.tsx +9 -34
- package/src/modules/directory/backend/directory/organizations/[id]/edit/page.tsx +14 -10
- package/src/modules/directory/backend/directory/organizations/page.tsx +1 -2
- package/src/modules/directory/backend/directory/tenants/page.tsx +1 -2
- package/src/modules/directory/commands/organizations.ts +1 -9
- package/src/modules/directory/commands/tenants.ts +0 -6
- package/src/modules/directory/data/entities.ts +0 -3
- package/src/modules/directory/data/validators.ts +0 -2
- package/src/modules/directory/i18n/de.json +1 -4
- package/src/modules/directory/i18n/en.json +1 -4
- package/src/modules/directory/i18n/es.json +1 -4
- package/src/modules/directory/i18n/pl.json +1 -4
- package/src/modules/directory/migrations/.snapshot-open-mercato.json +1 -18
- package/src/modules/directory/subscribers/invalidateOrgScopeCache.ts +1 -4
- package/src/modules/directory/utils/organizationScope.ts +3 -9
- package/src/modules/entities/api/definitions.ts +3 -55
- package/src/modules/entities/api/entities.ts +2 -30
- package/src/modules/entities/api/entity-settings.ts +22 -66
- package/src/modules/entities/api/records.ts +27 -3
- package/src/modules/entities/api/relations/options.ts +25 -11
- package/src/modules/entities/api/sidebar-entities.ts +14 -43
- package/src/modules/entities/backend/entities/user/[entityId]/records/page.tsx +75 -96
- package/src/modules/entities/backend/entities/user/create/page.tsx +7 -16
- package/src/modules/entities/cli.ts +21 -238
- package/src/modules/entities/components/SystemEntitiesTable.tsx +1 -2
- package/src/modules/entities/components/UserEntitiesTable.tsx +1 -2
- package/src/modules/entities/i18n/de.json +0 -9
- package/src/modules/entities/i18n/en.json +0 -9
- package/src/modules/entities/i18n/es.json +0 -9
- package/src/modules/entities/i18n/pl.json +0 -9
- package/src/modules/entities/lib/entityAcl.ts +11 -98
- package/src/modules/feature_toggles/components/FeatureGuard.tsx +2 -9
- package/src/modules/feature_toggles/components/hooks/useFeatureFlagBoolean.ts +1 -13
- package/src/modules/feature_toggles/components/hooks/useFeatureFlagJson.ts +3 -12
- package/src/modules/feature_toggles/components/hooks/useFeatureFlagNumber.ts +1 -10
- package/src/modules/feature_toggles/components/hooks/useFeatureFlagString.ts +1 -10
- package/src/modules/inbox_ops/ai-tools.ts +3 -5
- package/src/modules/inbox_ops/api/proposals/[id]/actions/[actionId]/route.ts +1 -17
- package/src/modules/inbox_ops/api/proposals/route.ts +1 -20
- package/src/modules/inbox_ops/api/webhook/inbound.ts +12 -14
- package/src/modules/inbox_ops/backend/inbox-ops/log/page.tsx +6 -6
- package/src/modules/inbox_ops/components/proposals/EditActionDialog.tsx +19 -24
- package/src/modules/inbox_ops/components/proposals/types.ts +0 -1
- package/src/modules/inbox_ops/i18n/de.json +0 -3
- package/src/modules/inbox_ops/i18n/en.json +0 -3
- package/src/modules/inbox_ops/i18n/es.json +0 -3
- package/src/modules/inbox_ops/i18n/pl.json +0 -3
- package/src/modules/inbox_ops/search.ts +4 -20
- package/src/modules/integrations/api/[id]/credentials/route.ts +5 -11
- package/src/modules/integrations/api/[id]/health/route.ts +3 -6
- package/src/modules/integrations/api/[id]/route.ts +3 -6
- package/src/modules/integrations/api/[id]/state/route.ts +3 -6
- package/src/modules/integrations/api/[id]/version/route.ts +3 -6
- package/src/modules/integrations/api/logs/route.ts +3 -6
- package/src/modules/integrations/api/route.ts +3 -6
- package/src/modules/integrations/api/umes-read.ts +2 -2
- package/src/modules/integrations/backend/integrations/[id]/page.tsx +2 -2
- package/src/modules/integrations/lib/organization-scope.ts +25 -5
- package/src/modules/integrations/widgets/injection/external-ids/widget.client.tsx +5 -0
- package/src/modules/messages/api/[id]/route.ts +0 -21
- package/src/modules/messages/api/route.ts +9 -109
- package/src/modules/messages/components/ComposeMessagePageClient.tsx +1 -2
- package/src/modules/messages/components/MessageDetailPageClient.tsx +2 -3
- package/src/modules/messages/components/MessagesInboxPageClient.tsx +1 -2
- package/src/modules/messages/components/message-detail/panels/dialogs.tsx +1 -1
- package/src/modules/messages/i18n/de.json +0 -2
- package/src/modules/messages/i18n/en.json +0 -2
- package/src/modules/messages/i18n/es.json +0 -2
- package/src/modules/messages/i18n/pl.json +0 -2
- package/src/modules/messages/lib/routeHelpers.ts +6 -4
- package/src/modules/messages/lib/searchLookup.ts +34 -11
- package/src/modules/messages/search.ts +5 -11
- package/src/modules/notifications/api/route.ts +3 -123
- package/src/modules/notifications/api/unread-count/route.ts +5 -42
- package/src/modules/notifications/di.ts +1 -1
- package/src/modules/notifications/events.ts +0 -2
- package/src/modules/notifications/lib/notificationRecipients.ts +8 -6
- package/src/modules/notifications/lib/notificationService.ts +1 -63
- package/src/modules/notifications/lib/routeHelpers.ts +2 -19
- package/src/modules/payment_gateways/api/capture/route.ts +1 -1
- package/src/modules/payment_gateways/api/sessions/route.ts +3 -6
- package/src/modules/payment_gateways/api/webhook/[provider]/route.ts +1 -13
- package/src/modules/payment_gateways/backend/payment-gateways/page.tsx +2 -3
- package/src/modules/payment_gateways/data/entities.ts +2 -13
- package/src/modules/payment_gateways/di.ts +2 -28
- package/src/modules/payment_gateways/i18n/de.json +1 -8
- package/src/modules/payment_gateways/i18n/en.json +1 -8
- package/src/modules/payment_gateways/i18n/es.json +1 -8
- package/src/modules/payment_gateways/i18n/pl.json +1 -8
- package/src/modules/payment_gateways/lib/gateway-service.ts +18 -114
- package/src/modules/payment_gateways/lib/payment-operation-idempotency.ts +0 -1
- package/src/modules/payment_gateways/lib/session-idempotency.ts +0 -36
- package/src/modules/payment_gateways/migrations/.snapshot-open-mercato.json +1 -44
- package/src/modules/payment_gateways/setup.ts +0 -62
- package/src/modules/planner/components/AvailabilityRulesEditor.tsx +4 -4
- package/src/modules/planner/components/unavailabilityReasons.ts +3 -3
- package/src/modules/portal/frontend/[orgSlug]/portal/dashboard/page.tsx +3 -3
- package/src/modules/portal/frontend/[orgSlug]/portal/login/page.tsx +3 -3
- package/src/modules/portal/frontend/[orgSlug]/portal/page.tsx +3 -3
- package/src/modules/portal/frontend/[orgSlug]/portal/profile/page.tsx +3 -3
- package/src/modules/portal/frontend/[orgSlug]/portal/reset-password/page.tsx +4 -4
- package/src/modules/portal/frontend/[orgSlug]/portal/signup/page.tsx +3 -3
- package/src/modules/portal/i18n/de.json +0 -18
- package/src/modules/portal/i18n/en.json +0 -18
- package/src/modules/portal/i18n/es.json +0 -18
- package/src/modules/portal/i18n/pl.json +0 -18
- package/src/modules/progress/AGENTS.md +1 -11
- package/src/modules/progress/lib/progressService.ts +0 -1
- package/src/modules/progress/lib/progressServiceImpl.ts +117 -385
- package/src/modules/query_index/api/openapi.ts +0 -12
- package/src/modules/query_index/api/reindex.ts +0 -15
- package/src/modules/query_index/api/status.ts +136 -238
- package/src/modules/query_index/cli.ts +1 -180
- package/src/modules/query_index/components/QueryIndexesTable.tsx +47 -194
- package/src/modules/query_index/data/entities.ts +0 -7
- package/src/modules/query_index/di.ts +0 -6
- package/src/modules/query_index/i18n/de.json +3 -5
- package/src/modules/query_index/i18n/en.json +3 -5
- package/src/modules/query_index/i18n/es.json +3 -5
- package/src/modules/query_index/i18n/pl.json +3 -5
- package/src/modules/query_index/lib/batch.ts +4 -11
- package/src/modules/query_index/lib/coverage.ts +14 -47
- package/src/modules/query_index/lib/document.ts +4 -35
- package/src/modules/query_index/lib/engine.ts +59 -136
- package/src/modules/query_index/lib/indexer.ts +21 -130
- package/src/modules/query_index/lib/reindexer.ts +40 -62
- package/src/modules/query_index/lib/search-tokens.ts +16 -48
- package/src/modules/query_index/lib/subscriber-scope.ts +7 -2
- package/src/modules/query_index/migrations/.snapshot-open-mercato.json +0 -12
- package/src/modules/query_index/subscribers/coverage_refresh.ts +0 -4
- package/src/modules/query_index/subscribers/delete_one.ts +1 -65
- package/src/modules/query_index/subscribers/upsert_one.ts +1 -68
- package/src/modules/resources/api/resources.ts +0 -2
- package/src/modules/resources/backend/resources/resource-types/page.tsx +1 -2
- package/src/modules/resources/backend/resources/resources/[id]/page.tsx +3 -9
- package/src/modules/resources/backend/resources/resources/page.tsx +1 -2
- package/src/modules/resources/commands/resources.ts +0 -10
- package/src/modules/resources/components/detail/dictionaries.ts +3 -3
- package/src/modules/resources/data/entities.ts +0 -3
- package/src/modules/resources/data/validators.ts +0 -5
- package/src/modules/resources/lib/seeds.ts +9 -16
- package/src/modules/resources/migrations/.snapshot-open-mercato.json +1 -17
- package/src/modules/sales/analytics.ts +0 -4
- package/src/modules/sales/api/document-history/route.ts +0 -1
- package/src/modules/sales/api/documents/factory.ts +3 -28
- package/src/modules/sales/backend/sales/documents/[id]/page.tsx +3 -11
- package/src/modules/sales/backend/sales/documents/create/page.tsx +4 -2
- package/src/modules/sales/commands/documents.ts +31 -298
- package/src/modules/sales/components/documents/ItemsSection.tsx +11 -21
- package/src/modules/sales/components/documents/LineItemDialog.tsx +5 -13
- package/src/modules/sales/components/documents/SalesDocumentForm.tsx +6 -48
- package/src/modules/sales/components/documents/SalesDocumentsTable.tsx +1 -6
- package/src/modules/sales/components/useSalesChannelsEnabled.ts +48 -2
- package/src/modules/sales/data/validators.ts +6 -59
- package/src/modules/sales/di.ts +0 -9
- package/src/modules/sales/events.ts +0 -1
- package/src/modules/sales/i18n/de.json +0 -22
- package/src/modules/sales/i18n/en.json +0 -22
- package/src/modules/sales/i18n/es.json +0 -22
- package/src/modules/sales/i18n/pl.json +0 -22
- package/src/modules/sales/lib/historyHelpers.ts +1 -88
- package/src/modules/sales/widgets/injection/document-history/widget.client.tsx +3 -64
- package/src/modules/sales/workflows.ts +7 -10
- package/src/modules/shipping_carriers/api/webhook/[provider]/route.ts +1 -11
- package/src/modules/shipping_carriers/lib/shipment-wizard/components/PackageEditor.tsx +1 -1
- package/src/modules/staff/api/interceptors.ts +4 -6
- package/src/modules/staff/api/leave-requests.ts +47 -54
- package/src/modules/staff/components/detail/dictionaries.ts +3 -3
- package/src/modules/sync_excel/api/upload/route.ts +2 -15
- package/src/modules/wms/components/backend/ReleaseReservationDialog.tsx +1 -1
- package/src/modules/wms/components/backend/WmsConfigurationPage.tsx +4 -5
- package/src/modules/wms/components/backend/WmsInventoryConsolePage.tsx +3 -4
- package/src/modules/wms/components/backend/WmsLocationDetailPage.tsx +2 -3
- package/src/modules/wms/components/backend/WmsLotDetailPage.tsx +2 -3
- package/src/modules/wms/components/backend/WmsLotsListPage.tsx +1 -2
- package/src/modules/wms/components/backend/WmsSkuDetailPage.tsx +2 -3
- package/src/modules/wms/i18n/de.json +0 -2
- package/src/modules/wms/i18n/en.json +0 -2
- package/src/modules/wms/i18n/es.json +0 -2
- package/src/modules/wms/i18n/pl.json +0 -2
- package/src/modules/workflows/backend/definitions/page.tsx +2 -3
- package/src/modules/workflows/backend/definitions/visual-editor/page.tsx +4 -13
- package/src/modules/workflows/backend/instances/page.tsx +9 -10
- package/src/modules/workflows/backend/tasks/page.tsx +7 -8
- package/src/modules/workflows/components/ActivitiesEditor.tsx +14 -98
- package/src/modules/workflows/components/BusinessRulesSelector.tsx +1 -1
- package/src/modules/workflows/components/DefinitionTriggersEditor.tsx +2 -2
- package/src/modules/workflows/components/EdgeEditDialogCrudForm.tsx +2 -1
- package/src/modules/workflows/components/NodeEditDialogCrudForm.tsx +2 -1
- package/src/modules/workflows/components/StepsEditor.tsx +2 -2
- package/src/modules/workflows/components/TransitionsEditor.tsx +20 -78
- package/src/modules/workflows/components/WorkflowLegend.tsx +1 -1
- package/src/modules/workflows/components/WorkflowSelector.tsx +1 -1
- package/src/modules/workflows/components/fields/BusinessRuleConditionsEditor.tsx +1 -1
- package/src/modules/workflows/components/fields/FormFieldArrayEditor.tsx +1 -1
- package/src/modules/workflows/components/fields/MappingArrayEditor.tsx +1 -1
- package/src/modules/workflows/components/fields/StartPreConditionsEditor.tsx +1 -1
- package/src/modules/workflows/components/fields/WorkflowSelectorField.tsx +4 -4
- package/src/modules/workflows/data/validators.ts +1 -52
- package/src/modules/workflows/events.ts +0 -1
- package/src/modules/workflows/i18n/de.json +0 -3
- package/src/modules/workflows/i18n/en.json +0 -3
- package/src/modules/workflows/i18n/es.json +0 -3
- package/src/modules/workflows/i18n/pl.json +0 -3
- package/src/modules/workflows/lib/activity-executor.ts +20 -99
- package/src/modules/workflows/lib/format-validation-error.ts +0 -60
- package/src/modules/workflows/widgets/injection/order-approval/widget.client.tsx +11 -27
- package/dist/generated/entities/attachment_quota_reservation/index.js +0 -33
- package/dist/generated/entities/attachment_quota_reservation/index.js.map +0 -7
- package/dist/modules/api_keys/extension-points.js +0 -16
- package/dist/modules/api_keys/extension-points.js.map +0 -7
- package/dist/modules/attachments/lib/quota-recovery-queue.js +0 -9
- package/dist/modules/attachments/lib/quota-recovery-queue.js.map +0 -7
- package/dist/modules/attachments/lib/quota-service.js +0 -224
- package/dist/modules/attachments/lib/quota-service.js.map +0 -7
- package/dist/modules/attachments/migrations/Migration20260709234741_attachments.js +0 -13
- package/dist/modules/attachments/migrations/Migration20260709234741_attachments.js.map +0 -7
- package/dist/modules/attachments/workers/quota-recovery.js +0 -45
- package/dist/modules/attachments/workers/quota-recovery.js.map +0 -7
- package/dist/modules/audit_logs/api/audit-logs/readScope.js +0 -12
- package/dist/modules/audit_logs/api/audit-logs/readScope.js.map +0 -7
- package/dist/modules/audit_logs/extension-points.js +0 -14
- package/dist/modules/audit_logs/extension-points.js.map +0 -7
- package/dist/modules/auth/extension-points.js +0 -21
- package/dist/modules/auth/extension-points.js.map +0 -7
- package/dist/modules/business_rules/api/openmercato-call-options/route.js +0 -85
- package/dist/modules/business_rules/api/openmercato-call-options/route.js.map +0 -7
- package/dist/modules/business_rules/events.js +0 -13
- package/dist/modules/business_rules/events.js.map +0 -7
- package/dist/modules/business_rules/extension-points.js +0 -13
- package/dist/modules/business_rules/extension-points.js.map +0 -7
- package/dist/modules/business_rules/lib/openmercato-call-options-types.js +0 -5
- package/dist/modules/business_rules/lib/openmercato-call-options-types.js.map +0 -7
- package/dist/modules/business_rules/lib/openmercato-call-options.js +0 -231
- package/dist/modules/business_rules/lib/openmercato-call-options.js.map +0 -7
- package/dist/modules/catalog/extension-points.js +0 -27
- package/dist/modules/catalog/extension-points.js.map +0 -7
- package/dist/modules/communication_channels/extension-points.js +0 -20
- package/dist/modules/communication_channels/extension-points.js.map +0 -7
- package/dist/modules/configs/extension-points.js +0 -18
- package/dist/modules/configs/extension-points.js.map +0 -7
- package/dist/modules/currencies/extension-points.js +0 -14
- package/dist/modules/currencies/extension-points.js.map +0 -7
- package/dist/modules/currencies/services/baseCurrencyService.js +0 -42
- package/dist/modules/currencies/services/baseCurrencyService.js.map +0 -7
- package/dist/modules/customer_accounts/emails/CustomerInvitationEmail.js +0 -26
- package/dist/modules/customer_accounts/emails/CustomerInvitationEmail.js.map +0 -7
- package/dist/modules/customer_accounts/extension-points.js +0 -14
- package/dist/modules/customer_accounts/extension-points.js.map +0 -7
- package/dist/modules/customer_accounts/lib/invitationEmail.js +0 -35
- package/dist/modules/customer_accounts/lib/invitationEmail.js.map +0 -7
- package/dist/modules/customer_accounts/migrations/Migration20260723120000_customer_accounts.js +0 -13
- package/dist/modules/customer_accounts/migrations/Migration20260723120000_customer_accounts.js.map +0 -7
- package/dist/modules/customers/extension-points.js +0 -42
- package/dist/modules/customers/extension-points.js.map +0 -7
- package/dist/modules/customers/lib/dealStatus.js +0 -38
- package/dist/modules/customers/lib/dealStatus.js.map +0 -7
- package/dist/modules/customers/lib/dealsSummaryQueries.js +0 -144
- package/dist/modules/customers/lib/dealsSummaryQueries.js.map +0 -7
- package/dist/modules/customers/lib/optionalBaseCurrency.js +0 -19
- package/dist/modules/customers/lib/optionalBaseCurrency.js.map +0 -7
- package/dist/modules/customers/migrations/Migration20260723210000_customers.js +0 -15
- package/dist/modules/customers/migrations/Migration20260723210000_customers.js.map +0 -7
- package/dist/modules/dashboards/components/UnlabelledAmountNotice.js +0 -33
- package/dist/modules/dashboards/components/UnlabelledAmountNotice.js.map +0 -7
- package/dist/modules/dashboards/lib/exactDecimal.js +0 -69
- package/dist/modules/dashboards/lib/exactDecimal.js.map +0 -7
- package/dist/modules/dashboards/lib/optionalBaseCurrency.js +0 -11
- package/dist/modules/dashboards/lib/optionalBaseCurrency.js.map +0 -7
- package/dist/modules/dashboards/subscribers/invalidateWidgetDataCache.js +0 -26
- package/dist/modules/dashboards/subscribers/invalidateWidgetDataCache.js.map +0 -7
- package/dist/modules/data_sync/extension-points.js +0 -13
- package/dist/modules/data_sync/extension-points.js.map +0 -7
- package/dist/modules/data_sync/lib/queue-policy.js +0 -15
- package/dist/modules/data_sync/lib/queue-policy.js.map +0 -7
- package/dist/modules/design_system/acl.js +0 -9
- package/dist/modules/design_system/acl.js.map +0 -7
- package/dist/modules/design_system/backend/design-system/page.js +0 -11
- package/dist/modules/design_system/backend/design-system/page.js.map +0 -7
- package/dist/modules/design_system/backend/design-system/page.meta.js +0 -15
- package/dist/modules/design_system/backend/design-system/page.meta.js.map +0 -7
- package/dist/modules/design_system/gallery/components/CodeSnippet.js +0 -52
- package/dist/modules/design_system/gallery/components/CodeSnippet.js.map +0 -7
- package/dist/modules/design_system/gallery/components/EntryCard.js +0 -63
- package/dist/modules/design_system/gallery/components/EntryCard.js.map +0 -7
- package/dist/modules/design_system/gallery/components/GalleryShell.js +0 -163
- package/dist/modules/design_system/gallery/components/GalleryShell.js.map +0 -7
- package/dist/modules/design_system/gallery/components/VariantPreview.js +0 -9
- package/dist/modules/design_system/gallery/components/VariantPreview.js.map +0 -7
- package/dist/modules/design_system/gallery/entries/banners.js +0 -186
- package/dist/modules/design_system/gallery/entries/banners.js.map +0 -7
- package/dist/modules/design_system/gallery/entries/buttons.js +0 -361
- package/dist/modules/design_system/gallery/entries/buttons.js.map +0 -7
- package/dist/modules/design_system/gallery/entries/charts.js +0 -457
- package/dist/modules/design_system/gallery/entries/charts.js.map +0 -7
- package/dist/modules/design_system/gallery/entries/dates.js +0 -306
- package/dist/modules/design_system/gallery/entries/dates.js.map +0 -7
- package/dist/modules/design_system/gallery/entries/detail.js +0 -358
- package/dist/modules/design_system/gallery/entries/detail.js.map +0 -7
- package/dist/modules/design_system/gallery/entries/display.js +0 -785
- package/dist/modules/design_system/gallery/entries/display.js.map +0 -7
- package/dist/modules/design_system/gallery/entries/feedback.js +0 -658
- package/dist/modules/design_system/gallery/entries/feedback.js.map +0 -7
- package/dist/modules/design_system/gallery/entries/filters.js +0 -505
- package/dist/modules/design_system/gallery/entries/filters.js.map +0 -7
- package/dist/modules/design_system/gallery/entries/foundations.js +0 -453
- package/dist/modules/design_system/gallery/entries/foundations.js.map +0 -7
- package/dist/modules/design_system/gallery/entries/icons.js +0 -140
- package/dist/modules/design_system/gallery/entries/icons.js.map +0 -7
- package/dist/modules/design_system/gallery/entries/inputs.js +0 -1217
- package/dist/modules/design_system/gallery/entries/inputs.js.map +0 -7
- package/dist/modules/design_system/gallery/entries/messages.js +0 -334
- package/dist/modules/design_system/gallery/entries/messages.js.map +0 -7
- package/dist/modules/design_system/gallery/entries/navigation.js +0 -475
- package/dist/modules/design_system/gallery/entries/navigation.js.map +0 -7
- package/dist/modules/design_system/gallery/entries/notifications.js +0 -257
- package/dist/modules/design_system/gallery/entries/notifications.js.map +0 -7
- package/dist/modules/design_system/gallery/entries/overlays.js +0 -576
- package/dist/modules/design_system/gallery/entries/overlays.js.map +0 -7
- package/dist/modules/design_system/gallery/entries/scaffolding.js +0 -378
- package/dist/modules/design_system/gallery/entries/scaffolding.js.map +0 -7
- package/dist/modules/design_system/gallery/entries/schedule.js +0 -297
- package/dist/modules/design_system/gallery/entries/schedule.js.map +0 -7
- package/dist/modules/design_system/gallery/registry.js +0 -139
- package/dist/modules/design_system/gallery/registry.js.map +0 -7
- package/dist/modules/design_system/gallery/types.js +0 -1
- package/dist/modules/design_system/gallery/types.js.map +0 -7
- package/dist/modules/design_system/index.js +0 -9
- package/dist/modules/design_system/index.js.map +0 -7
- package/dist/modules/design_system/setup.js +0 -14
- package/dist/modules/design_system/setup.js.map +0 -7
- package/dist/modules/dictionaries/lib/fetchAllEntries.js +0 -43
- package/dist/modules/dictionaries/lib/fetchAllEntries.js.map +0 -7
- package/dist/modules/directory/extension-points.js +0 -14
- package/dist/modules/directory/extension-points.js.map +0 -7
- package/dist/modules/directory/migrations/Migration20260626145500_directory_logo_preserve_aspect_ratio.js +0 -13
- package/dist/modules/directory/migrations/Migration20260626145500_directory_logo_preserve_aspect_ratio.js.map +0 -7
- package/dist/modules/entities/backend/config/settings/page.js +0 -10
- package/dist/modules/entities/backend/config/settings/page.js.map +0 -7
- package/dist/modules/entities/backend/config/settings/page.meta.js +0 -36
- package/dist/modules/entities/backend/config/settings/page.meta.js.map +0 -7
- package/dist/modules/entities/components/EntitySettingsManager.js +0 -136
- package/dist/modules/entities/components/EntitySettingsManager.js.map +0 -7
- package/dist/modules/entities/components/RecordListRelationCell.js +0 -63
- package/dist/modules/entities/components/RecordListRelationCell.js.map +0 -7
- package/dist/modules/entities/components/recordListRelationDisplays.js +0 -80
- package/dist/modules/entities/components/recordListRelationDisplays.js.map +0 -7
- package/dist/modules/entities/extension-points.js +0 -21
- package/dist/modules/entities/extension-points.js.map +0 -7
- package/dist/modules/feature_toggles/components/hooks/staleTime.js +0 -5
- package/dist/modules/feature_toggles/components/hooks/staleTime.js.map +0 -7
- package/dist/modules/inbox_ops/subscribers/search-reindex-proposal-created.js +0 -32
- package/dist/modules/inbox_ops/subscribers/search-reindex-proposal-created.js.map +0 -7
- package/dist/modules/integrations/extension-points.js +0 -30
- package/dist/modules/integrations/extension-points.js.map +0 -7
- package/dist/modules/integrations/widgets/injection/external-ids/widget.js +0 -14
- package/dist/modules/integrations/widgets/injection/external-ids/widget.js.map +0 -7
- package/dist/modules/messages/extension-points.js +0 -16
- package/dist/modules/messages/extension-points.js.map +0 -7
- package/dist/modules/messages/lib/participantScope.js +0 -15
- package/dist/modules/messages/lib/participantScope.js.map +0 -7
- package/dist/modules/notifications/lib/notificationScope.js +0 -26
- package/dist/modules/notifications/lib/notificationScope.js.map +0 -7
- package/dist/modules/payment_gateways/extension-points.js +0 -19
- package/dist/modules/payment_gateways/extension-points.js.map +0 -7
- package/dist/modules/payment_gateways/lib/capture-ledger.js +0 -183
- package/dist/modules/payment_gateways/lib/capture-ledger.js.map +0 -7
- package/dist/modules/payment_gateways/lib/order-amount-reconciliation.js +0 -58
- package/dist/modules/payment_gateways/lib/order-amount-reconciliation.js.map +0 -7
- package/dist/modules/payment_gateways/migrations/Migration20260725101500_payment_gateways.js +0 -16
- package/dist/modules/payment_gateways/migrations/Migration20260725101500_payment_gateways.js.map +0 -7
- package/dist/modules/payment_gateways/migrations/Migration20260803103035_payment_gateways.js +0 -18
- package/dist/modules/payment_gateways/migrations/Migration20260803103035_payment_gateways.js.map +0 -7
- package/dist/modules/payment_gateways/workers/session-initialization-prune.js +0 -50
- package/dist/modules/payment_gateways/workers/session-initialization-prune.js.map +0 -7
- package/dist/modules/portal/extension-points.js +0 -32
- package/dist/modules/portal/extension-points.js.map +0 -7
- package/dist/modules/portal/frontend/[orgSlug]/portal/invite/page.js +0 -134
- package/dist/modules/portal/frontend/[orgSlug]/portal/invite/page.js.map +0 -7
- package/dist/modules/portal/frontend/[orgSlug]/portal/invite/page.meta.js +0 -11
- package/dist/modules/portal/frontend/[orgSlug]/portal/invite/page.meta.js.map +0 -7
- package/dist/modules/portal/lib/navigation.js +0 -7
- package/dist/modules/portal/lib/navigation.js.map +0 -7
- package/dist/modules/query_index/events.js +0 -20
- package/dist/modules/query_index/events.js.map +0 -7
- package/dist/modules/query_index/extension-points.js +0 -13
- package/dist/modules/query_index/extension-points.js.map +0 -7
- package/dist/modules/query_index/migrations/Migration20260731105052_query_index.js +0 -17
- package/dist/modules/query_index/migrations/Migration20260731105052_query_index.js.map +0 -7
- package/dist/modules/resources/extension-points.js +0 -14
- package/dist/modules/resources/extension-points.js.map +0 -7
- package/dist/modules/resources/migrations/Migration20260608231000.js +0 -13
- package/dist/modules/resources/migrations/Migration20260608231000.js.map +0 -7
- package/dist/modules/sales/components/documents/SalesOrderDraftLines.js +0 -167
- package/dist/modules/sales/components/documents/SalesOrderDraftLines.js.map +0 -7
- package/dist/modules/sales/extension-points.js +0 -36
- package/dist/modules/sales/extension-points.js.map +0 -7
- package/dist/modules/sales/services/paymentOrderTotalResolver.js +0 -52
- package/dist/modules/sales/services/paymentOrderTotalResolver.js.map +0 -7
- package/dist/modules/wms/extension-points.js +0 -26
- package/dist/modules/wms/extension-points.js.map +0 -7
- package/dist/modules/workflows/extension-points.js +0 -15
- package/dist/modules/workflows/extension-points.js.map +0 -7
- package/dist/modules/workflows/widgets/injection/order-approval/context-keys.js +0 -10
- package/dist/modules/workflows/widgets/injection/order-approval/context-keys.js.map +0 -7
- package/generated/entities/attachment_quota_reservation/index.ts +0 -15
- package/src/modules/api_keys/extension-points.ts +0 -13
- package/src/modules/api_keys/i18n/ko.json +0 -42
- package/src/modules/attachments/i18n/ko.json +0 -175
- package/src/modules/attachments/lib/quota-recovery-queue.ts +0 -16
- package/src/modules/attachments/lib/quota-service.ts +0 -442
- package/src/modules/attachments/migrations/Migration20260709234741_attachments.ts +0 -12
- package/src/modules/attachments/workers/quota-recovery.ts +0 -68
- package/src/modules/audit_logs/api/audit-logs/readScope.ts +0 -28
- package/src/modules/audit_logs/extension-points.ts +0 -11
- package/src/modules/audit_logs/i18n/ko.json +0 -66
- package/src/modules/auth/extension-points.ts +0 -18
- package/src/modules/auth/i18n/ko.json +0 -255
- package/src/modules/business_rules/api/openmercato-call-options/route.ts +0 -94
- package/src/modules/business_rules/events.ts +0 -10
- package/src/modules/business_rules/extension-points.ts +0 -10
- package/src/modules/business_rules/i18n/ko.json +0 -396
- package/src/modules/business_rules/lib/openmercato-call-options-types.ts +0 -31
- package/src/modules/business_rules/lib/openmercato-call-options.ts +0 -297
- package/src/modules/catalog/extension-points.ts +0 -24
- package/src/modules/catalog/i18n/ko.json +0 -723
- package/src/modules/communication_channels/extension-points.ts +0 -17
- package/src/modules/communication_channels/i18n/ko.json +0 -138
- package/src/modules/configs/extension-points.ts +0 -15
- package/src/modules/configs/i18n/ko.json +0 -197
- package/src/modules/currencies/extension-points.ts +0 -11
- package/src/modules/currencies/i18n/ko.json +0 -160
- package/src/modules/currencies/services/baseCurrencyService.ts +0 -59
- package/src/modules/customer_accounts/emails/CustomerInvitationEmail.tsx +0 -45
- package/src/modules/customer_accounts/extension-points.ts +0 -11
- package/src/modules/customer_accounts/i18n/ko.json +0 -354
- package/src/modules/customer_accounts/lib/invitationEmail.ts +0 -42
- package/src/modules/customer_accounts/migrations/Migration20260723120000_customer_accounts.ts +0 -13
- package/src/modules/customers/extension-points.ts +0 -40
- package/src/modules/customers/i18n/ko.json +0 -2855
- package/src/modules/customers/lib/dealStatus.ts +0 -48
- package/src/modules/customers/lib/dealsSummaryQueries.ts +0 -211
- package/src/modules/customers/lib/optionalBaseCurrency.ts +0 -34
- package/src/modules/customers/migrations/Migration20260723210000_customers.ts +0 -15
- package/src/modules/dashboards/components/UnlabelledAmountNotice.tsx +0 -43
- package/src/modules/dashboards/i18n/ko.json +0 -118
- package/src/modules/dashboards/lib/exactDecimal.ts +0 -96
- package/src/modules/dashboards/lib/optionalBaseCurrency.ts +0 -22
- package/src/modules/dashboards/subscribers/invalidateWidgetDataCache.ts +0 -32
- package/src/modules/data_sync/extension-points.ts +0 -10
- package/src/modules/data_sync/i18n/ko.json +0 -125
- package/src/modules/data_sync/lib/queue-policy.ts +0 -30
- package/src/modules/design_system/AGENTS.md +0 -34
- package/src/modules/design_system/acl.ts +0 -5
- package/src/modules/design_system/backend/design-system/page.meta.ts +0 -11
- package/src/modules/design_system/backend/design-system/page.tsx +0 -14
- package/src/modules/design_system/gallery/components/CodeSnippet.tsx +0 -55
- package/src/modules/design_system/gallery/components/EntryCard.tsx +0 -95
- package/src/modules/design_system/gallery/components/GalleryShell.tsx +0 -206
- package/src/modules/design_system/gallery/components/VariantPreview.tsx +0 -15
- package/src/modules/design_system/gallery/entries/banners.tsx +0 -226
- package/src/modules/design_system/gallery/entries/buttons.tsx +0 -422
- package/src/modules/design_system/gallery/entries/charts.tsx +0 -518
- package/src/modules/design_system/gallery/entries/dates.tsx +0 -325
- package/src/modules/design_system/gallery/entries/detail.tsx +0 -403
- package/src/modules/design_system/gallery/entries/display.tsx +0 -893
- package/src/modules/design_system/gallery/entries/feedback.tsx +0 -746
- package/src/modules/design_system/gallery/entries/filters.tsx +0 -570
- package/src/modules/design_system/gallery/entries/foundations.tsx +0 -529
- package/src/modules/design_system/gallery/entries/icons.tsx +0 -168
- package/src/modules/design_system/gallery/entries/inputs.tsx +0 -1516
- package/src/modules/design_system/gallery/entries/messages.tsx +0 -339
- package/src/modules/design_system/gallery/entries/navigation.tsx +0 -573
- package/src/modules/design_system/gallery/entries/notifications.tsx +0 -285
- package/src/modules/design_system/gallery/entries/overlays.tsx +0 -677
- package/src/modules/design_system/gallery/entries/scaffolding.tsx +0 -430
- package/src/modules/design_system/gallery/entries/schedule.tsx +0 -307
- package/src/modules/design_system/gallery/registry.ts +0 -152
- package/src/modules/design_system/gallery/types.ts +0 -32
- package/src/modules/design_system/i18n/.hardcoded-allowlist.json +0 -71
- package/src/modules/design_system/i18n/de.json +0 -58
- package/src/modules/design_system/i18n/en.json +0 -58
- package/src/modules/design_system/i18n/es.json +0 -58
- package/src/modules/design_system/i18n/ko.json +0 -58
- package/src/modules/design_system/i18n/pl.json +0 -58
- package/src/modules/design_system/index.ts +0 -7
- package/src/modules/design_system/setup.ts +0 -12
- package/src/modules/dictionaries/i18n/ko.json +0 -130
- package/src/modules/dictionaries/lib/fetchAllEntries.ts +0 -72
- package/src/modules/directory/extension-points.ts +0 -11
- package/src/modules/directory/i18n/ko.json +0 -105
- package/src/modules/directory/migrations/Migration20260626145500_directory_logo_preserve_aspect_ratio.ts +0 -13
- package/src/modules/entities/backend/config/settings/page.meta.ts +0 -34
- package/src/modules/entities/backend/config/settings/page.tsx +0 -12
- package/src/modules/entities/components/EntitySettingsManager.tsx +0 -160
- package/src/modules/entities/components/RecordListRelationCell.tsx +0 -90
- package/src/modules/entities/components/recordListRelationDisplays.ts +0 -109
- package/src/modules/entities/extension-points.ts +0 -18
- package/src/modules/entities/i18n/ko.json +0 -260
- package/src/modules/feature_toggles/components/hooks/staleTime.ts +0 -5
- package/src/modules/feature_toggles/i18n/ko.json +0 -96
- package/src/modules/inbox_ops/i18n/ko.json +0 -196
- package/src/modules/inbox_ops/subscribers/search-reindex-proposal-created.ts +0 -39
- package/src/modules/integrations/extension-points.ts +0 -27
- package/src/modules/integrations/i18n/ko.json +0 -129
- package/src/modules/integrations/widgets/injection/external-ids/widget.ts +0 -13
- package/src/modules/messages/extension-points.ts +0 -13
- package/src/modules/messages/i18n/ko.json +0 -263
- package/src/modules/messages/lib/participantScope.ts +0 -64
- package/src/modules/notifications/i18n/ko.json +0 -55
- package/src/modules/notifications/lib/notificationScope.ts +0 -40
- package/src/modules/payment_gateways/extension-points.ts +0 -16
- package/src/modules/payment_gateways/i18n/ko.json +0 -87
- package/src/modules/payment_gateways/lib/capture-ledger.ts +0 -260
- package/src/modules/payment_gateways/lib/order-amount-reconciliation.ts +0 -93
- package/src/modules/payment_gateways/migrations/Migration20260725101500_payment_gateways.ts +0 -21
- package/src/modules/payment_gateways/migrations/Migration20260803103035_payment_gateways.ts +0 -17
- package/src/modules/payment_gateways/workers/session-initialization-prune.ts +0 -63
- package/src/modules/planner/i18n/ko.json +0 -565
- package/src/modules/portal/extension-points.ts +0 -30
- package/src/modules/portal/frontend/[orgSlug]/portal/invite/page.meta.ts +0 -9
- package/src/modules/portal/frontend/[orgSlug]/portal/invite/page.tsx +0 -164
- package/src/modules/portal/i18n/ko.json +0 -143
- package/src/modules/portal/lib/navigation.ts +0 -3
- package/src/modules/progress/i18n/ko.json +0 -20
- package/src/modules/query_index/events.ts +0 -17
- package/src/modules/query_index/extension-points.ts +0 -10
- package/src/modules/query_index/i18n/ko.json +0 -69
- package/src/modules/query_index/migrations/Migration20260731105052_query_index.ts +0 -35
- package/src/modules/resources/extension-points.ts +0 -11
- package/src/modules/resources/i18n/ko.json +0 -770
- package/src/modules/resources/migrations/Migration20260608231000.ts +0 -13
- package/src/modules/sales/components/documents/SalesOrderDraftLines.tsx +0 -198
- package/src/modules/sales/extension-points.ts +0 -33
- package/src/modules/sales/i18n/ko.json +0 -1442
- package/src/modules/sales/services/paymentOrderTotalResolver.ts +0 -67
- package/src/modules/shipping_carriers/i18n/ko.json +0 -85
- package/src/modules/staff/i18n/ko.json +0 -1162
- package/src/modules/sync_excel/i18n/ko.json +0 -107
- package/src/modules/translations/i18n/ko.json +0 -45
- package/src/modules/wms/extension-points.ts +0 -23
- package/src/modules/wms/i18n/ko.json +0 -1053
- package/src/modules/workflows/extension-points.ts +0 -12
- package/src/modules/workflows/i18n/ko.json +0 -1204
- package/src/modules/workflows/widgets/injection/order-approval/context-keys.ts +0 -18
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/modules/customer_accounts/api/invitations/accept.ts"],
|
|
4
|
-
"sourcesContent": ["import { NextResponse } from 'next/server'\nimport { z } from 'zod'\nimport type { OpenApiRouteDoc, OpenApiMethodDoc } from '@open-mercato/shared/lib/openapi'\nimport { invitationAcceptSchema } from '@open-mercato/core/modules/customer_accounts/data/validators'\nimport { createRequestContainer } from '@open-mercato/shared/lib/di/container'\nimport { CustomerInvitationService } from '@open-mercato/core/modules/customer_accounts/services/customerInvitationService'\nimport { CustomerSessionService } from '@open-mercato/core/modules/customer_accounts/services/customerSessionService'\nimport { CustomerRbacService } from '@open-mercato/core/modules/customer_accounts/services/customerRbacService'\nimport { emitCustomerAccountsEvent } from '@open-mercato/core/modules/customer_accounts/events'\nimport { getClientIp } from '@open-mercato/shared/lib/ratelimit/helpers'\n\nexport const metadata: { path?: string; requireAuth?: boolean } = { requireAuth: false }\n\nexport async function POST(req: Request) {\n let body: unknown\n try {\n body = await req.json()\n } catch {\n return NextResponse.json({ ok: false, error: 'Invalid request body' }, { status: 400 })\n }\n\n const parsed = invitationAcceptSchema.safeParse(body)\n if (!parsed.success) {\n return NextResponse.json({ ok: false, error: 'Validation failed', details: parsed.error.flatten().fieldErrors }, { status: 400 })\n }\n\n const container = await createRequestContainer()\n const customerInvitationService = container.resolve('customerInvitationService') as CustomerInvitationService\n const customerSessionService = container.resolve('customerSessionService') as CustomerSessionService\n const customerRbacService = container.resolve('customerRbacService') as CustomerRbacService\n\n const result = await customerInvitationService.acceptInvitation(\n parsed.data.token,\n parsed.data.password,\n parsed.data.displayName,\n )\n if (!result) {\n return NextResponse.json({ ok: false, error: 'Invalid or expired invitation' }, { status: 400 })\n }\n\n const { user, invitation } = result\n const
|
|
5
|
-
"mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,SAAS;AAElB,SAAS,8BAA8B;AACvC,SAAS,8BAA8B;AAIvC,SAAS,iCAAiC;AAC1C,SAAS,mBAAmB;AAErB,MAAM,WAAqD,EAAE,aAAa,MAAM;AAEvF,eAAsB,KAAK,KAAc;AACvC,MAAI;AACJ,MAAI;AACF,WAAO,MAAM,IAAI,KAAK;AAAA,EACxB,QAAQ;AACN,WAAO,aAAa,KAAK,EAAE,IAAI,OAAO,OAAO,uBAAuB,GAAG,EAAE,QAAQ,IAAI,CAAC;AAAA,EACxF;AAEA,QAAM,SAAS,uBAAuB,UAAU,IAAI;AACpD,MAAI,CAAC,OAAO,SAAS;AACnB,WAAO,aAAa,KAAK,EAAE,IAAI,OAAO,OAAO,qBAAqB,SAAS,OAAO,MAAM,QAAQ,EAAE,YAAY,GAAG,EAAE,QAAQ,IAAI,CAAC;AAAA,EAClI;AAEA,QAAM,YAAY,MAAM,uBAAuB;AAC/C,QAAM,4BAA4B,UAAU,QAAQ,2BAA2B;AAC/E,QAAM,yBAAyB,UAAU,QAAQ,wBAAwB;AACzE,QAAM,sBAAsB,UAAU,QAAQ,qBAAqB;AAEnE,QAAM,SAAS,MAAM,0BAA0B;AAAA,IAC7C,OAAO,KAAK;AAAA,IACZ,OAAO,KAAK;AAAA,IACZ,OAAO,KAAK;AAAA,EACd;AACA,MAAI,CAAC,QAAQ;AACX,WAAO,aAAa,KAAK,EAAE,IAAI,OAAO,OAAO,gCAAgC,GAAG,EAAE,QAAQ,IAAI,CAAC;AAAA,EACjG;AAEA,QAAM,EAAE,MAAM,WAAW,IAAI;AAC7B,QAAM,
|
|
4
|
+
"sourcesContent": ["import { NextResponse } from 'next/server'\nimport { z } from 'zod'\nimport type { OpenApiRouteDoc, OpenApiMethodDoc } from '@open-mercato/shared/lib/openapi'\nimport { invitationAcceptSchema } from '@open-mercato/core/modules/customer_accounts/data/validators'\nimport { createRequestContainer } from '@open-mercato/shared/lib/di/container'\nimport { CustomerInvitationService } from '@open-mercato/core/modules/customer_accounts/services/customerInvitationService'\nimport { CustomerSessionService } from '@open-mercato/core/modules/customer_accounts/services/customerSessionService'\nimport { CustomerRbacService } from '@open-mercato/core/modules/customer_accounts/services/customerRbacService'\nimport { emitCustomerAccountsEvent } from '@open-mercato/core/modules/customer_accounts/events'\nimport { getClientIp } from '@open-mercato/shared/lib/ratelimit/helpers'\n\nexport const metadata: { path?: string; requireAuth?: boolean } = { requireAuth: false }\n\nexport async function POST(req: Request) {\n let body: unknown\n try {\n body = await req.json()\n } catch {\n return NextResponse.json({ ok: false, error: 'Invalid request body' }, { status: 400 })\n }\n\n const parsed = invitationAcceptSchema.safeParse(body)\n if (!parsed.success) {\n return NextResponse.json({ ok: false, error: 'Validation failed', details: parsed.error.flatten().fieldErrors }, { status: 400 })\n }\n\n const container = await createRequestContainer()\n const customerInvitationService = container.resolve('customerInvitationService') as CustomerInvitationService\n const customerSessionService = container.resolve('customerSessionService') as CustomerSessionService\n const customerRbacService = container.resolve('customerRbacService') as CustomerRbacService\n\n const result = await customerInvitationService.acceptInvitation(\n parsed.data.token,\n parsed.data.password,\n parsed.data.displayName,\n )\n if (!result) {\n return NextResponse.json({ ok: false, error: 'Invalid or expired invitation' }, { status: 400 })\n }\n\n const { user, invitation } = result\n const acl = await customerRbacService.loadAcl(user.id, {\n tenantId: user.tenantId,\n organizationId: user.organizationId,\n })\n const resolvedFeatures = acl.features\n\n const ip = getClientIp(req, 0)\n const userAgent = req.headers.get('user-agent') || null\n const { rawToken, jwt } = await customerSessionService.createSession(user, resolvedFeatures, ip, userAgent)\n\n void emitCustomerAccountsEvent('customer_accounts.user.created', {\n id: user.id,\n email: user.email,\n tenantId: user.tenantId,\n organizationId: user.organizationId,\n invitationId: invitation.id,\n }).catch(() => undefined)\n\n void emitCustomerAccountsEvent('customer_accounts.invitation.accepted', {\n invitationId: invitation.id,\n userId: user.id,\n tenantId: user.tenantId,\n }).catch(() => undefined)\n\n const res = NextResponse.json({\n ok: true,\n user: {\n id: user.id,\n email: user.email,\n displayName: user.displayName,\n emailVerified: true,\n },\n resolvedFeatures,\n }, { status: 201 })\n\n res.cookies.set('customer_auth_token', jwt, {\n httpOnly: true,\n path: '/',\n sameSite: 'lax',\n secure: process.env.NODE_ENV === 'production',\n maxAge: 60 * 60 * 8,\n })\n res.cookies.set('customer_session_token', rawToken, {\n httpOnly: true,\n path: '/',\n sameSite: 'lax',\n secure: process.env.NODE_ENV === 'production',\n maxAge: 60 * 60 * 24 * 30,\n })\n\n return res\n}\n\nconst acceptSuccessSchema = z.object({\n ok: z.literal(true),\n user: z.object({\n id: z.string().uuid(),\n email: z.string().email(),\n displayName: z.string(),\n emailVerified: z.boolean(),\n }),\n resolvedFeatures: z.array(z.string()),\n})\n\nconst errorSchema = z.object({ ok: z.literal(false), error: z.string() })\n\nconst methodDoc: OpenApiMethodDoc = {\n summary: 'Accept customer invitation',\n description: 'Accepts an invitation, creates the user account, assigns roles, and auto-logs in.',\n tags: ['Customer Authentication'],\n requestBody: {\n schema: invitationAcceptSchema,\n description: 'Invitation acceptance with token, password, and display name.',\n },\n responses: [\n { status: 201, description: 'Invitation accepted and user created', schema: acceptSuccessSchema },\n ],\n errors: [\n { status: 400, description: 'Invalid or expired invitation', schema: errorSchema },\n ],\n}\n\nexport const openApi: OpenApiRouteDoc = {\n summary: 'Accept customer invitation',\n description: 'Hand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AAA,IACpB,OAAO,EAAE,OAAO,EAAE,MAAM;AAAA,IACxB,aAAa,EAAE,OAAO;AAAA,IACtB,eAAe,EAAE,QAAQ;AAAA,EAC3B,CAAC;AAAA,EACD,kBAAkB,EAAE,MAAM,EAAE,OAAO,CAAC;AACtC,CAAC;AAED,MAAM,cAAc,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,KAAK,GAAG,OAAO,EAAE,OAAO,EAAE,CAAC;AAExE,MAAM,YAA8B;AAAA,EAClC,SAAS;AAAA,EACT,aAAa;AAAA,EACb,MAAM,CAAC,yBAAyB;AAAA,EAChC,aAAa;AAAA,IACX,QAAQ;AAAA,IACR,aAAa;AAAA,EACf;AAAA,EACA,WAAW;AAAA,IACT,EAAE,QAAQ,KAAK,aAAa,wCAAwC,QAAQ,oBAAoB;AAAA,EAClG;AAAA,EACA,QAAQ;AAAA,IACN,EAAE,QAAQ,KAAK,aAAa,iCAAiC,QAAQ,YAAY;AAAA,EACnF;AACF;AAEO,MAAM,UAA2B;AAAA,EACtC,SAAS;AAAA,EACT,aAAa;AAAA,EACb,SAAS,EAAE,MAAM,UAAU;AAC7B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -88,10 +88,8 @@ async function POST(req) {
|
|
|
88
88
|
if (compoundKey) {
|
|
89
89
|
await resetAuthRateLimit(compoundKey, customerLoginRateLimitConfig);
|
|
90
90
|
}
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
organizationId: user.organizationId
|
|
94
|
-
});
|
|
91
|
+
const acl = await customerRbacService.loadAcl(user.id, { tenantId, organizationId: user.organizationId });
|
|
92
|
+
const resolvedFeatures = acl.features;
|
|
95
93
|
const ip = getClientIp(req, 0);
|
|
96
94
|
const userAgent = req.headers.get("user-agent") || null;
|
|
97
95
|
const { rawToken, jwt, session } = await customerSessionService.createSession(user, resolvedFeatures, ip, userAgent);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/modules/customer_accounts/api/login.ts"],
|
|
4
|
-
"sourcesContent": ["import { NextResponse } from 'next/server'\nimport { compare as bcryptCompare } from 'bcryptjs'\nimport { z } from 'zod'\nimport type { OpenApiRouteDoc, OpenApiMethodDoc } from '@open-mercato/shared/lib/openapi'\nimport { loginSchema } from '@open-mercato/core/modules/customer_accounts/data/validators'\nimport { createRequestContainer } from '@open-mercato/shared/lib/di/container'\nimport { CustomerUserService } from '@open-mercato/core/modules/customer_accounts/services/customerUserService'\nimport { CustomerSessionService } from '@open-mercato/core/modules/customer_accounts/services/customerSessionService'\nimport { CustomerRbacService } from '@open-mercato/core/modules/customer_accounts/services/customerRbacService'\nimport { emitCustomerAccountsEvent } from '@open-mercato/core/modules/customer_accounts/events'\nimport { rateLimitErrorSchema } from '@open-mercato/shared/lib/ratelimit/helpers'\nimport { getClientIp } from '@open-mercato/shared/lib/ratelimit/helpers'\nimport {\n checkAuthRateLimit,\n resetAuthRateLimit,\n customerLoginRateLimitConfig,\n customerLoginIpRateLimitConfig,\n} from '@open-mercato/core/modules/customer_accounts/lib/rateLimiter'\nimport {\n resolveTenantContext,\n TenantResolutionError,\n} from '@open-mercato/core/modules/customer_accounts/lib/resolveTenantContext'\n\nexport const metadata: { path?: string; requireAuth?: boolean } = { requireAuth: false }\n\n// Precomputed bcrypt cost-10 hash of an unknowable random 32-byte input; used to equalize\n// response latency between the real-account and unknown/inactive/locked/no-hash login branches\n// so account existence cannot be inferred from a timing side channel. Mirrors signup.ts.\nconst TIMING_EQUALIZATION_HASH = '$2b$10$.F2A6UHFzk.d8trNdfqt4OLz05Nf3IOuMmN6VJKflhD4.rz.prR8i'\n\nexport async function POST(req: Request) {\n let body: unknown\n try {\n body = await req.json()\n } catch {\n return NextResponse.json({ ok: false, error: 'Invalid request body' }, { status: 400 })\n }\n\n const parsed = loginSchema.safeParse(body)\n if (!parsed.success) {\n return NextResponse.json({ ok: false, error: 'Invalid credentials' }, { status: 400 })\n }\n\n const { email, password } = parsed.data\n let tenantId: string\n try {\n const context = await resolveTenantContext(req, parsed.data.tenantId, {\n organizationId: parsed.data.organizationId ?? null,\n })\n tenantId = context.tenantId\n } catch (err) {\n if (err instanceof TenantResolutionError) {\n return NextResponse.json({ ok: false, error: err.message }, { status: err.status })\n }\n throw err\n }\n\n const { error: rateLimitError, compoundKey } = await checkAuthRateLimit({\n req,\n ipConfig: customerLoginIpRateLimitConfig,\n compoundConfig: customerLoginRateLimitConfig,\n compoundIdentifier: email,\n })\n if (rateLimitError) return rateLimitError\n\n const container = await createRequestContainer()\n const customerUserService = container.resolve('customerUserService') as CustomerUserService\n const customerSessionService = container.resolve('customerSessionService') as CustomerSessionService\n const customerRbacService = container.resolve('customerRbacService') as CustomerRbacService\n\n const user = await customerUserService.findByEmail(email, tenantId)\n\n // Equalize response timing and error responses across every failed-login branch so an\n // attacker cannot enumerate which emails have an account in this tenant. Unknown,\n // password-less, inactive, locked, wrong-password, and unverified accounts all run a\n // bcrypt comparison and return the same generic 401 \u2014 lockout/deactivation guidance is\n // conveyed out-of-band (e.g. email), never in the synchronous response.\n if (!user || !user.passwordHash) {\n await bcryptCompare(password, TIMING_EQUALIZATION_HASH)\n void emitCustomerAccountsEvent('customer_accounts.login.failed', { email, reason: 'invalid_credentials', tenantId }).catch(() => undefined)\n return NextResponse.json({ ok: false, error: 'Invalid email or password' }, { status: 401 })\n }\n\n if (!user.isActive) {\n await bcryptCompare(password, TIMING_EQUALIZATION_HASH)\n void emitCustomerAccountsEvent('customer_accounts.login.failed', { email, reason: 'inactive', tenantId }).catch(() => undefined)\n return NextResponse.json({ ok: false, error: 'Invalid email or password' }, { status: 401 })\n }\n\n if (customerUserService.checkLockout(user)) {\n await bcryptCompare(password, TIMING_EQUALIZATION_HASH)\n void emitCustomerAccountsEvent('customer_accounts.login.failed', { email, reason: 'locked', tenantId }).catch(() => undefined)\n return NextResponse.json({ ok: false, error: 'Invalid email or password' }, { status: 401 })\n }\n\n const passwordValid = await customerUserService.verifyPassword(user, password)\n if (!passwordValid) {\n await customerUserService.incrementFailedAttempts(user)\n void emitCustomerAccountsEvent('customer_accounts.login.failed', { email, reason: 'invalid_password', tenantId }).catch(() => undefined)\n return NextResponse.json({ ok: false, error: 'Invalid email or password' }, { status: 401 })\n }\n\n if (!user.emailVerifiedAt) {\n void emitCustomerAccountsEvent('customer_accounts.login.failed', {\n email,\n reason: 'email_not_verified',\n tenantId,\n }).catch(() => undefined)\n return NextResponse.json({ ok: false, error: 'Invalid email or password' }, { status: 401 })\n }\n\n await customerUserService.resetFailedAttempts(user)\n await customerUserService.updateLastLoginAt(user)\n\n if (compoundKey) {\n await resetAuthRateLimit(compoundKey, customerLoginRateLimitConfig)\n }\n\n const
|
|
5
|
-
"mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,WAAW,qBAAqB;AACzC,SAAS,SAAS;AAElB,SAAS,mBAAmB;AAC5B,SAAS,8BAA8B;AAIvC,SAAS,iCAAiC;AAC1C,SAAS,4BAA4B;AACrC,SAAS,mBAAmB;AAC5B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAEA,MAAM,WAAqD,EAAE,aAAa,MAAM;AAKvF,MAAM,2BAA2B;AAEjC,eAAsB,KAAK,KAAc;AACvC,MAAI;AACJ,MAAI;AACF,WAAO,MAAM,IAAI,KAAK;AAAA,EACxB,QAAQ;AACN,WAAO,aAAa,KAAK,EAAE,IAAI,OAAO,OAAO,uBAAuB,GAAG,EAAE,QAAQ,IAAI,CAAC;AAAA,EACxF;AAEA,QAAM,SAAS,YAAY,UAAU,IAAI;AACzC,MAAI,CAAC,OAAO,SAAS;AACnB,WAAO,aAAa,KAAK,EAAE,IAAI,OAAO,OAAO,sBAAsB,GAAG,EAAE,QAAQ,IAAI,CAAC;AAAA,EACvF;AAEA,QAAM,EAAE,OAAO,SAAS,IAAI,OAAO;AACnC,MAAI;AACJ,MAAI;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,MAAI,oBAAoB,aAAa,IAAI,GAAG;AAC1C,UAAM,cAAc,UAAU,wBAAwB;AACtD,SAAK,0BAA0B,kCAAkC,EAAE,OAAO,QAAQ,UAAU,SAAS,CAAC,EAAE,MAAM,MAAM,MAAS;AAC7H,WAAO,aAAa,KAAK,EAAE,IAAI,OAAO,OAAO,4BAA4B,GAAG,EAAE,QAAQ,IAAI,CAAC;AAAA,EAC7F;AAEA,QAAM,gBAAgB,MAAM,oBAAoB,eAAe,MAAM,QAAQ;AAC7E,MAAI,CAAC,eAAe;AAClB,UAAM,oBAAoB,wBAAwB,IAAI;AACtD,SAAK,0BAA0B,kCAAkC,EAAE,OAAO,QAAQ,oBAAoB,SAAS,CAAC,EAAE,MAAM,MAAM,MAAS;AACvI,WAAO,aAAa,KAAK,EAAE,IAAI,OAAO,OAAO,4BAA4B,GAAG,EAAE,QAAQ,IAAI,CAAC;AAAA,EAC7F;AAEA,MAAI,CAAC,KAAK,iBAAiB;AACzB,SAAK,0BAA0B,kCAAkC;AAAA,MAC/D;AAAA,MACA,QAAQ;AAAA,MACR;AAAA,IACF,CAAC,EAAE,MAAM,MAAM,MAAS;AACxB,WAAO,aAAa,KAAK,EAAE,IAAI,OAAO,OAAO,4BAA4B,GAAG,EAAE,QAAQ,IAAI,CAAC;AAAA,EAC7F;AAEA,QAAM,oBAAoB,oBAAoB,IAAI;AAClD,QAAM,oBAAoB,kBAAkB,IAAI;AAEhD,MAAI,aAAa;AACf,UAAM,mBAAmB,aAAa,4BAA4B;AAAA,EACpE;AAEA,QAAM,
|
|
4
|
+
"sourcesContent": ["import { NextResponse } from 'next/server'\nimport { compare as bcryptCompare } from 'bcryptjs'\nimport { z } from 'zod'\nimport type { OpenApiRouteDoc, OpenApiMethodDoc } from '@open-mercato/shared/lib/openapi'\nimport { loginSchema } from '@open-mercato/core/modules/customer_accounts/data/validators'\nimport { createRequestContainer } from '@open-mercato/shared/lib/di/container'\nimport { CustomerUserService } from '@open-mercato/core/modules/customer_accounts/services/customerUserService'\nimport { CustomerSessionService } from '@open-mercato/core/modules/customer_accounts/services/customerSessionService'\nimport { CustomerRbacService } from '@open-mercato/core/modules/customer_accounts/services/customerRbacService'\nimport { emitCustomerAccountsEvent } from '@open-mercato/core/modules/customer_accounts/events'\nimport { rateLimitErrorSchema } from '@open-mercato/shared/lib/ratelimit/helpers'\nimport { getClientIp } from '@open-mercato/shared/lib/ratelimit/helpers'\nimport {\n checkAuthRateLimit,\n resetAuthRateLimit,\n customerLoginRateLimitConfig,\n customerLoginIpRateLimitConfig,\n} from '@open-mercato/core/modules/customer_accounts/lib/rateLimiter'\nimport {\n resolveTenantContext,\n TenantResolutionError,\n} from '@open-mercato/core/modules/customer_accounts/lib/resolveTenantContext'\n\nexport const metadata: { path?: string; requireAuth?: boolean } = { requireAuth: false }\n\n// Precomputed bcrypt cost-10 hash of an unknowable random 32-byte input; used to equalize\n// response latency between the real-account and unknown/inactive/locked/no-hash login branches\n// so account existence cannot be inferred from a timing side channel. Mirrors signup.ts.\nconst TIMING_EQUALIZATION_HASH = '$2b$10$.F2A6UHFzk.d8trNdfqt4OLz05Nf3IOuMmN6VJKflhD4.rz.prR8i'\n\nexport async function POST(req: Request) {\n let body: unknown\n try {\n body = await req.json()\n } catch {\n return NextResponse.json({ ok: false, error: 'Invalid request body' }, { status: 400 })\n }\n\n const parsed = loginSchema.safeParse(body)\n if (!parsed.success) {\n return NextResponse.json({ ok: false, error: 'Invalid credentials' }, { status: 400 })\n }\n\n const { email, password } = parsed.data\n let tenantId: string\n try {\n const context = await resolveTenantContext(req, parsed.data.tenantId, {\n organizationId: parsed.data.organizationId ?? null,\n })\n tenantId = context.tenantId\n } catch (err) {\n if (err instanceof TenantResolutionError) {\n return NextResponse.json({ ok: false, error: err.message }, { status: err.status })\n }\n throw err\n }\n\n const { error: rateLimitError, compoundKey } = await checkAuthRateLimit({\n req,\n ipConfig: customerLoginIpRateLimitConfig,\n compoundConfig: customerLoginRateLimitConfig,\n compoundIdentifier: email,\n })\n if (rateLimitError) return rateLimitError\n\n const container = await createRequestContainer()\n const customerUserService = container.resolve('customerUserService') as CustomerUserService\n const customerSessionService = container.resolve('customerSessionService') as CustomerSessionService\n const customerRbacService = container.resolve('customerRbacService') as CustomerRbacService\n\n const user = await customerUserService.findByEmail(email, tenantId)\n\n // Equalize response timing and error responses across every failed-login branch so an\n // attacker cannot enumerate which emails have an account in this tenant. Unknown,\n // password-less, inactive, locked, wrong-password, and unverified accounts all run a\n // bcrypt comparison and return the same generic 401 \u2014 lockout/deactivation guidance is\n // conveyed out-of-band (e.g. email), never in the synchronous response.\n if (!user || !user.passwordHash) {\n await bcryptCompare(password, TIMING_EQUALIZATION_HASH)\n void emitCustomerAccountsEvent('customer_accounts.login.failed', { email, reason: 'invalid_credentials', tenantId }).catch(() => undefined)\n return NextResponse.json({ ok: false, error: 'Invalid email or password' }, { status: 401 })\n }\n\n if (!user.isActive) {\n await bcryptCompare(password, TIMING_EQUALIZATION_HASH)\n void emitCustomerAccountsEvent('customer_accounts.login.failed', { email, reason: 'inactive', tenantId }).catch(() => undefined)\n return NextResponse.json({ ok: false, error: 'Invalid email or password' }, { status: 401 })\n }\n\n if (customerUserService.checkLockout(user)) {\n await bcryptCompare(password, TIMING_EQUALIZATION_HASH)\n void emitCustomerAccountsEvent('customer_accounts.login.failed', { email, reason: 'locked', tenantId }).catch(() => undefined)\n return NextResponse.json({ ok: false, error: 'Invalid email or password' }, { status: 401 })\n }\n\n const passwordValid = await customerUserService.verifyPassword(user, password)\n if (!passwordValid) {\n await customerUserService.incrementFailedAttempts(user)\n void emitCustomerAccountsEvent('customer_accounts.login.failed', { email, reason: 'invalid_password', tenantId }).catch(() => undefined)\n return NextResponse.json({ ok: false, error: 'Invalid email or password' }, { status: 401 })\n }\n\n if (!user.emailVerifiedAt) {\n void emitCustomerAccountsEvent('customer_accounts.login.failed', {\n email,\n reason: 'email_not_verified',\n tenantId,\n }).catch(() => undefined)\n return NextResponse.json({ ok: false, error: 'Invalid email or password' }, { status: 401 })\n }\n\n await customerUserService.resetFailedAttempts(user)\n await customerUserService.updateLastLoginAt(user)\n\n if (compoundKey) {\n await resetAuthRateLimit(compoundKey, customerLoginRateLimitConfig)\n }\n\n const acl = await customerRbacService.loadAcl(user.id, { tenantId, organizationId: user.organizationId })\n const resolvedFeatures = acl.features\n\n const ip = getClientIp(req, 0)\n const userAgent = req.headers.get('user-agent') || null\n const { rawToken, jwt, session } = await customerSessionService.createSession(user, resolvedFeatures, ip, userAgent)\n\n void emitCustomerAccountsEvent('customer_accounts.login.success', {\n id: user.id,\n email: user.email,\n tenantId,\n organizationId: user.organizationId,\n }).catch(() => undefined)\n\n const res = NextResponse.json({\n ok: true,\n user: {\n id: user.id,\n email: user.email,\n displayName: user.displayName,\n emailVerified: !!user.emailVerifiedAt,\n },\n resolvedFeatures,\n })\n\n res.cookies.set('customer_auth_token', jwt, {\n httpOnly: true,\n path: '/',\n sameSite: 'lax',\n secure: process.env.NODE_ENV === 'production',\n maxAge: 60 * 60 * 8,\n })\n res.cookies.set('customer_session_token', rawToken, {\n httpOnly: true,\n path: '/',\n sameSite: 'lax',\n secure: process.env.NODE_ENV === 'production',\n maxAge: 60 * 60 * 24 * 30,\n })\n\n return res\n}\n\nconst loginSuccessSchema = z.object({\n ok: z.literal(true),\n user: z.object({\n id: z.string().uuid(),\n email: z.string().email(),\n displayName: z.string(),\n emailVerified: z.boolean(),\n }),\n resolvedFeatures: z.array(z.string()),\n})\n\nconst errorSchema = z.object({\n ok: z.literal(false),\n error: z.string(),\n})\n\nconst methodDoc: OpenApiMethodDoc = {\n summary: 'Authenticate customer credentials',\n description: 'Validates customer credentials and issues JWT + session cookies.',\n tags: ['Customer Authentication'],\n requestBody: {\n schema: loginSchema,\n description: 'Login payload with email and password.',\n },\n responses: [\n { status: 200, description: 'Login successful', schema: loginSuccessSchema },\n ],\n errors: [\n { status: 400, description: 'Validation failed', schema: errorSchema },\n { status: 401, description: 'Invalid credentials', schema: errorSchema },\n { status: 429, description: 'Too many login attempts', schema: rateLimitErrorSchema },\n ],\n}\n\nexport const openApi: OpenApiRouteDoc = {\n summary: 'Customer login',\n description: 'Handles customer authentication and session issuance.',\n methods: { POST: methodDoc },\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,WAAW,qBAAqB;AACzC,SAAS,SAAS;AAElB,SAAS,mBAAmB;AAC5B,SAAS,8BAA8B;AAIvC,SAAS,iCAAiC;AAC1C,SAAS,4BAA4B;AACrC,SAAS,mBAAmB;AAC5B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAEA,MAAM,WAAqD,EAAE,aAAa,MAAM;AAKvF,MAAM,2BAA2B;AAEjC,eAAsB,KAAK,KAAc;AACvC,MAAI;AACJ,MAAI;AACF,WAAO,MAAM,IAAI,KAAK;AAAA,EACxB,QAAQ;AACN,WAAO,aAAa,KAAK,EAAE,IAAI,OAAO,OAAO,uBAAuB,GAAG,EAAE,QAAQ,IAAI,CAAC;AAAA,EACxF;AAEA,QAAM,SAAS,YAAY,UAAU,IAAI;AACzC,MAAI,CAAC,OAAO,SAAS;AACnB,WAAO,aAAa,KAAK,EAAE,IAAI,OAAO,OAAO,sBAAsB,GAAG,EAAE,QAAQ,IAAI,CAAC;AAAA,EACvF;AAEA,QAAM,EAAE,OAAO,SAAS,IAAI,OAAO;AACnC,MAAI;AACJ,MAAI;AACF,UAAM,UAAU,MAAM,qBAAqB,KAAK,OAAO,KAAK,UAAU;AAAA,MACpE,gBAAgB,OAAO,KAAK,kBAAkB;AAAA,IAChD,CAAC;AACD,eAAW,QAAQ;AAAA,EACrB,SAAS,KAAK;AACZ,QAAI,eAAe,uBAAuB;AACxC,aAAO,aAAa,KAAK,EAAE,IAAI,OAAO,OAAO,IAAI,QAAQ,GAAG,EAAE,QAAQ,IAAI,OAAO,CAAC;AAAA,IACpF;AACA,UAAM;AAAA,EACR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AAuB,QAAQ,YAAY;AAAA,IACvE,EAAE,QAAQ,KAAK,aAAa,2BAA2B,QAAQ,qBAAqB;AAAA,EACtF;AACF;AAEO,MAAM,UAA2B;AAAA,EACtC,SAAS;AAAA,EACT,aAAa;AAAA,EACb,SAAS,EAAE,MAAM,UAAU;AAC7B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -37,10 +37,8 @@ async function POST(req) {
|
|
|
37
37
|
}
|
|
38
38
|
await customerUserService.resetFailedAttempts(user);
|
|
39
39
|
await customerUserService.updateLastLoginAt(user);
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
organizationId: user.organizationId
|
|
43
|
-
});
|
|
40
|
+
const acl = await customerRbacService.loadAcl(user.id, { tenantId: user.tenantId, organizationId: user.organizationId });
|
|
41
|
+
const resolvedFeatures = acl.features;
|
|
44
42
|
const ip = getClientIp(req, 0);
|
|
45
43
|
const userAgent = req.headers.get("user-agent") || null;
|
|
46
44
|
const { rawToken, jwt } = await customerSessionService.createSession(user, resolvedFeatures, ip, userAgent);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/modules/customer_accounts/api/magic-link/verify.ts"],
|
|
4
|
-
"sourcesContent": ["import { NextResponse } from 'next/server'\nimport { z } from 'zod'\nimport type { OpenApiRouteDoc, OpenApiMethodDoc } from '@open-mercato/shared/lib/openapi'\nimport { magicLinkVerifySchema } from '@open-mercato/core/modules/customer_accounts/data/validators'\nimport { createRequestContainer } from '@open-mercato/shared/lib/di/container'\nimport { CustomerTokenService } from '@open-mercato/core/modules/customer_accounts/services/customerTokenService'\nimport { CustomerUserService } from '@open-mercato/core/modules/customer_accounts/services/customerUserService'\nimport { CustomerSessionService } from '@open-mercato/core/modules/customer_accounts/services/customerSessionService'\nimport { CustomerRbacService } from '@open-mercato/core/modules/customer_accounts/services/customerRbacService'\nimport { CustomerUser } from '@open-mercato/core/modules/customer_accounts/data/entities'\nimport { emitCustomerAccountsEvent } from '@open-mercato/core/modules/customer_accounts/events'\nimport { getClientIp } from '@open-mercato/shared/lib/ratelimit/helpers'\n\nexport const metadata: { path?: string; requireAuth?: boolean } = { requireAuth: false }\n\nexport async function POST(req: Request) {\n let body: unknown\n try {\n body = await req.json()\n } catch {\n return NextResponse.json({ ok: false, error: 'Invalid request body' }, { status: 400 })\n }\n\n const parsed = magicLinkVerifySchema.safeParse(body)\n if (!parsed.success) {\n return NextResponse.json({ ok: false, error: 'Invalid token' }, { status: 400 })\n }\n\n const container = await createRequestContainer()\n const customerTokenService = container.resolve('customerTokenService') as CustomerTokenService\n const customerUserService = container.resolve('customerUserService') as CustomerUserService\n const customerSessionService = container.resolve('customerSessionService') as CustomerSessionService\n const customerRbacService = container.resolve('customerRbacService') as CustomerRbacService\n const em = container.resolve('em') as import('@mikro-orm/postgresql').EntityManager\n\n const result = await customerTokenService.verifyEmailToken(parsed.data.token, 'magic_link')\n if (!result) {\n return NextResponse.json({ ok: false, error: 'Invalid or expired token' }, { status: 400 })\n }\n\n const user = await customerUserService.findById(result.userId, result.tenantId)\n if (!user || !user.isActive) {\n return NextResponse.json({ ok: false, error: 'Account not found or deactivated' }, { status: 401 })\n }\n\n // Auto-verify email on magic link login\n if (!user.emailVerifiedAt) {\n await em.nativeUpdate(CustomerUser, { id: user.id }, { emailVerifiedAt: new Date() })\n user.emailVerifiedAt = new Date()\n }\n\n await customerUserService.resetFailedAttempts(user)\n await customerUserService.updateLastLoginAt(user)\n\n const
|
|
5
|
-
"mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,SAAS;AAElB,SAAS,6BAA6B;AACtC,SAAS,8BAA8B;AAKvC,SAAS,oBAAoB;AAC7B,SAAS,iCAAiC;AAC1C,SAAS,mBAAmB;AAErB,MAAM,WAAqD,EAAE,aAAa,MAAM;AAEvF,eAAsB,KAAK,KAAc;AACvC,MAAI;AACJ,MAAI;AACF,WAAO,MAAM,IAAI,KAAK;AAAA,E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z } from 'zod'\nimport type { OpenApiRouteDoc, OpenApiMethodDoc } from '@open-mercato/shared/lib/openapi'\nimport { magicLinkVerifySchema } from '@open-mercato/core/modules/customer_accounts/data/validators'\nimport { createRequestContainer } from '@open-mercato/shared/lib/di/container'\nimport { CustomerTokenService } from '@open-mercato/core/modules/customer_accounts/services/customerTokenService'\nimport { CustomerUserService } from '@open-mercato/core/modules/customer_accounts/services/customerUserService'\nimport { CustomerSessionService } from '@open-mercato/core/modules/customer_accounts/services/customerSessionService'\nimport { CustomerRbacService } from '@open-mercato/core/modules/customer_accounts/services/customerRbacService'\nimport { CustomerUser } from '@open-mercato/core/modules/customer_accounts/data/entities'\nimport { emitCustomerAccountsEvent } from '@open-mercato/core/modules/customer_accounts/events'\nimport { getClientIp } from '@open-mercato/shared/lib/ratelimit/helpers'\n\nexport const metadata: { path?: string; requireAuth?: boolean } = { requireAuth: false }\n\nexport async function POST(req: Request) {\n let body: unknown\n try {\n body = await req.json()\n } catch {\n return NextResponse.json({ ok: false, error: 'Invalid request body' }, { status: 400 })\n }\n\n const parsed = magicLinkVerifySchema.safeParse(body)\n if (!parsed.success) {\n return NextResponse.json({ ok: false, error: 'Invalid token' }, { status: 400 })\n }\n\n const container = await createRequestContainer()\n const customerTokenService = container.resolve('customerTokenService') as CustomerTokenService\n const customerUserService = container.resolve('customerUserService') as CustomerUserService\n const customerSessionService = container.resolve('customerSessionService') as CustomerSessionService\n const customerRbacService = container.resolve('customerRbacService') as CustomerRbacService\n const em = container.resolve('em') as import('@mikro-orm/postgresql').EntityManager\n\n const result = await customerTokenService.verifyEmailToken(parsed.data.token, 'magic_link')\n if (!result) {\n return NextResponse.json({ ok: false, error: 'Invalid or expired token' }, { status: 400 })\n }\n\n const user = await customerUserService.findById(result.userId, result.tenantId)\n if (!user || !user.isActive) {\n return NextResponse.json({ ok: false, error: 'Account not found or deactivated' }, { status: 401 })\n }\n\n // Auto-verify email on magic link login\n if (!user.emailVerifiedAt) {\n await em.nativeUpdate(CustomerUser, { id: user.id }, { emailVerifiedAt: new Date() })\n user.emailVerifiedAt = new Date()\n }\n\n await customerUserService.resetFailedAttempts(user)\n await customerUserService.updateLastLoginAt(user)\n\n const acl = await customerRbacService.loadAcl(user.id, { tenantId: user.tenantId, organizationId: user.organizationId })\n const resolvedFeatures = acl.features\n\n const ip = getClientIp(req, 0)\n const userAgent = req.headers.get('user-agent') || null\n const { rawToken, jwt } = await customerSessionService.createSession(user, resolvedFeatures, ip, userAgent)\n\n void emitCustomerAccountsEvent('customer_accounts.login.success', {\n id: user.id,\n email: user.email,\n tenantId: user.tenantId,\n organizationId: user.organizationId,\n }).catch(() => undefined)\n\n const res = NextResponse.json({\n ok: true,\n user: {\n id: user.id,\n email: user.email,\n displayName: user.displayName,\n emailVerified: true,\n },\n resolvedFeatures,\n })\n\n res.cookies.set('customer_auth_token', jwt, {\n httpOnly: true,\n path: '/',\n sameSite: 'lax',\n secure: process.env.NODE_ENV === 'production',\n maxAge: 60 * 60 * 8,\n })\n res.cookies.set('customer_session_token', rawToken, {\n httpOnly: true,\n path: '/',\n sameSite: 'lax',\n secure: process.env.NODE_ENV === 'production',\n maxAge: 60 * 60 * 24 * 30,\n })\n\n return res\n}\n\nconst loginSuccessSchema = z.object({\n ok: z.literal(true),\n user: z.object({\n id: z.string().uuid(),\n email: z.string().email(),\n displayName: z.string(),\n emailVerified: z.boolean(),\n }),\n resolvedFeatures: z.array(z.string()),\n})\n\nconst errorSchema = z.object({ ok: z.literal(false), error: z.string() })\n\nconst methodDoc: OpenApiMethodDoc = {\n summary: 'Verify magic link token',\n description: 'Validates the magic link token, auto-verifies email, and creates a session.',\n tags: ['Customer Authentication'],\n requestBody: {\n schema: magicLinkVerifySchema,\n description: 'Magic link verification token.',\n },\n responses: [\n { status: 200, description: 'Login successful', schema: loginSuccessSchema },\n ],\n errors: [\n { status: 400, description: 'Invalid or expired token', schema: errorSchema },\n { status: 401, description: 'Account not found', schema: errorSchema },\n ],\n}\n\nexport const openApi: OpenAp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IACN,UAAU;AAAA,IACV,QAAQ,QAAQ,IAAI,aAAa;AAAA,IACjC,QAAQ,KAAK,KAAK,KAAK;AAAA,EACzB,CAAC;AAED,SAAO;AACT;AAEA,MAAM,qBAAqB,EAAE,OAAO;AAAA,EAClC,IAAI,EAAE,QAAQ,IAAI;AAAA,EAClB,MAAM,EAAE,OAAO;AAAA,IACb,IAAI,EAAE,OAAO,EAAE,KAAK;AAAA,IACpB,OAAO,EAAE,OAAO,EAAE,MAAM;AAAA,IACxB,aAAa,EAAE,OAAO;AAAA,IACtB,eAAe,EAAE,QAAQ;AAAA,EAC3B,CAAC;AAAA,EACD,kBAAkB,EAAE,MAAM,EAAE,OAAO,CAAC;AACtC,CAAC;AAED,MAAM,cAAc,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,KAAK,GAAG,OAAO,EAAE,OAAO,EAAE,CAAC;AAExE,MAAM,YAA8B;AAAA,EAClC,SAAS;AAAA,EACT,aAAa;AAAA,EACb,MAAM,CAAC,yBAAyB;AAAA,EAChC,aAAa;AAAA,IACX,QAAQ;AAAA,IACR,aAAa;AAAA,EACf;AAAA,EACA,WAAW;AAAA,IACT,EAAE,QAAQ,KAAK,aAAa,oBAAoB,QAAQ,mBAAmB;AAAA,EAC7E;AAAA,EACA,QAAQ;AAAA,IACN,EAAE,QAAQ,KAAK,aAAa,4BAA4B,QAAQ,YAAY;AAAA,IAC5E,EAAE,QAAQ,KAAK,aAAa,qBAAqB,QAAQ,YAAY;AAAA,EACvE;AACF;AAEO,MAAM,UAA2B;AAAA,EACtC,SAAS;AAAA,EACT,aAAa;AAAA,EACb,SAAS,EAAE,MAAM,UAAU;AAC7B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,7 +2,7 @@ import { NextResponse } from "next/server";
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { getCustomerAuthFromRequest } from "@open-mercato/core/modules/customer_accounts/lib/customerAuth";
|
|
4
4
|
import { createRequestContainer } from "@open-mercato/shared/lib/di/container";
|
|
5
|
-
import {
|
|
5
|
+
import { matchFeature } from "@open-mercato/shared/lib/auth/featureMatch";
|
|
6
6
|
const metadata = { requireAuth: false };
|
|
7
7
|
const requestSchema = z.object({
|
|
8
8
|
features: z.array(z.string()).min(1).max(100)
|
|
@@ -25,10 +25,9 @@ async function POST(req) {
|
|
|
25
25
|
tenantId: auth.tenantId,
|
|
26
26
|
organizationId: auth.orgId
|
|
27
27
|
});
|
|
28
|
-
const granted = body.features.filter(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}));
|
|
28
|
+
const granted = acl.isPortalAdmin ? [...body.features] : body.features.filter(
|
|
29
|
+
(feature) => acl.features.some((g) => matchFeature(feature, g))
|
|
30
|
+
);
|
|
32
31
|
return NextResponse.json({ ok: true, granted });
|
|
33
32
|
}
|
|
34
33
|
const methodDoc = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/modules/customer_accounts/api/portal/feature-check.ts"],
|
|
4
|
-
"sourcesContent": ["import { NextResponse } from 'next/server'\nimport { z } from 'zod'\nimport type { OpenApiRouteDoc, OpenApiMethodDoc } from '@open-mercato/shared/lib/openapi'\nimport { getCustomerAuthFromRequest } from '@open-mercato/core/modules/customer_accounts/lib/customerAuth'\nimport { createRequestContainer } from '@open-mercato/shared/lib/di/container'\nimport { CustomerRbacService } from '@open-mercato/core/modules/customer_accounts/services/customerRbacService'\nimport {
|
|
5
|
-
"mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,SAAS;AAElB,SAAS,kCAAkC;AAC3C,SAAS,8BAA8B;AAEvC,SAAS,
|
|
4
|
+
"sourcesContent": ["import { NextResponse } from 'next/server'\nimport { z } from 'zod'\nimport type { OpenApiRouteDoc, OpenApiMethodDoc } from '@open-mercato/shared/lib/openapi'\nimport { getCustomerAuthFromRequest } from '@open-mercato/core/modules/customer_accounts/lib/customerAuth'\nimport { createRequestContainer } from '@open-mercato/shared/lib/di/container'\nimport { CustomerRbacService } from '@open-mercato/core/modules/customer_accounts/services/customerRbacService'\nimport { matchFeature } from '@open-mercato/shared/lib/auth/featureMatch'\n\nexport const metadata: { path?: string; requireAuth?: boolean } = { requireAuth: false }\n\nconst requestSchema = z.object({\n features: z.array(z.string()).min(1).max(100),\n})\n\nexport async function POST(req: Request) {\n const auth = await getCustomerAuthFromRequest(req)\n if (!auth) {\n return NextResponse.json({ ok: false, error: 'Authentication required' }, { status: 401 })\n }\n\n let body: z.infer<typeof requestSchema>\n try {\n const raw = await req.json()\n body = requestSchema.parse(raw)\n } catch {\n return NextResponse.json({ ok: false, error: 'Invalid request body' }, { status: 400 })\n }\n\n const container = await createRequestContainer()\n const customerRbacService = container.resolve('customerRbacService') as CustomerRbacService\n const acl = await customerRbacService.loadAcl(auth.sub, {\n tenantId: auth.tenantId,\n organizationId: auth.orgId,\n })\n\n const granted = acl.isPortalAdmin\n ? [...body.features]\n : body.features.filter((feature) =>\n acl.features.some((g) => matchFeature(feature, g)),\n )\n\n return NextResponse.json({ ok: true, granted })\n}\n\nconst methodDoc: OpenApiMethodDoc = {\n summary: 'Check customer portal feature access',\n description: 'Checks which of the requested features the authenticated customer user has. Used by portal menu injection for feature-gating.',\n tags: ['Customer Portal'],\n requestBody: {\n schema: requestSchema,\n },\n responses: [\n {\n status: 200,\n description: 'Feature check result',\n schema: z.object({\n ok: z.literal(true),\n granted: z.array(z.string()),\n }),\n },\n ],\n errors: [\n { status: 401, description: 'Not authenticated', schema: z.object({ ok: z.literal(false), error: z.string() }) },\n { status: 400, description: 'Invalid request', schema: z.object({ ok: z.literal(false), error: z.string() }) },\n ],\n}\n\nexport const openApi: OpenApiRouteDoc = {\n summary: 'Portal feature check',\n methods: { POST: methodDoc },\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,SAAS;AAElB,SAAS,kCAAkC;AAC3C,SAAS,8BAA8B;AAEvC,SAAS,oBAA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EAAE,QAAQ,IAAI;AAAA,QAClB,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC;AAAA,MAC7B,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EACA,QAAQ;AAAA,IACN,EAAE,QAAQ,KAAK,aAAa,qBAAqB,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,KAAK,GAAG,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE;AAAA,IAC/G,EAAE,QAAQ,KAAK,aAAa,mBAAmB,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,KAAK,GAAG,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE;AAAA,EAC/G;AACF;AAEO,MAAM,UAA2B;AAAA,EACtC,SAAS;AAAA,EACT,SAAS,EAAE,MAAM,UAAU;AAC7B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -40,14 +40,12 @@ async function GET(req) {
|
|
|
40
40
|
return NextResponse.json({ ok: false, error: "Organization not found" }, { status: 404 });
|
|
41
41
|
}
|
|
42
42
|
const acl = await rbac.loadAcl(auth.sub, { tenantId: auth.tenantId, organizationId: auth.orgId });
|
|
43
|
-
const grantedFeatures =
|
|
44
|
-
tenantId: auth.tenantId,
|
|
45
|
-
organizationId: auth.orgId
|
|
46
|
-
});
|
|
43
|
+
const grantedFeatures = acl.isPortalAdmin ? ["*"] : acl.features;
|
|
47
44
|
const groups = buildPortalNav({
|
|
48
45
|
routes: getFrontendRouteManifests(),
|
|
49
46
|
orgSlug,
|
|
50
|
-
grantedFeatures
|
|
47
|
+
grantedFeatures,
|
|
48
|
+
isPortalAdmin: acl.isPortalAdmin
|
|
51
49
|
});
|
|
52
50
|
return NextResponse.json({
|
|
53
51
|
ok: true,
|
|
@@ -59,7 +57,7 @@ async function GET(req) {
|
|
|
59
57
|
}
|
|
60
58
|
const getMethodDoc = {
|
|
61
59
|
summary: "Portal sidebar navigation",
|
|
62
|
-
description: "Returns the portal sidebar for the authenticated customer. Items are derived from each portal page's `nav` metadata and filtered by `requireCustomerFeatures` against
|
|
60
|
+
description: "Returns the portal sidebar for the authenticated customer. Items are derived from each portal page's `nav` metadata and filtered by `requireCustomerFeatures` against the customer's grants (wildcards honored).",
|
|
63
61
|
tags: ["Customer Portal"],
|
|
64
62
|
responses: [{ status: 200, description: "Portal sidebar groups", schema: navResponseSchema }],
|
|
65
63
|
errors: [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/modules/customer_accounts/api/portal/nav.ts"],
|
|
4
|
-
"sourcesContent": ["import { NextResponse } from 'next/server'\nimport { z } from 'zod'\nimport type { OpenApiRouteDoc, OpenApiMethodDoc } from '@open-mercato/shared/lib/openapi'\nimport { getCustomerAuthFromRequest } from '@open-mercato/core/modules/customer_accounts/lib/customerAuth'\nimport { createRequestContainer } from '@open-mercato/shared/lib/di/container'\nimport { getFrontendRouteManifests } from '@open-mercato/shared/modules/registry'\nimport { CustomerRbacService } from '@open-mercato/core/modules/customer_accounts/services/customerRbacService'\nimport { findOrganizationInTenant } from '@open-mercato/core/modules/customer_accounts/lib/organizationLookup'\nimport { buildPortalNav } from '@open-mercato/ui/portal/utils/nav'\n\nexport const metadata: { path?: string; requireAuth?: boolean } = { requireAuth: false }\n\nconst navItemSchema = z.object({\n id: z.string(),\n label: z.string(),\n labelKey: z.string().optional(),\n href: z.string(),\n icon: z.string().optional(),\n order: z.number(),\n})\n\nconst navGroupSchema = z.object({\n id: z.enum(['main', 'account']),\n items: z.array(navItemSchema),\n})\n\nconst navResponseSchema = z.object({\n ok: z.literal(true),\n orgSlug: z.string(),\n groups: z.array(navGroupSchema),\n grantedFeatures: z.array(z.string()),\n isPortalAdmin: z.boolean(),\n})\n\nconst errorSchema = z.object({ ok: z.literal(false), error: z.string() })\n\nexport async function GET(req: Request) {\n const auth = await getCustomerAuthFromRequest(req)\n if (!auth) {\n return NextResponse.json({ ok: false, error: 'Authentication required' }, { status: 401 })\n }\n\n const container = await createRequestContainer()\n const rbac = container.resolve('customerRbacService') as CustomerRbacService\n const em = container.resolve('em') as import('@mikro-orm/postgresql').EntityManager\n\n const org = await findOrganizationInTenant(em, auth.orgId, auth.tenantId)\n const orgSlug = org?.slug ?? ''\n if (!orgSlug) {\n return NextResponse.json({ ok: false, error: 'Organization not found' }, { status: 404 })\n }\n\n const acl = await rbac.loadAcl(auth.sub, { tenantId: auth.tenantId, organizationId: auth.orgId })\n const grantedFeatures =
|
|
5
|
-
"mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,SAAS;AAElB,SAAS,kCAAkC;AAC3C,SAAS,8BAA8B;AACvC,SAAS,iCAAiC;AAE1C,SAAS,gCAAgC;AACzC,SAAS,sBAAsB;AAExB,MAAM,WAAqD,EAAE,aAAa,MAAM;AAEvF,MAAM,gBAAgB,EAAE,OAAO;AAAA,EAC7B,IAAI,EAAE,OAAO;AAAA,EACb,OAAO,EAAE,OAAO;AAAA,EAChB,UAAU,EAAE,OAAO,EAAE,SAAS;AAAA,EAC9B,MAAM,EAAE,OAAO;AAAA,EACf,MAAM,EAAE,OAAO,EAAE,SAAS;AAAA,EAC1B,OAAO,EAAE,OAAO;AAClB,CAAC;AAED,MAAM,iBAAiB,EAAE,OAAO;AAAA,EAC9B,IAAI,EAAE,KAAK,CAAC,QAAQ,SAAS,CAAC;AAAA,EAC9B,OAAO,EAAE,MAAM,aAAa;AAC9B,CAAC;AAED,MAAM,oBAAoB,EAAE,OAAO;AAAA,EACjC,IAAI,EAAE,QAAQ,IAAI;AAAA,EAClB,SAAS,EAAE,OAAO;AAAA,EAClB,QAAQ,EAAE,MAAM,cAAc;AAAA,EAC9B,iBAAiB,EAAE,MAAM,EAAE,OAAO,CAAC;AAAA,EACnC,eAAe,EAAE,QAAQ;AAC3B,CAAC;AAED,MAAM,cAAc,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,KAAK,GAAG,OAAO,EAAE,OAAO,EAAE,CAAC;AAExE,eAAsB,IAAI,KAAc;AACtC,QAAM,OAAO,MAAM,2BAA2B,GAAG;AACjD,MAAI,CAAC,MAAM;AACT,WAAO,aAAa,KAAK,EAAE,IAAI,OAAO,OAAO,0BAA0B,GAAG,EAAE,QAAQ,IAAI,CAAC;AAAA,EAC3F;AAEA,QAAM,YAAY,MAAM,uBAAuB;AAC/C,QAAM,OAAO,UAAU,QAAQ,qBAAqB;AACpD,QAAM,KAAK,UAAU,QAAQ,IAAI;AAEjC,QAAM,MAAM,MAAM,yBAAyB,IAAI,KAAK,OAAO,KAAK,QAAQ;AACxE,QAAM,UAAU,KAAK,QAAQ;AAC7B,MAAI,CAAC,SAAS;AACZ,WAAO,aAAa,KAAK,EAAE,IAAI,OAAO,OAAO,yBAAyB,GAAG,EAAE,QAAQ,IAAI,CAAC;AAAA,EAC1F;AAEA,QAAM,MAAM,MAAM,KAAK,QAAQ,KAAK,KAAK,EAAE,UAAU,KAAK,UAAU,gBAAgB,KAAK,MAAM,CAAC;AAChG,QAAM,kBAAkB,
|
|
4
|
+
"sourcesContent": ["import { NextResponse } from 'next/server'\nimport { z } from 'zod'\nimport type { OpenApiRouteDoc, OpenApiMethodDoc } from '@open-mercato/shared/lib/openapi'\nimport { getCustomerAuthFromRequest } from '@open-mercato/core/modules/customer_accounts/lib/customerAuth'\nimport { createRequestContainer } from '@open-mercato/shared/lib/di/container'\nimport { getFrontendRouteManifests } from '@open-mercato/shared/modules/registry'\nimport { CustomerRbacService } from '@open-mercato/core/modules/customer_accounts/services/customerRbacService'\nimport { findOrganizationInTenant } from '@open-mercato/core/modules/customer_accounts/lib/organizationLookup'\nimport { buildPortalNav } from '@open-mercato/ui/portal/utils/nav'\n\nexport const metadata: { path?: string; requireAuth?: boolean } = { requireAuth: false }\n\nconst navItemSchema = z.object({\n id: z.string(),\n label: z.string(),\n labelKey: z.string().optional(),\n href: z.string(),\n icon: z.string().optional(),\n order: z.number(),\n})\n\nconst navGroupSchema = z.object({\n id: z.enum(['main', 'account']),\n items: z.array(navItemSchema),\n})\n\nconst navResponseSchema = z.object({\n ok: z.literal(true),\n orgSlug: z.string(),\n groups: z.array(navGroupSchema),\n grantedFeatures: z.array(z.string()),\n isPortalAdmin: z.boolean(),\n})\n\nconst errorSchema = z.object({ ok: z.literal(false), error: z.string() })\n\nexport async function GET(req: Request) {\n const auth = await getCustomerAuthFromRequest(req)\n if (!auth) {\n return NextResponse.json({ ok: false, error: 'Authentication required' }, { status: 401 })\n }\n\n const container = await createRequestContainer()\n const rbac = container.resolve('customerRbacService') as CustomerRbacService\n const em = container.resolve('em') as import('@mikro-orm/postgresql').EntityManager\n\n const org = await findOrganizationInTenant(em, auth.orgId, auth.tenantId)\n const orgSlug = org?.slug ?? ''\n if (!orgSlug) {\n return NextResponse.json({ ok: false, error: 'Organization not found' }, { status: 404 })\n }\n\n const acl = await rbac.loadAcl(auth.sub, { tenantId: auth.tenantId, organizationId: auth.orgId })\n const grantedFeatures = acl.isPortalAdmin ? ['*'] : acl.features\n\n const groups = buildPortalNav({\n routes: getFrontendRouteManifests(),\n orgSlug,\n grantedFeatures,\n isPortalAdmin: acl.isPortalAdmin,\n })\n\n return NextResponse.json({\n ok: true,\n orgSlug,\n groups,\n grantedFeatures,\n isPortalAdmin: acl.isPortalAdmin,\n })\n}\n\nconst getMethodDoc: OpenApiMethodDoc = {\n summary: 'Portal sidebar navigation',\n description:\n 'Returns the portal sidebar for the authenticated customer. Items are derived from each portal page\\'s `nav` metadata and filtered by `requireCustomerFeatures` against the customer\\'s grants (wildcards honored).',\n tags: ['Customer Portal'],\n responses: [{ status: 200, description: 'Portal sidebar groups', schema: navResponseSchema }],\n errors: [\n { status: 401, description: 'Not authenticated', schema: errorSchema },\n { status: 404, description: 'Organization not found', schema: errorSchema },\n ],\n}\n\nexport const openApi: OpenApiRouteDoc = {\n summary: 'Portal navigation',\n methods: { GET: getMethodDoc },\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,SAAS;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AM,UAAU,KAAK,QAAQ;AAC7B,MAAI,CAAC,SAAS;AACZ,WAAO,aAAa,KAAK,EAAE,IAAI,OAAO,OAAO,yBAAyB,GAAG,EAAE,QAAQ,IAAI,CAAC;AAAA,EAC1F;AAEA,QAAM,MAAM,MAAM,KAAK,QAAQ,KAAK,KAAK,EAAE,UAAU,KAAK,UAAU,gBAAgB,KAAK,MAAM,CAAC;AAChG,QAAM,kBAAkB,IAAI,gBAAgB,CAAC,GAAG,IAAI,IAAI;AAExD,QAAM,SAAS,eAAe;AAAA,IAC5B,QAAQ,0BAA0B;AAAA,IAClC;AAAA,IACA;AAAA,IACA,eAAe,IAAI;AAAA,EACrB,CAAC;AAED,SAAO,aAAa,KAAK;AAAA,IACvB,IAAI;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA,eAAe,IAAI;AAAA,EACrB,CAAC;AACH;AAEA,MAAM,eAAiC;AAAA,EACrC,SAAS;AAAA,EACT,aACE;AAAA,EACF,MAAM,CAAC,iBAAiB;AAAA,EACxB,WAAW,CAAC,EAAE,QAAQ,KAAK,aAAa,yBAAyB,QAAQ,kBAAkB,CAAC;AAAA,EAC5F,QAAQ;AAAA,IACN,EAAE,QAAQ,KAAK,aAAa,qBAAqB,QAAQ,YAAY;AAAA,IACrE,EAAE,QAAQ,KAAK,aAAa,0BAA0B,QAAQ,YAAY;AAAA,EAC5E;AACF;AAEO,MAAM,UAA2B;AAAA,EACtC,SAAS;AAAA,EACT,SAAS,EAAE,KAAK,aAAa;AAC/B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -19,10 +19,6 @@ async function GET(req) {
|
|
|
19
19
|
return NextResponse.json({ ok: false, error: "User not found" }, { status: 404 });
|
|
20
20
|
}
|
|
21
21
|
const acl = await customerRbacService.loadAcl(user.id, { tenantId: user.tenantId, organizationId: user.organizationId });
|
|
22
|
-
const resolvedFeatures = await customerRbacService.getEffectiveFeatures(user.id, {
|
|
23
|
-
tenantId: user.tenantId,
|
|
24
|
-
organizationId: user.organizationId
|
|
25
|
-
});
|
|
26
22
|
const userRoles = await em.find(CustomerUserRole, {
|
|
27
23
|
user: user.id,
|
|
28
24
|
deletedAt: null
|
|
@@ -46,7 +42,7 @@ async function GET(req) {
|
|
|
46
42
|
createdAt: user.createdAt
|
|
47
43
|
},
|
|
48
44
|
roles,
|
|
49
|
-
resolvedFeatures,
|
|
45
|
+
resolvedFeatures: acl.features,
|
|
50
46
|
isPortalAdmin: acl.isPortalAdmin
|
|
51
47
|
});
|
|
52
48
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/modules/customer_accounts/api/portal/profile.ts"],
|
|
4
|
-
"sourcesContent": ["import { NextResponse } from 'next/server'\nimport { z } from 'zod'\nimport type { OpenApiRouteDoc, OpenApiMethodDoc } from '@open-mercato/shared/lib/openapi'\nimport { getCustomerAuthFromRequest, requireCustomerFeature } from '@open-mercato/core/modules/customer_accounts/lib/customerAuth'\nimport { createRequestContainer } from '@open-mercato/shared/lib/di/container'\nimport { CustomerUserService } from '@open-mercato/core/modules/customer_accounts/services/customerUserService'\nimport { CustomerRbacService } from '@open-mercato/core/modules/customer_accounts/services/customerRbacService'\nimport { CustomerUserRole } from '@open-mercato/core/modules/customer_accounts/data/entities'\nimport { profileUpdateSchema } from '@open-mercato/core/modules/customer_accounts/data/validators'\n\nexport const metadata: { path?: string; requireAuth?: boolean } = { requireAuth: false }\n\nexport async function GET(req: Request) {\n const auth = await getCustomerAuthFromRequest(req)\n if (!auth) {\n return NextResponse.json({ ok: false, error: 'Authentication required' }, { status: 401 })\n }\n\n const container = await createRequestContainer()\n const customerUserService = container.resolve('customerUserService') as CustomerUserService\n const customerRbacService = container.resolve('customerRbacService') as CustomerRbacService\n const em = container.resolve('em') as import('@mikro-orm/postgresql').EntityManager\n\n const user = await customerUserService.findById(auth.sub, auth.tenantId)\n if (!user) {\n return NextResponse.json({ ok: false, error: 'User not found' }, { status: 404 })\n }\n\n const acl = await customerRbacService.loadAcl(user.id, { tenantId: user.tenantId, organizationId: user.organizationId })\n
|
|
5
|
-
"mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,SAAS;AAElB,SAAS,4BAA4B,8BAA8B;AACnE,SAAS,8BAA8B;AAGvC,SAAS,wBAAwB;AACjC,SAAS,2BAA2B;AAE7B,MAAM,WAAqD,EAAE,aAAa,MAAM;AAEvF,eAAsB,IAAI,KAAc;AACtC,QAAM,OAAO,MAAM,2BAA2B,GAAG;AACjD,MAAI,CAAC,MAAM;AACT,WAAO,aAAa,KAAK,EAAE,IAAI,OAAO,OAAO,0BAA0B,GAAG,EAAE,QAAQ,IAAI,CAAC;AAAA,EAC3F;AAEA,QAAM,YAAY,MAAM,uBAAuB;AAC/C,QAAM,sBAAsB,UAAU,QAAQ,qBAAqB;AACnE,QAAM,sBAAsB,UAAU,QAAQ,qBAAqB;AACnE,QAAM,KAAK,UAAU,QAAQ,IAAI;AAEjC,QAAM,OAAO,MAAM,oBAAoB,SAAS,KAAK,KAAK,KAAK,QAAQ;AACvE,MAAI,CAAC,MAAM;AACT,WAAO,aAAa,KAAK,EAAE,IAAI,OAAO,OAAO,iBAAiB,GAAG,EAAE,QAAQ,IAAI,CAAC;AAAA,EAClF;AAEA,QAAM,MAAM,MAAM,oBAAoB,QAAQ,KAAK,IAAI,EAAE,UAAU,KAAK,UAAU,gBAAgB,KAAK,eAAe,CAAC;
|
|
4
|
+
"sourcesContent": ["import { NextResponse } from 'next/server'\nimport { z } from 'zod'\nimport type { OpenApiRouteDoc, OpenApiMethodDoc } from '@open-mercato/shared/lib/openapi'\nimport { getCustomerAuthFromRequest, requireCustomerFeature } from '@open-mercato/core/modules/customer_accounts/lib/customerAuth'\nimport { createRequestContainer } from '@open-mercato/shared/lib/di/container'\nimport { CustomerUserService } from '@open-mercato/core/modules/customer_accounts/services/customerUserService'\nimport { CustomerRbacService } from '@open-mercato/core/modules/customer_accounts/services/customerRbacService'\nimport { CustomerUserRole } from '@open-mercato/core/modules/customer_accounts/data/entities'\nimport { profileUpdateSchema } from '@open-mercato/core/modules/customer_accounts/data/validators'\n\nexport const metadata: { path?: string; requireAuth?: boolean } = { requireAuth: false }\n\nexport async function GET(req: Request) {\n const auth = await getCustomerAuthFromRequest(req)\n if (!auth) {\n return NextResponse.json({ ok: false, error: 'Authentication required' }, { status: 401 })\n }\n\n const container = await createRequestContainer()\n const customerUserService = container.resolve('customerUserService') as CustomerUserService\n const customerRbacService = container.resolve('customerRbacService') as CustomerRbacService\n const em = container.resolve('em') as import('@mikro-orm/postgresql').EntityManager\n\n const user = await customerUserService.findById(auth.sub, auth.tenantId)\n if (!user) {\n return NextResponse.json({ ok: false, error: 'User not found' }, { status: 404 })\n }\n\n const acl = await customerRbacService.loadAcl(user.id, { tenantId: user.tenantId, organizationId: user.organizationId })\n\n const userRoles = await em.find(CustomerUserRole, {\n user: user.id as any,\n deletedAt: null,\n }, { populate: ['role'] })\n const roles = userRoles.map((ur) => ({\n id: (ur.role as any).id,\n name: (ur.role as any).name,\n slug: (ur.role as any).slug,\n }))\n\n return NextResponse.json({\n ok: true,\n user: {\n id: user.id,\n email: user.email,\n displayName: user.displayName,\n emailVerified: !!user.emailVerifiedAt,\n customerEntityId: user.customerEntityId,\n personEntityId: user.personEntityId,\n isActive: user.isActive,\n lastLoginAt: user.lastLoginAt,\n createdAt: user.createdAt,\n },\n roles,\n resolvedFeatures: acl.features,\n isPortalAdmin: acl.isPortalAdmin,\n })\n}\n\nexport async function PUT(req: Request) {\n const auth = await getCustomerAuthFromRequest(req)\n if (!auth) {\n return NextResponse.json({ ok: false, error: 'Authentication required' }, { status: 401 })\n }\n\n const container = await createRequestContainer()\n const customerRbacService = container.resolve('customerRbacService') as CustomerRbacService\n\n try {\n await requireCustomerFeature(auth, ['portal.account.manage'], customerRbacService)\n } catch (response) {\n return response as NextResponse\n }\n\n let body: unknown\n try {\n body = await req.json()\n } catch {\n return NextResponse.json({ ok: false, error: 'Invalid request body' }, { status: 400 })\n }\n\n const parsed = profileUpdateSchema.safeParse(body)\n if (!parsed.success) {\n return NextResponse.json({ ok: false, error: 'Validation failed' }, { status: 400 })\n }\n\n const customerUserService = container.resolve('customerUserService') as CustomerUserService\n\n const user = await customerUserService.findById(auth.sub, auth.tenantId)\n if (!user) {\n return NextResponse.json({ ok: false, error: 'User not found' }, { status: 404 })\n }\n\n await customerUserService.updateProfile(user, parsed.data)\n\n return NextResponse.json({\n ok: true,\n user: {\n id: user.id,\n email: user.email,\n displayName: user.displayName,\n },\n })\n}\n\nconst profileSchema = z.object({\n ok: z.literal(true),\n user: z.object({\n id: z.string().uuid(),\n email: z.string(),\n displayName: z.string(),\n emailVerified: z.boolean(),\n customerEntityId: z.string().uuid().nullable(),\n personEntityId: z.string().uuid().nullable(),\n isActive: z.boolean(),\n lastLoginAt: z.string().datetime().nullable(),\n createdAt: z.string().datetime(),\n }),\n roles: z.array(z.object({ id: z.string().uuid(), name: z.string(), slug: z.string() })),\n resolvedFeatures: z.array(z.string()),\n isPortalAdmin: z.boolean(),\n})\n\nconst putSuccessSchema = z.object({\n ok: z.literal(true),\n user: z.object({ id: z.string().uuid(), email: z.string(), displayName: z.string() }),\n})\nconst errorSchema = z.object({ ok: z.literal(false), error: z.string() })\n\nconst getMethodDoc: OpenApiMethodDoc = {\n summary: 'Get customer profile',\n description: 'Returns the authenticated customer user profile with roles and permissions.',\n tags: ['Customer Portal'],\n responses: [{ status: 200, description: 'Profile data', schema: profileSchema }],\n errors: [{ status: 401, description: 'Not authenticated', schema: errorSchema }],\n}\n\nconst putMethodDoc: OpenApiMethodDoc = {\n summary: 'Update customer profile',\n description: 'Updates the authenticated customer user profile.',\n tags: ['Customer Portal'],\n requestBody: { schema: profileUpdateSchema },\n responses: [{ status: 200, description: 'Profile updated', schema: putSuccessSchema }],\n errors: [\n { status: 401, description: 'Not authenticated', schema: errorSchema },\n { status: 403, description: 'Insufficient permissions', schema: errorSchema },\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AACD,MAAM,cAAc,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,KAAK,GAAG,OAAO,EAAE,OAAO,EAAE,CAAC;AAExE,MAAM,eAAiC;AAAA,EACrC,SAAS;AAAA,EACT,aAAa;AAAA,EACb,MAAM,CAAC,iBAAiB;AAAA,EACxB,WAAW,CAAC,EAAE,QAAQ,KAAK,aAAa,gBAAgB,QAAQ,cAAc,CAAC;AAAA,EAC/E,QAAQ,CAAC,EAAE,QAAQ,KAAK,aAAa,qBAAqB,QAAQ,YAAY,CAAC;AACjF;AAEA,MAAM,eAAiC;AAAA,EACrC,SAAS;AAAA,EACT,aAAa;AAAA,EACb,MAAM,CAAC,iBAAiB;AAAA,EACxB,aAAa,EAAE,QAAQ,oBAAoB;AAAA,EAC3C,WAAW,CAAC,EAAE,QAAQ,KAAK,aAAa,mBAAmB,QAAQ,iBAAiB,CAAC;AAAA,EACrF,QAAQ;AAAA,IACN,EAAE,QAAQ,KAAK,aAAa,qBAAqB,QAAQ,YAAY;AAAA,IACrE,EAAE,QAAQ,KAAK,aAAa,4BAA4B,QAAQ,YAAY;AAAA,EAC9E;AACF;AAEO,MAAM,UAA2B;AAAA,EACtC,SAAS;AAAA,EACT,SAAS,EAAE,KAAK,cAAc,KAAK,aAAa;AAClD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -26,15 +26,15 @@ async function POST(req) {
|
|
|
26
26
|
if (!user || user.deletedAt || !user.isActive) {
|
|
27
27
|
return NextResponse.json({ ok: false, error: "Account not active" }, { status: 401 });
|
|
28
28
|
}
|
|
29
|
-
const
|
|
29
|
+
const acl = await customerRbacService.loadAcl(user.id, {
|
|
30
30
|
tenantId: user.tenantId,
|
|
31
31
|
organizationId: user.organizationId
|
|
32
32
|
});
|
|
33
|
-
const result = await customerSessionService.refreshSession(decodedToken,
|
|
33
|
+
const result = await customerSessionService.refreshSession(decodedToken, acl.features);
|
|
34
34
|
if (!result) {
|
|
35
35
|
return NextResponse.json({ ok: false, error: "Session refresh failed" }, { status: 401 });
|
|
36
36
|
}
|
|
37
|
-
const res = NextResponse.json({ ok: true, resolvedFeatures });
|
|
37
|
+
const res = NextResponse.json({ ok: true, resolvedFeatures: acl.features });
|
|
38
38
|
res.cookies.set("customer_auth_token", result.jwt, {
|
|
39
39
|
httpOnly: true,
|
|
40
40
|
path: "/",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/modules/customer_accounts/api/portal/sessions-refresh.ts"],
|
|
4
|
-
"sourcesContent": ["import { NextResponse } from 'next/server'\nimport { z } from 'zod'\nimport type { OpenApiRouteDoc, OpenApiMethodDoc } from '@open-mercato/shared/lib/openapi'\nimport { createRequestContainer } from '@open-mercato/shared/lib/di/container'\nimport { CustomerSessionService } from '@open-mercato/core/modules/customer_accounts/services/customerSessionService'\nimport { CustomerRbacService } from '@open-mercato/core/modules/customer_accounts/services/customerRbacService'\nimport { readCookieFromHeader } from '@open-mercato/core/modules/customer_accounts/lib/customerAuth'\n\nexport const metadata: { path?: string; requireAuth?: boolean } = { requireAuth: false }\n\nexport async function POST(req: Request) {\n const cookieHeader = req.headers.get('cookie') || ''\n const sessionToken = readCookieFromHeader(cookieHeader, 'customer_session_token')\n if (!sessionToken) {\n return NextResponse.json({ ok: false, error: 'No session token' }, { status: 401 })\n }\n\n let decodedToken: string\n try {\n decodedToken = decodeURIComponent(sessionToken)\n } catch {\n decodedToken = sessionToken\n }\n\n const container = await createRequestContainer()\n const customerSessionService = container.resolve('customerSessionService') as CustomerSessionService\n const customerRbacService = container.resolve('customerRbacService') as CustomerRbacService\n\n const session = await customerSessionService.findByToken(decodedToken)\n if (!session) {\n return NextResponse.json({ ok: false, error: 'Invalid or expired session' }, { status: 401 })\n }\n\n const user = session.user as any\n if (!user || user.deletedAt || !user.isActive) {\n return NextResponse.json({ ok: false, error: 'Account not active' }, { status: 401 })\n }\n\n const
|
|
5
|
-
"mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,SAAS;AAElB,SAAS,8BAA8B;AAGvC,SAAS,4BAA4B;AAE9B,MAAM,WAAqD,EAAE,aAAa,MAAM;AAEvF,eAAsB,KAAK,KAAc;AACvC,QAAM,eAAe,IAAI,QAAQ,IAAI,QAAQ,KAAK;AAClD,QAAM,eAAe,qBAAqB,cAAc,wBAAwB;AAChF,MAAI,CAAC,cAAc;AACjB,WAAO,aAAa,KAAK,EAAE,IAAI,OAAO,OAAO,mBAAmB,GAAG,EAAE,QAAQ,IAAI,CAAC;AAAA,EACpF;AAEA,MAAI;AACJ,MAAI;AACF,mBAAe,mBAAmB,YAAY;AAAA,EAChD,QAAQ;AACN,mBAAe;AAAA,EACjB;AAEA,QAAM,YAAY,MAAM,uBAAuB;AAC/C,QAAM,yBAAyB,UAAU,QAAQ,wBAAwB;AACzE,QAAM,sBAAsB,UAAU,QAAQ,qBAAqB;AAEnE,QAAM,UAAU,MAAM,uBAAuB,YAAY,YAAY;AACrE,MAAI,CAAC,SAAS;AACZ,WAAO,aAAa,KAAK,EAAE,IAAI,OAAO,OAAO,6BAA6B,GAAG,EAAE,QAAQ,IAAI,CAAC;AAAA,EAC9F;AAEA,QAAM,OAAO,QAAQ;AACrB,MAAI,CAAC,QAAQ,KAAK,aAAa,CAAC,KAAK,UAAU;AAC7C,WAAO,aAAa,KAAK,EAAE,IAAI,OAAO,OAAO,qBAAqB,GAAG,EAAE,QAAQ,IAAI,CAAC;AAAA,EACtF;AAEA,QAAM,
|
|
4
|
+
"sourcesContent": ["import { NextResponse } from 'next/server'\nimport { z } from 'zod'\nimport type { OpenApiRouteDoc, OpenApiMethodDoc } from '@open-mercato/shared/lib/openapi'\nimport { createRequestContainer } from '@open-mercato/shared/lib/di/container'\nimport { CustomerSessionService } from '@open-mercato/core/modules/customer_accounts/services/customerSessionService'\nimport { CustomerRbacService } from '@open-mercato/core/modules/customer_accounts/services/customerRbacService'\nimport { readCookieFromHeader } from '@open-mercato/core/modules/customer_accounts/lib/customerAuth'\n\nexport const metadata: { path?: string; requireAuth?: boolean } = { requireAuth: false }\n\nexport async function POST(req: Request) {\n const cookieHeader = req.headers.get('cookie') || ''\n const sessionToken = readCookieFromHeader(cookieHeader, 'customer_session_token')\n if (!sessionToken) {\n return NextResponse.json({ ok: false, error: 'No session token' }, { status: 401 })\n }\n\n let decodedToken: string\n try {\n decodedToken = decodeURIComponent(sessionToken)\n } catch {\n decodedToken = sessionToken\n }\n\n const container = await createRequestContainer()\n const customerSessionService = container.resolve('customerSessionService') as CustomerSessionService\n const customerRbacService = container.resolve('customerRbacService') as CustomerRbacService\n\n const session = await customerSessionService.findByToken(decodedToken)\n if (!session) {\n return NextResponse.json({ ok: false, error: 'Invalid or expired session' }, { status: 401 })\n }\n\n const user = session.user as any\n if (!user || user.deletedAt || !user.isActive) {\n return NextResponse.json({ ok: false, error: 'Account not active' }, { status: 401 })\n }\n\n const acl = await customerRbacService.loadAcl(user.id, {\n tenantId: user.tenantId,\n organizationId: user.organizationId,\n })\n\n const result = await customerSessionService.refreshSession(decodedToken, acl.features)\n if (!result) {\n return NextResponse.json({ ok: false, error: 'Session refresh failed' }, { status: 401 })\n }\n\n const res = NextResponse.json({ ok: true, resolvedFeatures: acl.features })\n\n res.cookies.set('customer_auth_token', result.jwt, {\n httpOnly: true,\n path: '/',\n sameSite: 'lax',\n secure: process.env.NODE_ENV === 'production',\n maxAge: 60 * 60 * 8,\n })\n\n return res\n}\n\nconst successSchema = z.object({ ok: z.literal(true), resolvedFeatures: z.array(z.string()) })\nconst errorSchema = z.object({ ok: z.literal(false), error: z.string() })\n\nconst methodDoc: OpenApiMethodDoc = {\n summary: 'Refresh customer JWT from session token',\n description: 'Uses the session cookie to issue a fresh JWT access token.',\n tags: ['Customer Portal'],\n responses: [{ status: 200, description: 'Token refreshed', schema: successSchema }],\n errors: [{ status: 401, description: 'Invalid session', schema: errorSchema }],\n}\n\nexport const openApi: OpenApiRouteDoc = {\n summary: 'Refresh customer session',\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G,EAAE,QAAQ,IAAI,CAAC;AAAA,EAC1F;AAEA,QAAM,MAAM,aAAa,KAAK,EAAE,IAAI,MAAM,kBAAkB,IAAI,SAAS,CAAC;AAE1E,MAAI,QAAQ,IAAI,uBAAuB,OAAO,KAAK;AAAA,IACjD,UAAU;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA,IACV,QAAQ,QAAQ,IAAI,aAAa;AAAA,IACjC,QAAQ,KAAK,KAAK;AAAA,EACpB,CAAC;AAED,SAAO;AACT;AAEA,MAAM,gBAAgB,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,IAAI,GAAG,kBAAkB,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;AAC7F,MAAM,cAAc,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,KAAK,GAAG,OAAO,EAAE,OAAO,EAAE,CAAC;AAExE,MAAM,YAA8B;AAAA,EAClC,SAAS;AAAA,EACT,aAAa;AAAA,EACb,MAAM,CAAC,iBAAiB;AAAA,EACxB,WAAW,CAAC,EAAE,QAAQ,KAAK,aAAa,mBAAmB,QAAQ,cAAc,CAAC;AAAA,EAClF,QAAQ,CAAC,EAAE,QAAQ,KAAK,aAAa,mBAAmB,QAAQ,YAAY,CAAC;AAC/E;AAEO,MAAM,UAA2B;AAAA,EACtC,SAAS;AAAA,EACT,SAAS,EAAE,MAAM,UAAU;AAC7B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -13,9 +13,6 @@ import {
|
|
|
13
13
|
customerInviteIpRateLimitConfig
|
|
14
14
|
} from "@open-mercato/core/modules/customer_accounts/lib/rateLimiter";
|
|
15
15
|
import { readNormalizedEmailFromJsonRequest } from "@open-mercato/core/modules/customer_accounts/lib/rateLimitIdentifier";
|
|
16
|
-
import { sendCustomerInvitationEmail } from "@open-mercato/core/modules/customer_accounts/lib/invitationEmail";
|
|
17
|
-
import { createLogger } from "@open-mercato/shared/lib/logger";
|
|
18
|
-
const logger = createLogger("customer_accounts").child({ component: "portal-users-invite" });
|
|
19
16
|
const metadata = { requireAuth: false };
|
|
20
17
|
async function POST(req) {
|
|
21
18
|
const auth = await getCustomerAuthFromRequest(req);
|
|
@@ -75,7 +72,7 @@ async function POST(req) {
|
|
|
75
72
|
}
|
|
76
73
|
}
|
|
77
74
|
const customerInvitationService = container.resolve("customerInvitationService");
|
|
78
|
-
const { invitation
|
|
75
|
+
const { invitation } = await customerInvitationService.createInvitation(
|
|
79
76
|
parsed.data.email,
|
|
80
77
|
{ tenantId: auth.tenantId, organizationId: auth.orgId },
|
|
81
78
|
{
|
|
@@ -85,22 +82,6 @@ async function POST(req) {
|
|
|
85
82
|
displayName: parsed.data.displayName || null
|
|
86
83
|
}
|
|
87
84
|
);
|
|
88
|
-
try {
|
|
89
|
-
await sendCustomerInvitationEmail({
|
|
90
|
-
container,
|
|
91
|
-
organizationId: auth.orgId,
|
|
92
|
-
email: invitation.email,
|
|
93
|
-
rawToken
|
|
94
|
-
});
|
|
95
|
-
} catch (error) {
|
|
96
|
-
logger.error("Invitation email failed", { err: error });
|
|
97
|
-
try {
|
|
98
|
-
await customerInvitationService.rollbackInvitation(invitation, rollbackState);
|
|
99
|
-
} catch (rollbackError) {
|
|
100
|
-
logger.error("Invitation rollback failed", { err: rollbackError });
|
|
101
|
-
}
|
|
102
|
-
return NextResponse.json({ ok: false, error: "Invitation email could not be sent" }, { status: 502 });
|
|
103
|
-
}
|
|
104
85
|
void emitCustomerAccountsEvent("customer_accounts.user.invited", {
|
|
105
86
|
invitationId: invitation.id,
|
|
106
87
|
email: invitation.email,
|
|
@@ -137,8 +118,7 @@ const methodDoc = {
|
|
|
137
118
|
{ status: 400, description: "Validation failed", schema: errorSchema },
|
|
138
119
|
{ status: 401, description: "Not authenticated", schema: errorSchema },
|
|
139
120
|
{ status: 403, description: "Insufficient permissions or non-assignable role", schema: errorSchema },
|
|
140
|
-
{ status: 429, description: "Too many invitation requests", schema: rateLimitErrorSchema }
|
|
141
|
-
{ status: 502, description: "Invitation email could not be sent", schema: errorSchema }
|
|
121
|
+
{ status: 429, description: "Too many invitation requests", schema: rateLimitErrorSchema }
|
|
142
122
|
]
|
|
143
123
|
};
|
|
144
124
|
const openApi = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/modules/customer_accounts/api/portal/users-invite.ts"],
|
|
4
|
-
"sourcesContent": ["import { NextResponse } from 'next/server'\nimport { z } from 'zod'\nimport type { OpenApiRouteDoc, OpenApiMethodDoc } from '@open-mercato/shared/lib/openapi'\nimport { getCustomerAuthFromRequest, requireCustomerFeature } from '@open-mercato/core/modules/customer_accounts/lib/customerAuth'\nimport { createRequestContainer } from '@open-mercato/shared/lib/di/container'\nimport { CustomerInvitationService } from '@open-mercato/core/modules/customer_accounts/services/customerInvitationService'\nimport { emitCustomerAccountsEvent } from '@open-mercato/core/modules/customer_accounts/events'\nimport { CustomerRbacService } from '@open-mercato/core/modules/customer_accounts/services/customerRbacService'\nimport { CustomerRole } from '@open-mercato/core/modules/customer_accounts/data/entities'\nimport { inviteUserSchema } from '@open-mercato/core/modules/customer_accounts/data/validators'\nimport { findWithDecryption } from '@open-mercato/shared/lib/encryption/find'\nimport { rateLimitErrorSchema } from '@open-mercato/shared/lib/ratelimit/helpers'\nimport {\n checkAuthRateLimit,\n customerInviteRateLimitConfig,\n customerInviteIpRateLimitConfig,\n} from '@open-mercato/core/modules/customer_accounts/lib/rateLimiter'\nimport { readNormalizedEmailFromJsonRequest } from '@open-mercato/core/modules/customer_accounts/lib/rateLimitIdentifier'\
|
|
5
|
-
"mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,SAAS;AAElB,SAAS,4BAA4B,8BAA8B;AACnE,SAAS,8BAA8B;AAEvC,SAAS,iCAAiC;AAE1C,SAAS,oBAAoB;AAC7B,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AACnC,SAAS,4BAA4B;AACrC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,0CAA0C;
|
|
4
|
+
"sourcesContent": ["import { NextResponse } from 'next/server'\nimport { z } from 'zod'\nimport type { OpenApiRouteDoc, OpenApiMethodDoc } from '@open-mercato/shared/lib/openapi'\nimport { getCustomerAuthFromRequest, requireCustomerFeature } from '@open-mercato/core/modules/customer_accounts/lib/customerAuth'\nimport { createRequestContainer } from '@open-mercato/shared/lib/di/container'\nimport { CustomerInvitationService } from '@open-mercato/core/modules/customer_accounts/services/customerInvitationService'\nimport { emitCustomerAccountsEvent } from '@open-mercato/core/modules/customer_accounts/events'\nimport { CustomerRbacService } from '@open-mercato/core/modules/customer_accounts/services/customerRbacService'\nimport { CustomerRole } from '@open-mercato/core/modules/customer_accounts/data/entities'\nimport { inviteUserSchema } from '@open-mercato/core/modules/customer_accounts/data/validators'\nimport { findWithDecryption } from '@open-mercato/shared/lib/encryption/find'\nimport { rateLimitErrorSchema } from '@open-mercato/shared/lib/ratelimit/helpers'\nimport {\n checkAuthRateLimit,\n customerInviteRateLimitConfig,\n customerInviteIpRateLimitConfig,\n} from '@open-mercato/core/modules/customer_accounts/lib/rateLimiter'\nimport { readNormalizedEmailFromJsonRequest } from '@open-mercato/core/modules/customer_accounts/lib/rateLimitIdentifier'\n\nexport const metadata: { path?: string; requireAuth?: boolean } = { requireAuth: false }\n\nexport async function POST(req: Request) {\n const auth = await getCustomerAuthFromRequest(req)\n if (!auth) {\n return NextResponse.json({ ok: false, error: 'Authentication required' }, { status: 401 })\n }\n\n const rateLimitEmail = await readNormalizedEmailFromJsonRequest(req)\n const { error: rateLimitError } = await checkAuthRateLimit({\n req,\n ipConfig: customerInviteIpRateLimitConfig,\n compoundConfig: customerInviteRateLimitConfig,\n compoundIdentifier: rateLimitEmail,\n })\n if (rateLimitError) return rateLimitError\n\n const container = await createRequestContainer()\n const customerRbacService = container.resolve('customerRbacService') as CustomerRbacService\n\n try {\n await requireCustomerFeature(auth, ['portal.users.manage'], customerRbacService)\n } catch (response) {\n return response as NextResponse\n }\n\n if (!auth.customerEntityId) {\n return NextResponse.json({ ok: false, error: 'No company association' }, { status: 403 })\n }\n\n let body: unknown\n try {\n body = await req.json()\n } catch {\n return NextResponse.json({ ok: false, error: 'Invalid request body' }, { status: 400 })\n }\n\n const parsed = inviteUserSchema.safeParse(body)\n if (!parsed.success) {\n return NextResponse.json({ ok: false, error: 'Validation failed', details: parsed.error.flatten().fieldErrors }, { status: 400 })\n }\n\n const em = container.resolve('em') as import('@mikro-orm/postgresql').EntityManager\n\n // Validate all roles are customer_assignable\n const requestedRoleIds = parsed.data.roleIds\n const roles = requestedRoleIds.length > 0\n ? await findWithDecryption(\n em,\n CustomerRole,\n {\n id: { $in: requestedRoleIds },\n tenantId: auth.tenantId,\n organizationId: auth.orgId,\n deletedAt: null,\n } as any,\n undefined,\n { tenantId: auth.tenantId, organizationId: auth.orgId },\n )\n : []\n const rolesById = new Map(roles.map((role) => [role.id, role]))\n for (const roleId of requestedRoleIds) {\n const role = rolesById.get(roleId)\n if (!role) {\n return NextResponse.json({ ok: false, error: `Role ${roleId} not found` }, { status: 400 })\n }\n if (!role.customerAssignable) {\n return NextResponse.json({ ok: false, error: `Role \"${role.name}\" cannot be assigned by portal users` }, { status: 403 })\n }\n }\n\n const customerInvitationService = container.resolve('customerInvitationService') as CustomerInvitationService\n\n const { invitation } = await customerInvitationService.createInvitation(\n parsed.data.email,\n { tenantId: auth.tenantId, organizationId: auth.orgId },\n {\n customerEntityId: auth.customerEntityId,\n roleIds: parsed.data.roleIds,\n invitedByCustomerUserId: auth.sub,\n displayName: parsed.data.displayName || null,\n },\n )\n\n void emitCustomerAccountsEvent('customer_accounts.user.invited', {\n invitationId: invitation.id,\n email: invitation.email,\n customerEntityId: invitation.customerEntityId || null,\n invitedByType: 'portal',\n tenantId: auth.tenantId,\n organizationId: auth.orgId,\n }).catch(() => undefined)\n\n return NextResponse.json({\n ok: true,\n invitation: {\n id: invitation.id,\n email: invitation.email,\n expiresAt: invitation.expiresAt,\n },\n }, { status: 201 })\n}\n\nconst successSchema = z.object({\n ok: z.literal(true),\n invitation: z.object({\n id: z.string().uuid(),\n email: z.string(),\n expiresAt: z.string().datetime(),\n }),\n})\nconst errorSchema = z.object({ ok: z.literal(false), error: z.string() })\n\nconst methodDoc: OpenApiMethodDoc = {\n summary: 'Invite a user to the company portal',\n description: 'Creates an invitation for a new user to join the company portal.',\n tags: ['Customer Portal'],\n requestBody: { schema: inviteUserSchema },\n responses: [{ status: 201, description: 'Invitation created', schema: successSchema }],\n errors: [\n { status: 400, description: 'Validation failed', schema: errorSchema },\n { status: 401, description: 'Not authenticated', schema: errorSchema },\n { status: 403, description: 'Insufficient permissions or non-assignable role', schema: errorSchema },\n { status: 429, description: 'Too many invitation requests', schema: rateLimitErrorSchema },\n ],\n}\n\nexport const openApi: OpenApiRouteDoc = {\n summary: 'Invite portal user',\n methods: { POST: methodDoc },\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,SAAS;AAElB,SAAS,4BAA4B,8BAA8B;AACnE,SAAS,8BAA8B;AAEvC,SAAS,iCAAiC;AAE1C,SAAS,oBAAoB;AAC7B,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AACnC,SAAS,4BAA4B;AACrC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,0CAA0C;AAE5C,MAAM,WAAqD,EAAE,aAAa,MAAM;AAEvF,eAAsB,KAAK,KAAc;AACvC,QAAM,OAAO,MAAM,2BAA2B,GAAG;AACjD,MAAI,CAAC,MAAM;AACT,WAAO,aAAa,KAAK,EAAE,IAAI,OAAO,OAAO,0BAA0B,GAAG,EAAE,QAAQ,IAAI,CAAC;AAAA,EAC3F;AAEA,QAAM,iBAAiB,MAAM,mCAAmC,GAAG;AACnE,QAAM,EAAE,OAAO,eAAe,IAAI,MAAM,mBAAmB;AAAA,IACzD;AAAA,IACA,UAAU;AAAA,IACV,gBAAgB;A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AO,EAAE,OAAO;AAAA,IAChB,WAAW,EAAE,OAAO,EAAE,SAAS;AAAA,EACjC,CAAC;AACH,CAAC;AACD,MAAM,cAAc,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,KAAK,GAAG,OAAO,EAAE,OAAO,EAAE,CAAC;AAExE,MAAM,YAA8B;AAAA,EAClC,SAAS;AAAA,EACT,aAAa;AAAA,EACb,MAAM,CAAC,iBAAiB;AAAA,EACxB,aAAa,EAAE,QAAQ,iBAAiB;AAAA,EACxC,WAAW,CAAC,EAAE,QAAQ,KAAK,aAAa,sBAAsB,QAAQ,cAAc,CAAC;AAAA,EACrF,QAAQ;AAAA,IACN,EAAE,QAAQ,KAAK,aAAa,qBAAqB,QAAQ,YAAY;AAAA,IACrE,EAAE,QAAQ,KAAK,aAAa,qBAAqB,QAAQ,YAAY;AAAA,IACrE,EAAE,QAAQ,KAAK,aAAa,mDAAmD,QAAQ,YAAY;AAAA,IACnG,EAAE,QAAQ,KAAK,aAAa,gCAAgC,QAAQ,qBAAqB;AAAA,EAC3F;AACF;AAEO,MAAM,UAA2B;AAAA,EACtC,SAAS;AAAA,EACT,SAAS,EAAE,MAAM,UAAU;AAC7B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import { extensionPoints } from "@open-mercato/core/modules/customer_accounts/extension-points";
|
|
5
4
|
import Link from "next/link";
|
|
6
5
|
import { useRouter } from "next/navigation";
|
|
7
6
|
import { Page, PageBody } from "@open-mercato/ui/backend/Page";
|
|
@@ -162,7 +161,7 @@ function CustomerRolesPage() {
|
|
|
162
161
|
setPage(1);
|
|
163
162
|
},
|
|
164
163
|
searchPlaceholder: t("customer_accounts.admin.roles.searchPlaceholder", "Search roles..."),
|
|
165
|
-
perspective: { tableId:
|
|
164
|
+
perspective: { tableId: "customer_accounts.admin.roles" },
|
|
166
165
|
emptyState: /* @__PURE__ */ jsx(
|
|
167
166
|
ListEmptyState,
|
|
168
167
|
{
|