@open-mercato/core 0.6.8-develop.7100.1.fbf66fca35 → 0.7.0
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 +1 -1
- package/dist/helpers/integration/api.js +1 -13
- package/dist/helpers/integration/api.js.map +2 -2
- package/dist/helpers/integration/communicationChannelsFixtures.js +0 -19
- package/dist/helpers/integration/communicationChannelsFixtures.js.map +2 -2
- package/dist/modules/api_keys/api/keys/route.js +1 -1
- package/dist/modules/api_keys/api/keys/route.js.map +2 -2
- package/dist/modules/api_keys/backend/api-keys/page.js +1 -3
- package/dist/modules/api_keys/backend/api-keys/page.js.map +2 -2
- package/dist/modules/attachments/api/route.js +2 -2
- package/dist/modules/attachments/api/route.js.map +2 -2
- package/dist/modules/attachments/components/AttachmentLibrary.js +0 -2
- package/dist/modules/attachments/components/AttachmentLibrary.js.map +2 -2
- package/dist/modules/attachments/di.js +1 -11
- package/dist/modules/attachments/di.js.map +2 -2
- package/dist/modules/attachments/index.js.map +1 -1
- package/dist/modules/attachments/lib/scoped-upload-service.js +2 -15
- package/dist/modules/attachments/lib/scoped-upload-service.js.map +2 -2
- package/dist/modules/attachments/lib/upload-limits.js +2 -6
- package/dist/modules/attachments/lib/upload-limits.js.map +2 -2
- package/dist/modules/audit_logs/backend/audit-logs/page.js +0 -6
- package/dist/modules/audit_logs/backend/audit-logs/page.js.map +2 -2
- package/dist/modules/audit_logs/lib/display-helpers.js +11 -19
- package/dist/modules/audit_logs/lib/display-helpers.js.map +2 -2
- package/dist/modules/audit_logs/services/actionLogService.js +12 -57
- package/dist/modules/audit_logs/services/actionLogService.js.map +3 -3
- package/dist/modules/auth/acl.js +5 -30
- package/dist/modules/auth/acl.js.map +2 -2
- package/dist/modules/auth/api/feature-check.js +2 -8
- package/dist/modules/auth/api/feature-check.js.map +2 -2
- package/dist/modules/auth/api/login.js +20 -4
- package/dist/modules/auth/api/login.js.map +2 -2
- package/dist/modules/auth/api/roles/acl/route.js +33 -28
- package/dist/modules/auth/api/roles/acl/route.js.map +2 -2
- package/dist/modules/auth/api/routeError.js +11 -0
- package/dist/modules/auth/api/routeError.js.map +7 -0
- package/dist/modules/auth/api/session/refresh.js +1 -25
- package/dist/modules/auth/api/session/refresh.js.map +2 -2
- package/dist/modules/auth/api/users/acl/route.js +73 -102
- package/dist/modules/auth/api/users/acl/route.js.map +2 -2
- package/dist/modules/auth/api/users/route.js +5 -13
- package/dist/modules/auth/api/users/route.js.map +2 -2
- package/dist/modules/auth/backend/roles/[id]/edit/page.meta.js +1 -5
- package/dist/modules/auth/backend/roles/[id]/edit/page.meta.js.map +2 -2
- package/dist/modules/auth/backend/roles/page.js +1 -3
- package/dist/modules/auth/backend/roles/page.js.map +2 -2
- package/dist/modules/auth/backend/users/[id]/edit/page.meta.js +1 -5
- package/dist/modules/auth/backend/users/[id]/edit/page.meta.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/components/AclEditor.js +30 -39
- package/dist/modules/auth/components/AclEditor.js.map +2 -2
- package/dist/modules/auth/data/entities.js.map +2 -2
- package/dist/modules/auth/data/validators.js +1 -5
- package/dist/modules/auth/data/validators.js.map +2 -2
- package/dist/modules/auth/di.js +9 -35
- package/dist/modules/auth/di.js.map +2 -2
- package/dist/modules/auth/frontend/reset/[token]/page.js +0 -46
- package/dist/modules/auth/frontend/reset/[token]/page.js.map +2 -2
- package/dist/modules/auth/lib/grantChecks.js.map +2 -2
- package/dist/modules/auth/services/authService.js +2 -16
- package/dist/modules/auth/services/authService.js.map +2 -2
- package/dist/modules/auth/services/rbacService.js +24 -67
- package/dist/modules/auth/services/rbacService.js.map +3 -3
- package/dist/modules/business_rules/backend/logs/page.js +1 -3
- package/dist/modules/business_rules/backend/logs/page.js.map +2 -2
- package/dist/modules/business_rules/backend/rules/[id]/page.meta.js +6 -1
- package/dist/modules/business_rules/backend/rules/[id]/page.meta.js.map +2 -2
- package/dist/modules/business_rules/backend/rules/create/page.meta.js +5 -1
- package/dist/modules/business_rules/backend/rules/create/page.meta.js.map +2 -2
- package/dist/modules/business_rules/backend/rules/page.js +1 -3
- package/dist/modules/business_rules/backend/rules/page.js.map +2 -2
- package/dist/modules/business_rules/backend/sets/[id]/page.meta.js +6 -1
- package/dist/modules/business_rules/backend/sets/[id]/page.meta.js.map +2 -2
- package/dist/modules/business_rules/backend/sets/create/page.meta.js +5 -1
- package/dist/modules/business_rules/backend/sets/create/page.meta.js.map +2 -2
- package/dist/modules/business_rules/backend/sets/page.js +1 -3
- package/dist/modules/business_rules/backend/sets/page.js.map +2 -2
- package/dist/modules/business_rules/lib/expression-evaluator.js +9 -9
- package/dist/modules/business_rules/lib/expression-evaluator.js.map +2 -2
- package/dist/modules/business_rules/lib/rule-evaluator.js +9 -10
- package/dist/modules/business_rules/lib/rule-evaluator.js.map +2 -2
- package/dist/modules/catalog/ai-agents.js +1 -1
- package/dist/modules/catalog/ai-agents.js.map +1 -1
- package/dist/modules/catalog/ai-tools/merchandising-pack.js +2 -2
- package/dist/modules/catalog/ai-tools/merchandising-pack.js.map +2 -2
- package/dist/modules/catalog/backend/catalog/products/MerchandisingAssistantSheet.js +2 -5
- package/dist/modules/catalog/backend/catalog/products/MerchandisingAssistantSheet.js.map +2 -2
- package/dist/modules/catalog/components/categories/CategoriesDataTable.js +0 -2
- package/dist/modules/catalog/components/categories/CategoriesDataTable.js.map +2 -2
- package/dist/modules/catalog/components/products/ProductsDataTable.js +1 -7
- package/dist/modules/catalog/components/products/ProductsDataTable.js.map +2 -2
- package/dist/modules/catalog/widgets/injection/merchandising-assistant-trigger/widget.client.js +0 -2
- package/dist/modules/catalog/widgets/injection/merchandising-assistant-trigger/widget.client.js.map +2 -2
- package/dist/modules/communication_channels/api/post/channels/[id]/test-send/route.js +1 -9
- package/dist/modules/communication_channels/api/post/channels/[id]/test-send/route.js.map +2 -2
- package/dist/modules/communication_channels/api/post/test-seed/route.js +10 -95
- package/dist/modules/communication_channels/api/post/test-seed/route.js.map +2 -2
- package/dist/modules/communication_channels/backend/communication_channels/channels/page.js +0 -3
- package/dist/modules/communication_channels/backend/communication_channels/channels/page.js.map +2 -2
- package/dist/modules/communication_channels/commands/ingest-inbound-message.js +1 -14
- package/dist/modules/communication_channels/commands/ingest-inbound-message.js.map +2 -2
- package/dist/modules/communication_channels/di.js +1 -7
- package/dist/modules/communication_channels/di.js.map +2 -2
- package/dist/modules/communication_channels/lib/email-capabilities.js +1 -4
- package/dist/modules/communication_channels/lib/email-capabilities.js.map +2 -2
- package/dist/modules/communication_channels/lib/test-seed.js +2 -41
- package/dist/modules/communication_channels/lib/test-seed.js.map +2 -2
- package/dist/modules/configs/lib/system-status.js +0 -9
- package/dist/modules/configs/lib/system-status.js.map +2 -2
- package/dist/modules/currencies/backend/currencies/page.js +1 -3
- package/dist/modules/currencies/backend/currencies/page.js.map +2 -2
- package/dist/modules/currencies/backend/exchange-rates/page.js +1 -3
- package/dist/modules/currencies/backend/exchange-rates/page.js.map +2 -2
- package/dist/modules/customer_accounts/api/admin/domain-mappings.js +0 -9
- package/dist/modules/customer_accounts/api/admin/domain-mappings.js.map +2 -2
- package/dist/modules/customer_accounts/backend/customer_accounts/roles/page.js +1 -3
- package/dist/modules/customer_accounts/backend/customer_accounts/roles/page.js.map +2 -2
- package/dist/modules/customer_accounts/backend/customer_accounts/settings/CustomerAccountsSettingsPageClient.js +84 -0
- package/dist/modules/customer_accounts/backend/customer_accounts/settings/CustomerAccountsSettingsPageClient.js.map +7 -0
- package/dist/modules/customer_accounts/backend/customer_accounts/settings/page.js +7 -81
- package/dist/modules/customer_accounts/backend/customer_accounts/settings/page.js.map +2 -2
- package/dist/modules/customer_accounts/backend/customer_accounts/users/PortalUsersPageClient.js +523 -0
- package/dist/modules/customer_accounts/backend/customer_accounts/users/PortalUsersPageClient.js.map +7 -0
- package/dist/modules/customer_accounts/backend/customer_accounts/users/[id]/PortalUserDetailPageClient.js +731 -0
- package/dist/modules/customer_accounts/backend/customer_accounts/users/[id]/PortalUserDetailPageClient.js.map +7 -0
- package/dist/modules/customer_accounts/backend/customer_accounts/users/[id]/page.js +7 -727
- package/dist/modules/customer_accounts/backend/customer_accounts/users/[id]/page.js.map +2 -2
- package/dist/modules/customer_accounts/backend/customer_accounts/users/page.js +7 -521
- package/dist/modules/customer_accounts/backend/customer_accounts/users/page.js.map +2 -2
- package/dist/modules/customer_accounts/extension-points.js +1 -1
- package/dist/modules/customer_accounts/extension-points.js.map +2 -2
- package/dist/modules/customer_accounts/lib/portalUrl.js +69 -0
- package/dist/modules/customer_accounts/lib/portalUrl.js.map +7 -0
- package/dist/modules/customer_accounts/services/domainMappingService.js +0 -10
- package/dist/modules/customer_accounts/services/domainMappingService.js.map +2 -2
- package/dist/modules/customers/ai-tools/companies-pack.js +1 -4
- package/dist/modules/customers/ai-tools/companies-pack.js.map +2 -2
- package/dist/modules/customers/ai-tools/deal-analyzer-pack.js +2 -13
- package/dist/modules/customers/ai-tools/deal-analyzer-pack.js.map +2 -2
- package/dist/modules/customers/ai-tools/deals-pack.js +6 -52
- package/dist/modules/customers/ai-tools/deals-pack.js.map +2 -2
- package/dist/modules/customers/ai-tools/people-pack.js +1 -4
- package/dist/modules/customers/ai-tools/people-pack.js.map +2 -2
- package/dist/modules/customers/api/activities/route.js +6 -48
- package/dist/modules/customers/api/activities/route.js.map +2 -2
- package/dist/modules/customers/api/companies/[id]/people/route.js +64 -20
- package/dist/modules/customers/api/companies/[id]/people/route.js.map +2 -2
- package/dist/modules/customers/api/companies/[id]/route.js +94 -17
- package/dist/modules/customers/api/companies/[id]/route.js.map +2 -2
- package/dist/modules/customers/api/dashboard/widgets/customer-todos/route.js +5 -8
- package/dist/modules/customers/api/dashboard/widgets/customer-todos/route.js.map +2 -2
- package/dist/modules/customers/api/deals/[id]/companies/route.js +1 -1
- package/dist/modules/customers/api/deals/[id]/companies/route.js.map +2 -2
- package/dist/modules/customers/api/deals/[id]/people/route.js +1 -1
- package/dist/modules/customers/api/deals/[id]/people/route.js.map +2 -2
- package/dist/modules/customers/api/deals/[id]/route.js +25 -8
- package/dist/modules/customers/api/deals/[id]/route.js.map +2 -2
- package/dist/modules/customers/api/deals/[id]/stats/route.js +22 -3
- package/dist/modules/customers/api/deals/[id]/stats/route.js.map +2 -2
- package/dist/modules/customers/api/deals/aggregate/route.js +4 -11
- package/dist/modules/customers/api/deals/aggregate/route.js.map +2 -2
- package/dist/modules/customers/api/deals/map/route.js +1 -2
- package/dist/modules/customers/api/deals/map/route.js.map +2 -2
- package/dist/modules/customers/api/deals/route.js +1 -38
- package/dist/modules/customers/api/deals/route.js.map +2 -2
- package/dist/modules/customers/api/entity-roles-factory.js +4 -4
- package/dist/modules/customers/api/entity-roles-factory.js.map +2 -2
- package/dist/modules/customers/api/interactions/route.js +1 -3
- package/dist/modules/customers/api/interactions/route.js.map +2 -2
- package/dist/modules/customers/api/interactions/tasks/route.js +4 -27
- package/dist/modules/customers/api/interactions/tasks/route.js.map +2 -2
- package/dist/modules/customers/api/people/[id]/companies/[linkId]/route.js +3 -4
- package/dist/modules/customers/api/people/[id]/companies/[linkId]/route.js.map +2 -2
- package/dist/modules/customers/api/people/[id]/companies/context.js +1 -1
- package/dist/modules/customers/api/people/[id]/companies/context.js.map +2 -2
- package/dist/modules/customers/api/people/[id]/companies/enriched/route.js +1 -1
- package/dist/modules/customers/api/people/[id]/companies/enriched/route.js.map +2 -2
- package/dist/modules/customers/api/people/[id]/route.js +10 -11
- package/dist/modules/customers/api/people/[id]/route.js.map +2 -2
- package/dist/modules/customers/api/people/check-phone/route.js +9 -51
- package/dist/modules/customers/api/people/check-phone/route.js.map +2 -2
- package/dist/modules/customers/api/todos/route.js +5 -30
- package/dist/modules/customers/api/todos/route.js.map +2 -2
- package/dist/modules/customers/backend/customers/companies/page.js +4 -6
- package/dist/modules/customers/backend/customers/companies/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/deals/[id]/page.js +1 -6
- package/dist/modules/customers/backend/customers/deals/[id]/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/deals/page.js +4 -7
- package/dist/modules/customers/backend/customers/deals/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/deals/pipeline/components/Lane.js +13 -4
- package/dist/modules/customers/backend/customers/deals/pipeline/components/Lane.js.map +2 -2
- package/dist/modules/customers/backend/customers/deals/pipeline/components/StatusFilterPopover.js +14 -85
- package/dist/modules/customers/backend/customers/deals/pipeline/components/StatusFilterPopover.js.map +2 -2
- package/dist/modules/customers/backend/customers/people/page.js +4 -6
- package/dist/modules/customers/backend/customers/people/page.js.map +2 -2
- package/dist/modules/customers/backend/hooks/useEmailDuplicateCheck.js +3 -9
- package/dist/modules/customers/backend/hooks/useEmailDuplicateCheck.js.map +2 -2
- package/dist/modules/customers/commands/deals.js +34 -21
- package/dist/modules/customers/commands/deals.js.map +2 -2
- package/dist/modules/customers/commands/interactions.js.map +1 -1
- package/dist/modules/customers/commands/personCompanyLinks.js +2 -131
- package/dist/modules/customers/commands/personCompanyLinks.js.map +2 -2
- package/dist/modules/customers/components/CustomerTodosTable.js +0 -1
- package/dist/modules/customers/components/CustomerTodosTable.js.map +2 -2
- package/dist/modules/customers/components/DealsKpiStrip.js +6 -7
- package/dist/modules/customers/components/DealsKpiStrip.js.map +2 -2
- package/dist/modules/customers/components/calendar/AgendaList.js +2 -2
- package/dist/modules/customers/components/calendar/AgendaList.js.map +2 -2
- package/dist/modules/customers/components/calendar/CalendarEventEditor.js +1 -1
- package/dist/modules/customers/components/calendar/CalendarEventEditor.js.map +2 -2
- package/dist/modules/customers/components/calendar/CalendarScreen.js +1 -1
- package/dist/modules/customers/components/calendar/CalendarScreen.js.map +2 -2
- package/dist/modules/customers/components/calendar/CalendarSettingsModal.js +1 -1
- package/dist/modules/customers/components/calendar/CalendarSettingsModal.js.map +2 -2
- package/dist/modules/customers/components/calendar/EventBlock.js +1 -1
- package/dist/modules/customers/components/calendar/EventBlock.js.map +2 -2
- package/dist/modules/customers/components/calendar/EventPeekPopover.js +2 -3
- package/dist/modules/customers/components/calendar/EventPeekPopover.js.map +2 -2
- package/dist/modules/customers/components/calendar/editor/PeopleField.js +5 -40
- package/dist/modules/customers/components/calendar/editor/PeopleField.js.map +2 -2
- package/dist/modules/customers/components/calendar/editor/hooks.js +1 -2
- package/dist/modules/customers/components/calendar/editor/hooks.js.map +2 -2
- package/dist/modules/customers/components/calendar/types.js +1 -1
- package/dist/modules/customers/components/calendar/types.js.map +2 -2
- package/dist/modules/customers/components/detail/AssignRoleDialog.js +33 -28
- package/dist/modules/customers/components/detail/AssignRoleDialog.js.map +2 -2
- package/dist/modules/customers/components/detail/CompanyKpiBar.js +4 -5
- package/dist/modules/customers/components/detail/CompanyKpiBar.js.map +2 -2
- package/dist/modules/customers/components/detail/CompanyPeopleSection.js +1 -3
- package/dist/modules/customers/components/detail/CompanyPeopleSection.js.map +2 -2
- package/dist/modules/customers/components/detail/DealForm.js +7 -19
- package/dist/modules/customers/components/detail/DealForm.js.map +2 -2
- package/dist/modules/customers/components/detail/DealsSection.js +5 -6
- package/dist/modules/customers/components/detail/DealsSection.js.map +2 -2
- package/dist/modules/customers/components/detail/EntityTagsDialog.js +11 -35
- package/dist/modules/customers/components/detail/EntityTagsDialog.js.map +2 -2
- package/dist/modules/customers/components/detail/PersonCompaniesSection.js +1 -3
- package/dist/modules/customers/components/detail/PersonCompaniesSection.js.map +2 -2
- package/dist/modules/customers/components/detail/hooks/usePersonTasks.js +13 -19
- package/dist/modules/customers/components/detail/hooks/usePersonTasks.js.map +2 -2
- package/dist/modules/customers/components/detail/schedule/ParticipantsField.js +4 -4
- package/dist/modules/customers/components/detail/schedule/ParticipantsField.js.map +2 -2
- package/dist/modules/customers/components/detail/schedule/useScheduleFormState.js +3 -3
- package/dist/modules/customers/components/detail/schedule/useScheduleFormState.js.map +2 -2
- package/dist/modules/customers/components/detail/utils.js +5 -5
- package/dist/modules/customers/components/detail/utils.js.map +2 -2
- package/dist/modules/customers/data/entities.js.map +1 -1
- package/dist/modules/customers/data/validators.js +3 -32
- package/dist/modules/customers/data/validators.js.map +2 -2
- package/dist/modules/customers/events.js +0 -5
- package/dist/modules/customers/events.js.map +2 -2
- package/dist/modules/customers/lib/calendar/conflicts.js +2 -8
- package/dist/modules/customers/lib/calendar/conflicts.js.map +2 -2
- package/dist/modules/customers/lib/calendar/editorPayload.js +2 -3
- package/dist/modules/customers/lib/calendar/editorPayload.js.map +2 -2
- package/dist/modules/customers/lib/calendar/mapItem.js +3 -8
- package/dist/modules/customers/lib/calendar/mapItem.js.map +2 -2
- package/dist/modules/customers/lib/dealStatus.js +0 -30
- package/dist/modules/customers/lib/dealStatus.js.map +2 -2
- package/dist/modules/customers/lib/findPeopleByAddresses.js +0 -1
- package/dist/modules/customers/lib/findPeopleByAddresses.js.map +2 -2
- package/dist/modules/customers/lib/personCompanies.js +2 -100
- package/dist/modules/customers/lib/personCompanies.js.map +2 -2
- package/dist/modules/customers/lib/todoCompatibility.js +0 -12
- package/dist/modules/customers/lib/todoCompatibility.js.map +2 -2
- package/dist/modules/dashboards/lib/widgetScope.js +1 -6
- package/dist/modules/dashboards/lib/widgetScope.js.map +2 -2
- package/dist/modules/data_sync/backend/data-sync/page.js +1 -3
- package/dist/modules/data_sync/backend/data-sync/page.js.map +2 -2
- package/dist/modules/data_sync/lib/sync-engine.js +6 -72
- package/dist/modules/data_sync/lib/sync-engine.js.map +2 -2
- package/dist/modules/data_sync/workers/sync-export.js +1 -5
- package/dist/modules/data_sync/workers/sync-export.js.map +2 -2
- package/dist/modules/data_sync/workers/sync-import.js +1 -5
- package/dist/modules/data_sync/workers/sync-import.js.map +2 -2
- package/dist/modules/devices/acl.js +1 -9
- package/dist/modules/devices/acl.js.map +2 -2
- package/dist/modules/devices/api/admin/devices/[id]/route.js +32 -5
- package/dist/modules/devices/api/admin/devices/[id]/route.js.map +2 -2
- package/dist/modules/devices/api/admin/devices/route.js +1 -14
- package/dist/modules/devices/api/admin/devices/route.js.map +2 -2
- package/dist/modules/devices/api/deviceList.js +12 -99
- package/dist/modules/devices/api/deviceList.js.map +2 -2
- package/dist/modules/devices/api/openapi.js +1 -3
- package/dist/modules/devices/api/openapi.js.map +2 -2
- package/dist/modules/devices/api/route.js +1 -9
- package/dist/modules/devices/api/route.js.map +2 -2
- package/dist/modules/devices/backend/devices/[id]/page.js +26 -10
- package/dist/modules/devices/backend/devices/[id]/page.js.map +2 -2
- package/dist/modules/devices/backend/devices/create/page.js +1 -17
- package/dist/modules/devices/backend/devices/create/page.js.map +2 -2
- package/dist/modules/devices/backend/devices/page.js +34 -28
- package/dist/modules/devices/backend/devices/page.js.map +2 -2
- package/dist/modules/devices/setup.js +2 -6
- package/dist/modules/devices/setup.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/di.js +0 -9
- package/dist/modules/directory/di.js.map +2 -2
- package/dist/modules/directory/utils/organizationScope.js.map +2 -2
- package/dist/modules/entities/api/records.js +2 -4
- package/dist/modules/entities/api/records.js.map +2 -2
- package/dist/modules/entities/backend/entities/user/[entityId]/records/page.js +1 -3
- package/dist/modules/entities/backend/entities/user/[entityId]/records/page.js.map +2 -2
- package/dist/modules/eudr/api/plots/route.js +1 -5
- package/dist/modules/eudr/api/plots/route.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/evidence-submissions/[id]/page.meta.js +3 -1
- package/dist/modules/eudr/backend/eudr/evidence-submissions/[id]/page.meta.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/evidence-submissions/create/page.meta.js +1 -0
- package/dist/modules/eudr/backend/eudr/evidence-submissions/create/page.meta.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/evidence-submissions/page.js +0 -3
- package/dist/modules/eudr/backend/eudr/evidence-submissions/page.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/evidence-submissions/page.meta.js +4 -1
- package/dist/modules/eudr/backend/eudr/evidence-submissions/page.meta.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/page.meta.js +2 -2
- package/dist/modules/eudr/backend/eudr/page.meta.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/plots/[id]/page.js +8 -2
- package/dist/modules/eudr/backend/eudr/plots/[id]/page.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/plots/[id]/page.meta.js +3 -1
- package/dist/modules/eudr/backend/eudr/plots/[id]/page.meta.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/plots/create/page.js +8 -2
- package/dist/modules/eudr/backend/eudr/plots/create/page.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/plots/create/page.meta.js +1 -0
- package/dist/modules/eudr/backend/eudr/plots/create/page.meta.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/plots/page.js +0 -3
- package/dist/modules/eudr/backend/eudr/plots/page.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/plots/page.meta.js +4 -1
- package/dist/modules/eudr/backend/eudr/plots/page.meta.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/product-mappings/[id]/page.meta.js +3 -1
- package/dist/modules/eudr/backend/eudr/product-mappings/[id]/page.meta.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/product-mappings/create/page.meta.js +1 -0
- package/dist/modules/eudr/backend/eudr/product-mappings/create/page.meta.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/product-mappings/page.js +0 -3
- package/dist/modules/eudr/backend/eudr/product-mappings/page.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/product-mappings/page.meta.js +4 -1
- package/dist/modules/eudr/backend/eudr/product-mappings/page.meta.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/risk-assessments/[id]/page.meta.js +3 -1
- package/dist/modules/eudr/backend/eudr/risk-assessments/[id]/page.meta.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/risk-assessments/create/page.meta.js +1 -0
- package/dist/modules/eudr/backend/eudr/risk-assessments/create/page.meta.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/risk-assessments/page.js +0 -3
- package/dist/modules/eudr/backend/eudr/risk-assessments/page.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/risk-assessments/page.meta.js +4 -1
- package/dist/modules/eudr/backend/eudr/risk-assessments/page.meta.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/statements/[id]/page.js +2 -0
- package/dist/modules/eudr/backend/eudr/statements/[id]/page.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/statements/[id]/page.meta.js +3 -1
- package/dist/modules/eudr/backend/eudr/statements/[id]/page.meta.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/statements/create/page.meta.js +1 -0
- package/dist/modules/eudr/backend/eudr/statements/create/page.meta.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/statements/page.js +30 -28
- package/dist/modules/eudr/backend/eudr/statements/page.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/statements/page.meta.js +4 -1
- package/dist/modules/eudr/backend/eudr/statements/page.meta.js.map +2 -2
- package/dist/modules/eudr/commands/statements.js +8 -3
- package/dist/modules/eudr/commands/statements.js.map +2 -2
- package/dist/modules/eudr/components/crudErrorI18n.js +21 -1
- package/dist/modules/eudr/components/crudErrorI18n.js.map +2 -2
- package/dist/modules/eudr/components/formConfig.js +6 -2
- package/dist/modules/eudr/components/formConfig.js.map +2 -2
- package/dist/modules/eudr/data/validators.js +1 -4
- package/dist/modules/eudr/data/validators.js.map +2 -2
- package/dist/modules/eudr/lib/statement-lifecycle.js +9 -1
- package/dist/modules/eudr/lib/statement-lifecycle.js.map +2 -2
- package/dist/modules/feature_toggles/components/FeatureTogglesTable.js +0 -1
- package/dist/modules/feature_toggles/components/FeatureTogglesTable.js.map +2 -2
- package/dist/modules/feature_toggles/components/OverridesTable.js +0 -1
- package/dist/modules/feature_toggles/components/OverridesTable.js.map +2 -2
- package/dist/modules/feature_toggles/defaults.json +8 -0
- package/dist/modules/inbox_ops/backend/inbox-ops/log/page.js +0 -3
- package/dist/modules/inbox_ops/backend/inbox-ops/log/page.js.map +2 -2
- package/dist/modules/inbox_ops/backend/inbox-ops/page.js +0 -3
- package/dist/modules/inbox_ops/backend/inbox-ops/page.js.map +2 -2
- package/dist/modules/inbox_ops/lib/htmlToPlainText.js +12 -1
- package/dist/modules/inbox_ops/lib/htmlToPlainText.js.map +2 -2
- package/dist/modules/integrations/api/[id]/credentials/route.js +1 -6
- package/dist/modules/integrations/api/[id]/credentials/route.js.map +2 -2
- package/dist/modules/integrations/backend/integrations/[id]/page.js +29 -38
- package/dist/modules/integrations/backend/integrations/[id]/page.js.map +2 -2
- package/dist/modules/integrations/backend/integrations/bundle/[id]/page.js +9 -36
- package/dist/modules/integrations/backend/integrations/bundle/[id]/page.js.map +2 -2
- package/dist/modules/integrations/data/validators.js +3 -11
- package/dist/modules/integrations/data/validators.js.map +2 -2
- package/dist/modules/integrations/lib/credentials-masking.js +2 -6
- package/dist/modules/integrations/lib/credentials-masking.js.map +2 -2
- package/dist/modules/messages/api/[id]/route.js +1 -29
- package/dist/modules/messages/api/[id]/route.js.map +2 -2
- package/dist/modules/messages/api/openapi.js +2 -17
- package/dist/modules/messages/api/openapi.js.map +2 -2
- package/dist/modules/messages/api/route.js +2 -17
- package/dist/modules/messages/api/route.js.map +2 -2
- package/dist/modules/messages/components/MessagesInboxPageClient.js +14 -7
- package/dist/modules/messages/components/MessagesInboxPageClient.js.map +2 -2
- package/dist/modules/messages/components/inboxFilters.js +0 -15
- package/dist/modules/messages/components/inboxFilters.js.map +2 -2
- package/dist/modules/messages/components/message-detail/hooks/useMessageDetailsConversation.js +1 -11
- package/dist/modules/messages/components/message-detail/hooks/useMessageDetailsConversation.js.map +2 -2
- package/dist/modules/messages/components/message-detail/panels/MessageHeader.js +1 -3
- package/dist/modules/messages/components/message-detail/panels/MessageHeader.js.map +2 -2
- package/dist/modules/messages/components/message-detail/panels/thread-panel.js +1 -2
- package/dist/modules/messages/components/message-detail/panels/thread-panel.js.map +2 -2
- package/dist/modules/messages/components/messageListLabels.js +2 -14
- package/dist/modules/messages/components/messageListLabels.js.map +2 -2
- package/dist/modules/messages/data/validators.js +4 -18
- package/dist/modules/messages/data/validators.js.map +2 -2
- package/dist/modules/payment_gateways/api/webhook/[provider]/route.js +6 -4
- package/dist/modules/payment_gateways/api/webhook/[provider]/route.js.map +2 -2
- package/dist/modules/payment_gateways/backend/payment-gateways/page.js +1 -3
- package/dist/modules/payment_gateways/backend/payment-gateways/page.js.map +2 -2
- package/dist/modules/payment_gateways/lib/webhook-processor.js +0 -7
- package/dist/modules/payment_gateways/lib/webhook-processor.js.map +2 -2
- package/dist/modules/planner/backend/planner/availability-rulesets/page.js +0 -3
- package/dist/modules/planner/backend/planner/availability-rulesets/page.js.map +2 -2
- package/dist/modules/push_notifications/backend/push_notifications/page.js +1 -3
- package/dist/modules/push_notifications/backend/push_notifications/page.js.map +2 -2
- package/dist/modules/push_notifications/backend/push_notifications/send/page.js +1 -1
- package/dist/modules/push_notifications/backend/push_notifications/send/page.js.map +2 -2
- package/dist/modules/query_index/lib/engine.js +51 -150
- package/dist/modules/query_index/lib/engine.js.map +2 -2
- package/dist/modules/query_index/lib/search-tokens.js +3 -79
- package/dist/modules/query_index/lib/search-tokens.js.map +2 -2
- package/dist/modules/resources/backend/resources/resource-types/page.js +1 -3
- package/dist/modules/resources/backend/resources/resource-types/page.js.map +2 -2
- package/dist/modules/resources/backend/resources/resources/page.js +1 -3
- package/dist/modules/resources/backend/resources/resources/page.js.map +2 -2
- package/dist/modules/sales/backend/sales/channels/offers/page.js +0 -3
- package/dist/modules/sales/backend/sales/channels/offers/page.js.map +2 -2
- package/dist/modules/sales/backend/sales/channels/page.js +0 -3
- package/dist/modules/sales/backend/sales/channels/page.js.map +2 -2
- package/dist/modules/sales/backend/sales/documents/[id]/page.js +8 -10
- package/dist/modules/sales/backend/sales/documents/[id]/page.js.map +2 -2
- package/dist/modules/sales/commands/documents.js +1 -79
- package/dist/modules/sales/commands/documents.js.map +2 -2
- package/dist/modules/sales/components/PriceWithCurrency.js +5 -7
- package/dist/modules/sales/components/PriceWithCurrency.js.map +2 -2
- package/dist/modules/sales/components/channels/SalesChannelOffersPanel.js +0 -3
- package/dist/modules/sales/components/channels/SalesChannelOffersPanel.js.map +2 -2
- package/dist/modules/sales/components/documents/AdjustmentsSection.js +6 -8
- package/dist/modules/sales/components/documents/AdjustmentsSection.js.map +2 -2
- package/dist/modules/sales/components/documents/ItemsSection.js +22 -51
- package/dist/modules/sales/components/documents/ItemsSection.js.map +2 -2
- package/dist/modules/sales/components/documents/LineItemDialog.js +19 -84
- package/dist/modules/sales/components/documents/LineItemDialog.js.map +2 -2
- package/dist/modules/sales/components/documents/PaymentsSection.js +9 -23
- package/dist/modules/sales/components/documents/PaymentsSection.js.map +2 -2
- package/dist/modules/sales/components/documents/ReturnsSection.js +6 -8
- package/dist/modules/sales/components/documents/ReturnsSection.js.map +2 -2
- package/dist/modules/sales/components/documents/SalesDocumentsTable.js +14 -68
- package/dist/modules/sales/components/documents/SalesDocumentsTable.js.map +2 -2
- package/dist/modules/sales/components/documents/SalesOrderDraftLines.js +5 -6
- package/dist/modules/sales/components/documents/SalesOrderDraftLines.js.map +2 -2
- package/dist/modules/sales/components/documents/ShipmentDialog.js +4 -5
- package/dist/modules/sales/components/documents/ShipmentDialog.js.map +2 -2
- package/dist/modules/sales/components/documents/ShipmentsSection.js +6 -8
- package/dist/modules/sales/components/documents/ShipmentsSection.js.map +2 -2
- package/dist/modules/sales/components/documents/lineItemUtils.js +2 -2
- package/dist/modules/sales/components/documents/lineItemUtils.js.map +2 -2
- package/dist/modules/sales/data/entities.js +2 -8
- package/dist/modules/sales/data/entities.js.map +2 -2
- package/dist/modules/sales/extension-points.js +0 -1
- package/dist/modules/sales/extension-points.js.map +2 -2
- package/dist/modules/sales/setup.js +0 -2
- package/dist/modules/sales/setup.js.map +2 -2
- package/dist/modules/sales/widgets/injection/document-history/widget.client.js +44 -2
- package/dist/modules/sales/widgets/injection/document-history/widget.client.js.map +2 -2
- package/dist/modules/sales/widgets/injection/payment-gateway-status-column/widget.js +2 -10
- package/dist/modules/sales/widgets/injection/payment-gateway-status-column/widget.js.map +2 -2
- package/dist/modules/sales/widgets/injection-table.js +7 -4
- package/dist/modules/sales/widgets/injection-table.js.map +2 -2
- package/dist/modules/staff/backend/staff/leave-requests/page.js +0 -3
- package/dist/modules/staff/backend/staff/leave-requests/page.js.map +2 -2
- package/dist/modules/staff/backend/staff/my-leave-requests/page.js +0 -3
- package/dist/modules/staff/backend/staff/my-leave-requests/page.js.map +2 -2
- package/dist/modules/staff/backend/staff/team-members/page.js +0 -3
- package/dist/modules/staff/backend/staff/team-members/page.js.map +2 -2
- package/dist/modules/staff/backend/staff/team-roles/page.js +0 -3
- package/dist/modules/staff/backend/staff/team-roles/page.js.map +2 -2
- package/dist/modules/staff/backend/staff/teams/[id]/edit/page.js +0 -3
- package/dist/modules/staff/backend/staff/teams/[id]/edit/page.js.map +2 -2
- package/dist/modules/staff/backend/staff/teams/page.js +0 -3
- package/dist/modules/staff/backend/staff/teams/page.js.map +2 -2
- package/dist/modules/staff/backend/staff/timesheets/page.js +18 -29
- package/dist/modules/staff/backend/staff/timesheets/page.js.map +2 -2
- package/dist/modules/staff/backend/staff/timesheets/projects/page.js +0 -3
- package/dist/modules/staff/backend/staff/timesheets/projects/page.js.map +2 -2
- package/dist/modules/sync_excel/lib/adapters/customers.js +0 -1
- package/dist/modules/sync_excel/lib/adapters/customers.js.map +2 -2
- package/dist/modules/warranty_claims/api/assignees/route.js +3 -3
- package/dist/modules/warranty_claims/api/assignees/route.js.map +2 -2
- package/dist/modules/warranty_claims/api/portal/attachments/route.js +2 -2
- package/dist/modules/warranty_claims/api/portal/attachments/route.js.map +2 -2
- package/dist/modules/warranty_claims/api/portal/claims/route.js +9 -12
- package/dist/modules/warranty_claims/api/portal/claims/route.js.map +2 -2
- package/dist/modules/warranty_claims/backend/page.js +0 -3
- package/dist/modules/warranty_claims/backend/page.js.map +2 -2
- package/dist/modules/warranty_claims/backend/warranty_claims/registrations/page.js +0 -3
- package/dist/modules/warranty_claims/backend/warranty_claims/registrations/page.js.map +2 -2
- package/dist/modules/warranty_claims/backend/warranty_claims/troubleshooting-guides/page.js +0 -3
- package/dist/modules/warranty_claims/backend/warranty_claims/troubleshooting-guides/page.js.map +2 -2
- package/dist/modules/warranty_claims/backend/warranty_claims/vendor-policies/page.js +0 -3
- package/dist/modules/warranty_claims/backend/warranty_claims/vendor-policies/page.js.map +2 -2
- package/dist/modules/warranty_claims/frontend/[orgSlug]/portal/claims/page.js +0 -3
- package/dist/modules/warranty_claims/frontend/[orgSlug]/portal/claims/page.js.map +2 -2
- package/dist/modules/wms/api/warehouses/route.js +9 -13
- package/dist/modules/wms/api/warehouses/route.js.map +2 -2
- package/dist/modules/wms/api/zones/route.js +2 -15
- package/dist/modules/wms/api/zones/route.js.map +2 -2
- package/dist/modules/wms/commands/configuration.js +9 -121
- package/dist/modules/wms/commands/configuration.js.map +2 -2
- package/dist/modules/wms/commands/inventory-actions.js +0 -3
- package/dist/modules/wms/commands/inventory-actions.js.map +2 -2
- package/dist/modules/wms/commands/shared.js +1 -9
- package/dist/modules/wms/commands/shared.js.map +2 -2
- package/dist/modules/wms/components/backend/WmsConfigurationPage.js +111 -76
- package/dist/modules/wms/components/backend/WmsConfigurationPage.js.map +3 -3
- package/dist/modules/wms/components/backend/WmsInventoryConsolePage.js +0 -1
- package/dist/modules/wms/components/backend/WmsInventoryConsolePage.js.map +2 -2
- package/dist/modules/wms/components/backend/WmsLocationDetailPage.js +20 -16
- package/dist/modules/wms/components/backend/WmsLocationDetailPage.js.map +2 -2
- package/dist/modules/wms/components/backend/WmsLotDetailPage.js +10 -6
- package/dist/modules/wms/components/backend/WmsLotDetailPage.js.map +2 -2
- package/dist/modules/wms/components/backend/WmsLotsListPage.js +0 -1
- package/dist/modules/wms/components/backend/WmsLotsListPage.js.map +2 -2
- package/dist/modules/wms/components/backend/WmsOperationalDashboardPage.js +11 -7
- package/dist/modules/wms/components/backend/WmsOperationalDashboardPage.js.map +2 -2
- package/dist/modules/wms/components/backend/WmsSkuDetailPage.js +10 -6
- package/dist/modules/wms/components/backend/WmsSkuDetailPage.js.map +2 -2
- package/dist/modules/wms/components/backend/inventoryMutationLoaders.js +20 -27
- package/dist/modules/wms/components/backend/inventoryMutationLoaders.js.map +2 -2
- package/dist/modules/workflows/backend/definitions/page.js +1 -3
- package/dist/modules/workflows/backend/definitions/page.js.map +2 -2
- package/dist/modules/workflows/backend/events/page.js +1 -3
- package/dist/modules/workflows/backend/events/page.js.map +2 -2
- package/dist/modules/workflows/backend/instances/page.js +1 -3
- package/dist/modules/workflows/backend/instances/page.js.map +2 -2
- package/dist/modules/workflows/backend/tasks/page.js +1 -3
- package/dist/modules/workflows/backend/tasks/page.js.map +2 -2
- package/dist/modules/workflows/lib/activity-executor.js +0 -4
- package/dist/modules/workflows/lib/activity-executor.js.map +2 -2
- package/package.json +10 -9
- package/src/helpers/integration/api.ts +1 -33
- package/src/helpers/integration/communicationChannelsFixtures.ts +1 -69
- package/src/modules/api_keys/api/keys/route.ts +1 -3
- package/src/modules/api_keys/backend/api-keys/page.tsx +1 -4
- package/src/modules/attachments/AGENTS.md +0 -15
- package/src/modules/attachments/api/route.ts +2 -2
- package/src/modules/attachments/components/AttachmentLibrary.tsx +0 -3
- package/src/modules/attachments/di.ts +0 -16
- package/src/modules/attachments/i18n/de.json +0 -5
- package/src/modules/attachments/i18n/en.json +0 -5
- package/src/modules/attachments/i18n/es.json +0 -5
- package/src/modules/attachments/i18n/ko.json +0 -5
- package/src/modules/attachments/i18n/pl.json +0 -5
- package/src/modules/attachments/index.ts +0 -10
- package/src/modules/attachments/lib/scoped-upload-service.ts +0 -46
- package/src/modules/attachments/lib/upload-limits.ts +2 -6
- package/src/modules/audit_logs/backend/audit-logs/page.tsx +0 -8
- package/src/modules/audit_logs/lib/display-helpers.tsx +32 -42
- package/src/modules/audit_logs/services/actionLogService.ts +11 -74
- package/src/modules/auth/acl.ts +6 -30
- package/src/modules/auth/api/feature-check.ts +3 -10
- package/src/modules/auth/api/login.ts +24 -9
- package/src/modules/auth/api/roles/acl/route.ts +39 -42
- package/src/modules/auth/api/routeError.ts +30 -0
- package/src/modules/auth/api/session/refresh.ts +1 -32
- package/src/modules/auth/api/users/acl/route.ts +101 -185
- package/src/modules/auth/api/users/route.ts +5 -18
- package/src/modules/auth/backend/roles/[id]/edit/page.meta.ts +2 -5
- package/src/modules/auth/backend/roles/page.tsx +2 -4
- package/src/modules/auth/backend/users/[id]/edit/page.meta.ts +2 -5
- package/src/modules/auth/backend/users/page.tsx +2 -3
- package/src/modules/auth/components/AclEditor.tsx +33 -63
- package/src/modules/auth/data/entities.ts +1 -4
- package/src/modules/auth/data/validators.ts +0 -5
- package/src/modules/auth/di.ts +16 -46
- package/src/modules/auth/frontend/reset/[token]/page.tsx +0 -74
- package/src/modules/auth/i18n/de.json +0 -389
- package/src/modules/auth/i18n/en.json +0 -389
- package/src/modules/auth/i18n/es.json +0 -389
- package/src/modules/auth/i18n/ko.json +0 -389
- package/src/modules/auth/i18n/pl.json +2 -391
- package/src/modules/auth/lib/grantChecks.ts +0 -6
- package/src/modules/auth/services/authService.ts +2 -18
- package/src/modules/auth/services/rbacService.ts +24 -110
- package/src/modules/business_rules/backend/logs/page.tsx +1 -4
- package/src/modules/business_rules/backend/rules/[id]/page.meta.ts +5 -0
- package/src/modules/business_rules/backend/rules/create/page.meta.ts +5 -1
- package/src/modules/business_rules/backend/rules/page.tsx +1 -4
- package/src/modules/business_rules/backend/sets/[id]/page.meta.ts +5 -0
- package/src/modules/business_rules/backend/sets/create/page.meta.ts +5 -1
- package/src/modules/business_rules/backend/sets/page.tsx +1 -4
- package/src/modules/business_rules/lib/expression-evaluator.ts +9 -9
- package/src/modules/business_rules/lib/rule-evaluator.ts +9 -10
- package/src/modules/catalog/ai-agents.ts +1 -1
- package/src/modules/catalog/ai-tools/merchandising-pack.ts +2 -2
- package/src/modules/catalog/backend/catalog/products/MerchandisingAssistantSheet.tsx +5 -12
- package/src/modules/catalog/components/categories/CategoriesDataTable.tsx +0 -3
- package/src/modules/catalog/components/products/ProductsDataTable.tsx +0 -7
- package/src/modules/catalog/i18n/de.json +0 -1
- package/src/modules/catalog/i18n/en.json +0 -1
- package/src/modules/catalog/i18n/es.json +0 -1
- package/src/modules/catalog/i18n/ko.json +0 -1
- package/src/modules/catalog/i18n/pl.json +0 -1
- package/src/modules/catalog/widgets/injection/merchandising-assistant-trigger/widget.client.tsx +0 -4
- package/src/modules/communication_channels/api/post/channels/[id]/test-send/route.ts +1 -17
- package/src/modules/communication_channels/api/post/test-seed/route.ts +16 -155
- package/src/modules/communication_channels/backend/communication_channels/channels/page.tsx +0 -4
- package/src/modules/communication_channels/commands/ingest-inbound-message.ts +1 -38
- package/src/modules/communication_channels/di.ts +0 -7
- package/src/modules/communication_channels/lib/adapter.ts +0 -14
- package/src/modules/communication_channels/lib/email-capabilities.ts +0 -4
- package/src/modules/communication_channels/lib/test-seed.ts +4 -64
- package/src/modules/configs/i18n/de.json +0 -2
- package/src/modules/configs/i18n/en.json +0 -2
- package/src/modules/configs/i18n/es.json +0 -2
- package/src/modules/configs/i18n/ko.json +0 -2
- package/src/modules/configs/i18n/pl.json +0 -2
- package/src/modules/configs/lib/system-status.ts +0 -9
- package/src/modules/currencies/backend/currencies/page.tsx +1 -4
- package/src/modules/currencies/backend/exchange-rates/page.tsx +1 -4
- package/src/modules/customer_accounts/api/admin/domain-mappings.ts +0 -7
- package/src/modules/customer_accounts/backend/customer_accounts/roles/page.tsx +1 -4
- package/src/modules/customer_accounts/backend/customer_accounts/settings/CustomerAccountsSettingsPageClient.tsx +138 -0
- package/src/modules/customer_accounts/backend/customer_accounts/settings/page.tsx +8 -132
- package/src/modules/customer_accounts/backend/customer_accounts/users/PortalUsersPageClient.tsx +598 -0
- package/src/modules/customer_accounts/backend/customer_accounts/users/[id]/PortalUserDetailPageClient.tsx +838 -0
- package/src/modules/customer_accounts/backend/customer_accounts/users/[id]/page.tsx +6 -838
- package/src/modules/customer_accounts/backend/customer_accounts/users/page.tsx +6 -590
- package/src/modules/customer_accounts/extension-points.ts +1 -1
- package/src/modules/customer_accounts/lib/portalUrl.ts +112 -0
- package/src/modules/customer_accounts/services/domainMappingService.ts +0 -10
- package/src/modules/customers/ai-tools/companies-pack.ts +1 -4
- package/src/modules/customers/ai-tools/deal-analyzer-pack.ts +2 -17
- package/src/modules/customers/ai-tools/deals-pack.ts +1 -66
- package/src/modules/customers/ai-tools/people-pack.ts +1 -4
- package/src/modules/customers/api/activities/route.ts +0 -45
- package/src/modules/customers/api/companies/[id]/people/route.ts +73 -24
- package/src/modules/customers/api/companies/[id]/route.ts +107 -24
- package/src/modules/customers/api/dashboard/widgets/customer-todos/route.ts +8 -16
- package/src/modules/customers/api/deals/[id]/companies/route.ts +1 -4
- package/src/modules/customers/api/deals/[id]/people/route.ts +1 -4
- package/src/modules/customers/api/deals/[id]/route.ts +28 -17
- package/src/modules/customers/api/deals/[id]/stats/route.ts +25 -10
- package/src/modules/customers/api/deals/aggregate/route.ts +4 -14
- package/src/modules/customers/api/deals/map/route.ts +0 -1
- package/src/modules/customers/api/deals/route.ts +1 -50
- package/src/modules/customers/api/entity-roles-factory.ts +4 -8
- package/src/modules/customers/api/interactions/route.ts +2 -8
- package/src/modules/customers/api/interactions/tasks/route.ts +1 -24
- package/src/modules/customers/api/people/[id]/companies/[linkId]/route.ts +4 -12
- package/src/modules/customers/api/people/[id]/companies/context.ts +1 -4
- package/src/modules/customers/api/people/[id]/companies/enriched/route.ts +1 -4
- package/src/modules/customers/api/people/[id]/route.ts +11 -16
- package/src/modules/customers/api/people/check-phone/route.ts +10 -75
- package/src/modules/customers/api/todos/route.ts +2 -27
- package/src/modules/customers/backend/customers/companies/page.tsx +4 -7
- package/src/modules/customers/backend/customers/deals/[id]/page.tsx +2 -7
- package/src/modules/customers/backend/customers/deals/page.tsx +4 -10
- package/src/modules/customers/backend/customers/deals/pipeline/components/Lane.tsx +14 -5
- package/src/modules/customers/backend/customers/deals/pipeline/components/StatusFilterPopover.tsx +27 -109
- package/src/modules/customers/backend/customers/people/page.tsx +4 -7
- package/src/modules/customers/backend/hooks/useEmailDuplicateCheck.ts +4 -12
- package/src/modules/customers/commands/deals.ts +59 -34
- package/src/modules/customers/commands/interactions.ts +1 -1
- package/src/modules/customers/commands/personCompanyLinks.ts +8 -224
- package/src/modules/customers/components/CustomerTodosTable.tsx +0 -2
- package/src/modules/customers/components/DealsKpiStrip.tsx +7 -7
- package/src/modules/customers/components/calendar/AgendaList.tsx +3 -3
- package/src/modules/customers/components/calendar/CalendarEventEditor.tsx +1 -1
- package/src/modules/customers/components/calendar/CalendarScreen.tsx +1 -1
- package/src/modules/customers/components/calendar/CalendarSettingsModal.tsx +1 -1
- package/src/modules/customers/components/calendar/EventBlock.tsx +2 -2
- package/src/modules/customers/components/calendar/EventPeekPopover.tsx +2 -4
- package/src/modules/customers/components/calendar/editor/PeopleField.tsx +5 -61
- package/src/modules/customers/components/calendar/editor/hooks.ts +1 -7
- package/src/modules/customers/components/calendar/types.ts +2 -2
- package/src/modules/customers/components/detail/AssignRoleDialog.tsx +12 -7
- package/src/modules/customers/components/detail/CompanyKpiBar.tsx +4 -5
- package/src/modules/customers/components/detail/CompanyPeopleSection.tsx +1 -8
- package/src/modules/customers/components/detail/DealForm.tsx +2 -22
- package/src/modules/customers/components/detail/DealsSection.tsx +5 -11
- package/src/modules/customers/components/detail/EntityTagsDialog.tsx +12 -58
- package/src/modules/customers/components/detail/PersonCompaniesSection.tsx +1 -8
- package/src/modules/customers/components/detail/hooks/usePersonTasks.ts +14 -23
- package/src/modules/customers/components/detail/schedule/ParticipantsField.tsx +5 -5
- package/src/modules/customers/components/detail/schedule/useScheduleFormState.ts +5 -5
- package/src/modules/customers/components/detail/types.ts +1 -1
- package/src/modules/customers/components/detail/utils.ts +5 -15
- package/src/modules/customers/data/entities.ts +1 -1
- package/src/modules/customers/data/validators.ts +9 -50
- package/src/modules/customers/events.ts +0 -5
- package/src/modules/customers/i18n/de.json +1 -9
- package/src/modules/customers/i18n/en.json +1 -9
- package/src/modules/customers/i18n/es.json +1 -9
- package/src/modules/customers/i18n/ko.json +1 -9
- package/src/modules/customers/i18n/pl.json +1 -9
- package/src/modules/customers/lib/calendar/conflicts.ts +2 -10
- package/src/modules/customers/lib/calendar/editorPayload.ts +3 -4
- package/src/modules/customers/lib/calendar/mapItem.ts +3 -8
- package/src/modules/customers/lib/dealStatus.ts +0 -42
- package/src/modules/customers/lib/findPeopleByAddresses.ts +6 -8
- package/src/modules/customers/lib/personCompanies.ts +1 -136
- package/src/modules/customers/lib/todoCompatibility.ts +1 -19
- package/src/modules/dashboards/i18n/es.json +4 -4
- package/src/modules/dashboards/i18n/pl.json +7 -7
- package/src/modules/dashboards/lib/widgetScope.ts +0 -6
- package/src/modules/data_sync/AGENTS.md +1 -1
- package/src/modules/data_sync/backend/data-sync/page.tsx +1 -4
- package/src/modules/data_sync/lib/adapter.ts +0 -36
- package/src/modules/data_sync/lib/sync-engine.ts +5 -113
- package/src/modules/data_sync/workers/sync-export.ts +0 -4
- package/src/modules/data_sync/workers/sync-import.ts +0 -4
- package/src/modules/devices/AGENTS.md +1 -20
- package/src/modules/devices/acl.ts +1 -9
- package/src/modules/devices/api/admin/devices/[id]/route.ts +34 -5
- package/src/modules/devices/api/admin/devices/route.ts +1 -14
- package/src/modules/devices/api/deviceList.ts +11 -135
- package/src/modules/devices/api/openapi.ts +1 -9
- package/src/modules/devices/api/route.ts +1 -9
- package/src/modules/devices/backend/devices/[id]/page.tsx +32 -18
- package/src/modules/devices/backend/devices/create/page.tsx +1 -17
- package/src/modules/devices/backend/devices/page.tsx +45 -44
- package/src/modules/devices/i18n/de.json +2 -3
- package/src/modules/devices/i18n/en.json +2 -3
- package/src/modules/devices/i18n/es.json +2 -3
- package/src/modules/devices/i18n/ko.json +2 -3
- package/src/modules/devices/i18n/pl.json +2 -3
- package/src/modules/devices/setup.ts +2 -6
- package/src/modules/directory/backend/directory/organizations/page.tsx +1 -3
- package/src/modules/directory/backend/directory/tenants/page.tsx +1 -3
- package/src/modules/directory/di.ts +2 -14
- package/src/modules/directory/utils/organizationScope.ts +15 -4
- package/src/modules/entities/api/records.ts +0 -2
- package/src/modules/entities/backend/entities/user/[entityId]/records/page.tsx +1 -4
- package/src/modules/eudr/api/plots/route.ts +0 -4
- package/src/modules/eudr/backend/eudr/evidence-submissions/[id]/page.meta.ts +2 -0
- package/src/modules/eudr/backend/eudr/evidence-submissions/create/page.meta.ts +1 -0
- package/src/modules/eudr/backend/eudr/evidence-submissions/page.meta.ts +4 -1
- package/src/modules/eudr/backend/eudr/evidence-submissions/page.tsx +0 -4
- package/src/modules/eudr/backend/eudr/page.meta.ts +2 -2
- package/src/modules/eudr/backend/eudr/plots/[id]/page.meta.ts +2 -0
- package/src/modules/eudr/backend/eudr/plots/[id]/page.tsx +8 -2
- package/src/modules/eudr/backend/eudr/plots/create/page.meta.ts +1 -0
- package/src/modules/eudr/backend/eudr/plots/create/page.tsx +8 -2
- package/src/modules/eudr/backend/eudr/plots/page.meta.ts +4 -1
- package/src/modules/eudr/backend/eudr/plots/page.tsx +0 -4
- package/src/modules/eudr/backend/eudr/product-mappings/[id]/page.meta.ts +2 -0
- package/src/modules/eudr/backend/eudr/product-mappings/create/page.meta.ts +1 -0
- package/src/modules/eudr/backend/eudr/product-mappings/page.meta.ts +4 -1
- package/src/modules/eudr/backend/eudr/product-mappings/page.tsx +0 -4
- package/src/modules/eudr/backend/eudr/risk-assessments/[id]/page.meta.ts +2 -0
- package/src/modules/eudr/backend/eudr/risk-assessments/create/page.meta.ts +1 -0
- package/src/modules/eudr/backend/eudr/risk-assessments/page.meta.ts +4 -1
- package/src/modules/eudr/backend/eudr/risk-assessments/page.tsx +0 -4
- package/src/modules/eudr/backend/eudr/statements/[id]/page.meta.ts +2 -0
- package/src/modules/eudr/backend/eudr/statements/[id]/page.tsx +2 -0
- package/src/modules/eudr/backend/eudr/statements/create/page.meta.ts +1 -0
- package/src/modules/eudr/backend/eudr/statements/page.meta.ts +4 -1
- package/src/modules/eudr/backend/eudr/statements/page.tsx +32 -30
- package/src/modules/eudr/commands/statements.ts +7 -2
- package/src/modules/eudr/components/crudErrorI18n.ts +31 -0
- package/src/modules/eudr/components/formConfig.tsx +9 -1
- package/src/modules/eudr/data/validators.ts +1 -16
- package/src/modules/eudr/i18n/de.json +3 -2
- package/src/modules/eudr/i18n/en.json +3 -2
- package/src/modules/eudr/i18n/es.json +3 -2
- package/src/modules/eudr/i18n/ko.json +3 -2
- package/src/modules/eudr/i18n/pl.json +3 -2
- package/src/modules/eudr/lib/statement-lifecycle.ts +8 -0
- package/src/modules/feature_toggles/components/FeatureTogglesTable.tsx +1 -2
- package/src/modules/feature_toggles/components/OverridesTable.tsx +1 -2
- package/src/modules/feature_toggles/defaults.json +8 -0
- package/src/modules/inbox_ops/backend/inbox-ops/log/page.tsx +0 -4
- package/src/modules/inbox_ops/backend/inbox-ops/page.tsx +0 -4
- package/src/modules/inbox_ops/lib/htmlToPlainText.ts +17 -1
- package/src/modules/integrations/api/[id]/credentials/route.ts +4 -6
- package/src/modules/integrations/backend/integrations/[id]/page.tsx +31 -61
- package/src/modules/integrations/backend/integrations/bundle/[id]/page.tsx +9 -44
- package/src/modules/integrations/data/validators.ts +2 -12
- package/src/modules/integrations/i18n/de.json +0 -1
- package/src/modules/integrations/i18n/en.json +0 -1
- package/src/modules/integrations/i18n/es.json +0 -1
- package/src/modules/integrations/i18n/ko.json +0 -1
- package/src/modules/integrations/i18n/pl.json +0 -1
- package/src/modules/integrations/lib/credentials-masking.ts +6 -10
- package/src/modules/messages/api/[id]/route.ts +1 -55
- package/src/modules/messages/api/openapi.ts +0 -20
- package/src/modules/messages/api/route.ts +2 -31
- package/src/modules/messages/components/MessagesInboxPageClient.tsx +16 -9
- package/src/modules/messages/components/inboxFilters.ts +0 -36
- package/src/modules/messages/components/message-detail/hooks/useMessageDetailsConversation.ts +1 -14
- package/src/modules/messages/components/message-detail/panels/MessageHeader.tsx +1 -3
- package/src/modules/messages/components/message-detail/panels/thread-panel.tsx +1 -2
- package/src/modules/messages/components/message-detail/types.ts +0 -3
- package/src/modules/messages/components/messageListLabels.ts +3 -52
- package/src/modules/messages/data/validators.ts +4 -43
- package/src/modules/payment_gateways/api/webhook/[provider]/route.ts +6 -4
- package/src/modules/payment_gateways/backend/payment-gateways/page.tsx +1 -4
- package/src/modules/payment_gateways/lib/webhook-processor.ts +0 -11
- package/src/modules/planner/backend/planner/availability-rulesets/page.tsx +0 -4
- package/src/modules/push_notifications/backend/push_notifications/page.tsx +1 -4
- package/src/modules/push_notifications/backend/push_notifications/send/page.tsx +4 -4
- package/src/modules/query_index/lib/engine.ts +61 -249
- package/src/modules/query_index/lib/search-tokens.ts +3 -135
- package/src/modules/resources/backend/resources/resource-types/page.tsx +1 -4
- package/src/modules/resources/backend/resources/resources/page.tsx +1 -4
- package/src/modules/sales/backend/sales/channels/offers/page.tsx +0 -4
- package/src/modules/sales/backend/sales/channels/page.tsx +0 -4
- package/src/modules/sales/backend/sales/documents/[id]/page.tsx +8 -14
- package/src/modules/sales/commands/documents.ts +0 -93
- package/src/modules/sales/components/PriceWithCurrency.tsx +5 -17
- package/src/modules/sales/components/channels/SalesChannelOffersPanel.tsx +0 -4
- package/src/modules/sales/components/documents/AdjustmentsSection.tsx +5 -6
- package/src/modules/sales/components/documents/ItemsSection.tsx +18 -56
- package/src/modules/sales/components/documents/LineItemDialog.tsx +21 -138
- package/src/modules/sales/components/documents/PaymentsSection.tsx +9 -20
- package/src/modules/sales/components/documents/ReturnsSection.tsx +5 -6
- package/src/modules/sales/components/documents/SalesDocumentsTable.tsx +14 -106
- package/src/modules/sales/components/documents/SalesOrderDraftLines.tsx +5 -6
- package/src/modules/sales/components/documents/ShipmentDialog.tsx +4 -5
- package/src/modules/sales/components/documents/ShipmentsSection.tsx +5 -6
- package/src/modules/sales/components/documents/lineItemUtils.ts +2 -7
- package/src/modules/sales/data/entities.ts +0 -6
- package/src/modules/sales/extension-points.ts +0 -1
- package/src/modules/sales/i18n/de.json +37 -8
- package/src/modules/sales/i18n/en.json +37 -8
- package/src/modules/sales/i18n/es.json +37 -8
- package/src/modules/sales/i18n/ko.json +37 -8
- package/src/modules/sales/i18n/pl.json +37 -8
- package/src/modules/sales/migrations/.snapshot-open-mercato.json +0 -60
- package/src/modules/sales/setup.ts +0 -2
- package/src/modules/sales/widgets/injection/document-history/widget.client.tsx +42 -2
- package/src/modules/sales/widgets/injection/payment-gateway-status-column/widget.ts +1 -9
- package/src/modules/sales/widgets/injection-table.ts +7 -4
- package/src/modules/staff/backend/staff/leave-requests/page.tsx +0 -4
- package/src/modules/staff/backend/staff/my-leave-requests/page.tsx +0 -4
- package/src/modules/staff/backend/staff/team-members/page.tsx +0 -6
- package/src/modules/staff/backend/staff/team-roles/page.tsx +0 -4
- package/src/modules/staff/backend/staff/teams/[id]/edit/page.tsx +0 -4
- package/src/modules/staff/backend/staff/teams/page.tsx +0 -4
- package/src/modules/staff/backend/staff/timesheets/page.tsx +1 -12
- package/src/modules/staff/backend/staff/timesheets/projects/page.tsx +0 -4
- package/src/modules/sync_excel/lib/adapters/customers.ts +0 -5
- package/src/modules/warranty_claims/api/assignees/route.ts +3 -3
- package/src/modules/warranty_claims/api/portal/attachments/route.ts +2 -2
- package/src/modules/warranty_claims/api/portal/claims/route.ts +9 -12
- package/src/modules/warranty_claims/backend/page.tsx +0 -4
- package/src/modules/warranty_claims/backend/warranty_claims/registrations/page.tsx +0 -4
- package/src/modules/warranty_claims/backend/warranty_claims/troubleshooting-guides/page.tsx +0 -4
- package/src/modules/warranty_claims/backend/warranty_claims/vendor-policies/page.tsx +0 -4
- package/src/modules/warranty_claims/frontend/[orgSlug]/portal/claims/page.tsx +0 -4
- package/src/modules/wms/api/warehouses/route.ts +9 -13
- package/src/modules/wms/api/zones/route.ts +0 -16
- package/src/modules/wms/commands/configuration.ts +10 -159
- package/src/modules/wms/commands/inventory-actions.ts +0 -3
- package/src/modules/wms/commands/shared.ts +0 -17
- package/src/modules/wms/components/backend/WmsConfigurationPage.tsx +141 -95
- package/src/modules/wms/components/backend/WmsInventoryConsolePage.tsx +0 -2
- package/src/modules/wms/components/backend/WmsLocationDetailPage.tsx +30 -26
- package/src/modules/wms/components/backend/WmsLotDetailPage.tsx +21 -17
- package/src/modules/wms/components/backend/WmsLotsListPage.tsx +0 -2
- package/src/modules/wms/components/backend/WmsOperationalDashboardPage.tsx +17 -13
- package/src/modules/wms/components/backend/WmsSkuDetailPage.tsx +16 -12
- package/src/modules/wms/components/backend/inventoryMutationLoaders.ts +20 -36
- 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/ko.json +0 -2
- package/src/modules/wms/i18n/pl.json +0 -2
- package/src/modules/workflows/backend/definitions/page.tsx +1 -4
- package/src/modules/workflows/backend/events/page.tsx +1 -4
- package/src/modules/workflows/backend/instances/page.tsx +1 -4
- package/src/modules/workflows/backend/tasks/page.tsx +1 -4
- package/src/modules/workflows/lib/activity-executor.ts +0 -9
- package/dist/modules/api_keys/di.js +0 -9
- package/dist/modules/api_keys/di.js.map +0 -7
- package/dist/modules/api_keys/services/principalService.js +0 -31
- package/dist/modules/api_keys/services/principalService.js.map +0 -7
- package/dist/modules/attachments/lib/attachment-service.js +0 -313
- package/dist/modules/attachments/lib/attachment-service.js.map +0 -7
- package/dist/modules/auth/api/reset/validate.js +0 -55
- package/dist/modules/auth/api/reset/validate.js.map +0 -7
- package/dist/modules/auth/commands/acl.js +0 -254
- package/dist/modules/auth/commands/acl.js.map +0 -7
- package/dist/modules/auth/lib/userIdFilter.js +0 -16
- package/dist/modules/auth/lib/userIdFilter.js.map +0 -7
- package/dist/modules/auth/services/principalService.js +0 -200
- package/dist/modules/auth/services/principalService.js.map +0 -7
- package/dist/modules/auth/services/roleOrganizationScope.js +0 -41
- package/dist/modules/auth/services/roleOrganizationScope.js.map +0 -7
- package/dist/modules/communication_channels/lib/outbound-recipient.js +0 -33
- package/dist/modules/communication_channels/lib/outbound-recipient.js.map +0 -7
- package/dist/modules/communication_channels/lib/resolve-channel-type.js +0 -51
- package/dist/modules/communication_channels/lib/resolve-channel-type.js.map +0 -7
- package/dist/modules/customers/backend/customers/deals/pipeline/components/toneClasses.js +0 -18
- package/dist/modules/customers/backend/customers/deals/pipeline/components/toneClasses.js.map +0 -7
- package/dist/modules/customers/lib/calendar/participantIdentity.js +0 -9
- package/dist/modules/customers/lib/calendar/participantIdentity.js.map +0 -7
- package/dist/modules/customers/lib/closureStage.js +0 -45
- package/dist/modules/customers/lib/closureStage.js.map +0 -7
- package/dist/modules/customers/lib/detailReadAccess.js +0 -12
- package/dist/modules/customers/lib/detailReadAccess.js.map +0 -7
- package/dist/modules/data_sync/lib/abandoned-run.js +0 -19
- package/dist/modules/data_sync/lib/abandoned-run.js.map +0 -7
- package/dist/modules/devices/api/deviceSerialization.js +0 -46
- package/dist/modules/devices/api/deviceSerialization.js.map +0 -7
- package/dist/modules/devices/backend/devices/useDeviceUserLabels.js +0 -34
- package/dist/modules/devices/backend/devices/useDeviceUserLabels.js.map +0 -7
- package/dist/modules/devices/backend/devices/userOptions.js +0 -52
- package/dist/modules/devices/backend/devices/userOptions.js.map +0 -7
- package/dist/modules/directory/services/organizationHierarchyService.js +0 -29
- package/dist/modules/directory/services/organizationHierarchyService.js.map +0 -7
- package/dist/modules/directory/services/organizationScopeService.js +0 -56
- package/dist/modules/directory/services/organizationScopeService.js.map +0 -7
- package/dist/modules/integrations/backend/integrations/credential-secret-fields.js +0 -55
- package/dist/modules/integrations/backend/integrations/credential-secret-fields.js.map +0 -7
- package/dist/modules/messages/lib/channel-sender-identity.js +0 -26
- package/dist/modules/messages/lib/channel-sender-identity.js.map +0 -7
- package/dist/modules/messages/lib/composeSourceChannelType.js +0 -41
- package/dist/modules/messages/lib/composeSourceChannelType.js.map +0 -7
- package/dist/modules/query_index/lib/search-entity-policy.js +0 -14
- package/dist/modules/query_index/lib/search-entity-policy.js.map +0 -7
- package/dist/modules/sales/components/documents/lineItemShipmentLock.js +0 -54
- package/dist/modules/sales/components/documents/lineItemShipmentLock.js.map +0 -7
- package/dist/modules/sales/lib/salesChannelsToggleSeed.js +0 -33
- package/dist/modules/sales/lib/salesChannelsToggleSeed.js.map +0 -7
- package/dist/modules/sales/migrations/Migration20260821120000_sales_notes_addresses_context_idx.js +0 -32
- package/dist/modules/sales/migrations/Migration20260821120000_sales_notes_addresses_context_idx.js.map +0 -7
- package/dist/modules/wms/api/warehouseSearch.js +0 -21
- package/dist/modules/wms/api/warehouseSearch.js.map +0 -7
- package/dist/modules/wms/components/backend/WarehouseEditDialog.js +0 -158
- package/dist/modules/wms/components/backend/WarehouseEditDialog.js.map +0 -7
- package/dist/modules/wms/components/backend/warehouseFormOptions.js +0 -66
- package/dist/modules/wms/components/backend/warehouseFormOptions.js.map +0 -7
- package/src/modules/api_keys/di.ts +0 -7
- package/src/modules/api_keys/services/principalService.ts +0 -33
- package/src/modules/attachments/lib/attachment-service.ts +0 -468
- package/src/modules/auth/api/reset/validate.ts +0 -57
- package/src/modules/auth/commands/acl.ts +0 -495
- package/src/modules/auth/lib/userIdFilter.ts +0 -31
- package/src/modules/auth/services/principalService.ts +0 -266
- package/src/modules/auth/services/roleOrganizationScope.ts +0 -70
- package/src/modules/communication_channels/lib/outbound-recipient.ts +0 -71
- package/src/modules/communication_channels/lib/resolve-channel-type.ts +0 -99
- package/src/modules/customers/backend/customers/deals/pipeline/components/toneClasses.ts +0 -21
- package/src/modules/customers/lib/calendar/participantIdentity.ts +0 -17
- package/src/modules/customers/lib/closureStage.ts +0 -76
- package/src/modules/customers/lib/detailReadAccess.ts +0 -35
- package/src/modules/data_sync/lib/abandoned-run.ts +0 -56
- package/src/modules/devices/api/deviceSerialization.ts +0 -50
- package/src/modules/devices/backend/devices/useDeviceUserLabels.ts +0 -45
- package/src/modules/devices/backend/devices/userOptions.ts +0 -99
- package/src/modules/directory/services/organizationHierarchyService.ts +0 -34
- package/src/modules/directory/services/organizationScopeService.ts +0 -85
- package/src/modules/integrations/backend/integrations/credential-secret-fields.ts +0 -84
- package/src/modules/messages/lib/channel-sender-identity.ts +0 -55
- package/src/modules/messages/lib/composeSourceChannelType.ts +0 -95
- package/src/modules/query_index/lib/search-entity-policy.ts +0 -46
- package/src/modules/sales/components/documents/lineItemShipmentLock.ts +0 -74
- package/src/modules/sales/lib/salesChannelsToggleSeed.ts +0 -42
- package/src/modules/sales/migrations/Migration20260821120000_sales_notes_addresses_context_idx.ts +0 -87
- package/src/modules/wms/api/warehouseSearch.ts +0 -23
- package/src/modules/wms/components/backend/WarehouseEditDialog.tsx +0 -216
- package/src/modules/wms/components/backend/warehouseFormOptions.ts +0 -72
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/modules/messages/components/inboxFilters.ts"],
|
|
4
|
-
"sourcesContent": ["import type { FilterDef, FilterValues } from '@open-mercato/ui/backend/FilterBar'\n\ntype Translator = (key: string, fallback?: string) => string\n\nexport type SenderOption = {\n value: string\n label: string\n description?: string | null\n}\n\
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import type { FilterDef, FilterValues } from '@open-mercato/ui/backend/FilterBar'\n\ntype Translator = (key: string, fallback?: string) => string\n\nexport type SenderOption = {\n value: string\n label: string\n description?: string | null\n}\n\nexport type MessagesInboxFilterContext = {\n t: Translator\n typeOptions: { value: string; label: string }[]\n senderOptions: SenderOption[]\n loadSenderOptions: (query?: string) => Promise<SenderOption[]>\n}\n\nexport function buildMessagesInboxFilters({\n t,\n typeOptions,\n senderOptions,\n loadSenderOptions,\n}: MessagesInboxFilterContext): FilterDef[] {\n const senderLabel = (val: string): string => {\n const match = senderOptions.find((opt) => opt.value === val)\n return match?.label ?? val\n }\n\n return [\n {\n id: 'status',\n label: t('messages.filters.status', 'Status'),\n type: 'select',\n options: [\n { value: '', label: t('messages.filters.all', 'All') },\n { value: 'unread', label: t('messages.status.unread', 'Unread') },\n { value: 'read', label: t('messages.status.read', 'Read') },\n { value: 'archived', label: t('messages.status.archived', 'Archived') },\n ],\n },\n {\n id: 'type',\n label: t('messages.filters.type', 'Type'),\n type: 'select',\n options: [{ value: '', label: t('messages.filters.all', 'All') }, ...typeOptions],\n },\n {\n id: 'hasObjects',\n label: t('messages.filters.hasObjects', 'Has related records'),\n tooltip: t('messages.filters.hasObjectsTooltip', 'Shows messages that have Open Mercato records attached \u2014 such as orders, quotes, or customers.'),\n type: 'select',\n options: [\n { value: '', label: t('messages.filters.all', 'All') },\n { value: 'true', label: t('common.yes', 'Yes') },\n { value: 'false', label: t('common.no', 'No') },\n ],\n },\n {\n id: 'hasAttachments',\n label: t('messages.filters.hasAttachments', 'Has attachments'),\n type: 'select',\n options: [\n { value: '', label: t('messages.filters.all', 'All') },\n { value: 'true', label: t('common.yes', 'Yes') },\n { value: 'false', label: t('common.no', 'No') },\n ],\n },\n {\n id: 'hasActions',\n label: t('messages.filters.hasActions', 'Has action requests'),\n tooltip: t('messages.filters.hasActionsTooltip', 'Shows messages where one or more attached records require a response (approval, rejection, or review).'),\n type: 'select',\n options: [\n { value: '', label: t('messages.filters.all', 'All') },\n { value: 'true', label: t('common.yes', 'Yes') },\n { value: 'false', label: t('common.no', 'No') },\n ],\n },\n {\n id: 'senderId',\n label: t('messages.filters.sender', 'Sender'),\n type: 'combobox',\n placeholder: t('messages.filters.senderEmpty', 'Type to search users'),\n options: senderOptions,\n loadOptions: loadSenderOptions,\n formatValue: senderLabel,\n formatDescription: (val: string) =>\n senderOptions.find((opt) => opt.value === val)?.description ?? null,\n },\n {\n id: 'since',\n label: t('messages.filters.since', 'Sent after'),\n type: 'text',\n placeholder: t('messages.filters.sincePlaceholder', 'YYYY-MM-DD'),\n },\n ]\n}\n\nconst DATE_ONLY_PATTERN = /^\\d{4}-\\d{2}-\\d{2}$/\n\nexport function normalizeMessagesSinceValue(input: string): string | null {\n const trimmed = input.trim()\n if (!trimmed) return null\n if (DATE_ONLY_PATTERN.test(trimmed)) {\n const parsed = new Date(`${trimmed}T00:00:00.000Z`)\n if (Number.isNaN(parsed.getTime())) return null\n if (parsed.toISOString().slice(0, 10) !== trimmed) return null\n return parsed.toISOString()\n }\n const parsed = new Date(trimmed)\n if (Number.isNaN(parsed.getTime())) return null\n return parsed.toISOString()\n}\n\nexport type BuildMessagesListParamsOptions = {\n folder: string\n page: number\n pageSize: number\n search: string\n filterValues: FilterValues\n}\n\nexport function buildMessagesListParams({\n folder,\n page,\n pageSize,\n search,\n filterValues,\n}: BuildMessagesListParamsOptions): URLSearchParams {\n const params = new URLSearchParams()\n params.set('folder', folder)\n params.set('page', String(page))\n params.set('pageSize', String(pageSize))\n\n if (search.trim()) {\n params.set('search', search.trim())\n }\n\n const stringValue = (id: string): string => {\n const raw = filterValues[id]\n return typeof raw === 'string' ? raw.trim() : ''\n }\n\n const status = stringValue('status')\n const type = stringValue('type')\n const hasObjects = stringValue('hasObjects')\n const hasAttachments = stringValue('hasAttachments')\n const hasActions = stringValue('hasActions')\n const senderId = stringValue('senderId')\n const sinceRaw = stringValue('since')\n\n if (status) params.set('status', status)\n if (type) params.set('type', type)\n if (hasObjects) params.set('hasObjects', hasObjects)\n if (hasAttachments) params.set('hasAttachments', hasAttachments)\n if (hasActions) params.set('hasActions', hasActions)\n if (senderId) params.set('senderId', senderId)\n if (sinceRaw) {\n const normalized = normalizeMessagesSinceValue(sinceRaw)\n if (normalized) params.set('since', normalized)\n }\n\n return params\n}\n"],
|
|
5
|
+
"mappings": "AAiBO,SAAS,0BAA0B;AAAA,EACxC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAA4C;AAC1C,QAAM,cAAc,CAAC,QAAwB;AAC3C,UAAM,QAA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}
|
package/dist/modules/messages/components/message-detail/hooks/useMessageDetailsConversation.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import { getMessageParticipantLabel } from "../../messageListLabels.js";
|
|
4
3
|
function useMessageDetailsConversation({
|
|
5
4
|
detail,
|
|
6
5
|
t
|
|
@@ -13,9 +12,6 @@ function useMessageDetailsConversation({
|
|
|
13
12
|
senderUserId: detail.senderUserId,
|
|
14
13
|
senderName: detail.senderName,
|
|
15
14
|
senderEmail: detail.senderEmail,
|
|
16
|
-
externalName: detail.externalName,
|
|
17
|
-
externalEmail: detail.externalEmail,
|
|
18
|
-
sourceEntityType: detail.sourceEntityType,
|
|
19
15
|
body: detail.body,
|
|
20
16
|
bodyFormat: detail.bodyFormat,
|
|
21
17
|
sentAt: detail.sentAt,
|
|
@@ -27,9 +23,6 @@ function useMessageDetailsConversation({
|
|
|
27
23
|
senderUserId: item.senderUserId,
|
|
28
24
|
senderName: item.senderName,
|
|
29
25
|
senderEmail: item.senderEmail,
|
|
30
|
-
externalName: item.externalName,
|
|
31
|
-
externalEmail: item.externalEmail,
|
|
32
|
-
sourceEntityType: item.sourceEntityType,
|
|
33
26
|
body: item.body,
|
|
34
27
|
bodyFormat: item.bodyFormat,
|
|
35
28
|
sentAt: item.sentAt,
|
|
@@ -41,9 +34,6 @@ function useMessageDetailsConversation({
|
|
|
41
34
|
senderUserId: detail.senderUserId,
|
|
42
35
|
senderName: detail.senderName,
|
|
43
36
|
senderEmail: detail.senderEmail,
|
|
44
|
-
externalName: detail.externalName,
|
|
45
|
-
externalEmail: detail.externalEmail,
|
|
46
|
-
sourceEntityType: detail.sourceEntityType,
|
|
47
37
|
body: detail.body,
|
|
48
38
|
bodyFormat: detail.bodyFormat,
|
|
49
39
|
sentAt: detail.sentAt,
|
|
@@ -90,7 +80,7 @@ function useMessageDetailsConversation({
|
|
|
90
80
|
bodyFormat: item.bodyFormat ?? "text",
|
|
91
81
|
priority: "normal",
|
|
92
82
|
sentAt: item.sentAt ? new Date(item.sentAt) : null,
|
|
93
|
-
senderName:
|
|
83
|
+
senderName: item.senderName || item.senderEmail || item.senderUserId,
|
|
94
84
|
hasObjects: (item.objects ?? []).length > 0,
|
|
95
85
|
objectCount: (item.objects ?? []).length,
|
|
96
86
|
hasAttachments: false,
|
package/dist/modules/messages/components/message-detail/hooks/useMessageDetailsConversation.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/modules/messages/components/message-detail/hooks/useMessageDetailsConversation.ts"],
|
|
4
|
-
"sourcesContent": ["\"use client\"\n\nimport * as React from 'react'\nimport type { TranslateFn } from '@open-mercato/shared/lib/i18n/context'\nimport type { MessageListItemProps } from '@open-mercato/shared/modules/messages/types'\nimport type { MessageDetail } from '../types'\
|
|
5
|
-
"mappings": ";AAEA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["\"use client\"\n\nimport * as React from 'react'\nimport type { TranslateFn } from '@open-mercato/shared/lib/i18n/context'\nimport type { MessageListItemProps } from '@open-mercato/shared/modules/messages/types'\nimport type { MessageDetail } from '../types'\n\nexport type ConversationItem = {\n id: string\n senderUserId: string\n senderName?: string | null\n senderEmail?: string | null\n body: string\n bodyFormat?: 'text' | 'markdown'\n sentAt?: string | null\n objects?: Array<{ id: string }>\n}\n\ntype UseMessageDetailsConversationInput = {\n detail: MessageDetail | null\n t: TranslateFn\n}\n\nexport function useMessageDetailsConversation({\n detail,\n t,\n}: UseMessageDetailsConversationInput) {\n const conversationItems = React.useMemo<ConversationItem[]>(() => {\n const thread = detail?.thread ?? []\n if (thread.length === 0 && detail) {\n return [{\n id: detail.id,\n senderUserId: detail.senderUserId,\n senderName: detail.senderName,\n senderEmail: detail.senderEmail,\n body: detail.body,\n bodyFormat: detail.bodyFormat,\n sentAt: detail.sentAt,\n objects: detail.objects.map((item) => ({ id: item.id })),\n }]\n }\n\n const items = thread\n .map((item) => ({\n id: item.id,\n senderUserId: item.senderUserId,\n senderName: item.senderName,\n senderEmail: item.senderEmail,\n body: item.body,\n bodyFormat: item.bodyFormat,\n sentAt: item.sentAt,\n objects: item.objects?.map((entry) => ({ id: entry.id })) ?? [],\n }))\n\n if (detail && !items.some((item) => item.id === detail.id)) {\n items.push({\n id: detail.id,\n senderUserId: detail.senderUserId,\n senderName: detail.senderName,\n senderEmail: detail.senderEmail,\n body: detail.body,\n bodyFormat: detail.bodyFormat,\n sentAt: detail.sentAt,\n objects: detail.objects.map((entry) => ({ id: entry.id })),\n })\n }\n\n items.sort((a, b) => {\n const aTime = a.sentAt ? new Date(a.sentAt).getTime() : 0\n const bTime = b.sentAt ? new Date(b.sentAt).getTime() : 0\n return aTime - bTime\n })\n\n return items\n }, [detail])\n\n const forcedExpandedItemId = conversationItems.length > 0\n ? conversationItems[conversationItems.length - 1].id\n : null\n\n const [expandedById, setExpandedById] = React.useState<Record<string, boolean>>({})\n const conversationIdsKey = React.useMemo(\n () => conversationItems.map((item) => item.id).join('|'),\n [conversationItems],\n )\n\n React.useEffect(() => {\n const nextState: Record<string, boolean> = {}\n for (const item of conversationItems) {\n nextState[item.id] = forcedExpandedItemId === item.id\n }\n setExpandedById(nextState)\n }, [conversationIdsKey, conversationItems, forcedExpandedItemId])\n\n const toggleConversationItem = React.useCallback((itemId: string) => {\n if (itemId === forcedExpandedItemId) return\n setExpandedById((previous) => ({\n ...previous,\n [itemId]: !previous[itemId],\n }))\n }, [forcedExpandedItemId])\n\n const isConversationItemExpanded = React.useCallback((itemId: string) => {\n if (itemId === forcedExpandedItemId) return true\n return Boolean(expandedById[itemId])\n }, [expandedById, forcedExpandedItemId])\n\n const buildConversationListItemMessage = React.useCallback((item: ConversationItem): MessageListItemProps['message'] => ({\n id: item.id,\n type: detail?.type ?? 'default',\n typeLabel: detail ? t(detail.typeDefinition.labelKey, detail.type) : undefined,\n subject: detail?.subject ?? '',\n body: item.body,\n bodyFormat: item.bodyFormat ?? 'text',\n priority: 'normal',\n sentAt: item.sentAt ? new Date(item.sentAt) : null,\n senderName: item.senderName || item.senderEmail || item.senderUserId,\n hasObjects: (item.objects ?? []).length > 0,\n objectCount: (item.objects ?? []).length,\n hasAttachments: false,\n attachmentCount: 0,\n hasActions: false,\n actionTaken: null,\n unread: false,\n }), [detail, t])\n\n return {\n conversationItems,\n forcedExpandedItemId,\n toggleConversationItem,\n isConversationItemExpanded,\n buildConversationListItemMessage,\n }\n}\n"],
|
|
5
|
+
"mappings": ";AAEA,YAAY,WAAW;AAqBhB,SAAS,8BAA8B;AAAA,EAC5C;AAAA,EACA;AACF,GAAuC;AACrC,QAAM,oBAAoB,MAAM,QAA4B,MAAM;AAChE,UAAM,SAAS,QAAQ,UAAU,CAAC;AAClC,QAAI,OAAO,WAAW,KAAK,QAAQ;AACjC,aAAO,CAAC;AAAA,QACN,IAAI,OAAO;AAAA,QACX,cAAc,OAAO;AAAA,QACrB,YAAY,OAAO;AAAA,QACnB,aAAa,OAAO;AAAA,QACpB,MAAM,OAAO;AAAA,QACb,YAAY,OAAO;AAAA,QACnB,QAAQ,OAAO;AAAA,QACf,SAAS,OAAO,QAAQ,IAAI,CAAC,UAAU,EAAE,IAAI,KAAK,GAAG,EAAE;AAAA,MACzD,CAAC;AAAA,IACH;AAEA,UAAM,QAAQ,OACX,IAAI,CAAC,UAAU;AAAA,MACd,IAAI,KAAK;AAAA,MACT,cAAc,KAAK;AAAA,MACnB,YAAY,KAAK;AAAA,MACjB,aAAa,KAAK;AAAA,MAClB,MAAM,KAAK;AAAA,MACX,YAAY,KAAK;AAAA,MACjB,QAAQ,KAAK;AAAA,MACb,SAAS,KAAK,SAAS,IAAI,CAAC,WAAW,EAAE,IAAI,MAAM,GAAG,EAAE,KAAK,CAAC;AAAA,IAChE,EAAE;AAEJ,QAAI,UAAU,CAAC,MAAM,KAAK,CAAC,SAAS,KAAK,OAAO,OAAO,EAAE,GAAG;AAC1D,YAAM,K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AA,EACJ,GAAG,CAAC,oBAAoB,CAAC;AAEzB,QAAM,6BAA6B,MAAM,YAAY,CAAC,WAAmB;AACvE,QAAI,WAAW,qBAAsB,QAAO;AAC5C,WAAO,QAAQ,aAAa,MAAM,CAAC;AAAA,EACrC,GAAG,CAAC,cAAc,oBAAoB,CAAC;AAEvC,QAAM,mCAAmC,MAAM,YAAY,CAAC,UAA6D;AAAA,IACvH,IAAI,KAAK;AAAA,IACT,MAAM,QAAQ,QAAQ;AAAA,IACtB,WAAW,SAAS,EAAE,OAAO,eAAe,UAAU,OAAO,IAAI,IAAI;AAAA,IACrE,SAAS,QAAQ,WAAW;AAAA,IAC5B,MAAM,KAAK;AAAA,IACX,YAAY,KAAK,cAAc;AAAA,IAC/B,UAAU;AAAA,IACV,QAAQ,KAAK,SAAS,IAAI,KAAK,KAAK,MAAM,IAAI;AAAA,IAC9C,YAAY,KAAK,cAAc,KAAK,eAAe,KAAK;AAAA,IACxD,aAAa,KAAK,WAAW,CAAC,GAAG,SAAS;AAAA,IAC1C,cAAc,KAAK,WAAW,CAAC,GAAG;AAAA,IAClC,gBAAgB;AAAA,IAChB,iBAAiB;AAAA,IACjB,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,QAAQ;AAAA,EACV,IAAI,CAAC,QAAQ,CAAC,CAAC;AAEf,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -17,12 +17,10 @@ import {
|
|
|
17
17
|
Trash2
|
|
18
18
|
} from "lucide-react";
|
|
19
19
|
import { formatDateTime } from "../utils.js";
|
|
20
|
-
import { getMessageParticipantLabel } from "../../messageListLabels.js";
|
|
21
20
|
function MessageHeader(props) {
|
|
22
21
|
const t = useT();
|
|
23
22
|
const showSubject = props.showSubject !== false;
|
|
24
23
|
const canReply = !props.detail.isDraft && props.detail.typeDefinition.allowReply;
|
|
25
|
-
const senderLabel = getMessageParticipantLabel(props.detail);
|
|
26
24
|
const actionItems = React.useMemo(() => {
|
|
27
25
|
const items = [];
|
|
28
26
|
if (props.detail.isDraft && props.detail.canEditDraft) {
|
|
@@ -86,7 +84,7 @@ function MessageHeader(props) {
|
|
|
86
84
|
{
|
|
87
85
|
mode: "detail",
|
|
88
86
|
title: showSubject ? props.detail.subject : void 0,
|
|
89
|
-
subtitle: `${t("messages.detail.from", "From")}: ${
|
|
87
|
+
subtitle: `${t("messages.detail.from", "From")}: ${props.detail.senderName || props.detail.senderEmail || props.detail.senderUserId}`,
|
|
90
88
|
statusBadge: /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: formatDateTime(props.detail.sentAt) }),
|
|
91
89
|
utilityActions: canReply ? /* @__PURE__ */ jsx(
|
|
92
90
|
IconButton,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/modules/messages/components/message-detail/panels/MessageHeader.tsx"],
|
|
4
|
-
"sourcesContent": ["\"use client\"\n\nimport * as React from 'react'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { FormHeader, type ActionItem } from '@open-mercato/ui/backend/forms'\nimport { IconButton } from '@open-mercato/ui/primitives/icon-button'\nimport {\n Archive,\n ArchiveRestore,\n ChevronDown,\n ChevronUp,\n FilePenLine,\n Forward,\n Mail,\n MailOpen,\n Reply,\n Trash2,\n} from 'lucide-react'\nimport type { MessageDetail } from '../types'\nimport { formatDateTime } from '../utils'\
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["\"use client\"\n\nimport * as React from 'react'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { FormHeader, type ActionItem } from '@open-mercato/ui/backend/forms'\nimport { IconButton } from '@open-mercato/ui/primitives/icon-button'\nimport {\n Archive,\n ArchiveRestore,\n ChevronDown,\n ChevronUp,\n FilePenLine,\n Forward,\n Mail,\n MailOpen,\n Reply,\n Trash2,\n} from 'lucide-react'\nimport type { MessageDetail } from '../types'\nimport { formatDateTime } from '../utils'\n\ntype MessageHeaderProps = {\n detail: MessageDetail\n updatingState: boolean\n isArchived: boolean\n showSubject?: boolean\n onReply: () => void\n onForward: () => void\n onEdit: () => void\n onToggleRead: () => void\n onToggleArchive: () => void\n onDelete: () => void\n collapseToggle?: {\n expanded: boolean\n onToggle: () => void\n }\n}\n\nexport function MessageHeader(props: MessageHeaderProps) {\n const t = useT()\n const showSubject = props.showSubject !== false\n const canReply = !props.detail.isDraft && props.detail.typeDefinition.allowReply\n const actionItems = React.useMemo(() => {\n const items: ActionItem[] = []\n\n if (props.detail.isDraft && props.detail.canEditDraft) {\n items.push({\n id: 'edit',\n label: t('messages.actions.edit', 'Edit'),\n icon: FilePenLine,\n onSelect: props.onEdit,\n })\n }\n\n if (!props.detail.isDraft && props.detail.typeDefinition.allowForward) {\n items.push({\n id: 'forward',\n label: t('messages.forward', 'Forward'),\n icon: Forward,\n onSelect: props.onForward,\n })\n }\n\n if (!props.detail.isDraft) {\n items.push({\n id: 'toggle-read',\n label: props.detail.isRead\n ? t('messages.actions.markUnread', 'Mark unread')\n : t('messages.actions.markRead', 'Mark read'),\n icon: props.detail.isRead ? Mail : MailOpen,\n onSelect: props.onToggleRead,\n disabled: props.updatingState,\n })\n }\n\n if (!props.detail.isDraft && props.detail.canArchive) {\n items.push({\n id: 'toggle-archive',\n label: props.isArchived\n ? t('messages.actions.unarchive', 'Unarchive')\n : t('messages.actions.archive', 'Archive'),\n icon: props.isArchived ? ArchiveRestore : Archive,\n onSelect: props.onToggleArchive,\n disabled: props.updatingState,\n })\n }\n\n items.push({\n id: 'delete',\n label: t('messages.actions.delete', 'Delete'),\n icon: Trash2,\n onSelect: props.onDelete,\n disabled: props.updatingState,\n })\n\n return items\n }, [props, t])\n\n return (\n <div className=\"flex items-start gap-2\">\n {props.collapseToggle ? (\n <IconButton\n type=\"button\"\n onClick={props.collapseToggle.onToggle}\n variant=\"ghost\"\n size=\"sm\"\n className=\"mt-1 text-muted-foreground hover:text-foreground\"\n aria-label={props.collapseToggle.expanded\n ? t('messages.detail.hideDetails', 'Hide details')\n : t('messages.detail.showDetails', 'Show details')}\n >\n {props.collapseToggle.expanded ? (\n <ChevronUp className=\"h-4 w-4\" aria-hidden />\n ) : (\n <ChevronDown className=\"h-4 w-4\" aria-hidden />\n )}\n </IconButton>\n ) : null}\n\n <div className=\"min-w-0 flex-1\">\n <FormHeader\n mode=\"detail\"\n title={showSubject ? props.detail.subject : undefined}\n subtitle={`${t('messages.detail.from', 'From')}: ${props.detail.senderName || props.detail.senderEmail || props.detail.senderUserId}`}\n statusBadge={<p className=\"text-xs text-muted-foreground\">{formatDateTime(props.detail.sentAt)}</p>}\n utilityActions={canReply ? (\n <IconButton\n type=\"button\"\n variant=\"outline\"\n size=\"default\"\n aria-label={t('messages.reply', 'Reply')}\n onClick={props.onReply}\n >\n <Reply className=\"h-4 w-4\" aria-hidden />\n </IconButton>\n ) : undefined}\n menuTriggerMode=\"icon\"\n menuAriaLabel={t('ui.actions.actions', 'Actions')}\n menuActions={actionItems}\n />\n </div>\n </div>\n )\n}\n"],
|
|
5
|
+
"mappings": ";AAmGI,SAaQ,KAbR;AAjGJ,YAAY,WAAW;AACvB,SAAS,YAAY;AACrB,SAAS,kBAAmC;AAC5C,SAAS,kBAAkB;AAC3B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,sBAAsB;AAmBxB,SAAS,cAAc,OAA2B;AACvD,QAAM,IAAI,KAAK;AACf,QAAM,cAAc,MAAM,gBAAgB;AAC1C,QAAM,WAAW,CAAC,MAAM,OAAO,WAAW,MAAM,OAAO,eAAe;AACtE,QAAM,cAAc,MAAM,QAAQ,MAAM;AACtC,UAAM,QAAsB,CAAC;AAE7B,QAAI,MAAM,OAAO,WAAW,MAAM,OA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,MAAM,eAAe;AAAA,QAC9B,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,WAAU;AAAA,QACV,cAAY,MAAM,eAAe,WAC7B,EAAE,+BAA+B,cAAc,IAC/C,EAAE,+BAA+B,cAAc;AAAA,QAElD,gBAAM,eAAe,WACpB,oBAAC,aAAU,WAAU,WAAU,eAAW,MAAC,IAE3C,oBAAC,eAAY,WAAU,WAAU,eAAW,MAAC;AAAA;AAAA,IAEjD,IACE;AAAA,IAEJ,oBAAC,SAAI,WAAU,kBACb;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAO,cAAc,MAAM,OAAO,UAAU;AAAA,QAC5C,UAAU,GAAG,EAAE,wBAAwB,MAAM,CAAC,KAAK,MAAM,OAAO,cAAc,MAAM,OAAO,eAAe,MAAM,OAAO,YAAY;AAAA,QACnI,aAAa,oBAAC,OAAE,WAAU,iCAAiC,yBAAe,MAAM,OAAO,MAAM,GAAE;AAAA,QAC/F,gBAAgB,WACd;AAAA,UAAC;AAAA;AAAA,YACC,MAAK;AAAA,YACL,SAAQ;AAAA,YACR,MAAK;AAAA,YACL,cAAY,EAAE,kBAAkB,OAAO;AAAA,YACvC,SAAS,MAAM;AAAA,YAEf,8BAAC,SAAM,WAAU,WAAU,eAAW,MAAC;AAAA;AAAA,QACzC,IACE;AAAA,QACJ,iBAAgB;AAAA,QAChB,eAAe,EAAE,sBAAsB,SAAS;AAAA,QAChD,aAAa;AAAA;AAAA,IACf,GACF;AAAA,KACF;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -5,7 +5,6 @@ import { MarkdownContent } from "@open-mercato/ui/backend/markdown/MarkdownConte
|
|
|
5
5
|
import { getMessageUiComponentRegistry } from "../../utils/typeUiRegistry.js";
|
|
6
6
|
import { getMessageObjectType } from "../../../lib/message-objects-registry.js";
|
|
7
7
|
import { formatDateTime } from "../utils.js";
|
|
8
|
-
import { getMessageParticipantLabel } from "../../messageListLabels.js";
|
|
9
8
|
function MessageDetailThreadSection({ detail }) {
|
|
10
9
|
const t = useT();
|
|
11
10
|
const messageUiRegistry = getMessageUiComponentRegistry();
|
|
@@ -14,7 +13,7 @@ function MessageDetailThreadSection({ detail }) {
|
|
|
14
13
|
/* @__PURE__ */ jsx("h2", { className: "text-base font-semibold", children: t("messages.detail.thread", "Thread") }),
|
|
15
14
|
/* @__PURE__ */ jsx("div", { className: "space-y-3", children: (detail.thread ?? []).map((threadItem) => /* @__PURE__ */ jsxs("article", { className: "rounded border p-3", children: [
|
|
16
15
|
/* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground", children: [
|
|
17
|
-
|
|
16
|
+
threadItem.senderName || threadItem.senderEmail || threadItem.senderUserId,
|
|
18
17
|
" \u2022 ",
|
|
19
18
|
formatDateTime(threadItem.sentAt)
|
|
20
19
|
] }),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/modules/messages/components/message-detail/panels/thread-panel.tsx"],
|
|
4
|
-
"sourcesContent": ["\"use client\"\n\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { MarkdownContent } from '@open-mercato/ui/backend/markdown/MarkdownContent'\nimport { getMessageUiComponentRegistry } from '../../utils/typeUiRegistry'\nimport { getMessageObjectType } from '../../../lib/message-objects-registry'\nimport type { MessageDetail, MessageDetailObject } from '../types'\nimport { formatDateTime } from '../utils'\
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["\"use client\"\n\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { MarkdownContent } from '@open-mercato/ui/backend/markdown/MarkdownContent'\nimport { getMessageUiComponentRegistry } from '../../utils/typeUiRegistry'\nimport { getMessageObjectType } from '../../../lib/message-objects-registry'\nimport type { MessageDetail, MessageDetailObject } from '../types'\nimport { formatDateTime } from '../utils'\n\nexport function MessageDetailThreadSection({ detail }: { detail: MessageDetail }) {\n const t = useT()\n const messageUiRegistry = getMessageUiComponentRegistry()\n\n if ((detail.thread ?? []).length === 0) return null\n\n return (\n <section className=\"space-y-3 border-l pl-4 py-2\">\n <h2 className=\"text-base font-semibold\">{t('messages.detail.thread', 'Thread')}</h2>\n <div className=\"space-y-3\">\n {(detail.thread ?? []).map((threadItem) => (\n <article key={threadItem.id} className=\"rounded border p-3\">\n <p className=\"text-xs text-muted-foreground\">\n {(threadItem.senderName || threadItem.senderEmail || threadItem.senderUserId)} \u2022 {formatDateTime(threadItem.sentAt)}\n </p>\n <div className=\"mt-2 max-h-[60vh] overflow-y-auto pr-1\">\n <MarkdownContent\n body={threadItem.body}\n format={threadItem.bodyFormat ?? 'text'}\n className=\"text-sm whitespace-pre-wrap [&>*]:mb-2 [&>*:last-child]:mb-0 [&_ul]:ml-4 [&_ul]:list-disc [&_ol]:ml-4 [&_ol]:list-decimal [&_code]:rounded [&_code]:bg-muted [&_code]:px-1 [&_code]:py-0.5 [&_pre]:rounded-md [&_pre]:bg-muted [&_pre]:p-3 [&_pre]:text-xs\"\n />\n </div>\n\n {(threadItem.objects ?? []).length > 0 && (\n <div className=\"mt-3 space-y-2\">\n <p className=\"text-xs text-muted-foreground font-medium\">\n {t('messages.attachedObjects', 'Attached objects')}\n </p>\n {(threadItem.objects ?? []).map((obj: MessageDetailObject) => {\n const componentKey = `${obj.entityModule}:${obj.entityType}`\n const PreviewComponent = messageUiRegistry.objectPreviewComponents[componentKey]\n ?? messageUiRegistry.objectPreviewComponents['messages:default']\n const objectType = getMessageObjectType(obj.entityModule, obj.entityType)\n if (!PreviewComponent) return null\n\n return (\n <div key={obj.id} className=\"scale-95 origin-left\">\n <PreviewComponent\n entityId={obj.entityId}\n entityModule={obj.entityModule}\n entityType={obj.entityType}\n snapshot={obj.snapshot ?? undefined}\n previewData={obj.preview ?? undefined}\n actionRequired={obj.actionRequired}\n actionType={obj.actionType ?? undefined}\n actionLabel={obj.actionLabel ?? undefined}\n icon={objectType?.icon}\n />\n </div>\n )\n })}\n </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,oBAAC,SAAiB,WAAU,wBAC1B;AAAA,YAAC;AAAA;AAAA,cACC,UAAU,IAAI;AAAA,cACd,cAAc,IAAI;AAAA,cAClB,YAAY,IAAI;AAAA,cAChB,UAAU,IAAI,YAAY;AAAA,cAC1B,aAAa,IAAI,WAAW;AAAA,cAC5B,gBAAgB,IAAI;AAAA,cACpB,YAAY,IAAI,cAAc;AAAA,cAC9B,aAAa,IAAI,eAAe;AAAA,cAChC,MAAM,YAAY;AAAA;AAAA,UACpB,KAXQ,IAAI,EAYd;AAAA,QAEJ,CAAC;AAAA,SACH;AAAA,SAxCU,WAAW,EA0CzB,CACD,GACH;AAAA,KACF;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,26 +1,14 @@
|
|
|
1
|
-
const INBOUND_EXTERNAL_SOURCE_ENTITY_TYPE = "communication_channels.external_conversation";
|
|
2
1
|
function normalizeLabel(value) {
|
|
3
2
|
const normalized = value?.trim();
|
|
4
3
|
return normalized ? normalized : null;
|
|
5
4
|
}
|
|
6
|
-
function isInboundExternalMessage(item) {
|
|
7
|
-
return item.sourceEntityType === INBOUND_EXTERNAL_SOURCE_ENTITY_TYPE;
|
|
8
|
-
}
|
|
9
|
-
function getMessageParticipantLabel(item) {
|
|
10
|
-
const platformIdentity = normalizeLabel(item.senderName) ?? normalizeLabel(item.senderEmail);
|
|
11
|
-
const externalIdentity = normalizeLabel(item.externalName) ?? normalizeLabel(item.externalEmail);
|
|
12
|
-
const preferred = isInboundExternalMessage(item) ? externalIdentity : platformIdentity;
|
|
13
|
-
const fallback = isInboundExternalMessage(item) ? platformIdentity : externalIdentity;
|
|
14
|
-
return preferred ?? fallback ?? item.senderUserId;
|
|
15
|
-
}
|
|
16
5
|
function getMessageListParticipantLabel(item, folder, t) {
|
|
17
6
|
if ((folder === "sent" || folder === "drafts") && Number(item.recipientCount ?? 0) <= 0) {
|
|
18
7
|
return t("messages.list.noRecipient", "(No recipient)");
|
|
19
8
|
}
|
|
20
|
-
return
|
|
9
|
+
return normalizeLabel(item.senderName) ?? normalizeLabel(item.senderEmail) ?? item.senderUserId;
|
|
21
10
|
}
|
|
22
11
|
export {
|
|
23
|
-
getMessageListParticipantLabel
|
|
24
|
-
getMessageParticipantLabel
|
|
12
|
+
getMessageListParticipantLabel
|
|
25
13
|
};
|
|
26
14
|
//# sourceMappingURL=messageListLabels.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/modules/messages/components/messageListLabels.ts"],
|
|
4
|
-
"sourcesContent": ["import type { MessageFolder } from './useMessagesInboxBulkActions'\n\ntype Translate = (key: string, fallback: string, params?: Record<string, string | number>) => string\n\
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import type { MessageFolder } from './useMessagesInboxBulkActions'\n\ntype Translate = (key: string, fallback: string, params?: Record<string, string | number>) => string\n\ntype MessageParticipantSource = {\n senderName?: string | null\n senderEmail?: string | null\n senderUserId: string\n recipientCount?: number | null\n}\n\nfunction normalizeLabel(value: string | null | undefined): string | null {\n const normalized = value?.trim()\n return normalized ? normalized : null\n}\n\nexport function getMessageListParticipantLabel(\n item: MessageParticipantSource,\n folder: MessageFolder,\n t: Translate,\n): string {\n if ((folder === 'sent' || folder === 'drafts') && Number(item.recipientCount ?? 0) <= 0) {\n return t('messages.list.noRecipient', '(No recipient)')\n }\n\n return normalizeLabel(item.senderName)\n ?? normalizeLabel(item.senderEmail)\n ?? item.senderUserId\n}\n"],
|
|
5
|
+
"mappings": "AAWA,SAAS,eAAe,OAAiD;AACvE,QAAM,aAAa,OAAO,KAAK;AAC/B,SAAO,aAAa,aAAa;AACnC;AAEO,SAAS,+BACd,MACA,QACA,GACQ;AACR,OAAK,WAAW,UAAU,WAAW,aAAa,OAAO,KAAK,kBAAkB,CAAC,KAAK,GAAG;AACvF,WAAO,EAAE,6BAA6B,gBAAgB;AAAA,EACxD;AAEA,SAAO,eAAe,KAAK,UAAU,KAChC,eAAe,KAAK,WAAW,KAC/B,KAAK;AACZ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { parseBooleanFlag } from "@open-mercato/shared/lib/boolean";
|
|
3
3
|
import { sanitizeRichTextHref } from "@open-mercato/shared/lib/html/sanitizeRichText";
|
|
4
|
-
import { channelTypeRequiresExternalEmail } from "../lib/channel-sender-identity.js";
|
|
5
4
|
function collectDuplicateRecipientIds(recipients) {
|
|
6
5
|
const seen = /* @__PURE__ */ new Set();
|
|
7
6
|
const duplicates = /* @__PURE__ */ new Set();
|
|
@@ -80,22 +79,13 @@ const messageActionDataSchema = z.object({
|
|
|
80
79
|
primaryActionId: z.string().optional(),
|
|
81
80
|
expiresAt: z.string().datetime().optional()
|
|
82
81
|
});
|
|
83
|
-
const
|
|
82
|
+
const composeMessageSchema = z.object({
|
|
84
83
|
type: z.string().optional().default("default"),
|
|
85
84
|
visibility: z.enum(["public", "internal"]).nullable().optional(),
|
|
86
85
|
sourceEntityType: z.string().min(1).optional(),
|
|
87
86
|
sourceEntityId: z.string().uuid().optional(),
|
|
88
87
|
externalEmail: z.string().email().optional(),
|
|
89
88
|
externalName: z.string().min(1).max(255).optional(),
|
|
90
|
-
/**
|
|
91
|
-
* Channel type the message originates from, when the caller knows it (#4975).
|
|
92
|
-
* Non-email channels (Discord, Slack, SMS…) have senders with no address, so
|
|
93
|
-
* `externalEmail` is not required for them. Resolved server-side — the HTTP
|
|
94
|
-
* route strips any client-sent value and derives it from the referenced
|
|
95
|
-
* conversation or parent message, so a caller cannot waive the requirement by
|
|
96
|
-
* asserting its own channel type.
|
|
97
|
-
*/
|
|
98
|
-
sourceChannelType: z.string().min(1).max(64).optional(),
|
|
99
89
|
recipients: z.array(messageRecipientSchema).max(100).optional().default([]),
|
|
100
90
|
subject: z.string().max(500).optional().default(""),
|
|
101
91
|
body: z.string().max(5e4).optional().default(""),
|
|
@@ -108,8 +98,7 @@ const composeMessageBaseSchema = z.object({
|
|
|
108
98
|
sendViaEmail: z.boolean().optional().default(false),
|
|
109
99
|
parentMessageId: z.string().uuid().optional(),
|
|
110
100
|
isDraft: z.boolean().optional().default(false)
|
|
111
|
-
})
|
|
112
|
-
function refineComposeMessage(value, ctx) {
|
|
101
|
+
}).superRefine((value, ctx) => {
|
|
113
102
|
const isDraft = value.isDraft ?? false;
|
|
114
103
|
const visibility = value.visibility ?? "internal";
|
|
115
104
|
const recipientCount = value.recipients.length;
|
|
@@ -118,7 +107,7 @@ function refineComposeMessage(value, ctx) {
|
|
|
118
107
|
const hasBody = value.body.trim().length > 0;
|
|
119
108
|
if (!isDraft) {
|
|
120
109
|
if (visibility === "public") {
|
|
121
|
-
if (!hasExternalEmail
|
|
110
|
+
if (!hasExternalEmail) {
|
|
122
111
|
ctx.addIssue({
|
|
123
112
|
code: z.ZodIssueCode.custom,
|
|
124
113
|
path: ["externalEmail"],
|
|
@@ -163,9 +152,7 @@ function refineComposeMessage(value, ctx) {
|
|
|
163
152
|
});
|
|
164
153
|
}
|
|
165
154
|
validateDefaultWithObjectsPayload(value, ctx);
|
|
166
|
-
}
|
|
167
|
-
const composeMessageSchema = composeMessageBaseSchema.superRefine(refineComposeMessage);
|
|
168
|
-
const composeMessageRequestSchema = composeMessageBaseSchema.omit({ sourceChannelType: true }).superRefine(refineComposeMessage);
|
|
155
|
+
});
|
|
169
156
|
const updateDraftSchema = z.object({
|
|
170
157
|
type: z.string().optional(),
|
|
171
158
|
visibility: z.enum(["public", "internal"]).nullable().optional(),
|
|
@@ -274,7 +261,6 @@ const unlinkAttachmentPayloadSchema = z.object({
|
|
|
274
261
|
);
|
|
275
262
|
export {
|
|
276
263
|
attachmentIdsPayloadSchema,
|
|
277
|
-
composeMessageRequestSchema,
|
|
278
264
|
composeMessageSchema,
|
|
279
265
|
confirmMessageSchema,
|
|
280
266
|
executeActionSchema,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/modules/messages/data/validators.ts"],
|
|
4
|
-
"sourcesContent": ["import { z } from 'zod'\nimport { parseBooleanFlag } from '@open-mercato/shared/lib/boolean'\nimport { sanitizeRichTextHref } from '@open-mercato/shared/lib/html/sanitizeRichText'\nimport { channelTypeRequiresExternalEmail } from '../lib/channel-sender-identity'\n\nfunction collectDuplicateRecipientIds(\n recipients: Array<{ userId: string }>,\n): string[] {\n const seen = new Set<string>()\n const duplicates = new Set<string>()\n for (const recipient of recipients) {\n if (seen.has(recipient.userId)) {\n duplicates.add(recipient.userId)\n continue\n }\n seen.add(recipient.userId)\n }\n return Array.from(duplicates)\n}\n\nfunction validateDefaultWithObjectsPayload(\n value: {\n type?: string\n objects?: Array<{ actionRequired?: boolean; actionType?: string; actionLabel?: string }>\n },\n ctx: z.RefinementCtx,\n): void {\n if (value.type !== 'messages.defaultWithObjects') return\n\n if (!Array.isArray(value.objects) || value.objects.length === 0) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['objects'],\n message: 'at least one object is required for messages.defaultWithObjects',\n })\n return\n }\n\n value.objects.forEach((object, index) => {\n if (object.actionRequired === true) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['objects', index, 'actionRequired'],\n message: 'actionRequired must be false for messages.defaultWithObjects',\n })\n }\n if (typeof object.actionType === 'string' && object.actionType.trim().length > 0) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['objects', index, 'actionType'],\n message: 'actionType is not allowed for messages.defaultWithObjects',\n })\n }\n if (typeof object.actionLabel === 'string' && object.actionLabel.trim().length > 0) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['objects', index, 'actionLabel'],\n message: 'actionLabel is not allowed for messages.defaultWithObjects',\n })\n }\n })\n}\n\nexport const messageRecipientSchema = z.object({\n userId: z.string().uuid(),\n type: z.enum(['to', 'cc', 'bcc']).optional().default('to'),\n})\n\nexport const messageObjectSchema = z.object({\n entityModule: z.string().min(1),\n entityType: z.string().min(1),\n entityId: z.string().uuid(),\n actionRequired: z.boolean().optional().default(false),\n actionType: z.string().optional(),\n actionLabel: z.string().optional(),\n})\n\nexport const messageActionSchema = z.object({\n id: z.string().min(1),\n label: z.string().min(1),\n labelKey: z.string().optional(),\n variant: z.enum(['default', 'secondary', 'destructive', 'outline', 'ghost']).optional(),\n icon: z.string().optional(),\n commandId: z.string().optional(),\n href: z\n .string()\n .optional()\n .refine(\n (value) => value == null || sanitizeRichTextHref(value) != null,\n { message: '[internal] message action href must be http(s), mailto, tel, or a relative path' },\n ),\n isTerminal: z.boolean().optional(),\n confirmRequired: z.boolean().optional(),\n confirmMessage: z.string().optional(),\n})\n\nexport const messageActionDataSchema = z.object({\n actions: z.array(messageActionSchema),\n primaryActionId: z.string().optional(),\n expiresAt: z.string().datetime().optional(),\n})\n\nconst composeMessageBaseSchema = z.object({\n type: z.string().optional().default('default'),\n visibility: z.enum(['public', 'internal']).nullable().optional(),\n sourceEntityType: z.string().min(1).optional(),\n sourceEntityId: z.string().uuid().optional(),\n externalEmail: z.string().email().optional(),\n externalName: z.string().min(1).max(255).optional(),\n /**\n * Channel type the message originates from, when the caller knows it (#4975).\n * Non-email channels (Discord, Slack, SMS\u2026) have senders with no address, so\n * `externalEmail` is not required for them. Resolved server-side \u2014 the HTTP\n * route strips any client-sent value and derives it from the referenced\n * conversation or parent message, so a caller cannot waive the requirement by\n * asserting its own channel type.\n */\n sourceChannelType: z.string().min(1).max(64).optional(),\n recipients: z.array(messageRecipientSchema).max(100).optional().default([]),\n subject: z.string().max(500).optional().default(''),\n body: z.string().max(50000).optional().default(''),\n bodyFormat: z.enum(['text', 'markdown']).optional().default('text'),\n priority: z.enum(['low', 'normal', 'high', 'urgent']).optional().default('normal'),\n objects: z.array(messageObjectSchema).optional(),\n attachmentIds: z.array(z.string().uuid()).optional(),\n attachmentRecordId: z.string().min(1).max(255).optional(),\n actionData: messageActionDataSchema.optional(),\n sendViaEmail: z.boolean().optional().default(false),\n parentMessageId: z.string().uuid().optional(),\n isDraft: z.boolean().optional().default(false),\n})\n\ntype ComposeMessageRefinementValue = Omit<\n z.infer<typeof composeMessageBaseSchema>,\n 'sourceChannelType'\n> & { sourceChannelType?: string }\n\nfunction refineComposeMessage(value: ComposeMessageRefinementValue, ctx: z.RefinementCtx): void {\n const isDraft = value.isDraft ?? false\n const visibility = value.visibility ?? 'internal'\n const recipientCount = value.recipients.length\n const hasExternalEmail = Boolean(value.externalEmail?.trim())\n const hasSubject = value.subject.trim().length > 0\n const hasBody = value.body.trim().length > 0\n\n if (!isDraft) {\n if (visibility === 'public') {\n // #4975: an external correspondent is only guaranteed to have an address\n // on an email-typed channel. `channelTypeRequiresExternalEmail` fails\n // closed, so an unknown or absent channel type keeps the original rule.\n if (!hasExternalEmail && channelTypeRequiresExternalEmail(value.sourceChannelType)) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['externalEmail'],\n message: 'externalEmail is required when visibility is public',\n })\n }\n if (recipientCount > 0) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['recipients'],\n message: 'recipients must be empty when visibility is public',\n })\n }\n } else if (recipientCount === 0) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['recipients'],\n message: 'at least one recipient is required when visibility is internal',\n })\n }\n\n if (!hasSubject) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['subject'],\n message: 'subject is required',\n })\n }\n if (!hasBody) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['body'],\n message: 'body is required',\n })\n }\n }\n\n const duplicateRecipientIds = collectDuplicateRecipientIds(value.recipients)\n if (duplicateRecipientIds.length > 0) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['recipients'],\n message: 'recipient user ids must be unique',\n })\n }\n\n validateDefaultWithObjectsPayload(value, ctx)\n}\n\n/**\n * Full compose contract, including the server-resolved `sourceChannelType`.\n * Used by the `messages.messages.compose` command and by the HTTP route AFTER\n * it has resolved the channel type itself.\n */\nexport const composeMessageSchema = composeMessageBaseSchema.superRefine(refineComposeMessage)\n\n/**\n * Client-facing compose contract \u2014 the same rules minus `sourceChannelType`,\n * which is never accepted from a request body (#4975). Published in OpenAPI so\n * the documented request shape matches what `POST /api/messages` actually reads:\n * the route discards any client-sent channel type, resolves the real one from\n * the referenced conversation or parent message, and only then validates against\n * {@link composeMessageSchema}.\n */\nexport const composeMessageRequestSchema = composeMessageBaseSchema\n .omit({ sourceChannelType: true })\n .superRefine(refineComposeMessage)\n\nexport const updateDraftSchema = z.object({\n type: z.string().optional(),\n visibility: z.enum(['public', 'internal']).nullable().optional(),\n sourceEntityType: z.string().min(1).optional(),\n sourceEntityId: z.string().uuid().optional(),\n externalEmail: z.string().email().optional(),\n externalName: z.string().min(1).max(255).optional(),\n recipients: z.array(messageRecipientSchema).optional(),\n subject: z.string().max(500).optional(),\n body: z.string().max(50000).optional(),\n bodyFormat: z.enum(['text', 'markdown']).optional(),\n priority: z.enum(['low', 'normal', 'high', 'urgent']).optional(),\n objects: z.array(messageObjectSchema).optional(),\n attachmentIds: z.array(z.string().uuid()).optional(),\n actionData: messageActionDataSchema.optional(),\n sendViaEmail: z.boolean().optional(),\n isDraft: z.literal(false).optional(),\n}).superRefine((value, ctx) => {\n if (value.recipients) {\n const duplicateRecipientIds = collectDuplicateRecipientIds(value.recipients)\n if (duplicateRecipientIds.length > 0) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['recipients'],\n message: 'recipient user ids must be unique',\n })\n }\n }\n\n validateDefaultWithObjectsPayload(value, ctx)\n})\n\nexport const listMessagesSchema = z.object({\n folder: z.enum(['inbox', 'sent', 'drafts', 'archived', 'all']).optional().default('inbox'),\n status: z.enum(['unread', 'read', 'archived']).optional(),\n type: z.string().optional(),\n visibility: z.enum(['public', 'internal']).optional(),\n sourceEntityType: z.string().optional(),\n sourceEntityId: z.string().uuid().optional(),\n externalEmail: z.string().email().optional(),\n hasObjects: z.string().transform(parseBooleanFlag).optional(),\n hasAttachments: z.string().transform(parseBooleanFlag).optional(),\n hasActions: z.string().transform(parseBooleanFlag).optional(),\n senderId: z.string().uuid().optional(),\n search: z.string().max(200).optional(),\n since: z.string().datetime().optional(),\n page: z.coerce.number().int().min(1).optional().default(1),\n pageSize: z.coerce.number().int().min(1).max(100).optional().default(20),\n})\n\nexport const forwardMessageSchema = z.object({\n recipients: z.array(messageRecipientSchema).min(1).max(100),\n body: z.string().max(50000).optional(),\n additionalBody: z.string().max(10000).optional(),\n includeAttachments: z.boolean().optional().default(true),\n sendViaEmail: z.boolean().optional().default(false),\n}).superRefine((value, ctx) => {\n const duplicateRecipientIds = collectDuplicateRecipientIds(value.recipients)\n if (duplicateRecipientIds.length > 0) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['recipients'],\n message: 'recipient user ids must be unique',\n })\n }\n})\n\nexport const replyMessageSchema = z.object({\n body: z.string().min(1).max(50000),\n bodyFormat: z.enum(['text', 'markdown']).optional().default('text'),\n recipients: z.array(messageRecipientSchema).max(100).optional(),\n attachmentIds: z.array(z.string().uuid()).optional(),\n attachmentRecordId: z.string().min(1).max(255).optional(),\n replyAll: z.boolean().optional().default(false),\n sendViaEmail: z.boolean().optional().default(false),\n}).superRefine((value, ctx) => {\n if (!value.recipients) return\n const duplicateRecipientIds = collectDuplicateRecipientIds(value.recipients)\n if (duplicateRecipientIds.length > 0) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['recipients'],\n message: 'recipient user ids must be unique',\n })\n }\n})\n\nexport const executeActionSchema = z.object({\n messageId: z.string().uuid(),\n actionId: z.string().min(1),\n payload: z.record(z.string(), z.unknown()).optional(),\n})\n\nexport const confirmMessageSchema = z.object({\n messageId: z.string().uuid(),\n tenantId: z.string().uuid().optional(),\n organizationId: z.string().uuid().nullable().optional(),\n confirmed: z.boolean().optional().default(true),\n})\n\nexport const messageObjectTypesQuerySchema = z.object({\n messageType: z.string().min(1),\n})\n\nexport const attachmentIdsPayloadSchema = z.object({\n attachmentIds: z.array(z.string().uuid()).min(1).max(100),\n})\n\nexport const unlinkAttachmentPayloadSchema = z.object({\n attachmentId: z.string().uuid().optional(),\n attachmentIds: z.array(z.string().uuid()).min(1).max(100).optional(),\n}).refine(\n (value) => Boolean(value.attachmentId || value.attachmentIds?.length),\n { message: 'attachmentId or attachmentIds is required' }\n)\n\nexport type ComposeMessageInput = z.infer<typeof composeMessageSchema>\nexport type UpdateDraftInput = z.infer<typeof updateDraftSchema>\nexport type ListMessagesInput = z.infer<typeof listMessagesSchema>\nexport type ForwardMessageInput = z.infer<typeof forwardMessageSchema>\nexport type ReplyMessageInput = z.infer<typeof replyMessageSchema>\nexport type ExecuteActionInput = z.infer<typeof executeActionSchema>\nexport type ConfirmMessageInput = z.infer<typeof confirmMessageSchema>\nexport type MessageObjectTypesQueryInput = z.infer<typeof messageObjectTypesQuerySchema>\nexport type AttachmentIdsPayload = z.infer<typeof attachmentIdsPayloadSchema>\nexport type UnlinkAttachmentPayload = z.infer<typeof unlinkAttachmentPayloadSchema>\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,SAAS;AAClB,SAAS,wBAAwB;AACjC,SAAS,4BAA4B;
|
|
4
|
+
"sourcesContent": ["import { z } from 'zod'\nimport { parseBooleanFlag } from '@open-mercato/shared/lib/boolean'\nimport { sanitizeRichTextHref } from '@open-mercato/shared/lib/html/sanitizeRichText'\n\nfunction collectDuplicateRecipientIds(\n recipients: Array<{ userId: string }>,\n): string[] {\n const seen = new Set<string>()\n const duplicates = new Set<string>()\n for (const recipient of recipients) {\n if (seen.has(recipient.userId)) {\n duplicates.add(recipient.userId)\n continue\n }\n seen.add(recipient.userId)\n }\n return Array.from(duplicates)\n}\n\nfunction validateDefaultWithObjectsPayload(\n value: {\n type?: string\n objects?: Array<{ actionRequired?: boolean; actionType?: string; actionLabel?: string }>\n },\n ctx: z.RefinementCtx,\n): void {\n if (value.type !== 'messages.defaultWithObjects') return\n\n if (!Array.isArray(value.objects) || value.objects.length === 0) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['objects'],\n message: 'at least one object is required for messages.defaultWithObjects',\n })\n return\n }\n\n value.objects.forEach((object, index) => {\n if (object.actionRequired === true) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['objects', index, 'actionRequired'],\n message: 'actionRequired must be false for messages.defaultWithObjects',\n })\n }\n if (typeof object.actionType === 'string' && object.actionType.trim().length > 0) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['objects', index, 'actionType'],\n message: 'actionType is not allowed for messages.defaultWithObjects',\n })\n }\n if (typeof object.actionLabel === 'string' && object.actionLabel.trim().length > 0) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['objects', index, 'actionLabel'],\n message: 'actionLabel is not allowed for messages.defaultWithObjects',\n })\n }\n })\n}\n\nexport const messageRecipientSchema = z.object({\n userId: z.string().uuid(),\n type: z.enum(['to', 'cc', 'bcc']).optional().default('to'),\n})\n\nexport const messageObjectSchema = z.object({\n entityModule: z.string().min(1),\n entityType: z.string().min(1),\n entityId: z.string().uuid(),\n actionRequired: z.boolean().optional().default(false),\n actionType: z.string().optional(),\n actionLabel: z.string().optional(),\n})\n\nexport const messageActionSchema = z.object({\n id: z.string().min(1),\n label: z.string().min(1),\n labelKey: z.string().optional(),\n variant: z.enum(['default', 'secondary', 'destructive', 'outline', 'ghost']).optional(),\n icon: z.string().optional(),\n commandId: z.string().optional(),\n href: z\n .string()\n .optional()\n .refine(\n (value) => value == null || sanitizeRichTextHref(value) != null,\n { message: '[internal] message action href must be http(s), mailto, tel, or a relative path' },\n ),\n isTerminal: z.boolean().optional(),\n confirmRequired: z.boolean().optional(),\n confirmMessage: z.string().optional(),\n})\n\nexport const messageActionDataSchema = z.object({\n actions: z.array(messageActionSchema),\n primaryActionId: z.string().optional(),\n expiresAt: z.string().datetime().optional(),\n})\n\nexport const composeMessageSchema = z.object({\n type: z.string().optional().default('default'),\n visibility: z.enum(['public', 'internal']).nullable().optional(),\n sourceEntityType: z.string().min(1).optional(),\n sourceEntityId: z.string().uuid().optional(),\n externalEmail: z.string().email().optional(),\n externalName: z.string().min(1).max(255).optional(),\n recipients: z.array(messageRecipientSchema).max(100).optional().default([]),\n subject: z.string().max(500).optional().default(''),\n body: z.string().max(50000).optional().default(''),\n bodyFormat: z.enum(['text', 'markdown']).optional().default('text'),\n priority: z.enum(['low', 'normal', 'high', 'urgent']).optional().default('normal'),\n objects: z.array(messageObjectSchema).optional(),\n attachmentIds: z.array(z.string().uuid()).optional(),\n attachmentRecordId: z.string().min(1).max(255).optional(),\n actionData: messageActionDataSchema.optional(),\n sendViaEmail: z.boolean().optional().default(false),\n parentMessageId: z.string().uuid().optional(),\n isDraft: z.boolean().optional().default(false),\n}).superRefine((value, ctx) => {\n const isDraft = value.isDraft ?? false\n const visibility = value.visibility ?? 'internal'\n const recipientCount = value.recipients.length\n const hasExternalEmail = Boolean(value.externalEmail?.trim())\n const hasSubject = value.subject.trim().length > 0\n const hasBody = value.body.trim().length > 0\n\n if (!isDraft) {\n if (visibility === 'public') {\n if (!hasExternalEmail) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['externalEmail'],\n message: 'externalEmail is required when visibility is public',\n })\n }\n if (recipientCount > 0) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['recipients'],\n message: 'recipients must be empty when visibility is public',\n })\n }\n } else if (recipientCount === 0) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['recipients'],\n message: 'at least one recipient is required when visibility is internal',\n })\n }\n\n if (!hasSubject) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['subject'],\n message: 'subject is required',\n })\n }\n if (!hasBody) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['body'],\n message: 'body is required',\n })\n }\n }\n\n const duplicateRecipientIds = collectDuplicateRecipientIds(value.recipients)\n if (duplicateRecipientIds.length > 0) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['recipients'],\n message: 'recipient user ids must be unique',\n })\n }\n\n validateDefaultWithObjectsPayload(value, ctx)\n})\n\nexport const updateDraftSchema = z.object({\n type: z.string().optional(),\n visibility: z.enum(['public', 'internal']).nullable().optional(),\n sourceEntityType: z.string().min(1).optional(),\n sourceEntityId: z.string().uuid().optional(),\n externalEmail: z.string().email().optional(),\n externalName: z.string().min(1).max(255).optional(),\n recipients: z.array(messageRecipientSchema).optional(),\n subject: z.string().max(500).optional(),\n body: z.string().max(50000).optional(),\n bodyFormat: z.enum(['text', 'markdown']).optional(),\n priority: z.enum(['low', 'normal', 'high', 'urgent']).optional(),\n objects: z.array(messageObjectSchema).optional(),\n attachmentIds: z.array(z.string().uuid()).optional(),\n actionData: messageActionDataSchema.optional(),\n sendViaEmail: z.boolean().optional(),\n isDraft: z.literal(false).optional(),\n}).superRefine((value, ctx) => {\n if (value.recipients) {\n const duplicateRecipientIds = collectDuplicateRecipientIds(value.recipients)\n if (duplicateRecipientIds.length > 0) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['recipients'],\n message: 'recipient user ids must be unique',\n })\n }\n }\n\n validateDefaultWithObjectsPayload(value, ctx)\n})\n\nexport const listMessagesSchema = z.object({\n folder: z.enum(['inbox', 'sent', 'drafts', 'archived', 'all']).optional().default('inbox'),\n status: z.enum(['unread', 'read', 'archived']).optional(),\n type: z.string().optional(),\n visibility: z.enum(['public', 'internal']).optional(),\n sourceEntityType: z.string().optional(),\n sourceEntityId: z.string().uuid().optional(),\n externalEmail: z.string().email().optional(),\n hasObjects: z.string().transform(parseBooleanFlag).optional(),\n hasAttachments: z.string().transform(parseBooleanFlag).optional(),\n hasActions: z.string().transform(parseBooleanFlag).optional(),\n senderId: z.string().uuid().optional(),\n search: z.string().max(200).optional(),\n since: z.string().datetime().optional(),\n page: z.coerce.number().int().min(1).optional().default(1),\n pageSize: z.coerce.number().int().min(1).max(100).optional().default(20),\n})\n\nexport const forwardMessageSchema = z.object({\n recipients: z.array(messageRecipientSchema).min(1).max(100),\n body: z.string().max(50000).optional(),\n additionalBody: z.string().max(10000).optional(),\n includeAttachments: z.boolean().optional().default(true),\n sendViaEmail: z.boolean().optional().default(false),\n}).superRefine((value, ctx) => {\n const duplicateRecipientIds = collectDuplicateRecipientIds(value.recipients)\n if (duplicateRecipientIds.length > 0) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['recipients'],\n message: 'recipient user ids must be unique',\n })\n }\n})\n\nexport const replyMessageSchema = z.object({\n body: z.string().min(1).max(50000),\n bodyFormat: z.enum(['text', 'markdown']).optional().default('text'),\n recipients: z.array(messageRecipientSchema).max(100).optional(),\n attachmentIds: z.array(z.string().uuid()).optional(),\n attachmentRecordId: z.string().min(1).max(255).optional(),\n replyAll: z.boolean().optional().default(false),\n sendViaEmail: z.boolean().optional().default(false),\n}).superRefine((value, ctx) => {\n if (!value.recipients) return\n const duplicateRecipientIds = collectDuplicateRecipientIds(value.recipients)\n if (duplicateRecipientIds.length > 0) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['recipients'],\n message: 'recipient user ids must be unique',\n })\n }\n})\n\nexport const executeActionSchema = z.object({\n messageId: z.string().uuid(),\n actionId: z.string().min(1),\n payload: z.record(z.string(), z.unknown()).optional(),\n})\n\nexport const confirmMessageSchema = z.object({\n messageId: z.string().uuid(),\n tenantId: z.string().uuid().optional(),\n organizationId: z.string().uuid().nullable().optional(),\n confirmed: z.boolean().optional().default(true),\n})\n\nexport const messageObjectTypesQuerySchema = z.object({\n messageType: z.string().min(1),\n})\n\nexport const attachmentIdsPayloadSchema = z.object({\n attachmentIds: z.array(z.string().uuid()).min(1).max(100),\n})\n\nexport const unlinkAttachmentPayloadSchema = z.object({\n attachmentId: z.string().uuid().optional(),\n attachmentIds: z.array(z.string().uuid()).min(1).max(100).optional(),\n}).refine(\n (value) => Boolean(value.attachmentId || value.attachmentIds?.length),\n { message: 'attachmentId or attachmentIds is required' }\n)\n\nexport type ComposeMessageInput = z.infer<typeof composeMessageSchema>\nexport type UpdateDraftInput = z.infer<typeof updateDraftSchema>\nexport type ListMessagesInput = z.infer<typeof listMessagesSchema>\nexport type ForwardMessageInput = z.infer<typeof forwardMessageSchema>\nexport type ReplyMessageInput = z.infer<typeof replyMessageSchema>\nexport type ExecuteActionInput = z.infer<typeof executeActionSchema>\nexport type ConfirmMessageInput = z.infer<typeof confirmMessageSchema>\nexport type MessageObjectTypesQueryInput = z.infer<typeof messageObjectTypesQuerySchema>\nexport type AttachmentIdsPayload = z.infer<typeof attachmentIdsPayloadSchema>\nexport type UnlinkAttachmentPayload = z.infer<typeof unlinkAttachmentPayloadSchema>\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,SAAS;AAClB,SAAS,wBAAwB;AACjC,SAAS,4BAA4B;AAErC,SAAS,6BACP,YACU;AACV,QAAM,OAAO,oBAAI,IAAY;AAC7B,QAAM,aAAa,oBAAI,IAAY;AACnC,aAAW,aAAa,YAAY;AAClC,QAAI,KAAK,IAAI,UAAU,MAAM,GAAG;AAC9B,iBAAW,IAAI,UAAU,MAAM;AAC/B;AAAA,IACF;AACA,SAAK,IAAI,UAAU,MAAM;AAAA,EAC3B;AACA,SAAO,MAAM,KAAK,UAAU;AAC9B;AAEA,SAAS,kCACP,OAIA,KACM;AACN,MAAI,MAAM,SAAS,8BAA+B;AAElD,MAAI,CAAC,MAAM,QAAQ,MAAM,OAAO,KAAK,MAAM,QAAQ,WAAW,GAAG;AAC/D,QAAI,SAAS;AAAA,MACX,MAAM,EAAE,aAAa;AAAA,MACrB,MAAM,CAAC,SAAS;AAAA,MAChB,SAAS;AAAA,IACX,CAAC;AACD;AAAA,EACF;AAEA,QAAM,QAAQ,QAAQ,CAAC,QAAQ,UAAU;AACvC,QAAI,OAAO,mBAAmB,MAAM;AAClC,UAAI,SAAS;AAAA,QACX,MAAM,EAAE,aAAa;AAAA,QACrB,MA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ACrC,gBAAgB,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS;AAAA,EACtD,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,IAAI;AAChD,CAAC;AAEM,MAAM,gCAAgC,EAAE,OAAO;AAAA,EACpD,aAAa,EAAE,OAAO,EAAE,IAAI,CAAC;AAC/B,CAAC;AAEM,MAAM,6BAA6B,EAAE,OAAO;AAAA,EACjD,eAAe,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAC1D,CAAC;AAEM,MAAM,gCAAgC,EAAE,OAAO;AAAA,EACpD,cAAc,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS;AAAA,EACzC,eAAe,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG,EAAE,SAAS;AACrE,CAAC,EAAE;AAAA,EACD,CAAC,UAAU,QAAQ,MAAM,gBAAgB,MAAM,eAAe,MAAM;AAAA,EACpE,EAAE,SAAS,4CAA4C;AACzD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -4,7 +4,6 @@ import { findWithDecryption } from "@open-mercato/shared/lib/encryption/find";
|
|
|
4
4
|
import { readJsonSafe } from "@open-mercato/shared/lib/http/readJsonSafe";
|
|
5
5
|
import { checkRateLimit, getClientIp, RATE_LIMIT_ERROR_FALLBACK } from "@open-mercato/shared/lib/ratelimit/helpers";
|
|
6
6
|
import { getWebhookHandler } from "@open-mercato/shared/modules/payment_gateways/types";
|
|
7
|
-
import { markQueueJobOrigin } from "@open-mercato/shared/lib/queue/dispatchOrigin";
|
|
8
7
|
import { GatewayTransaction } from "../../../data/entities.js";
|
|
9
8
|
import { getPaymentGatewayQueue } from "../../../lib/queue.js";
|
|
10
9
|
import { processPaymentGatewayWebhookJob } from "../../../lib/webhook-processor.js";
|
|
@@ -82,14 +81,17 @@ async function POST(req, { params }) {
|
|
|
82
81
|
throw lastVerificationError ?? new Error("Webhook verification failed: no matching transaction");
|
|
83
82
|
}
|
|
84
83
|
const scope = matchedScope;
|
|
85
|
-
const jobPayload =
|
|
84
|
+
const jobPayload = {
|
|
86
85
|
providerKey,
|
|
87
86
|
event,
|
|
88
87
|
transactionId: transaction.id,
|
|
89
88
|
scope
|
|
90
|
-
}
|
|
89
|
+
};
|
|
91
90
|
if (process.env.QUEUE_STRATEGY === "async") {
|
|
92
|
-
await queue.enqueue(
|
|
91
|
+
await queue.enqueue({
|
|
92
|
+
name: "payment-gateway-webhook",
|
|
93
|
+
payload: jobPayload
|
|
94
|
+
});
|
|
93
95
|
} else {
|
|
94
96
|
await processPaymentGatewayWebhookJob(
|
|
95
97
|
{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/modules/payment_gateways/api/webhook/%5Bprovider%5D/route.ts"],
|
|
4
|
-
"sourcesContent": ["import { NextResponse } from 'next/server'\nimport { createRequestContainer } from '@open-mercato/shared/lib/di/container'\nimport { findWithDecryption } from '@open-mercato/shared/lib/encryption/find'\nimport { readJsonSafe } from '@open-mercato/shared/lib/http/readJsonSafe'\nimport { checkRateLimit, getClientIp, RATE_LIMIT_ERROR_FALLBACK } from '@open-mercato/shared/lib/ratelimit/helpers'\nimport type { RateLimiterService } from '@open-mercato/shared/lib/ratelimit/service'\nimport type { EntityManager } from '@mikro-orm/postgresql'\nimport { getWebhookHandler } from '@open-mercato/shared/modules/payment_gateways/types'\nimport
|
|
5
|
-
"mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,8BAA8B;AACvC,SAAS,0BAA0B;AACnC,SAAS,oBAAoB;AAC7B,SAAS,gBAAgB,aAAa,iCAAiC;AAGvE,SAAS,yBAAyB;
|
|
4
|
+
"sourcesContent": ["import { NextResponse } from 'next/server'\nimport { createRequestContainer } from '@open-mercato/shared/lib/di/container'\nimport { findWithDecryption } from '@open-mercato/shared/lib/encryption/find'\nimport { readJsonSafe } from '@open-mercato/shared/lib/http/readJsonSafe'\nimport { checkRateLimit, getClientIp, RATE_LIMIT_ERROR_FALLBACK } from '@open-mercato/shared/lib/ratelimit/helpers'\nimport type { RateLimiterService } from '@open-mercato/shared/lib/ratelimit/service'\nimport type { EntityManager } from '@mikro-orm/postgresql'\nimport { getWebhookHandler } from '@open-mercato/shared/modules/payment_gateways/types'\nimport type { IntegrationLogService } from '../../../../integrations/lib/log-service'\nimport type { PaymentGatewayService } from '../../../lib/gateway-service'\nimport type { CredentialsService } from '../../../../integrations/lib/credentials-service'\nimport { GatewayTransaction } from '../../../data/entities'\nimport { getPaymentGatewayQueue } from '../../../lib/queue'\nimport { processPaymentGatewayWebhookJob } from '../../../lib/webhook-processor'\nimport { paymentGatewaysTag } from '../../openapi'\nimport { createLogger } from '@open-mercato/shared/lib/logger'\nimport { readBoundedRequestBody, WebhookBodyTooLargeError } from '@open-mercato/shared/lib/webhooks'\n\nconst logger = createLogger('payment_gateways').child({ component: 'webhook' })\n\nexport const metadata = {\n path: '/payment_gateways/webhook/[provider]',\n POST: { requireAuth: false },\n}\n\nconst WEBHOOK_VERIFICATION_FAILED = 'Webhook verification failed'\n\nconst paymentGatewayWebhookRateLimitConfig = {\n points: 60,\n duration: 60,\n keyPrefix: 'payment_gateways:webhook',\n}\n\nexport async function POST(req: Request, { params }: { params: Promise<{ provider: string }> | { provider: string } }) {\n const resolvedParams = await params\n const providerKey = resolvedParams.provider\n const container = await createRequestContainer()\n const registration = getWebhookHandler(providerKey)\n if (!registration) {\n return NextResponse.json({ error: `No webhook handler for provider: ${providerKey}` }, { status: 404 })\n }\n\n const rateLimitResponse = await checkProviderWebhookRateLimit(container, req, providerKey)\n if (rateLimitResponse) return rateLimitResponse\n\n let rawBody: string\n try {\n rawBody = registration.maxBodyBytes === undefined\n ? await req.text()\n : await readBoundedRequestBody(req, { maxBytes: registration.maxBodyBytes })\n } catch (error) {\n if (error instanceof WebhookBodyTooLargeError) {\n return NextResponse.json({ error: 'Webhook payload too large' }, { status: 413 })\n }\n throw error\n }\n const headers: Record<string, string> = {}\n req.headers.forEach((value, key) => {\n headers[key] = value\n })\n\n const service = container.resolve('paymentGatewayService') as PaymentGatewayService\n const em = container.resolve('em') as EntityManager\n const integrationCredentialsService = container.resolve('integrationCredentialsService') as CredentialsService\n const queue = getPaymentGatewayQueue(registration.queue ?? 'payment-gateways-webhook')\n const payload = await readJsonSafe<Record<string, unknown>>(rawBody)\n const sessionIdHint = registration.readSessionIdHint?.(payload) ?? null\n\n try {\n // The webhook endpoint is unauthenticated. Tenant/organization scope MUST come from a\n // GatewayTransaction whose per-tenant credentials successfully verify the inbound\n // signature \u2014 NEVER from attacker-controlled payload metadata. If no candidate\n // transaction can be located by the provider-reported session id, or no candidate's\n // credentials can verify the signature, we fail closed with 401. This prevents\n // forged webhooks (e.g. mock gateway PoC) from mutating another tenant's payment\n // state via `event.data.metadata.{organizationId,tenantId}`.\n const candidates = sessionIdHint\n ? await findWithDecryption(\n em,\n GatewayTransaction,\n {\n providerKey,\n providerSessionId: sessionIdHint,\n deletedAt: null,\n },\n { limit: 10, orderBy: { createdAt: 'desc' } },\n )\n : []\n\n let transaction: GatewayTransaction | null = null\n let matchedScope: { organizationId: string; tenantId: string } | null = null\n let event: Awaited<ReturnType<typeof registration.handler>> | null = null\n let lastVerificationError: unknown = null\n\n for (const candidate of candidates) {\n const candidateScope = { organizationId: candidate.organizationId, tenantId: candidate.tenantId }\n const credentials = await integrationCredentialsService.resolve(`gateway_${providerKey}`, candidateScope) ?? {}\n try {\n event = await registration.handler({ rawBody, headers, credentials })\n transaction = candidate\n matchedScope = candidateScope\n break\n } catch (error: unknown) {\n lastVerificationError = error\n }\n }\n\n if (!event || !transaction || !matchedScope) {\n throw lastVerificationError ?? new Error('Webhook verification failed: no matching transaction')\n }\n\n const scope = matchedScope\n\n const jobPayload = {\n providerKey,\n event,\n transactionId: transaction.id,\n scope,\n }\n\n if (process.env.QUEUE_STRATEGY === 'async') {\n await queue.enqueue({\n name: 'payment-gateway-webhook',\n payload: jobPayload,\n })\n } else {\n await processPaymentGatewayWebhookJob(\n {\n em: container.resolve('em') as EntityManager,\n paymentGatewayService: service,\n integrationLogService: container.resolve('integrationLogService') as IntegrationLogService,\n },\n jobPayload,\n )\n }\n\n return NextResponse.json({ received: true, queued: true }, { status: 202 })\n } catch (err: unknown) {\n logger.warn('Webhook verification failed', { providerKey, err })\n return NextResponse.json({ error: WEBHOOK_VERIFICATION_FAILED }, { status: 401 })\n }\n}\n\nasync function checkProviderWebhookRateLimit(\n container: { resolve: (name: string) => unknown },\n req: Request,\n providerKey: string,\n): Promise<NextResponse | null> {\n const rateLimiterService = tryResolve<RateLimiterService>(container, 'rateLimiterService')\n if (!rateLimiterService) return null\n\n return checkRateLimit(\n rateLimiterService,\n paymentGatewayWebhookRateLimitConfig,\n `${providerKey}:${getClientIp(req, rateLimiterService.trustProxyDepth) ?? 'unknown'}`,\n RATE_LIMIT_ERROR_FALLBACK,\n )\n}\n\nfunction tryResolve<T>(container: { resolve: (name: string) => unknown }, name: string): T | null {\n try {\n return container.resolve(name) as T\n } catch {\n return null\n }\n}\n\nexport const openApi = {\n tags: [paymentGatewaysTag],\n summary: 'Receive payment gateway webhook',\n methods: {\n POST: {\n summary: 'Process inbound webhook from payment provider',\n tags: [paymentGatewaysTag],\n responses: [\n { status: 202, description: 'Webhook accepted for async processing' },\n { status: 401, description: 'Signature verification failed' },\n { status: 413, description: 'Webhook payload too large' },\n { status: 404, description: 'Unknown provider' },\n ],\n },\n },\n}\n\nexport default POST\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,8BAA8B;AACvC,SAAS,0BAA0B;AACnC,SAAS,oBAAoB;AAC7B,SAAS,gBAAgB,aAAa,iCAAiC;AAGvE,SAAS,yBAAyB;AAIlC,SAAS,0BAA0B;AACnC,SAAS,8BAA8B;AACvC,SAAS,uCAAuC;AAChD,SAA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