@open-mercato/core 0.6.6-develop.6465.1.019f0fb26f → 0.6.6-develop.6471.1.9ab5bdd79a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bootstrap.js +13 -11
- package/dist/bootstrap.js.map +2 -2
- package/dist/helpers/integration/queue-runner.js +4 -2
- package/dist/helpers/integration/queue-runner.js.map +2 -2
- package/dist/modules/api_keys/services/apiKeyService.js +5 -3
- package/dist/modules/api_keys/services/apiKeyService.js.map +2 -2
- package/dist/modules/attachments/api/image/[id]/[[...slug]]/route.js +4 -2
- package/dist/modules/attachments/api/image/[id]/[[...slug]]/route.js.map +2 -2
- package/dist/modules/attachments/api/library/[id]/route.js +3 -1
- package/dist/modules/attachments/api/library/[id]/route.js.map +2 -2
- package/dist/modules/attachments/api/route.js +8 -6
- package/dist/modules/attachments/api/route.js.map +2 -2
- package/dist/modules/attachments/components/AttachmentPartitionSettings.js +5 -3
- package/dist/modules/attachments/components/AttachmentPartitionSettings.js.map +2 -2
- package/dist/modules/attachments/lib/assignmentDetails.js +3 -1
- package/dist/modules/attachments/lib/assignmentDetails.js.map +2 -2
- package/dist/modules/attachments/lib/drivers/driverFactory.js +3 -1
- package/dist/modules/attachments/lib/drivers/driverFactory.js.map +2 -2
- package/dist/modules/attachments/lib/ocrQueue.js +10 -11
- package/dist/modules/attachments/lib/ocrQueue.js.map +2 -2
- package/dist/modules/attachments/lib/ocrService.js +6 -4
- package/dist/modules/attachments/lib/ocrService.js.map +2 -2
- package/dist/modules/audit_logs/api/audit-logs/actions/redo/route.js +3 -1
- package/dist/modules/audit_logs/api/audit-logs/actions/redo/route.js.map +2 -2
- package/dist/modules/audit_logs/api/audit-logs/actions/undo/route.js +3 -1
- package/dist/modules/audit_logs/api/audit-logs/actions/undo/route.js.map +2 -2
- package/dist/modules/audit_logs/backend/audit-logs/page.js +3 -1
- package/dist/modules/audit_logs/backend/audit-logs/page.js.map +2 -2
- package/dist/modules/audit_logs/components/AuditLogsActions.js +4 -2
- package/dist/modules/audit_logs/components/AuditLogsActions.js.map +2 -2
- package/dist/modules/audit_logs/services/accessLogService.js +4 -2
- package/dist/modules/audit_logs/services/accessLogService.js.map +2 -2
- package/dist/modules/audit_logs/services/actionLogService.js +7 -5
- package/dist/modules/audit_logs/services/actionLogService.js.map +3 -3
- package/dist/modules/auth/api/profile/route.js +4 -2
- package/dist/modules/auth/api/profile/route.js.map +2 -2
- package/dist/modules/auth/api/reset/confirm.js +3 -1
- package/dist/modules/auth/api/reset/confirm.js.map +2 -2
- package/dist/modules/auth/api/reset.js +4 -2
- package/dist/modules/auth/api/reset.js.map +2 -2
- package/dist/modules/auth/api/roles/route.js +3 -1
- package/dist/modules/auth/api/roles/route.js.map +2 -2
- package/dist/modules/auth/api/sidebar/variants/route.js +3 -1
- package/dist/modules/auth/api/sidebar/variants/route.js.map +2 -2
- package/dist/modules/auth/api/users/resend-invite/route.js +4 -2
- package/dist/modules/auth/api/users/resend-invite/route.js.map +2 -2
- package/dist/modules/auth/api/users/route.js +3 -1
- package/dist/modules/auth/api/users/route.js.map +2 -2
- package/dist/modules/auth/backend/auth/profile/page.js +3 -1
- package/dist/modules/auth/backend/auth/profile/page.js.map +2 -2
- package/dist/modules/auth/backend/profile/change-password/page.js +3 -1
- package/dist/modules/auth/backend/profile/change-password/page.js.map +2 -2
- package/dist/modules/auth/backend/users/[id]/edit/page.js +5 -3
- package/dist/modules/auth/backend/users/[id]/edit/page.js.map +2 -2
- package/dist/modules/auth/backend/users/create/page.js +4 -2
- package/dist/modules/auth/backend/users/create/page.js.map +2 -2
- package/dist/modules/auth/cli.js +10 -0
- package/dist/modules/auth/cli.js.map +2 -2
- package/dist/modules/auth/commands/users.js +4 -2
- package/dist/modules/auth/commands/users.js.map +2 -2
- package/dist/modules/auth/lib/consentIntegrity.js +3 -3
- package/dist/modules/auth/lib/consentIntegrity.js.map +2 -2
- package/dist/modules/auth/lib/setup-app.js +9 -10
- package/dist/modules/auth/lib/setup-app.js.map +2 -2
- package/dist/modules/auth/lib/tenantAccess.js +3 -1
- package/dist/modules/auth/lib/tenantAccess.js.map +2 -2
- package/dist/modules/auth/lib/tokenHash.js +3 -3
- package/dist/modules/auth/lib/tokenHash.js.map +2 -2
- package/dist/modules/business_rules/api/rules/route.js +4 -2
- package/dist/modules/business_rules/api/rules/route.js.map +2 -2
- package/dist/modules/business_rules/lib/expression-evaluator.js +7 -5
- package/dist/modules/business_rules/lib/expression-evaluator.js.map +2 -2
- package/dist/modules/business_rules/lib/rule-engine.js +5 -3
- package/dist/modules/business_rules/lib/rule-engine.js.map +2 -2
- package/dist/modules/business_rules/lib/rule-evaluator.js +11 -12
- package/dist/modules/business_rules/lib/rule-evaluator.js.map +2 -2
- package/dist/modules/business_rules/subscribers/crud-rule-trigger.js +3 -1
- package/dist/modules/business_rules/subscribers/crud-rule-trigger.js.map +2 -2
- package/dist/modules/business_rules/subscribers/rule-execution-failed-notification.js +3 -1
- package/dist/modules/business_rules/subscribers/rule-execution-failed-notification.js.map +2 -2
- package/dist/modules/catalog/ai-agents-context.js +4 -5
- package/dist/modules/catalog/ai-agents-context.js.map +2 -2
- package/dist/modules/catalog/ai-tools/_shared.js +3 -1
- package/dist/modules/catalog/ai-tools/_shared.js.map +2 -2
- package/dist/modules/catalog/ai-tools/authoring-pack.js +3 -1
- package/dist/modules/catalog/ai-tools/authoring-pack.js.map +2 -2
- package/dist/modules/catalog/ai-tools/merchandising-pack.js +3 -1
- package/dist/modules/catalog/ai-tools/merchandising-pack.js.map +2 -2
- package/dist/modules/catalog/api/dictionaries/[key]/route.js +3 -1
- package/dist/modules/catalog/api/dictionaries/[key]/route.js.map +2 -2
- package/dist/modules/catalog/api/prices/route.js +3 -1
- package/dist/modules/catalog/api/prices/route.js.map +2 -2
- package/dist/modules/catalog/api/products/route.js +5 -3
- package/dist/modules/catalog/api/products/route.js.map +2 -2
- package/dist/modules/catalog/api/settings/route.js +4 -2
- package/dist/modules/catalog/api/settings/route.js.map +2 -2
- package/dist/modules/catalog/backend/catalog/products/[id]/page.js +14 -12
- package/dist/modules/catalog/backend/catalog/products/[id]/page.js.map +2 -2
- package/dist/modules/catalog/backend/catalog/products/[productId]/variants/[variantId]/page.js +8 -6
- package/dist/modules/catalog/backend/catalog/products/[productId]/variants/[variantId]/page.js.map +2 -2
- package/dist/modules/catalog/backend/catalog/products/[productId]/variants/create/page.js +5 -3
- package/dist/modules/catalog/backend/catalog/products/[productId]/variants/create/page.js.map +2 -2
- package/dist/modules/catalog/backend/catalog/products/create/page.js +5 -6
- package/dist/modules/catalog/backend/catalog/products/create/page.js.map +2 -2
- package/dist/modules/catalog/backend/catalog/products/optionSchemaClient.js +3 -1
- package/dist/modules/catalog/backend/catalog/products/optionSchemaClient.js.map +2 -2
- package/dist/modules/catalog/components/PriceKindSettings.js +5 -3
- package/dist/modules/catalog/components/PriceKindSettings.js.map +2 -2
- package/dist/modules/catalog/components/UnitPriceDisplaySettings.js +4 -2
- package/dist/modules/catalog/components/UnitPriceDisplaySettings.js.map +2 -2
- package/dist/modules/catalog/inbox-actions.js +4 -2
- package/dist/modules/catalog/inbox-actions.js.map +2 -2
- package/dist/modules/catalog/seed/examples.js +4 -5
- package/dist/modules/catalog/seed/examples.js.map +2 -2
- package/dist/modules/catalog/subscribers/low-stock-notification.js +3 -1
- package/dist/modules/catalog/subscribers/low-stock-notification.js.map +2 -2
- package/dist/modules/catalog/widgets/injection/product-seo/state.js +3 -1
- package/dist/modules/catalog/widgets/injection/product-seo/state.js.map +2 -2
- package/dist/modules/communication_channels/api/get/oauth/[provider]/callback/route.js +12 -11
- package/dist/modules/communication_channels/api/get/oauth/[provider]/callback/route.js.map +2 -2
- package/dist/modules/communication_channels/api/post/channels/[id]/import-history/route.js +3 -1
- package/dist/modules/communication_channels/api/post/channels/[id]/import-history/route.js.map +2 -2
- package/dist/modules/communication_channels/api/post/channels/[id]/push/register/route.js +3 -1
- package/dist/modules/communication_channels/api/post/channels/[id]/push/register/route.js.map +2 -2
- package/dist/modules/communication_channels/api/post/webhook/[provider]/route.js +5 -3
- package/dist/modules/communication_channels/api/post/webhook/[provider]/route.js.map +2 -2
- package/dist/modules/communication_channels/api/post/webhooks/gmail/route.js +6 -6
- package/dist/modules/communication_channels/api/post/webhooks/gmail/route.js.map +2 -2
- package/dist/modules/communication_channels/commands/connect-credential-channel.js +4 -6
- package/dist/modules/communication_channels/commands/connect-credential-channel.js.map +2 -2
- package/dist/modules/communication_channels/commands/delete-channel.js +3 -3
- package/dist/modules/communication_channels/commands/delete-channel.js.map +2 -2
- package/dist/modules/communication_channels/commands/deliver-outbound-message.js +4 -5
- package/dist/modules/communication_channels/commands/deliver-outbound-message.js.map +2 -2
- package/dist/modules/communication_channels/commands/disconnect-channel.js +3 -3
- package/dist/modules/communication_channels/commands/disconnect-channel.js.map +2 -2
- package/dist/modules/communication_channels/commands/ingest-inbound-message.js +5 -12
- package/dist/modules/communication_channels/commands/ingest-inbound-message.js.map +2 -2
- package/dist/modules/communication_channels/commands/push-unregister.js +3 -3
- package/dist/modules/communication_channels/commands/push-unregister.js.map +2 -2
- package/dist/modules/communication_channels/commands/reassign-conversation.js +5 -3
- package/dist/modules/communication_channels/commands/reassign-conversation.js.map +2 -2
- package/dist/modules/communication_channels/lib/dead-letter.js +3 -3
- package/dist/modules/communication_channels/lib/dead-letter.js.map +2 -2
- package/dist/modules/communication_channels/lib/email-mime.js +4 -6
- package/dist/modules/communication_channels/lib/email-mime.js.map +2 -2
- package/dist/modules/communication_channels/lib/oauth-client-config.js +5 -3
- package/dist/modules/communication_channels/lib/oauth-client-config.js.map +2 -2
- package/dist/modules/communication_channels/lib/send-as-user.js +3 -1
- package/dist/modules/communication_channels/lib/send-as-user.js.map +2 -2
- package/dist/modules/communication_channels/lib/thread-token.js +4 -2
- package/dist/modules/communication_channels/lib/thread-token.js.map +2 -2
- package/dist/modules/communication_channels/setup.js +3 -4
- package/dist/modules/communication_channels/setup.js.map +2 -2
- package/dist/modules/communication_channels/workers/channel-import-history.js +4 -6
- package/dist/modules/communication_channels/workers/channel-import-history.js.map +2 -2
- package/dist/modules/communication_channels/workers/gmail-history-sync.js +8 -16
- package/dist/modules/communication_channels/workers/gmail-history-sync.js.map +2 -2
- package/dist/modules/communication_channels/workers/gmail-renew-watch.js +5 -7
- package/dist/modules/communication_channels/workers/gmail-renew-watch.js.map +2 -2
- package/dist/modules/communication_channels/workers/outbound-delivery.js +6 -12
- package/dist/modules/communication_channels/workers/outbound-delivery.js.map +2 -2
- package/dist/modules/communication_channels/workers/poll-channel.js +7 -15
- package/dist/modules/communication_channels/workers/poll-channel.js.map +2 -2
- package/dist/modules/communication_channels/workers/poll-tick.js +5 -6
- package/dist/modules/communication_channels/workers/poll-tick.js.map +2 -2
- package/dist/modules/communication_channels/workers/reaction-processor.js +5 -9
- package/dist/modules/communication_channels/workers/reaction-processor.js.map +2 -2
- package/dist/modules/configs/api/cache/route.js +4 -2
- package/dist/modules/configs/api/cache/route.js.map +2 -2
- package/dist/modules/configs/api/system-status/route.js +4 -2
- package/dist/modules/configs/api/system-status/route.js.map +2 -2
- package/dist/modules/configs/api/upgrade-actions/route.js +4 -2
- package/dist/modules/configs/api/upgrade-actions/route.js.map +2 -2
- package/dist/modules/configs/components/ModuleTelemetryPanel.js +3 -1
- package/dist/modules/configs/components/ModuleTelemetryPanel.js.map +2 -2
- package/dist/modules/configs/lib/touchGeneratedBarrels.js +2 -1
- package/dist/modules/configs/lib/touchGeneratedBarrels.js.map +2 -2
- package/dist/modules/configs/services/upgradeActionsService.js +6 -3
- package/dist/modules/configs/services/upgradeActionsService.js.map +2 -2
- package/dist/modules/currencies/components/CurrencyFetchingConfig.js +3 -1
- package/dist/modules/currencies/components/CurrencyFetchingConfig.js.map +2 -2
- package/dist/modules/currencies/lib/exchangeRateFormConfig.js +3 -1
- package/dist/modules/currencies/lib/exchangeRateFormConfig.js.map +2 -2
- package/dist/modules/currencies/services/providers/nbp.js +6 -4
- package/dist/modules/currencies/services/providers/nbp.js.map +2 -2
- package/dist/modules/currencies/services/providers/raiffeisen.js +7 -7
- package/dist/modules/currencies/services/providers/raiffeisen.js.map +2 -2
- package/dist/modules/customer_accounts/api/domain-resolve/all.js +6 -5
- package/dist/modules/customer_accounts/api/domain-resolve/all.js.map +2 -2
- package/dist/modules/customer_accounts/api/signup.js +4 -2
- package/dist/modules/customer_accounts/api/signup.js.map +2 -2
- package/dist/modules/customer_accounts/lib/customerAuthServer.js +3 -1
- package/dist/modules/customer_accounts/lib/customerAuthServer.js.map +2 -2
- package/dist/modules/customer_accounts/subscribers/autoLinkCrm.js +3 -1
- package/dist/modules/customer_accounts/subscribers/autoLinkCrm.js.map +2 -2
- package/dist/modules/customer_accounts/subscribers/autoLinkCrmReverse.js +3 -1
- package/dist/modules/customer_accounts/subscribers/autoLinkCrmReverse.js.map +2 -2
- package/dist/modules/customer_accounts/subscribers/unlinkOnCompanyDelete.js +3 -1
- package/dist/modules/customer_accounts/subscribers/unlinkOnCompanyDelete.js.map +2 -2
- package/dist/modules/customer_accounts/subscribers/unlinkOnPersonDelete.js +3 -1
- package/dist/modules/customer_accounts/subscribers/unlinkOnPersonDelete.js.map +2 -2
- package/dist/modules/customers/ai-agents-context.js +4 -5
- package/dist/modules/customers/ai-agents-context.js.map +2 -2
- package/dist/modules/customers/api/activities/route.js +6 -4
- package/dist/modules/customers/api/activities/route.js.map +2 -2
- package/dist/modules/customers/api/comments/route.js +3 -1
- package/dist/modules/customers/api/comments/route.js.map +2 -2
- package/dist/modules/customers/api/companies/[id]/people/route.js +3 -1
- package/dist/modules/customers/api/companies/[id]/people/route.js.map +2 -2
- package/dist/modules/customers/api/companies/[id]/route.js +5 -3
- package/dist/modules/customers/api/companies/[id]/route.js.map +2 -2
- package/dist/modules/customers/api/companies/route.js +5 -3
- package/dist/modules/customers/api/companies/route.js.map +2 -2
- package/dist/modules/customers/api/dashboard/widgets/customer-todos/route.js +3 -1
- package/dist/modules/customers/api/dashboard/widgets/customer-todos/route.js.map +2 -2
- package/dist/modules/customers/api/dashboard/widgets/new-customers/route.js +3 -1
- package/dist/modules/customers/api/dashboard/widgets/new-customers/route.js.map +2 -2
- package/dist/modules/customers/api/dashboard/widgets/new-deals/route.js +3 -1
- package/dist/modules/customers/api/dashboard/widgets/new-deals/route.js.map +2 -2
- package/dist/modules/customers/api/dashboard/widgets/next-interactions/route.js +3 -1
- package/dist/modules/customers/api/dashboard/widgets/next-interactions/route.js.map +2 -2
- package/dist/modules/customers/api/deals/[id]/companies/route.js +3 -1
- package/dist/modules/customers/api/deals/[id]/companies/route.js.map +2 -2
- package/dist/modules/customers/api/deals/[id]/people/route.js +3 -1
- package/dist/modules/customers/api/deals/[id]/people/route.js.map +2 -2
- package/dist/modules/customers/api/deals/aggregate/route.js +3 -1
- package/dist/modules/customers/api/deals/aggregate/route.js.map +2 -2
- package/dist/modules/customers/api/deals/bulk-update-owner/route.js +7 -5
- package/dist/modules/customers/api/deals/bulk-update-owner/route.js.map +2 -2
- package/dist/modules/customers/api/deals/bulk-update-stage/route.js +7 -5
- package/dist/modules/customers/api/deals/bulk-update-stage/route.js.map +2 -2
- package/dist/modules/customers/api/deals/route.js +3 -1
- package/dist/modules/customers/api/deals/route.js.map +2 -2
- package/dist/modules/customers/api/deals/summary/route.js +3 -1
- package/dist/modules/customers/api/deals/summary/route.js.map +2 -2
- package/dist/modules/customers/api/dictionaries/[kind]/[id]/route.js +4 -2
- package/dist/modules/customers/api/dictionaries/[kind]/[id]/route.js.map +2 -2
- package/dist/modules/customers/api/dictionaries/[kind]/route.js +5 -3
- package/dist/modules/customers/api/dictionaries/[kind]/route.js.map +2 -2
- package/dist/modules/customers/api/dictionaries/cache.js +3 -1
- package/dist/modules/customers/api/dictionaries/cache.js.map +2 -2
- package/dist/modules/customers/api/dictionaries/context.js +3 -1
- package/dist/modules/customers/api/dictionaries/context.js.map +2 -2
- package/dist/modules/customers/api/dictionaries/currency/route.js +3 -1
- package/dist/modules/customers/api/dictionaries/currency/route.js.map +2 -2
- package/dist/modules/customers/api/dictionaries/kind-settings/route.js +4 -2
- package/dist/modules/customers/api/dictionaries/kind-settings/route.js.map +2 -2
- package/dist/modules/customers/api/entity-roles-factory.js +7 -5
- package/dist/modules/customers/api/entity-roles-factory.js.map +2 -2
- package/dist/modules/customers/api/interactions/cancel/route.js +3 -1
- package/dist/modules/customers/api/interactions/cancel/route.js.map +2 -2
- package/dist/modules/customers/api/interactions/complete/route.js +3 -1
- package/dist/modules/customers/api/interactions/complete/route.js.map +2 -2
- package/dist/modules/customers/api/interactions/conflicts/route.js +3 -1
- package/dist/modules/customers/api/interactions/conflicts/route.js.map +2 -2
- package/dist/modules/customers/api/interactions/counts/route.js +3 -1
- package/dist/modules/customers/api/interactions/counts/route.js.map +2 -2
- package/dist/modules/customers/api/interactions/route.js +7 -4
- package/dist/modules/customers/api/interactions/route.js.map +2 -2
- package/dist/modules/customers/api/interactions/tasks/route.js +3 -1
- package/dist/modules/customers/api/interactions/tasks/route.js.map +2 -2
- package/dist/modules/customers/api/labels/assign/route.js +3 -1
- package/dist/modules/customers/api/labels/assign/route.js.map +2 -2
- package/dist/modules/customers/api/labels/route.js +6 -3
- package/dist/modules/customers/api/labels/route.js.map +2 -2
- package/dist/modules/customers/api/labels/unassign/route.js +3 -1
- package/dist/modules/customers/api/labels/unassign/route.js.map +2 -2
- package/dist/modules/customers/api/people/[id]/companies/enriched/route.js +3 -1
- package/dist/modules/customers/api/people/[id]/companies/enriched/route.js.map +2 -2
- package/dist/modules/customers/api/people/[id]/route.js +5 -3
- package/dist/modules/customers/api/people/[id]/route.js.map +2 -2
- package/dist/modules/customers/api/people/route.js +5 -3
- package/dist/modules/customers/api/people/route.js.map +2 -2
- package/dist/modules/customers/api/pipeline-stages/reorder/route.js +3 -1
- package/dist/modules/customers/api/pipeline-stages/reorder/route.js.map +2 -2
- package/dist/modules/customers/api/pipeline-stages/route.js +6 -4
- package/dist/modules/customers/api/pipeline-stages/route.js.map +2 -2
- package/dist/modules/customers/api/pipelines/route.js +6 -4
- package/dist/modules/customers/api/pipelines/route.js.map +2 -2
- package/dist/modules/customers/api/settings/address-format/route.js +4 -2
- package/dist/modules/customers/api/settings/address-format/route.js.map +2 -2
- package/dist/modules/customers/api/settings/dictionary-sort-modes/route.js +4 -2
- package/dist/modules/customers/api/settings/dictionary-sort-modes/route.js.map +2 -2
- package/dist/modules/customers/api/settings/stuck-threshold/route.js +4 -2
- package/dist/modules/customers/api/settings/stuck-threshold/route.js.map +2 -2
- package/dist/modules/customers/api/tags/assign/route.js +3 -1
- package/dist/modules/customers/api/tags/assign/route.js.map +2 -2
- package/dist/modules/customers/api/tags/unassign/route.js +3 -1
- package/dist/modules/customers/api/tags/unassign/route.js.map +2 -2
- package/dist/modules/customers/api/todos/route.js +6 -4
- package/dist/modules/customers/api/todos/route.js.map +2 -2
- package/dist/modules/customers/backend/customers/companies-v2/[id]/page.js +5 -3
- package/dist/modules/customers/backend/customers/companies-v2/[id]/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealActivities.js +3 -1
- package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealActivities.js.map +2 -2
- package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealClosure.js +3 -1
- package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealClosure.js.map +2 -2
- package/dist/modules/customers/backend/customers/deals/map/components/DealsMapCanvasImpl.js +4 -2
- package/dist/modules/customers/backend/customers/deals/map/components/DealsMapCanvasImpl.js.map +2 -2
- package/dist/modules/customers/backend/customers/deals/page.js +4 -2
- package/dist/modules/customers/backend/customers/deals/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/people-v2/[id]/page.js +5 -3
- package/dist/modules/customers/backend/customers/people-v2/[id]/page.js.map +2 -2
- package/dist/modules/customers/commands/deals.js +3 -1
- package/dist/modules/customers/commands/deals.js.map +2 -2
- package/dist/modules/customers/commands/dictionaries.js +3 -1
- package/dist/modules/customers/commands/dictionaries.js.map +2 -2
- package/dist/modules/customers/commands/interactions.js +4 -2
- package/dist/modules/customers/commands/interactions.js.map +2 -2
- package/dist/modules/customers/commands/shared.js +4 -2
- package/dist/modules/customers/commands/shared.js.map +2 -2
- package/dist/modules/customers/commands/todos.js +3 -1
- package/dist/modules/customers/commands/todos.js.map +2 -2
- package/dist/modules/customers/components/DictionarySettings.js +5 -3
- package/dist/modules/customers/components/DictionarySettings.js.map +2 -2
- package/dist/modules/customers/components/DictionarySortSettings.js +3 -1
- package/dist/modules/customers/components/DictionarySortSettings.js.map +2 -2
- package/dist/modules/customers/components/detail/ActivitiesCard.js +3 -1
- package/dist/modules/customers/components/detail/ActivitiesCard.js.map +2 -2
- package/dist/modules/customers/components/detail/ActivitiesDayStrip.js +3 -1
- package/dist/modules/customers/components/detail/ActivitiesDayStrip.js.map +2 -2
- package/dist/modules/customers/components/detail/ActivitiesSection.js +6 -4
- package/dist/modules/customers/components/detail/ActivitiesSection.js.map +2 -2
- package/dist/modules/customers/components/detail/ActivityCard.js +3 -1
- package/dist/modules/customers/components/detail/ActivityCard.js.map +2 -2
- package/dist/modules/customers/components/detail/ChangelogTab.js +3 -1
- package/dist/modules/customers/components/detail/ChangelogTab.js.map +2 -2
- package/dist/modules/customers/components/detail/CompanyCard.js +3 -1
- package/dist/modules/customers/components/detail/CompanyCard.js.map +2 -2
- package/dist/modules/customers/components/detail/ConfirmDealLostDialog.js +3 -1
- package/dist/modules/customers/components/detail/ConfirmDealLostDialog.js.map +2 -2
- package/dist/modules/customers/components/detail/EntityTagsDialog.js +3 -1
- package/dist/modules/customers/components/detail/EntityTagsDialog.js.map +2 -2
- package/dist/modules/customers/components/detail/InlineActivityComposer.js +3 -1
- package/dist/modules/customers/components/detail/InlineActivityComposer.js.map +2 -2
- package/dist/modules/customers/components/detail/ManageTagsDialog.js +3 -1
- package/dist/modules/customers/components/detail/ManageTagsDialog.js.map +2 -2
- package/dist/modules/customers/components/detail/RoleAssignmentRow.js +5 -3
- package/dist/modules/customers/components/detail/RoleAssignmentRow.js.map +2 -2
- package/dist/modules/customers/components/detail/RolesSection.js +4 -2
- package/dist/modules/customers/components/detail/RolesSection.js.map +2 -2
- package/dist/modules/customers/components/detail/hooks/useInteractionMutations.js +5 -3
- package/dist/modules/customers/components/detail/hooks/useInteractionMutations.js.map +2 -2
- package/dist/modules/customers/components/linking/LinkEntityDialog.js +4 -2
- package/dist/modules/customers/components/linking/LinkEntityDialog.js.map +2 -2
- package/dist/modules/customers/inbox-actions.js +3 -1
- package/dist/modules/customers/inbox-actions.js.map +2 -2
- package/dist/modules/customers/lib/bulkDeals.js +3 -1
- package/dist/modules/customers/lib/bulkDeals.js.map +2 -2
- package/dist/modules/customers/lib/dealClosureNotification.js +4 -2
- package/dist/modules/customers/lib/dealClosureNotification.js.map +2 -2
- package/dist/modules/customers/lib/dealStageTransitionTable.js +3 -1
- package/dist/modules/customers/lib/dealStageTransitionTable.js.map +2 -2
- package/dist/modules/customers/lib/interactionFeatureFlags.js +3 -1
- package/dist/modules/customers/lib/interactionFeatureFlags.js.map +2 -2
- package/dist/modules/customers/lib/todoCompatibility.js +3 -1
- package/dist/modules/customers/lib/todoCompatibility.js.map +2 -2
- package/dist/modules/customers/search.js +14 -7
- package/dist/modules/customers/search.js.map +2 -2
- package/dist/modules/customers/widgets/dashboard/customer-todos/widget.client.js +3 -1
- package/dist/modules/customers/widgets/dashboard/customer-todos/widget.client.js.map +2 -2
- package/dist/modules/customers/widgets/dashboard/new-customers/widget.client.js +3 -1
- package/dist/modules/customers/widgets/dashboard/new-customers/widget.client.js.map +2 -2
- package/dist/modules/customers/widgets/dashboard/new-deals/widget.client.js +3 -1
- package/dist/modules/customers/widgets/dashboard/new-deals/widget.client.js.map +2 -2
- package/dist/modules/customers/widgets/dashboard/next-interactions/widget.client.js +3 -1
- package/dist/modules/customers/widgets/dashboard/next-interactions/widget.client.js.map +2 -2
- package/dist/modules/dashboards/api/widgets/data/batch/route.js +3 -1
- package/dist/modules/dashboards/api/widgets/data/batch/route.js.map +2 -2
- package/dist/modules/dashboards/api/widgets/data/route.js +3 -1
- package/dist/modules/dashboards/api/widgets/data/route.js.map +2 -2
- package/dist/modules/dashboards/components/WidgetVisibilityEditor.js +5 -3
- package/dist/modules/dashboards/components/WidgetVisibilityEditor.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/aov-kpi/widget.client.js +3 -1
- package/dist/modules/dashboards/widgets/dashboard/aov-kpi/widget.client.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/new-customers-kpi/widget.client.js +3 -1
- package/dist/modules/dashboards/widgets/dashboard/new-customers-kpi/widget.client.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/orders-by-status/widget.client.js +3 -1
- package/dist/modules/dashboards/widgets/dashboard/orders-by-status/widget.client.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/orders-kpi/widget.client.js +3 -1
- package/dist/modules/dashboards/widgets/dashboard/orders-kpi/widget.client.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/pipeline-summary/widget.client.js +3 -1
- package/dist/modules/dashboards/widgets/dashboard/pipeline-summary/widget.client.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/revenue-kpi/widget.client.js +3 -1
- package/dist/modules/dashboards/widgets/dashboard/revenue-kpi/widget.client.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/revenue-trend/widget.client.js +3 -1
- package/dist/modules/dashboards/widgets/dashboard/revenue-trend/widget.client.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/sales-by-region/widget.client.js +3 -1
- package/dist/modules/dashboards/widgets/dashboard/sales-by-region/widget.client.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/top-customers/widget.client.js +3 -1
- package/dist/modules/dashboards/widgets/dashboard/top-customers/widget.client.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/top-products/widget.client.js +3 -1
- package/dist/modules/dashboards/widgets/dashboard/top-products/widget.client.js.map +2 -2
- package/dist/modules/data_sync/api/run.js +3 -1
- package/dist/modules/data_sync/api/run.js.map +2 -2
- package/dist/modules/data_sync/backend/data-sync/runs/[id]/page.js +1 -1
- package/dist/modules/data_sync/backend/data-sync/runs/[id]/page.js.map +2 -2
- package/dist/modules/data_sync/lib/adapter-registry.js +11 -4
- package/dist/modules/data_sync/lib/adapter-registry.js.map +2 -2
- package/dist/modules/data_sync/lib/sync-engine.js +23 -2
- package/dist/modules/data_sync/lib/sync-engine.js.map +2 -2
- package/dist/modules/data_sync/workers/sync-export.js +3 -1
- package/dist/modules/data_sync/workers/sync-export.js.map +2 -2
- package/dist/modules/data_sync/workers/sync-import.js +3 -1
- package/dist/modules/data_sync/workers/sync-import.js.map +2 -2
- package/dist/modules/dictionaries/api/[dictionaryId]/entries/[entryId]/route.js +4 -2
- package/dist/modules/dictionaries/api/[dictionaryId]/entries/[entryId]/route.js.map +2 -2
- package/dist/modules/dictionaries/api/[dictionaryId]/entries/reorder/route.js +3 -1
- package/dist/modules/dictionaries/api/[dictionaryId]/entries/reorder/route.js.map +2 -2
- package/dist/modules/dictionaries/api/[dictionaryId]/entries/route.js +4 -2
- package/dist/modules/dictionaries/api/[dictionaryId]/entries/route.js.map +2 -2
- package/dist/modules/dictionaries/api/[dictionaryId]/entries/set-default/route.js +3 -1
- package/dist/modules/dictionaries/api/[dictionaryId]/entries/set-default/route.js.map +2 -2
- package/dist/modules/dictionaries/api/[dictionaryId]/route.js +5 -3
- package/dist/modules/dictionaries/api/[dictionaryId]/route.js.map +2 -2
- package/dist/modules/dictionaries/api/context.js +3 -1
- package/dist/modules/dictionaries/api/context.js.map +2 -2
- package/dist/modules/dictionaries/api/route.js +4 -2
- package/dist/modules/dictionaries/api/route.js.map +2 -2
- package/dist/modules/dictionaries/components/DictionariesManager.js +5 -3
- package/dist/modules/dictionaries/components/DictionariesManager.js.map +2 -2
- package/dist/modules/dictionaries/components/DictionaryEntriesEditor.js +4 -2
- package/dist/modules/dictionaries/components/DictionaryEntriesEditor.js.map +2 -2
- package/dist/modules/dictionaries/components/DictionaryEntrySelect.js +4 -2
- package/dist/modules/dictionaries/components/DictionaryEntrySelect.js.map +2 -2
- package/dist/modules/dictionaries/components/DictionarySelectControl.js +3 -1
- package/dist/modules/dictionaries/components/DictionarySelectControl.js.map +2 -2
- package/dist/modules/dictionaries/fields/dictionary.js +3 -1
- package/dist/modules/dictionaries/fields/dictionary.js.map +2 -2
- package/dist/modules/directory/api/organization-branding/route.js +3 -1
- package/dist/modules/directory/api/organization-branding/route.js.map +2 -2
- package/dist/modules/directory/api/organization-switcher/route.js +3 -1
- package/dist/modules/directory/api/organization-switcher/route.js.map +2 -2
- package/dist/modules/directory/commands/tenants.js +5 -3
- package/dist/modules/directory/commands/tenants.js.map +2 -2
- package/dist/modules/directory/utils/organizationScope.js +6 -4
- package/dist/modules/directory/utils/organizationScope.js.map +2 -2
- package/dist/modules/entities/api/definitions.cache.js +3 -1
- package/dist/modules/entities/api/definitions.cache.js.map +2 -2
- package/dist/modules/entities/api/definitions.js +7 -5
- package/dist/modules/entities/api/definitions.js.map +2 -2
- package/dist/modules/entities/api/records.js +4 -8
- package/dist/modules/entities/api/records.js.map +2 -2
- package/dist/modules/entities/components/EncryptionManager.js +3 -1
- package/dist/modules/entities/components/EncryptionManager.js.map +2 -2
- package/dist/modules/entities/lib/makeActivityRoute.js +3 -1
- package/dist/modules/entities/lib/makeActivityRoute.js.map +2 -2
- package/dist/modules/feature_toggles/api/overrides/route.js +3 -1
- package/dist/modules/feature_toggles/api/overrides/route.js.map +2 -2
- package/dist/modules/feature_toggles/lib/feature-flag-check.js +5 -9
- package/dist/modules/feature_toggles/lib/feature-flag-check.js.map +2 -2
- package/dist/modules/inbox_ops/api/emails/[id]/reprocess/route.js +4 -2
- package/dist/modules/inbox_ops/api/emails/[id]/reprocess/route.js.map +2 -2
- package/dist/modules/inbox_ops/api/emails/[id]/route.js +4 -2
- package/dist/modules/inbox_ops/api/emails/[id]/route.js.map +2 -2
- package/dist/modules/inbox_ops/api/emails/route.js +3 -1
- package/dist/modules/inbox_ops/api/emails/route.js.map +2 -2
- package/dist/modules/inbox_ops/api/extract/route.js +3 -1
- package/dist/modules/inbox_ops/api/extract/route.js.map +2 -2
- package/dist/modules/inbox_ops/api/proposals/[id]/actions/[actionId]/route.js +3 -1
- package/dist/modules/inbox_ops/api/proposals/[id]/actions/[actionId]/route.js.map +2 -2
- package/dist/modules/inbox_ops/api/proposals/[id]/replies/[replyId]/send/route.js +4 -2
- package/dist/modules/inbox_ops/api/proposals/[id]/replies/[replyId]/send/route.js.map +2 -2
- package/dist/modules/inbox_ops/api/proposals/counts/route.js +4 -2
- package/dist/modules/inbox_ops/api/proposals/counts/route.js.map +2 -2
- package/dist/modules/inbox_ops/api/proposals/route.js +3 -1
- package/dist/modules/inbox_ops/api/proposals/route.js.map +2 -2
- package/dist/modules/inbox_ops/api/routeHelpers.js +3 -1
- package/dist/modules/inbox_ops/api/routeHelpers.js.map +2 -2
- package/dist/modules/inbox_ops/api/settings/route.js +3 -1
- package/dist/modules/inbox_ops/api/settings/route.js.map +2 -2
- package/dist/modules/inbox_ops/api/webhook/inbound.js +7 -5
- package/dist/modules/inbox_ops/api/webhook/inbound.js.map +2 -2
- package/dist/modules/inbox_ops/lib/cache.js +4 -2
- package/dist/modules/inbox_ops/lib/cache.js.map +2 -2
- package/dist/modules/inbox_ops/lib/catalogLookup.js +3 -1
- package/dist/modules/inbox_ops/lib/catalogLookup.js.map +2 -2
- package/dist/modules/inbox_ops/lib/eventBus.js +3 -4
- package/dist/modules/inbox_ops/lib/eventBus.js.map +2 -2
- package/dist/modules/inbox_ops/lib/messagesIntegration.js +4 -8
- package/dist/modules/inbox_ops/lib/messagesIntegration.js.map +2 -2
- package/dist/modules/inbox_ops/subscribers/executionAuditor.js +3 -1
- package/dist/modules/inbox_ops/subscribers/executionAuditor.js.map +2 -2
- package/dist/modules/inbox_ops/subscribers/extractionWorker.js +10 -8
- package/dist/modules/inbox_ops/subscribers/extractionWorker.js.map +2 -2
- package/dist/modules/inbox_ops/subscribers/proposalNotifier.js +3 -1
- package/dist/modules/inbox_ops/subscribers/proposalNotifier.js.map +2 -2
- package/dist/modules/messages/api/[id]/route.js +3 -4
- package/dist/modules/messages/api/[id]/route.js.map +2 -2
- package/dist/modules/messages/commands/actions.js +3 -1
- package/dist/modules/messages/commands/actions.js.map +2 -2
- package/dist/modules/messages/components/MessagesInboxPageClient.js +3 -1
- package/dist/modules/messages/components/MessagesInboxPageClient.js.map +2 -2
- package/dist/modules/messages/lib/email-sender.js +3 -7
- package/dist/modules/messages/lib/email-sender.js.map +2 -2
- package/dist/modules/messages/lib/message-objects-registry.js +3 -1
- package/dist/modules/messages/lib/message-objects-registry.js.map +2 -2
- package/dist/modules/messages/lib/message-types-registry.js +3 -1
- package/dist/modules/messages/lib/message-types-registry.js.map +2 -2
- package/dist/modules/messages/workers/send-email.worker.js +6 -4
- package/dist/modules/messages/workers/send-email.worker.js.map +2 -2
- package/dist/modules/notifications/lib/notificationMapper.js +3 -4
- package/dist/modules/notifications/lib/notificationMapper.js.map +2 -2
- package/dist/modules/notifications/lib/notificationService.js +4 -5
- package/dist/modules/notifications/lib/notificationService.js.map +2 -2
- package/dist/modules/notifications/subscribers/deliver-notification.js +8 -13
- package/dist/modules/notifications/subscribers/deliver-notification.js.map +2 -2
- package/dist/modules/payment_gateways/api/webhook/[provider]/route.js +3 -1
- package/dist/modules/payment_gateways/api/webhook/[provider]/route.js.map +2 -2
- package/dist/modules/perspectives/services/perspectiveService.js +3 -3
- package/dist/modules/perspectives/services/perspectiveService.js.map +2 -2
- package/dist/modules/planner/api/access.js +3 -3
- package/dist/modules/planner/api/access.js.map +2 -2
- package/dist/modules/planner/api/availability-date-specific.js +3 -1
- package/dist/modules/planner/api/availability-date-specific.js.map +2 -2
- package/dist/modules/planner/api/availability-weekly.js +3 -1
- package/dist/modules/planner/api/availability-weekly.js.map +2 -2
- package/dist/modules/planner/backend/planner/availability-rulesets/page.js +4 -2
- package/dist/modules/planner/backend/planner/availability-rulesets/page.js.map +2 -2
- package/dist/modules/planner/components/AvailabilityRulesEditor.js +3 -1
- package/dist/modules/planner/components/AvailabilityRulesEditor.js.map +2 -2
- package/dist/modules/progress/api/jobs/route.js +3 -1
- package/dist/modules/progress/api/jobs/route.js.map +2 -2
- package/dist/modules/query_index/components/QueryIndexesTable.js +5 -3
- package/dist/modules/query_index/components/QueryIndexesTable.js.map +2 -2
- package/dist/modules/query_index/lib/batch.js +4 -2
- package/dist/modules/query_index/lib/batch.js.map +2 -2
- package/dist/modules/query_index/lib/coverage.js +3 -1
- package/dist/modules/query_index/lib/coverage.js.map +2 -2
- package/dist/modules/query_index/lib/engine.js +13 -18
- package/dist/modules/query_index/lib/engine.js.map +2 -2
- package/dist/modules/query_index/lib/reindexer.js +8 -6
- package/dist/modules/query_index/lib/reindexer.js.map +2 -2
- package/dist/modules/query_index/lib/search-tokens.js +3 -1
- package/dist/modules/query_index/lib/search-tokens.js.map +2 -2
- package/dist/modules/query_index/subscribers/coverage_refresh.js +3 -1
- package/dist/modules/query_index/subscribers/coverage_refresh.js.map +2 -2
- package/dist/modules/resources/api/comments.js +3 -1
- package/dist/modules/resources/api/comments.js.map +2 -2
- package/dist/modules/resources/api/resources/tags/assign/route.js +3 -1
- package/dist/modules/resources/api/resources/tags/assign/route.js.map +2 -2
- package/dist/modules/resources/api/resources/tags/unassign/route.js +3 -1
- package/dist/modules/resources/api/resources/tags/unassign/route.js.map +2 -2
- package/dist/modules/resources/backend/resources/resource-types/[id]/edit/page.js +3 -1
- package/dist/modules/resources/backend/resources/resource-types/[id]/edit/page.js.map +2 -2
- package/dist/modules/resources/backend/resources/resource-types/page.js +4 -2
- package/dist/modules/resources/backend/resources/resource-types/page.js.map +2 -2
- package/dist/modules/resources/commands/activities.js +6 -5
- package/dist/modules/resources/commands/activities.js.map +2 -2
- package/dist/modules/resources/commands/comments.js +6 -4
- package/dist/modules/resources/commands/comments.js.map +2 -2
- package/dist/modules/resources/commands/shared.js +24 -1
- package/dist/modules/resources/commands/shared.js.map +2 -2
- package/dist/modules/sales/api/channels/route.js +3 -1
- package/dist/modules/sales/api/channels/route.js.map +2 -2
- package/dist/modules/sales/api/document-history/route.js +3 -1
- package/dist/modules/sales/api/document-history/route.js.map +2 -2
- package/dist/modules/sales/api/document-numbers/route.js +3 -1
- package/dist/modules/sales/api/document-numbers/route.js.map +2 -2
- package/dist/modules/sales/api/quotes/accept/route.js +4 -2
- package/dist/modules/sales/api/quotes/accept/route.js.map +2 -2
- package/dist/modules/sales/api/quotes/convert/route.js +3 -1
- package/dist/modules/sales/api/quotes/convert/route.js.map +2 -2
- package/dist/modules/sales/api/quotes/public/[token]/route.js +3 -1
- package/dist/modules/sales/api/quotes/public/[token]/route.js.map +2 -2
- package/dist/modules/sales/api/quotes/send/route.js +3 -1
- package/dist/modules/sales/api/quotes/send/route.js.map +2 -2
- package/dist/modules/sales/api/returns/[id]/route.js +3 -1
- package/dist/modules/sales/api/returns/[id]/route.js.map +2 -2
- package/dist/modules/sales/api/settings/document-numbers/route.js +4 -2
- package/dist/modules/sales/api/settings/document-numbers/route.js.map +2 -2
- package/dist/modules/sales/api/settings/order-editing/route.js +4 -2
- package/dist/modules/sales/api/settings/order-editing/route.js.map +2 -2
- package/dist/modules/sales/backend/sales/channels/[channelId]/edit/page.js +3 -1
- package/dist/modules/sales/backend/sales/channels/[channelId]/edit/page.js.map +2 -2
- package/dist/modules/sales/backend/sales/channels/offers/page.js +6 -4
- package/dist/modules/sales/backend/sales/channels/offers/page.js.map +2 -2
- package/dist/modules/sales/backend/sales/channels/page.js +4 -2
- package/dist/modules/sales/backend/sales/channels/page.js.map +2 -2
- package/dist/modules/sales/backend/sales/documents/[id]/page.js +20 -18
- package/dist/modules/sales/backend/sales/documents/[id]/page.js.map +2 -2
- package/dist/modules/sales/commands/documents.js +4 -8
- package/dist/modules/sales/commands/documents.js.map +2 -2
- package/dist/modules/sales/commands/payments.js +3 -1
- package/dist/modules/sales/commands/payments.js.map +2 -2
- package/dist/modules/sales/commands/shipments.js +3 -1
- package/dist/modules/sales/commands/shipments.js.map +2 -2
- package/dist/modules/sales/components/AdjustmentKindSettings.js +5 -3
- package/dist/modules/sales/components/AdjustmentKindSettings.js.map +2 -2
- package/dist/modules/sales/components/DocumentNumberSettings.js +4 -2
- package/dist/modules/sales/components/DocumentNumberSettings.js.map +2 -2
- package/dist/modules/sales/components/OrderEditingSettings.js +4 -2
- package/dist/modules/sales/components/OrderEditingSettings.js.map +2 -2
- package/dist/modules/sales/components/PaymentMethodsSettings.js +5 -3
- package/dist/modules/sales/components/PaymentMethodsSettings.js.map +2 -2
- package/dist/modules/sales/components/ShippingMethodsSettings.js +5 -3
- package/dist/modules/sales/components/ShippingMethodsSettings.js.map +2 -2
- package/dist/modules/sales/components/StatusSettings.js +5 -3
- package/dist/modules/sales/components/StatusSettings.js.map +2 -2
- package/dist/modules/sales/components/TaxRatesSettings.js +5 -3
- package/dist/modules/sales/components/TaxRatesSettings.js.map +2 -2
- package/dist/modules/sales/components/channels/ChannelOfferForm.js +16 -14
- package/dist/modules/sales/components/channels/ChannelOfferForm.js.map +2 -2
- package/dist/modules/sales/components/channels/SalesChannelOffersPanel.js +4 -2
- package/dist/modules/sales/components/channels/SalesChannelOffersPanel.js.map +2 -2
- package/dist/modules/sales/components/documents/AddressesSection.js +5 -3
- package/dist/modules/sales/components/documents/AddressesSection.js.map +2 -2
- package/dist/modules/sales/components/documents/AdjustmentDialog.js +3 -1
- package/dist/modules/sales/components/documents/AdjustmentDialog.js.map +2 -2
- package/dist/modules/sales/components/documents/AdjustmentsSection.js +5 -3
- package/dist/modules/sales/components/documents/AdjustmentsSection.js.map +2 -2
- package/dist/modules/sales/components/documents/ItemsSection.js +6 -4
- package/dist/modules/sales/components/documents/ItemsSection.js.map +2 -2
- package/dist/modules/sales/components/documents/LineItemDialog.js +8 -6
- package/dist/modules/sales/components/documents/LineItemDialog.js.map +2 -2
- package/dist/modules/sales/components/documents/PaymentDialog.js +5 -3
- package/dist/modules/sales/components/documents/PaymentDialog.js.map +2 -2
- package/dist/modules/sales/components/documents/PaymentsSection.js +4 -2
- package/dist/modules/sales/components/documents/PaymentsSection.js.map +2 -2
- package/dist/modules/sales/components/documents/SalesDocumentForm.js +14 -12
- package/dist/modules/sales/components/documents/SalesDocumentForm.js.map +2 -2
- package/dist/modules/sales/components/documents/SalesDocumentsTable.js +5 -3
- package/dist/modules/sales/components/documents/SalesDocumentsTable.js.map +2 -2
- package/dist/modules/sales/components/documents/ShipmentDialog.js +9 -7
- package/dist/modules/sales/components/documents/ShipmentDialog.js.map +2 -2
- package/dist/modules/sales/components/documents/ShipmentsSection.js +4 -2
- package/dist/modules/sales/components/documents/ShipmentsSection.js.map +2 -2
- package/dist/modules/sales/frontend/quote/[token]/page.js +4 -2
- package/dist/modules/sales/frontend/quote/[token]/page.js.map +2 -2
- package/dist/modules/sales/seed/examples.js +7 -9
- package/dist/modules/sales/seed/examples.js.map +2 -2
- package/dist/modules/sales/subscribers/quote-expiring-notification.js +3 -1
- package/dist/modules/sales/subscribers/quote-expiring-notification.js.map +2 -2
- package/dist/modules/sales/subscribers/reconcileOnAddressDelete.js +3 -1
- package/dist/modules/sales/subscribers/reconcileOnAddressDelete.js.map +2 -2
- package/dist/modules/sales/subscribers/reconcileOnCompanyDelete.js +3 -1
- package/dist/modules/sales/subscribers/reconcileOnCompanyDelete.js.map +2 -2
- package/dist/modules/sales/subscribers/reconcileOnCustomerDelete.js +3 -1
- package/dist/modules/sales/subscribers/reconcileOnCustomerDelete.js.map +2 -2
- package/dist/modules/sales/widgets/dashboard/makeDashboardWidgetRoute.js +5 -3
- package/dist/modules/sales/widgets/dashboard/makeDashboardWidgetRoute.js.map +2 -2
- package/dist/modules/sales/widgets/dashboard/new-orders/widget.client.js +3 -1
- package/dist/modules/sales/widgets/dashboard/new-orders/widget.client.js.map +2 -2
- package/dist/modules/sales/widgets/dashboard/new-quotes/widget.client.js +3 -1
- package/dist/modules/sales/widgets/dashboard/new-quotes/widget.client.js.map +2 -2
- package/dist/modules/shipping_carriers/api/tracking/route.js +5 -0
- package/dist/modules/shipping_carriers/api/tracking/route.js.map +2 -2
- package/dist/modules/shipping_carriers/api/webhook/[provider]/route.js +3 -1
- package/dist/modules/shipping_carriers/api/webhook/[provider]/route.js.map +2 -2
- package/dist/modules/shipping_carriers/lib/shipping-service.js +41 -19
- package/dist/modules/shipping_carriers/lib/shipping-service.js.map +2 -2
- package/dist/modules/shipping_carriers/lib/upstream-error-response.js +3 -1
- package/dist/modules/shipping_carriers/lib/upstream-error-response.js.map +2 -2
- package/dist/modules/shipping_carriers/workers/webhook-processor.js +3 -5
- package/dist/modules/shipping_carriers/workers/webhook-processor.js.map +2 -2
- package/dist/modules/staff/api/comments.js +3 -1
- package/dist/modules/staff/api/comments.js.map +2 -2
- package/dist/modules/staff/api/leave-requests/accept/route.js +3 -1
- package/dist/modules/staff/api/leave-requests/accept/route.js.map +2 -2
- package/dist/modules/staff/api/leave-requests/reject/route.js +3 -1
- package/dist/modules/staff/api/leave-requests/reject/route.js.map +2 -2
- package/dist/modules/staff/api/team-members/assignable/route.js +3 -1
- package/dist/modules/staff/api/team-members/assignable/route.js.map +2 -2
- package/dist/modules/staff/api/team-members/self/route.js +4 -2
- package/dist/modules/staff/api/team-members/self/route.js.map +2 -2
- package/dist/modules/staff/api/team-members/tags/assign/route.js +3 -1
- package/dist/modules/staff/api/team-members/tags/assign/route.js.map +2 -2
- package/dist/modules/staff/api/team-members/tags/unassign/route.js +3 -1
- package/dist/modules/staff/api/team-members/tags/unassign/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/my-projects/[projectId]/route.js +3 -1
- package/dist/modules/staff/api/timesheets/my-projects/[projectId]/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/my-projects/route.js +3 -1
- package/dist/modules/staff/api/timesheets/my-projects/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/projects/kpis/route.js +3 -1
- package/dist/modules/staff/api/timesheets/projects/kpis/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/[id]/segments/route.js +3 -1
- package/dist/modules/staff/api/timesheets/time-entries/[id]/segments/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/[id]/timer-start/route.js +4 -2
- package/dist/modules/staff/api/timesheets/time-entries/[id]/timer-start/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/[id]/timer-stop/route.js +4 -2
- package/dist/modules/staff/api/timesheets/time-entries/[id]/timer-stop/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/bulk/route.js +3 -1
- package/dist/modules/staff/api/timesheets/time-entries/bulk/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/start-timer/route.js +3 -1
- package/dist/modules/staff/api/timesheets/time-entries/start-timer/route.js.map +2 -2
- package/dist/modules/staff/backend/staff/team-members/page.js +4 -2
- package/dist/modules/staff/backend/staff/team-members/page.js.map +2 -2
- package/dist/modules/staff/backend/staff/team-roles/page.js +4 -2
- package/dist/modules/staff/backend/staff/team-roles/page.js.map +2 -2
- package/dist/modules/staff/backend/staff/teams/[id]/edit/page.js +4 -2
- package/dist/modules/staff/backend/staff/teams/[id]/edit/page.js.map +2 -2
- package/dist/modules/staff/backend/staff/teams/page.js +4 -2
- package/dist/modules/staff/backend/staff/teams/page.js.map +2 -2
- package/dist/modules/staff/backend/staff/timesheets/page.js +7 -5
- package/dist/modules/staff/backend/staff/timesheets/page.js.map +2 -2
- package/dist/modules/staff/backend/staff/timesheets/projects/[id]/page.js +3 -1
- package/dist/modules/staff/backend/staff/timesheets/projects/[id]/page.js.map +2 -2
- package/dist/modules/staff/backend/staff/timesheets/projects/page.js +4 -2
- package/dist/modules/staff/backend/staff/timesheets/projects/page.js.map +2 -2
- package/dist/modules/staff/commands/timesheets-entries.js +3 -1
- package/dist/modules/staff/commands/timesheets-entries.js.map +2 -2
- package/dist/modules/staff/widgets/dashboard/timesheets-hours-by-project/widget.client.js +3 -1
- package/dist/modules/staff/widgets/dashboard/timesheets-hours-by-project/widget.client.js.map +2 -2
- package/dist/modules/staff/widgets/dashboard/timesheets-time-reporting/widget.client.js +5 -3
- package/dist/modules/staff/widgets/dashboard/timesheets-time-reporting/widget.client.js.map +2 -2
- package/dist/modules/sync_excel/api/import/route.js +3 -1
- package/dist/modules/sync_excel/api/import/route.js.map +2 -2
- package/dist/modules/translations/api/[entityType]/[entityId]/route.js +5 -3
- package/dist/modules/translations/api/[entityType]/[entityId]/route.js.map +2 -2
- package/dist/modules/translations/api/get/locales.js +3 -1
- package/dist/modules/translations/api/get/locales.js.map +2 -2
- package/dist/modules/translations/api/put/locales.js +3 -1
- package/dist/modules/translations/api/put/locales.js.map +2 -2
- package/dist/modules/translations/components/TranslationManager.js +3 -1
- package/dist/modules/translations/components/TranslationManager.js.map +2 -2
- package/dist/modules/translations/subscribers/cleanup.js +3 -1
- package/dist/modules/translations/subscribers/cleanup.js.map +2 -2
- package/dist/modules/workflows/api/definitions/[id]/customize/route.js +4 -2
- package/dist/modules/workflows/api/definitions/[id]/customize/route.js.map +2 -2
- package/dist/modules/workflows/api/definitions/[id]/reset-to-code/route.js +4 -2
- package/dist/modules/workflows/api/definitions/[id]/reset-to-code/route.js.map +2 -2
- package/dist/modules/workflows/api/definitions/[id]/route.js +6 -4
- package/dist/modules/workflows/api/definitions/[id]/route.js.map +2 -2
- package/dist/modules/workflows/api/definitions/route.js +4 -2
- package/dist/modules/workflows/api/definitions/route.js.map +2 -2
- package/dist/modules/workflows/api/events/[id]/route.js +3 -1
- package/dist/modules/workflows/api/events/[id]/route.js.map +2 -2
- package/dist/modules/workflows/api/events/route.js +3 -1
- package/dist/modules/workflows/api/events/route.js.map +2 -2
- package/dist/modules/workflows/api/instances/[id]/advance/route.js +3 -1
- package/dist/modules/workflows/api/instances/[id]/advance/route.js.map +2 -2
- package/dist/modules/workflows/api/instances/[id]/cancel/route.js +3 -1
- package/dist/modules/workflows/api/instances/[id]/cancel/route.js.map +2 -2
- package/dist/modules/workflows/api/instances/[id]/events/route.js +3 -1
- package/dist/modules/workflows/api/instances/[id]/events/route.js.map +2 -2
- package/dist/modules/workflows/api/instances/[id]/retry/route.js +3 -1
- package/dist/modules/workflows/api/instances/[id]/retry/route.js.map +2 -2
- package/dist/modules/workflows/api/instances/[id]/route.js +3 -1
- package/dist/modules/workflows/api/instances/[id]/route.js.map +2 -2
- package/dist/modules/workflows/api/instances/[id]/signal/route.js +5 -7
- package/dist/modules/workflows/api/instances/[id]/signal/route.js.map +2 -2
- package/dist/modules/workflows/api/instances/route.js +5 -3
- package/dist/modules/workflows/api/instances/route.js.map +2 -2
- package/dist/modules/workflows/api/instances/validate-start/route.js +3 -1
- package/dist/modules/workflows/api/instances/validate-start/route.js.map +2 -2
- package/dist/modules/workflows/api/signals/route.js +3 -1
- package/dist/modules/workflows/api/signals/route.js.map +2 -2
- package/dist/modules/workflows/api/tasks/[id]/claim/route.js +3 -1
- package/dist/modules/workflows/api/tasks/[id]/claim/route.js.map +2 -2
- package/dist/modules/workflows/api/tasks/[id]/complete/route.js +3 -1
- package/dist/modules/workflows/api/tasks/[id]/complete/route.js.map +2 -2
- package/dist/modules/workflows/api/tasks/[id]/route.js +3 -1
- package/dist/modules/workflows/api/tasks/[id]/route.js.map +2 -2
- package/dist/modules/workflows/api/tasks/route.js +3 -1
- package/dist/modules/workflows/api/tasks/route.js.map +2 -2
- package/dist/modules/workflows/backend/definitions/visual-editor/page.js +4 -2
- package/dist/modules/workflows/backend/definitions/visual-editor/page.js.map +2 -2
- package/dist/modules/workflows/backend/instances/[id]/page.js +5 -3
- package/dist/modules/workflows/backend/instances/[id]/page.js.map +2 -2
- package/dist/modules/workflows/backend/tasks/[id]/page.js +3 -1
- package/dist/modules/workflows/backend/tasks/[id]/page.js.map +2 -2
- package/dist/modules/workflows/components/BusinessRulesSelector.js +5 -3
- package/dist/modules/workflows/components/BusinessRulesSelector.js.map +2 -2
- package/dist/modules/workflows/components/WorkflowSelector.js +5 -3
- package/dist/modules/workflows/components/WorkflowSelector.js.map +2 -2
- package/dist/modules/workflows/components/fields/BusinessRuleConditionsEditor.js +3 -1
- package/dist/modules/workflows/components/fields/BusinessRuleConditionsEditor.js.map +2 -2
- package/dist/modules/workflows/components/fields/StartPreConditionsEditor.js +3 -1
- package/dist/modules/workflows/components/fields/StartPreConditionsEditor.js.map +2 -2
- package/dist/modules/workflows/components/fields/WorkflowSelectorField.js +3 -1
- package/dist/modules/workflows/components/fields/WorkflowSelectorField.js.map +2 -2
- package/dist/modules/workflows/frontend/checkout-demo/page.js +8 -7
- package/dist/modules/workflows/frontend/checkout-demo/page.js.map +2 -2
- package/dist/modules/workflows/lib/activity-executor.js +25 -21
- package/dist/modules/workflows/lib/activity-executor.js.map +2 -2
- package/dist/modules/workflows/lib/activity-worker-handler.js +8 -15
- package/dist/modules/workflows/lib/activity-worker-handler.js.map +2 -2
- package/dist/modules/workflows/lib/code-registry.js +7 -7
- package/dist/modules/workflows/lib/code-registry.js.map +2 -2
- package/dist/modules/workflows/lib/compensation-handler.js +4 -2
- package/dist/modules/workflows/lib/compensation-handler.js.map +2 -2
- package/dist/modules/workflows/lib/edgeFormTransforms.js +3 -1
- package/dist/modules/workflows/lib/edgeFormTransforms.js.map +2 -2
- package/dist/modules/workflows/lib/event-trigger-service.js +5 -3
- package/dist/modules/workflows/lib/event-trigger-service.js.map +2 -2
- package/dist/modules/workflows/lib/nodeFormTransforms.js +3 -1
- package/dist/modules/workflows/lib/nodeFormTransforms.js.map +2 -2
- package/dist/modules/workflows/lib/seeds.js +16 -2
- package/dist/modules/workflows/lib/seeds.js.map +2 -2
- package/dist/modules/workflows/lib/signal-handler.js +3 -1
- package/dist/modules/workflows/lib/signal-handler.js.map +2 -2
- package/dist/modules/workflows/lib/start-validator.js +9 -3
- package/dist/modules/workflows/lib/start-validator.js.map +2 -2
- package/dist/modules/workflows/lib/step-handler.js +3 -1
- package/dist/modules/workflows/lib/step-handler.js.map +2 -2
- package/dist/modules/workflows/lib/task-handler.js +3 -1
- package/dist/modules/workflows/lib/task-handler.js.map +2 -2
- package/dist/modules/workflows/lib/transition-handler.js +5 -3
- package/dist/modules/workflows/lib/transition-handler.js.map +2 -2
- package/dist/modules/workflows/lib/workflow-executor.js +27 -15
- package/dist/modules/workflows/lib/workflow-executor.js.map +2 -2
- package/dist/modules/workflows/subscribers/event-trigger.js +21 -18
- package/dist/modules/workflows/subscribers/event-trigger.js.map +2 -2
- package/dist/modules/workflows/subscribers/task-assigned-notification.js +3 -1
- package/dist/modules/workflows/subscribers/task-assigned-notification.js.map +2 -2
- package/dist/modules/workflows/workers/workflow-activities.worker.js +30 -20
- package/dist/modules/workflows/workers/workflow-activities.worker.js.map +2 -2
- package/package.json +7 -7
- package/src/bootstrap.ts +14 -11
- package/src/helpers/integration/queue-runner.ts +2 -2
- package/src/modules/api_keys/services/apiKeyService.ts +6 -3
- package/src/modules/attachments/api/image/[id]/[[...slug]]/route.ts +5 -2
- package/src/modules/attachments/api/library/[id]/route.ts +4 -1
- package/src/modules/attachments/api/route.ts +9 -6
- package/src/modules/attachments/components/AttachmentPartitionSettings.tsx +6 -3
- package/src/modules/attachments/lib/assignmentDetails.ts +4 -1
- package/src/modules/attachments/lib/drivers/driverFactory.ts +4 -1
- package/src/modules/attachments/lib/ocrQueue.ts +11 -11
- package/src/modules/attachments/lib/ocrService.ts +7 -4
- package/src/modules/audit_logs/api/audit-logs/actions/redo/route.ts +4 -1
- package/src/modules/audit_logs/api/audit-logs/actions/undo/route.ts +4 -1
- package/src/modules/audit_logs/backend/audit-logs/page.tsx +4 -1
- package/src/modules/audit_logs/components/AuditLogsActions.tsx +5 -2
- package/src/modules/audit_logs/services/accessLogService.ts +5 -4
- package/src/modules/audit_logs/services/actionLogService.ts +5 -2
- package/src/modules/auth/api/profile/route.ts +5 -2
- package/src/modules/auth/api/reset/confirm.ts +4 -1
- package/src/modules/auth/api/reset.ts +5 -2
- package/src/modules/auth/api/roles/route.ts +4 -1
- package/src/modules/auth/api/sidebar/variants/route.ts +4 -2
- package/src/modules/auth/api/users/resend-invite/route.ts +5 -2
- package/src/modules/auth/api/users/route.ts +4 -1
- package/src/modules/auth/backend/auth/profile/page.tsx +4 -1
- package/src/modules/auth/backend/profile/change-password/page.tsx +4 -1
- package/src/modules/auth/backend/users/[id]/edit/page.tsx +6 -3
- package/src/modules/auth/backend/users/create/page.tsx +5 -2
- package/src/modules/auth/cli.ts +10 -0
- package/src/modules/auth/commands/users.ts +5 -2
- package/src/modules/auth/lib/consentIntegrity.ts +4 -4
- package/src/modules/auth/lib/setup-app.ts +10 -10
- package/src/modules/auth/lib/tenantAccess.ts +4 -1
- package/src/modules/auth/lib/tokenHash.ts +4 -4
- package/src/modules/business_rules/api/rules/route.ts +5 -2
- package/src/modules/business_rules/lib/expression-evaluator.ts +8 -6
- package/src/modules/business_rules/lib/rule-engine.ts +6 -3
- package/src/modules/business_rules/lib/rule-evaluator.ts +11 -11
- package/src/modules/business_rules/subscribers/crud-rule-trigger.ts +4 -1
- package/src/modules/business_rules/subscribers/rule-execution-failed-notification.ts +4 -1
- package/src/modules/catalog/ai-agents-context.ts +5 -5
- package/src/modules/catalog/ai-tools/_shared.ts +4 -1
- package/src/modules/catalog/ai-tools/authoring-pack.ts +4 -1
- package/src/modules/catalog/ai-tools/merchandising-pack.ts +4 -1
- package/src/modules/catalog/api/dictionaries/[key]/route.ts +4 -1
- package/src/modules/catalog/api/prices/route.ts +4 -1
- package/src/modules/catalog/api/products/route.ts +6 -3
- package/src/modules/catalog/api/settings/route.ts +5 -2
- package/src/modules/catalog/backend/catalog/products/[id]/page.tsx +15 -12
- package/src/modules/catalog/backend/catalog/products/[productId]/variants/[variantId]/page.tsx +9 -6
- package/src/modules/catalog/backend/catalog/products/[productId]/variants/create/page.tsx +6 -3
- package/src/modules/catalog/backend/catalog/products/create/page.tsx +6 -6
- package/src/modules/catalog/backend/catalog/products/optionSchemaClient.ts +4 -1
- package/src/modules/catalog/components/PriceKindSettings.tsx +6 -3
- package/src/modules/catalog/components/UnitPriceDisplaySettings.tsx +5 -2
- package/src/modules/catalog/inbox-actions.ts +5 -2
- package/src/modules/catalog/seed/examples.ts +5 -5
- package/src/modules/catalog/subscribers/low-stock-notification.ts +4 -1
- package/src/modules/catalog/widgets/injection/product-seo/state.ts +4 -1
- package/src/modules/communication_channels/api/get/oauth/[provider]/callback/route.ts +13 -13
- package/src/modules/communication_channels/api/post/channels/[id]/import-history/route.ts +4 -1
- package/src/modules/communication_channels/api/post/channels/[id]/push/register/route.ts +4 -1
- package/src/modules/communication_channels/api/post/webhook/[provider]/route.ts +6 -3
- package/src/modules/communication_channels/api/post/webhooks/gmail/route.ts +7 -6
- package/src/modules/communication_channels/commands/connect-credential-channel.ts +5 -10
- package/src/modules/communication_channels/commands/delete-channel.ts +4 -5
- package/src/modules/communication_channels/commands/deliver-outbound-message.ts +5 -5
- package/src/modules/communication_channels/commands/disconnect-channel.ts +4 -5
- package/src/modules/communication_channels/commands/ingest-inbound-message.ts +6 -12
- package/src/modules/communication_channels/commands/push-unregister.ts +4 -3
- package/src/modules/communication_channels/commands/reassign-conversation.ts +6 -3
- package/src/modules/communication_channels/lib/dead-letter.ts +4 -5
- package/src/modules/communication_channels/lib/email-mime.ts +5 -6
- package/src/modules/communication_channels/lib/oauth-client-config.ts +7 -3
- package/src/modules/communication_channels/lib/send-as-user.ts +4 -1
- package/src/modules/communication_channels/lib/thread-token.ts +5 -2
- package/src/modules/communication_channels/setup.ts +4 -4
- package/src/modules/communication_channels/workers/channel-import-history.ts +5 -8
- package/src/modules/communication_channels/workers/gmail-history-sync.ts +9 -18
- package/src/modules/communication_channels/workers/gmail-renew-watch.ts +6 -9
- package/src/modules/communication_channels/workers/outbound-delivery.ts +7 -12
- package/src/modules/communication_channels/workers/poll-channel.ts +8 -15
- package/src/modules/communication_channels/workers/poll-tick.ts +6 -6
- package/src/modules/communication_channels/workers/reaction-processor.ts +6 -9
- package/src/modules/configs/api/cache/route.ts +5 -2
- package/src/modules/configs/api/system-status/route.ts +5 -2
- package/src/modules/configs/api/upgrade-actions/route.ts +5 -2
- package/src/modules/configs/components/ModuleTelemetryPanel.tsx +4 -1
- package/src/modules/configs/lib/touchGeneratedBarrels.ts +1 -1
- package/src/modules/configs/services/upgradeActionsService.ts +7 -3
- package/src/modules/currencies/components/CurrencyFetchingConfig.tsx +4 -1
- package/src/modules/currencies/lib/exchangeRateFormConfig.ts +4 -1
- package/src/modules/currencies/services/providers/nbp.ts +7 -4
- package/src/modules/currencies/services/providers/raiffeisen.ts +8 -7
- package/src/modules/customer_accounts/api/domain-resolve/all.ts +7 -5
- package/src/modules/customer_accounts/api/signup.ts +5 -2
- package/src/modules/customer_accounts/lib/customerAuthServer.ts +4 -1
- package/src/modules/customer_accounts/subscribers/autoLinkCrm.ts +4 -1
- package/src/modules/customer_accounts/subscribers/autoLinkCrmReverse.ts +4 -1
- package/src/modules/customer_accounts/subscribers/unlinkOnCompanyDelete.ts +4 -1
- package/src/modules/customer_accounts/subscribers/unlinkOnPersonDelete.ts +4 -1
- package/src/modules/customers/ai-agents-context.ts +5 -5
- package/src/modules/customers/api/activities/route.ts +7 -4
- package/src/modules/customers/api/comments/route.ts +4 -1
- package/src/modules/customers/api/companies/[id]/people/route.ts +4 -1
- package/src/modules/customers/api/companies/[id]/route.ts +6 -3
- package/src/modules/customers/api/companies/route.ts +6 -3
- package/src/modules/customers/api/dashboard/widgets/customer-todos/route.ts +4 -1
- package/src/modules/customers/api/dashboard/widgets/new-customers/route.ts +4 -1
- package/src/modules/customers/api/dashboard/widgets/new-deals/route.ts +4 -1
- package/src/modules/customers/api/dashboard/widgets/next-interactions/route.ts +4 -1
- package/src/modules/customers/api/deals/[id]/companies/route.ts +4 -1
- package/src/modules/customers/api/deals/[id]/people/route.ts +4 -1
- package/src/modules/customers/api/deals/aggregate/route.ts +4 -1
- package/src/modules/customers/api/deals/bulk-update-owner/route.ts +8 -5
- package/src/modules/customers/api/deals/bulk-update-stage/route.ts +8 -5
- package/src/modules/customers/api/deals/route.ts +4 -1
- package/src/modules/customers/api/deals/summary/route.ts +4 -1
- package/src/modules/customers/api/dictionaries/[kind]/[id]/route.ts +5 -2
- package/src/modules/customers/api/dictionaries/[kind]/route.ts +6 -3
- package/src/modules/customers/api/dictionaries/cache.ts +4 -1
- package/src/modules/customers/api/dictionaries/context.ts +4 -1
- package/src/modules/customers/api/dictionaries/currency/route.ts +4 -1
- package/src/modules/customers/api/dictionaries/kind-settings/route.ts +5 -2
- package/src/modules/customers/api/entity-roles-factory.ts +8 -5
- package/src/modules/customers/api/interactions/cancel/route.ts +4 -1
- package/src/modules/customers/api/interactions/complete/route.ts +4 -1
- package/src/modules/customers/api/interactions/conflicts/route.ts +4 -1
- package/src/modules/customers/api/interactions/counts/route.ts +4 -1
- package/src/modules/customers/api/interactions/route.ts +8 -4
- package/src/modules/customers/api/interactions/tasks/route.ts +4 -1
- package/src/modules/customers/api/labels/assign/route.ts +4 -1
- package/src/modules/customers/api/labels/route.ts +7 -3
- package/src/modules/customers/api/labels/unassign/route.ts +4 -1
- package/src/modules/customers/api/people/[id]/companies/enriched/route.ts +4 -1
- package/src/modules/customers/api/people/[id]/route.ts +6 -3
- package/src/modules/customers/api/people/route.ts +6 -3
- package/src/modules/customers/api/pipeline-stages/reorder/route.ts +4 -1
- package/src/modules/customers/api/pipeline-stages/route.ts +7 -4
- package/src/modules/customers/api/pipelines/route.ts +7 -4
- package/src/modules/customers/api/settings/address-format/route.ts +5 -2
- package/src/modules/customers/api/settings/dictionary-sort-modes/route.ts +5 -2
- package/src/modules/customers/api/settings/stuck-threshold/route.ts +5 -2
- package/src/modules/customers/api/tags/assign/route.ts +4 -1
- package/src/modules/customers/api/tags/unassign/route.ts +4 -1
- package/src/modules/customers/api/todos/route.ts +7 -4
- package/src/modules/customers/backend/customers/companies-v2/[id]/page.tsx +6 -3
- package/src/modules/customers/backend/customers/deals/[id]/hooks/useDealActivities.ts +4 -1
- package/src/modules/customers/backend/customers/deals/[id]/hooks/useDealClosure.ts +4 -1
- package/src/modules/customers/backend/customers/deals/map/components/DealsMapCanvasImpl.tsx +5 -3
- package/src/modules/customers/backend/customers/deals/page.tsx +5 -2
- package/src/modules/customers/backend/customers/people-v2/[id]/page.tsx +6 -3
- package/src/modules/customers/commands/deals.ts +4 -1
- package/src/modules/customers/commands/dictionaries.ts +4 -1
- package/src/modules/customers/commands/interactions.ts +5 -2
- package/src/modules/customers/commands/shared.ts +5 -2
- package/src/modules/customers/commands/todos.ts +4 -1
- package/src/modules/customers/components/DictionarySettings.tsx +6 -3
- package/src/modules/customers/components/DictionarySortSettings.tsx +4 -1
- package/src/modules/customers/components/detail/ActivitiesCard.tsx +4 -1
- package/src/modules/customers/components/detail/ActivitiesDayStrip.tsx +4 -1
- package/src/modules/customers/components/detail/ActivitiesSection.tsx +7 -4
- package/src/modules/customers/components/detail/ActivityCard.tsx +4 -1
- package/src/modules/customers/components/detail/ChangelogTab.tsx +4 -1
- package/src/modules/customers/components/detail/CompanyCard.tsx +4 -1
- package/src/modules/customers/components/detail/ConfirmDealLostDialog.tsx +4 -1
- package/src/modules/customers/components/detail/EntityTagsDialog.tsx +4 -1
- package/src/modules/customers/components/detail/InlineActivityComposer.tsx +4 -1
- package/src/modules/customers/components/detail/ManageTagsDialog.tsx +4 -1
- package/src/modules/customers/components/detail/RoleAssignmentRow.tsx +6 -3
- package/src/modules/customers/components/detail/RolesSection.tsx +5 -2
- package/src/modules/customers/components/detail/hooks/useInteractionMutations.ts +6 -3
- package/src/modules/customers/components/linking/LinkEntityDialog.tsx +5 -2
- package/src/modules/customers/inbox-actions.ts +4 -1
- package/src/modules/customers/lib/bulkDeals.ts +4 -1
- package/src/modules/customers/lib/dealClosureNotification.ts +5 -2
- package/src/modules/customers/lib/dealStageTransitionTable.ts +4 -1
- package/src/modules/customers/lib/interactionFeatureFlags.ts +5 -1
- package/src/modules/customers/lib/todoCompatibility.ts +4 -1
- package/src/modules/customers/search.ts +15 -7
- package/src/modules/customers/widgets/dashboard/customer-todos/widget.client.tsx +4 -1
- package/src/modules/customers/widgets/dashboard/new-customers/widget.client.tsx +4 -1
- package/src/modules/customers/widgets/dashboard/new-deals/widget.client.tsx +4 -1
- package/src/modules/customers/widgets/dashboard/next-interactions/widget.client.tsx +4 -1
- package/src/modules/dashboards/api/widgets/data/batch/route.ts +4 -1
- package/src/modules/dashboards/api/widgets/data/route.ts +4 -1
- package/src/modules/dashboards/components/WidgetVisibilityEditor.tsx +6 -3
- package/src/modules/dashboards/widgets/dashboard/aov-kpi/widget.client.tsx +4 -1
- package/src/modules/dashboards/widgets/dashboard/new-customers-kpi/widget.client.tsx +4 -1
- package/src/modules/dashboards/widgets/dashboard/orders-by-status/widget.client.tsx +4 -1
- package/src/modules/dashboards/widgets/dashboard/orders-kpi/widget.client.tsx +4 -1
- package/src/modules/dashboards/widgets/dashboard/pipeline-summary/widget.client.tsx +4 -1
- package/src/modules/dashboards/widgets/dashboard/revenue-kpi/widget.client.tsx +4 -1
- package/src/modules/dashboards/widgets/dashboard/revenue-trend/widget.client.tsx +4 -1
- package/src/modules/dashboards/widgets/dashboard/sales-by-region/widget.client.tsx +4 -1
- package/src/modules/dashboards/widgets/dashboard/top-customers/widget.client.tsx +4 -1
- package/src/modules/dashboards/widgets/dashboard/top-products/widget.client.tsx +4 -1
- package/src/modules/data_sync/api/run.ts +4 -1
- package/src/modules/data_sync/backend/data-sync/runs/[id]/page.tsx +3 -1
- package/src/modules/data_sync/lib/adapter-registry.ts +16 -4
- package/src/modules/data_sync/lib/sync-engine.ts +31 -2
- package/src/modules/data_sync/workers/sync-export.ts +4 -1
- package/src/modules/data_sync/workers/sync-import.ts +4 -1
- package/src/modules/dictionaries/api/[dictionaryId]/entries/[entryId]/route.ts +5 -2
- package/src/modules/dictionaries/api/[dictionaryId]/entries/reorder/route.ts +4 -1
- package/src/modules/dictionaries/api/[dictionaryId]/entries/route.ts +5 -2
- package/src/modules/dictionaries/api/[dictionaryId]/entries/set-default/route.ts +4 -1
- package/src/modules/dictionaries/api/[dictionaryId]/route.ts +6 -3
- package/src/modules/dictionaries/api/context.ts +4 -1
- package/src/modules/dictionaries/api/route.ts +5 -2
- package/src/modules/dictionaries/components/DictionariesManager.tsx +6 -3
- package/src/modules/dictionaries/components/DictionaryEntriesEditor.tsx +5 -2
- package/src/modules/dictionaries/components/DictionaryEntrySelect.tsx +5 -2
- package/src/modules/dictionaries/components/DictionarySelectControl.tsx +4 -1
- package/src/modules/dictionaries/fields/dictionary.tsx +4 -1
- package/src/modules/directory/api/organization-branding/route.ts +4 -1
- package/src/modules/directory/api/organization-switcher/route.ts +4 -1
- package/src/modules/directory/commands/tenants.ts +6 -3
- package/src/modules/directory/utils/organizationScope.ts +7 -4
- package/src/modules/entities/api/definitions.cache.ts +4 -1
- package/src/modules/entities/api/definitions.ts +8 -5
- package/src/modules/entities/api/records.ts +5 -2
- package/src/modules/entities/components/EncryptionManager.tsx +4 -1
- package/src/modules/entities/lib/makeActivityRoute.ts +4 -1
- package/src/modules/feature_toggles/api/overrides/route.ts +4 -1
- package/src/modules/feature_toggles/lib/feature-flag-check.ts +6 -9
- package/src/modules/inbox_ops/api/emails/[id]/reprocess/route.ts +5 -2
- package/src/modules/inbox_ops/api/emails/[id]/route.ts +5 -2
- package/src/modules/inbox_ops/api/emails/route.ts +4 -1
- package/src/modules/inbox_ops/api/extract/route.ts +4 -1
- package/src/modules/inbox_ops/api/proposals/[id]/actions/[actionId]/route.ts +4 -1
- package/src/modules/inbox_ops/api/proposals/[id]/replies/[replyId]/send/route.ts +5 -2
- package/src/modules/inbox_ops/api/proposals/counts/route.ts +5 -2
- package/src/modules/inbox_ops/api/proposals/route.ts +4 -1
- package/src/modules/inbox_ops/api/routeHelpers.ts +4 -1
- package/src/modules/inbox_ops/api/settings/route.ts +4 -1
- package/src/modules/inbox_ops/api/webhook/inbound.ts +8 -5
- package/src/modules/inbox_ops/lib/cache.ts +5 -2
- package/src/modules/inbox_ops/lib/catalogLookup.ts +4 -1
- package/src/modules/inbox_ops/lib/eventBus.ts +4 -4
- package/src/modules/inbox_ops/lib/messagesIntegration.ts +5 -8
- package/src/modules/inbox_ops/subscribers/executionAuditor.ts +5 -1
- package/src/modules/inbox_ops/subscribers/extractionWorker.ts +11 -8
- package/src/modules/inbox_ops/subscribers/proposalNotifier.ts +4 -1
- package/src/modules/messages/api/[id]/route.ts +4 -4
- package/src/modules/messages/commands/actions.ts +4 -1
- package/src/modules/messages/components/MessagesInboxPageClient.tsx +4 -1
- package/src/modules/messages/lib/email-sender.ts +4 -7
- package/src/modules/messages/lib/message-objects-registry.ts +4 -1
- package/src/modules/messages/lib/message-types-registry.ts +4 -1
- package/src/modules/messages/workers/send-email.worker.ts +7 -4
- package/src/modules/notifications/lib/notificationMapper.ts +4 -4
- package/src/modules/notifications/lib/notificationService.ts +4 -5
- package/src/modules/notifications/subscribers/deliver-notification.ts +9 -14
- package/src/modules/payment_gateways/api/webhook/[provider]/route.ts +4 -1
- package/src/modules/perspectives/services/perspectiveService.ts +4 -3
- package/src/modules/planner/api/access.ts +4 -3
- package/src/modules/planner/api/availability-date-specific.ts +4 -1
- package/src/modules/planner/api/availability-weekly.ts +4 -1
- package/src/modules/planner/backend/planner/availability-rulesets/page.tsx +5 -2
- package/src/modules/planner/components/AvailabilityRulesEditor.tsx +4 -1
- package/src/modules/progress/api/jobs/route.ts +4 -1
- package/src/modules/query_index/components/QueryIndexesTable.tsx +6 -3
- package/src/modules/query_index/lib/batch.ts +5 -2
- package/src/modules/query_index/lib/coverage.ts +4 -1
- package/src/modules/query_index/lib/engine.ts +14 -17
- package/src/modules/query_index/lib/reindexer.ts +9 -6
- package/src/modules/query_index/lib/search-tokens.ts +4 -2
- package/src/modules/query_index/subscribers/coverage_refresh.ts +4 -1
- package/src/modules/resources/api/comments.ts +4 -1
- package/src/modules/resources/api/resources/tags/assign/route.ts +4 -1
- package/src/modules/resources/api/resources/tags/unassign/route.ts +4 -1
- package/src/modules/resources/backend/resources/resource-types/[id]/edit/page.tsx +4 -1
- package/src/modules/resources/backend/resources/resource-types/page.tsx +5 -2
- package/src/modules/resources/commands/activities.ts +5 -4
- package/src/modules/resources/commands/comments.ts +6 -4
- package/src/modules/resources/commands/shared.ts +36 -0
- package/src/modules/sales/api/channels/route.ts +4 -1
- package/src/modules/sales/api/document-history/route.ts +4 -1
- package/src/modules/sales/api/document-numbers/route.ts +4 -1
- package/src/modules/sales/api/quotes/accept/route.ts +5 -2
- package/src/modules/sales/api/quotes/convert/route.ts +4 -1
- package/src/modules/sales/api/quotes/public/[token]/route.ts +4 -1
- package/src/modules/sales/api/quotes/send/route.ts +4 -1
- package/src/modules/sales/api/returns/[id]/route.ts +4 -1
- package/src/modules/sales/api/settings/document-numbers/route.ts +5 -2
- package/src/modules/sales/api/settings/order-editing/route.ts +5 -2
- package/src/modules/sales/backend/sales/channels/[channelId]/edit/page.tsx +4 -1
- package/src/modules/sales/backend/sales/channels/offers/page.tsx +7 -4
- package/src/modules/sales/backend/sales/channels/page.tsx +5 -2
- package/src/modules/sales/backend/sales/documents/[id]/page.tsx +21 -18
- package/src/modules/sales/commands/documents.ts +5 -8
- package/src/modules/sales/commands/payments.ts +4 -1
- package/src/modules/sales/commands/shipments.ts +4 -2
- package/src/modules/sales/components/AdjustmentKindSettings.tsx +6 -3
- package/src/modules/sales/components/DocumentNumberSettings.tsx +5 -2
- package/src/modules/sales/components/OrderEditingSettings.tsx +5 -2
- package/src/modules/sales/components/PaymentMethodsSettings.tsx +6 -3
- package/src/modules/sales/components/ShippingMethodsSettings.tsx +6 -3
- package/src/modules/sales/components/StatusSettings.tsx +6 -3
- package/src/modules/sales/components/TaxRatesSettings.tsx +6 -3
- package/src/modules/sales/components/channels/ChannelOfferForm.tsx +17 -14
- package/src/modules/sales/components/channels/SalesChannelOffersPanel.tsx +5 -2
- package/src/modules/sales/components/documents/AddressesSection.tsx +6 -3
- package/src/modules/sales/components/documents/AdjustmentDialog.tsx +4 -1
- package/src/modules/sales/components/documents/AdjustmentsSection.tsx +6 -3
- package/src/modules/sales/components/documents/ItemsSection.tsx +7 -4
- package/src/modules/sales/components/documents/LineItemDialog.tsx +9 -6
- package/src/modules/sales/components/documents/PaymentDialog.tsx +6 -3
- package/src/modules/sales/components/documents/PaymentsSection.tsx +5 -2
- package/src/modules/sales/components/documents/SalesDocumentForm.tsx +15 -12
- package/src/modules/sales/components/documents/SalesDocumentsTable.tsx +6 -3
- package/src/modules/sales/components/documents/ShipmentDialog.tsx +10 -7
- package/src/modules/sales/components/documents/ShipmentsSection.tsx +5 -2
- package/src/modules/sales/frontend/quote/[token]/page.tsx +5 -2
- package/src/modules/sales/seed/examples.ts +8 -9
- package/src/modules/sales/subscribers/quote-expiring-notification.ts +4 -1
- package/src/modules/sales/subscribers/reconcileOnAddressDelete.ts +4 -1
- package/src/modules/sales/subscribers/reconcileOnCompanyDelete.ts +4 -1
- package/src/modules/sales/subscribers/reconcileOnCustomerDelete.ts +4 -1
- package/src/modules/sales/widgets/dashboard/makeDashboardWidgetRoute.ts +6 -3
- package/src/modules/sales/widgets/dashboard/new-orders/widget.client.tsx +274 -271
- package/src/modules/sales/widgets/dashboard/new-quotes/widget.client.tsx +280 -277
- package/src/modules/shipping_carriers/api/tracking/route.ts +5 -1
- package/src/modules/shipping_carriers/api/webhook/[provider]/route.ts +4 -1
- package/src/modules/shipping_carriers/lib/shipping-service.ts +47 -22
- package/src/modules/shipping_carriers/lib/upstream-error-response.ts +4 -1
- package/src/modules/shipping_carriers/workers/webhook-processor.ts +4 -5
- package/src/modules/staff/api/comments.ts +4 -1
- package/src/modules/staff/api/leave-requests/accept/route.ts +4 -1
- package/src/modules/staff/api/leave-requests/reject/route.ts +4 -1
- package/src/modules/staff/api/team-members/assignable/route.ts +4 -1
- package/src/modules/staff/api/team-members/self/route.ts +5 -2
- package/src/modules/staff/api/team-members/tags/assign/route.ts +4 -1
- package/src/modules/staff/api/team-members/tags/unassign/route.ts +4 -1
- package/src/modules/staff/api/timesheets/my-projects/[projectId]/route.ts +4 -1
- package/src/modules/staff/api/timesheets/my-projects/route.ts +4 -1
- package/src/modules/staff/api/timesheets/projects/kpis/route.ts +4 -1
- package/src/modules/staff/api/timesheets/time-entries/[id]/segments/route.ts +4 -1
- package/src/modules/staff/api/timesheets/time-entries/[id]/timer-start/route.ts +5 -2
- package/src/modules/staff/api/timesheets/time-entries/[id]/timer-stop/route.ts +5 -2
- package/src/modules/staff/api/timesheets/time-entries/bulk/route.ts +4 -1
- package/src/modules/staff/api/timesheets/time-entries/start-timer/route.ts +4 -1
- package/src/modules/staff/backend/staff/team-members/page.tsx +5 -2
- package/src/modules/staff/backend/staff/team-roles/page.tsx +5 -2
- package/src/modules/staff/backend/staff/teams/[id]/edit/page.tsx +5 -2
- package/src/modules/staff/backend/staff/teams/page.tsx +5 -2
- package/src/modules/staff/backend/staff/timesheets/page.tsx +8 -5
- package/src/modules/staff/backend/staff/timesheets/projects/[id]/page.tsx +4 -1
- package/src/modules/staff/backend/staff/timesheets/projects/page.tsx +5 -2
- package/src/modules/staff/commands/timesheets-entries.ts +4 -1
- package/src/modules/staff/widgets/dashboard/timesheets-hours-by-project/widget.client.tsx +4 -1
- package/src/modules/staff/widgets/dashboard/timesheets-time-reporting/widget.client.tsx +6 -3
- package/src/modules/sync_excel/api/import/route.ts +4 -1
- package/src/modules/translations/api/[entityType]/[entityId]/route.ts +6 -3
- package/src/modules/translations/api/get/locales.ts +4 -1
- package/src/modules/translations/api/put/locales.ts +4 -1
- package/src/modules/translations/components/TranslationManager.tsx +4 -1
- package/src/modules/translations/subscribers/cleanup.ts +4 -1
- package/src/modules/workflows/api/definitions/[id]/customize/route.ts +5 -2
- package/src/modules/workflows/api/definitions/[id]/reset-to-code/route.ts +5 -2
- package/src/modules/workflows/api/definitions/[id]/route.ts +7 -4
- package/src/modules/workflows/api/definitions/route.ts +5 -2
- package/src/modules/workflows/api/events/[id]/route.ts +4 -1
- package/src/modules/workflows/api/events/route.ts +4 -1
- package/src/modules/workflows/api/instances/[id]/advance/route.ts +4 -1
- package/src/modules/workflows/api/instances/[id]/cancel/route.ts +4 -1
- package/src/modules/workflows/api/instances/[id]/events/route.ts +4 -1
- package/src/modules/workflows/api/instances/[id]/retry/route.ts +4 -1
- package/src/modules/workflows/api/instances/[id]/route.ts +4 -1
- package/src/modules/workflows/api/instances/[id]/signal/route.ts +6 -7
- package/src/modules/workflows/api/instances/route.ts +6 -3
- package/src/modules/workflows/api/instances/validate-start/route.ts +4 -1
- package/src/modules/workflows/api/signals/route.ts +4 -1
- package/src/modules/workflows/api/tasks/[id]/claim/route.ts +4 -1
- package/src/modules/workflows/api/tasks/[id]/complete/route.ts +4 -1
- package/src/modules/workflows/api/tasks/[id]/route.ts +4 -1
- package/src/modules/workflows/api/tasks/route.ts +4 -1
- package/src/modules/workflows/backend/definitions/visual-editor/page.tsx +5 -2
- package/src/modules/workflows/backend/instances/[id]/page.tsx +6 -3
- package/src/modules/workflows/backend/tasks/[id]/page.tsx +4 -1
- package/src/modules/workflows/components/BusinessRulesSelector.tsx +6 -3
- package/src/modules/workflows/components/WorkflowSelector.tsx +6 -3
- package/src/modules/workflows/components/fields/BusinessRuleConditionsEditor.tsx +4 -1
- package/src/modules/workflows/components/fields/StartPreConditionsEditor.tsx +4 -1
- package/src/modules/workflows/components/fields/WorkflowSelectorField.tsx +4 -1
- package/src/modules/workflows/frontend/checkout-demo/page.tsx +9 -7
- package/src/modules/workflows/lib/activity-executor.ts +26 -21
- package/src/modules/workflows/lib/activity-worker-handler.ts +9 -15
- package/src/modules/workflows/lib/code-registry.ts +8 -7
- package/src/modules/workflows/lib/compensation-handler.ts +5 -2
- package/src/modules/workflows/lib/edgeFormTransforms.ts +4 -1
- package/src/modules/workflows/lib/event-trigger-service.ts +6 -3
- package/src/modules/workflows/lib/nodeFormTransforms.ts +4 -1
- package/src/modules/workflows/lib/seeds.ts +17 -2
- package/src/modules/workflows/lib/signal-handler.ts +4 -1
- package/src/modules/workflows/lib/start-validator.ts +10 -3
- package/src/modules/workflows/lib/step-handler.ts +4 -1
- package/src/modules/workflows/lib/task-handler.ts +4 -1
- package/src/modules/workflows/lib/transition-handler.ts +6 -3
- package/src/modules/workflows/lib/workflow-executor.ts +28 -15
- package/src/modules/workflows/subscribers/event-trigger.ts +22 -24
- package/src/modules/workflows/subscribers/task-assigned-notification.ts +4 -1
- package/src/modules/workflows/workers/workflow-activities.worker.ts +31 -20
|
@@ -19,6 +19,8 @@ import { useConfirmDialog } from "@open-mercato/ui/backend/confirm-dialog";
|
|
|
19
19
|
import { useGuardedMutation } from "@open-mercato/ui/backend/injection/useGuardedMutation";
|
|
20
20
|
import { useT } from "@open-mercato/shared/lib/i18n/context";
|
|
21
21
|
import { Copy, Info, RefreshCw, Trash2 } from "lucide-react";
|
|
22
|
+
import { createLogger } from "@open-mercato/shared/lib/logger";
|
|
23
|
+
const logger = createLogger("configs");
|
|
22
24
|
const API_PATH = "/api/configs/module-telemetry";
|
|
23
25
|
const HOUR_MS = 60 * 60 * 1e3;
|
|
24
26
|
const REASON_LABEL_KEYS = {
|
|
@@ -436,7 +438,7 @@ function copyRowStats(module, translate) {
|
|
|
436
438
|
navigator.clipboard.writeText(json).then(() => {
|
|
437
439
|
flash(translate("configs.moduleTelemetry.table.copySuccess", "Row stats copied to clipboard."), "success");
|
|
438
440
|
}).catch((err) => {
|
|
439
|
-
|
|
441
|
+
logger.warn("clipboard write failed", { component: "ModuleTelemetryPanel", err });
|
|
440
442
|
flash(translate("configs.moduleTelemetry.table.copyError", "Failed to copy row stats."), "error");
|
|
441
443
|
});
|
|
442
444
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/modules/configs/components/ModuleTelemetryPanel.tsx"],
|
|
4
|
-
"sourcesContent": ["\"use client\"\n\nimport * as React from 'react'\nimport { usePathname, useRouter, useSearchParams } from 'next/navigation'\nimport { Button } from '@open-mercato/ui/primitives/button'\nimport {\n SegmentedControl,\n SegmentedControlItem,\n} from '@open-mercato/ui/primitives/segmented-control'\nimport { Spinner } from '@open-mercato/ui/primitives/spinner'\nimport { StatusBadge } from '@open-mercato/ui/primitives/status-badge'\nimport { SimpleTooltip, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@open-mercato/ui/primitives/tooltip'\nimport { IconButton } from '@open-mercato/ui/primitives/icon-button'\nimport { formatAttachmentFileSize as formatBytes } from '@open-mercato/ui/backend/detail/AttachmentVisualPreview'\nimport { ErrorMessage } from '@open-mercato/ui/backend/detail'\nimport { readApiResultOrThrow } from '@open-mercato/ui/backend/utils/apiCall'\nimport { flash } from '@open-mercato/ui/backend/FlashMessages'\nimport { useConfirmDialog } from '@open-mercato/ui/backend/confirm-dialog'\nimport { useGuardedMutation } from '@open-mercato/ui/backend/injection/useGuardedMutation'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { Copy, Info, RefreshCw, Trash2 } from 'lucide-react'\nimport type {\n ModuleResourceUsageEntry,\n ModuleResourceUsageReport,\n ModuleResourceUsageTimeBucket,\n ModuleResourceUsageTimeBucketModule,\n} from '@open-mercato/shared/lib/modules/resource-usage'\n\nconst API_PATH = '/api/configs/module-telemetry'\n\ntype FetchState = {\n loading: boolean\n error: string | null\n report: ModuleTelemetryApiResponse | null\n}\n\ntype ModuleTelemetryApiResponse = ModuleResourceUsageReport & {\n canClearTelemetry?: boolean\n}\n\ntype ModuleTelemetryClearResponse = {\n cleared: boolean\n}\n\nconst HOUR_MS = 60 * 60 * 1000\n\nconst REASON_LABEL_KEYS: Record<string, string> = {\n p95_duration: 'configs.moduleTelemetry.reason.p95Duration',\n cpu: 'configs.moduleTelemetry.reason.cpu',\n heap_allocations: 'configs.moduleTelemetry.reason.heapAllocations',\n rss_growth: 'configs.moduleTelemetry.reason.rssGrowth',\n errors: 'configs.moduleTelemetry.reason.errors',\n}\n\nconst REASON_FALLBACKS: Record<string, string> = {\n p95_duration: 'Slow p95',\n cpu: 'CPU',\n heap_allocations: 'Heap',\n rss_growth: 'RSS growth',\n errors: 'Errors',\n}\n\ntype UsageRangePreset = 'today' | 'last_1h' | 'last_6h' | 'last_24h' | 'all'\n\ntype UsageRange = {\n preset: UsageRangePreset\n startMs: number\n endMs: number\n}\n\ntype RangeModuleSummary = ModuleResourceUsageTimeBucketModule & {\n stage: ModuleResourceUsageTimeBucket['stage']\n}\n\ntype RangeModuleGroup = {\n moduleId: string\n stages: RangeModuleSummary[]\n candidateReasons: string[]\n calls: number\n totalCpuMs: number\n positiveRssDeltaBytes: number\n}\n\nconst USAGE_RANGE_PRESETS: UsageRangePreset[] = ['today', 'last_1h', 'last_6h', 'last_24h', 'all']\n\nfunction formatMs(ms: number): string {\n if (!Number.isFinite(ms) || ms <= 0) return '0 ms'\n if (ms >= 1000) return `${(ms / 1000).toFixed(ms >= 10_000 ? 1 : 2)} s`\n return `${Math.round(ms)} ms`\n}\n\nfunction formatCount(value: number): string {\n return new Intl.NumberFormat().format(value)\n}\n\nfunction formatBucketInterval(ms: number | undefined): string {\n if (!ms || !Number.isFinite(ms)) return 'interval'\n if (ms >= 60 * 60 * 1000) {\n const hours = Math.round(ms / (60 * 60 * 1000))\n return `${hours}h`\n }\n const minutes = Math.round(ms / (60 * 1000))\n return `${minutes}m`\n}\n\nfunction bucketIntervalLabel(\n buckets: ModuleResourceUsageTimeBucket[],\n fallbackMs: number | undefined,\n translate: (key: string, fallback?: string, values?: Record<string, string | number>) => string,\n): string {\n const intervals = new Set(\n buckets\n .map((bucket) => bucket.bucketIntervalMs)\n .filter((value) => Number.isFinite(value) && value > 0),\n )\n if (intervals.size === 1) return formatBucketInterval(Array.from(intervals)[0])\n return formatBucketInterval(fallbackMs)\n}\n\nfunction bucketCountLabel(\n buckets: ModuleResourceUsageTimeBucket[],\n fallbackMs: number | undefined,\n translate: (key: string, fallback?: string, values?: Record<string, string | number>) => string,\n): string {\n const intervals = new Set(\n buckets\n .map((bucket) => bucket.bucketIntervalMs)\n .filter((value) => Number.isFinite(value) && value > 0),\n )\n if (intervals.size > 1) {\n return translate(\n 'configs.moduleTelemetry.overview.mixedBucketCount',\n '{{count}} buckets \u00B7 mixed intervals',\n { count: buckets.length },\n )\n }\n return translate(\n 'configs.moduleTelemetry.overview.bucketCount',\n '{{count}} {{bucketWord}} ({{interval}} interval)',\n {\n count: buckets.length,\n bucketWord: buckets.length === 1\n ? translate('configs.moduleTelemetry.overview.bucketSingular', 'bucket')\n : translate('configs.moduleTelemetry.overview.bucketPlural', 'buckets'),\n interval: bucketIntervalLabel(buckets, fallbackMs, translate),\n },\n )\n}\n\nfunction formatRangeBoundary(ms: number): string {\n return new Date(ms).toLocaleString(undefined, {\n month: 'short',\n day: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n })\n}\n\nfunction MetricTitle({\n label,\n tooltip,\n}: {\n label: string\n tooltip: string\n}) {\n return (\n <div className=\"inline-flex min-w-0 items-center gap-1.5 text-xs uppercase tracking-wide text-muted-foreground\">\n <span className=\"truncate\">{label}</span>\n <SimpleTooltip content={tooltip} side=\"top\" align=\"center\" variant=\"light\" size=\"lg\">\n <span\n className=\"inline-flex size-4 shrink-0 items-center justify-center rounded-full text-muted-foreground hover:text-foreground\"\n aria-label={tooltip}\n >\n <Info className=\"h-3.5 w-3.5\" aria-hidden=\"true\" />\n </span>\n </SimpleTooltip>\n </div>\n )\n}\n\nfunction MetricCard({\n label,\n tooltip,\n value,\n subValue,\n}: {\n label: string\n tooltip: string\n value: React.ReactNode\n subValue?: React.ReactNode\n}) {\n return (\n <div className=\"rounded-lg border bg-card p-4\">\n <MetricTitle label={label} tooltip={tooltip} />\n <div className=\"mt-2 text-2xl font-semibold\">{value}</div>\n {subValue ? <div className=\"mt-1 text-xs text-muted-foreground\">{subValue}</div> : null}\n </div>\n )\n}\n\nfunction firstBucketStartMs(buckets: ModuleResourceUsageTimeBucket[]): number | null {\n const starts = buckets\n .map((bucket) => Date.parse(bucket.bucketStart))\n .filter((value) => Number.isFinite(value))\n return starts.length ? Math.min(...starts) : null\n}\n\nfunction firstBucketEndMs(buckets: ModuleResourceUsageTimeBucket[]): number | null {\n const ends = buckets\n .map((bucket) => Date.parse(bucket.bucketEnd))\n .filter((value) => Number.isFinite(value))\n return ends.length ? Math.min(...ends) : null\n}\n\nfunction firstAvailableTelemetryMs(buckets: ModuleResourceUsageTimeBucket[], startedAtMs: number, nowMs: number): number {\n const firstBucketMs = firstBucketStartMs(buckets)\n if (firstBucketMs === null) return Number.isFinite(startedAtMs) ? startedAtMs : nowMs\n if (!Number.isFinite(startedAtMs)) return firstBucketMs\n\n const firstBucketEnd = firstBucketEndMs(buckets)\n if (firstBucketEnd !== null && firstBucketEnd > startedAtMs) return startedAtMs\n return firstBucketMs\n}\n\nfunction startOfTodayMs(nowMs: number): number {\n const date = new Date(nowMs)\n date.setHours(0, 0, 0, 0)\n return date.getTime()\n}\n\nfunction resolveUsageRange(\n preset: UsageRangePreset,\n buckets: ModuleResourceUsageTimeBucket[],\n startedAt: string,\n nowMs = Date.now(),\n): UsageRange {\n const startedAtMs = Date.parse(startedAt)\n const availableStartMs = firstAvailableTelemetryMs(buckets, startedAtMs, nowMs)\n const rawStartMs = preset === 'today'\n ? startOfTodayMs(nowMs)\n : preset === 'last_1h'\n ? nowMs - HOUR_MS\n : preset === 'last_6h'\n ? nowMs - 6 * HOUR_MS\n : preset === 'last_24h'\n ? nowMs - 24 * HOUR_MS\n : availableStartMs\n const boundedStartMs = preset === 'all' ? rawStartMs : Math.max(rawStartMs, availableStartMs)\n return {\n preset,\n startMs: Math.min(boundedStartMs, nowMs),\n endMs: nowMs,\n }\n}\n\nfunction bucketsInRange(buckets: ModuleResourceUsageTimeBucket[], range: UsageRange): ModuleResourceUsageTimeBucket[] {\n return buckets.filter((bucket) => {\n const bucketStartMs = Date.parse(bucket.bucketStart)\n const bucketEndMs = Date.parse(bucket.bucketEnd)\n if (!Number.isFinite(bucketStartMs) || !Number.isFinite(bucketEndMs)) return false\n return bucketEndMs > range.startMs && bucketStartMs <= range.endMs\n })\n}\n\n// Hours of telemetry actually observed in the range (sum of the returned buckets' own\n// intervals), not the wall-clock span of the range. Buckets are only created when an\n// operation runs, so idle stretches with no tracked calls would otherwise dilute the\n// wall-clock denominator and make \"per hour\" rates incomparable across range presets\n// (e.g. \"Today\" diluted by idle daytime vs. \"Last hour\" right after a burst).\nfunction activeRangeHours(buckets: ModuleResourceUsageTimeBucket[], bucketIntervalMs: number | undefined): number {\n const fallbackIntervalMs = bucketIntervalMs && Number.isFinite(bucketIntervalMs) && bucketIntervalMs > 0\n ? bucketIntervalMs\n : HOUR_MS\n if (!buckets.length) return fallbackIntervalMs / HOUR_MS\n const totalMs = buckets.reduce((sum, bucket) => {\n const interval = Number.isFinite(bucket.bucketIntervalMs) && bucket.bucketIntervalMs > 0\n ? bucket.bucketIntervalMs\n : fallbackIntervalMs\n return sum + interval\n }, 0)\n return Math.max(fallbackIntervalMs / HOUR_MS, totalMs / HOUR_MS)\n}\n\nfunction formatActiveDuration(hours: number): string {\n if (!Number.isFinite(hours) || hours <= 0) return '0m'\n if (hours < 1) return `${Math.max(Math.round(hours * 60), 1)}m`\n if (hours < 10) return `${hours.toFixed(1)}h`\n return `${Math.round(hours)}h`\n}\n\nfunction usageRangeLabel(preset: UsageRangePreset, translate: (key: string, fallback?: string) => string): string {\n if (preset === 'today') return translate('configs.moduleTelemetry.range.today', 'Today')\n if (preset === 'last_1h') return translate('configs.moduleTelemetry.range.last1h', 'Last hour')\n if (preset === 'last_6h') return translate('configs.moduleTelemetry.range.last6h', 'Last 6 hours')\n if (preset === 'last_24h') return translate('configs.moduleTelemetry.range.last24h', 'Last 24 hours')\n return translate('configs.moduleTelemetry.range.all', 'All available')\n}\n\nfunction isUsageRangePreset(value: string | null): value is UsageRangePreset {\n return !!value && USAGE_RANGE_PRESETS.includes(value as UsageRangePreset)\n}\n\nfunction readUsageRangePreset(searchParams: { get(name: string): string | null } | null): UsageRangePreset {\n const value = searchParams?.get('range') ?? null\n return isUsageRangePreset(value) ? value : 'today'\n}\n\nfunction usageStageLabel(stage: ModuleResourceUsageTimeBucket['stage'], translate: (key: string, fallback?: string) => string): string {\n if (stage === 'startup') return translate('configs.moduleTelemetry.stage.startup', 'Startup')\n return translate('configs.moduleTelemetry.stage.running', 'Running')\n}\n\nfunction sortStageRows(a: RangeModuleSummary, b: RangeModuleSummary): number {\n if (a.stage !== b.stage) return a.stage === 'startup' ? -1 : 1\n return b.totalCpuMs - a.totalCpuMs\n}\n\nfunction groupRangeModules(modules: RangeModuleSummary[]): RangeModuleGroup[] {\n const groups = new Map<string, RangeModuleSummary[]>()\n for (const module of modules) {\n const group = groups.get(module.moduleId) ?? []\n group.push(module)\n groups.set(module.moduleId, group)\n }\n\n return Array.from(groups.entries()).map(([moduleId, stages]) => {\n const candidateReasons = Array.from(new Set(stages.flatMap((stage) => stage.candidateReasons)))\n return {\n moduleId,\n stages: [...stages].sort(sortStageRows),\n candidateReasons,\n calls: stages.reduce((sum, stage) => sum + stage.calls, 0),\n totalCpuMs: stages.reduce((sum, stage) => sum + stage.totalCpuMs, 0),\n positiveRssDeltaBytes: stages.reduce((sum, stage) => sum + stage.positiveRssDeltaBytes, 0),\n }\n }).sort((a, b) =>\n b.candidateReasons.length - a.candidateReasons.length\n || b.totalCpuMs - a.totalCpuMs\n || b.positiveRssDeltaBytes - a.positiveRssDeltaBytes\n || b.calls - a.calls\n || a.moduleId.localeCompare(b.moduleId)\n )\n}\n\n// Thresholds are sized as \"per 5-minute bucket\" heavy-usage limits (see\n// getModuleResourceUsageThresholds()). A range can span anywhere from one bucket (\"Last hour\")\n// to hundreds (\"Today\"/\"All available\"), so comparing a raw range-wide sum against a per-bucket\n// threshold makes longer ranges strictly more likely to flag a signal regardless of actual\n// per-window intensity. Normalize CPU/heap/RSS/errors to \"average per bucket this module was\n// active in\" before comparing, so the same sustained workload reads the same way at any range.\n// p95DurationMs is already a max across buckets (not a sum), so it needs no normalization.\nfunction buildCandidateReasonsForModule(\n module: Pick<ModuleResourceUsageTimeBucketModule, 'p95DurationMs' | 'totalCpuMs' | 'positiveHeapDeltaBytes' | 'positiveRssDeltaBytes' | 'errors'>,\n thresholds: ModuleResourceUsageReport['thresholds'],\n bucketCount: number,\n): string[] {\n const divisor = Math.max(1, bucketCount)\n const reasons: string[] = []\n if (module.p95DurationMs >= thresholds.p95DurationMs) reasons.push('p95_duration')\n if (module.totalCpuMs / divisor >= thresholds.cpuMs) reasons.push('cpu')\n if (module.positiveHeapDeltaBytes / divisor >= thresholds.positiveHeapDeltaBytes) reasons.push('heap_allocations')\n if (module.positiveRssDeltaBytes / divisor >= thresholds.positiveRssDeltaBytes) reasons.push('rss_growth')\n if (module.errors / divisor >= thresholds.errors) reasons.push('errors')\n return reasons\n}\n\nfunction mergeRangeOperations(modules: ModuleResourceUsageTimeBucketModule[]) {\n const operations = new Map<string, ModuleResourceUsageTimeBucketModule['topOperations'][number]>()\n for (const module of modules) {\n for (const operation of module.topOperations) {\n const key = `${operation.surface}\\u0000${operation.operation}\\u0000${operation.resourceId ?? ''}`\n const existing = operations.get(key)\n if (!existing) {\n operations.set(key, { ...operation })\n continue\n }\n existing.calls += operation.calls\n existing.errors += operation.errors\n existing.totalDurationMs += operation.totalDurationMs\n existing.maxDurationMs = Math.max(existing.maxDurationMs, operation.maxDurationMs)\n existing.p95DurationMs = Math.max(existing.p95DurationMs, operation.p95DurationMs)\n existing.totalCpuUserMs += operation.totalCpuUserMs\n existing.totalCpuSystemMs += operation.totalCpuSystemMs\n existing.maxCpuMs = Math.max(existing.maxCpuMs, operation.maxCpuMs)\n existing.totalHeapDeltaBytes += operation.totalHeapDeltaBytes\n existing.positiveHeapDeltaBytes += operation.positiveHeapDeltaBytes\n existing.maxHeapDeltaBytes = Math.max(existing.maxHeapDeltaBytes, operation.maxHeapDeltaBytes)\n existing.totalRssDeltaBytes += operation.totalRssDeltaBytes\n existing.positiveRssDeltaBytes += operation.positiveRssDeltaBytes\n existing.maxRssDeltaBytes = Math.max(existing.maxRssDeltaBytes, operation.maxRssDeltaBytes)\n existing.firstSeenAt = existing.firstSeenAt < operation.firstSeenAt ? existing.firstSeenAt : operation.firstSeenAt\n existing.lastSeenAt = existing.lastSeenAt > operation.lastSeenAt ? existing.lastSeenAt : operation.lastSeenAt\n }\n }\n return Array.from(operations.values())\n .sort((a, b) =>\n (b.totalCpuUserMs + b.totalCpuSystemMs) - (a.totalCpuUserMs + a.totalCpuSystemMs)\n || b.totalDurationMs - a.totalDurationMs\n || b.calls - a.calls\n )\n .slice(0, 5)\n}\n\nfunction mergeRangeSurfaces(modules: ModuleResourceUsageTimeBucketModule[]): ModuleResourceUsageTimeBucketModule['surfaces'] {\n const surfaces = new Map<string, ModuleResourceUsageTimeBucketModule['surfaces'][number]>()\n for (const module of modules) {\n for (const surface of module.surfaces) {\n const existing = surfaces.get(surface.surface)\n if (!existing) {\n surfaces.set(surface.surface, { ...surface })\n continue\n }\n existing.calls += surface.calls\n existing.errors += surface.errors\n existing.totalDurationMs += surface.totalDurationMs\n existing.p95DurationMs = Math.max(existing.p95DurationMs, surface.p95DurationMs)\n existing.totalCpuMs += surface.totalCpuMs\n existing.positiveHeapDeltaBytes += surface.positiveHeapDeltaBytes\n existing.positiveRssDeltaBytes += surface.positiveRssDeltaBytes\n }\n }\n return Array.from(surfaces.values()).sort((a, b) => b.totalCpuMs - a.totalCpuMs || b.totalDurationMs - a.totalDurationMs)\n}\n\nfunction aggregateRangeModules(\n buckets: ModuleResourceUsageTimeBucket[],\n thresholds: ModuleResourceUsageReport['thresholds'],\n): RangeModuleSummary[] {\n const grouped = new Map<string, {\n moduleId: string\n stage: ModuleResourceUsageTimeBucket['stage']\n modules: ModuleResourceUsageTimeBucketModule[]\n // Distinct bucketStart values this module+stage appeared in. Tracked explicitly (rather than\n // relying on modules.length) so the \"per-bucket average\" candidate-signal divisor stays\n // correct even if a future change ever pushes more/fewer than one module entry per bucket.\n bucketKeys: Set<string>\n }>()\n for (const bucket of buckets) {\n for (const module of bucket.modules) {\n const key = `${module.moduleId}\\u0000${bucket.stage}`\n const group = grouped.get(key) ?? { moduleId: module.moduleId, stage: bucket.stage, modules: [], bucketKeys: new Set<string>() }\n group.modules.push(module)\n group.bucketKeys.add(bucket.bucketStart)\n grouped.set(key, group)\n }\n }\n\n return Array.from(grouped.values()).map(({ moduleId, stage, modules, bucketKeys }) => {\n const summaryBase = {\n moduleId,\n stage,\n calls: modules.reduce((sum, module) => sum + module.calls, 0),\n errors: modules.reduce((sum, module) => sum + module.errors, 0),\n totalDurationMs: modules.reduce((sum, module) => sum + module.totalDurationMs, 0),\n p95DurationMs: Math.max(...modules.map((module) => module.p95DurationMs), 0),\n totalCpuMs: modules.reduce((sum, module) => sum + module.totalCpuMs, 0),\n positiveHeapDeltaBytes: modules.reduce((sum, module) => sum + module.positiveHeapDeltaBytes, 0),\n positiveRssDeltaBytes: modules.reduce((sum, module) => sum + module.positiveRssDeltaBytes, 0),\n surfaces: mergeRangeSurfaces(modules),\n topOperations: mergeRangeOperations(modules),\n }\n return {\n ...summaryBase,\n candidateReasons: buildCandidateReasonsForModule(summaryBase, thresholds, bucketKeys.size),\n }\n }).sort((a, b) =>\n b.candidateReasons.length - a.candidateReasons.length\n || b.totalCpuMs - a.totalCpuMs\n || b.positiveRssDeltaBytes - a.positiveRssDeltaBytes\n || b.calls - a.calls\n )\n}\n\nfunction RangeOverview({\n buckets,\n modules,\n range,\n rangePreset,\n onRangePresetChange,\n bucketIntervalMs,\n translate,\n}: {\n buckets: ModuleResourceUsageTimeBucket[]\n modules: RangeModuleSummary[]\n range: UsageRange\n rangePreset: UsageRangePreset\n onRangePresetChange: (value: UsageRangePreset) => void\n bucketIntervalMs?: number\n translate: (key: string, fallback?: string, values?: Record<string, string | number>) => string\n}) {\n const selectedHours = activeRangeHours(buckets, bucketIntervalMs)\n const activeDurationLabel = formatActiveDuration(selectedHours)\n const bucketsLabel = bucketCountLabel(buckets, bucketIntervalMs, translate)\n const totalHeapGrowthBytes = modules.reduce((sum, module) => sum + module.positiveHeapDeltaBytes, 0)\n const totalRssGrowthBytes = modules.reduce((sum, module) => sum + module.positiveRssDeltaBytes, 0)\n const totals = {\n modules: new Set(modules.map((module) => module.moduleId)).size,\n calls: modules.reduce((sum, module) => sum + module.calls, 0),\n totalCpuMs: modules.reduce((sum, module) => sum + module.totalCpuMs, 0),\n avgHeapGrowthPerHour: totalHeapGrowthBytes / selectedHours,\n avgRssGrowthPerHour: totalRssGrowthBytes / selectedHours,\n }\n const growthTooltip = translate(\n 'configs.moduleTelemetry.overview.growthTooltip',\n 'Average positive growth per hour of measured activity in the selected range: total growth divided by the hours actually covered by tracked buckets, not the full wall-clock span. Idle stretches with no tracked calls do not dilute this rate, so it stays comparable across range presets. This is allocation pressure over time, not the current live process memory.',\n )\n const heapSubValue = translate(\n 'configs.moduleTelemetry.overview.growthSubValue',\n '{{total}} total over {{duration}}',\n { total: formatBytes(totalHeapGrowthBytes), duration: activeDurationLabel },\n )\n const rssSubValue = translate(\n 'configs.moduleTelemetry.overview.growthSubValue',\n '{{total}} total over {{duration}}',\n { total: formatBytes(totalRssGrowthBytes), duration: activeDurationLabel },\n )\n\n return (\n <div className=\"space-y-4 rounded-lg border bg-card p-4\">\n <div className=\"flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between\">\n <div className=\"space-y-1\">\n <h3 className=\"text-base font-semibold\">{translate('configs.moduleTelemetry.overview.title', 'Usage overview')}</h3>\n <p className=\"text-sm text-muted-foreground\">\n {translate(\n 'configs.moduleTelemetry.overview.description',\n 'From {{from}} to now \u00B7 {{buckets}}',\n {\n from: formatRangeBoundary(range.startMs),\n buckets: bucketsLabel,\n },\n )}\n </p>\n </div>\n <div className=\"flex flex-col gap-2 sm:flex-row\">\n <SegmentedControl\n value={rangePreset}\n onValueChange={(value) => onRangePresetChange(value as UsageRangePreset)}\n aria-label={translate('configs.moduleTelemetry.range.label', 'Time range')}\n size=\"sm\"\n className=\"max-w-full flex-wrap overflow-x-auto rounded-lg\"\n >\n {USAGE_RANGE_PRESETS.map((option) => (\n <SegmentedControlItem key={option} value={option}>\n {usageRangeLabel(option, translate)}\n </SegmentedControlItem>\n ))}\n </SegmentedControl>\n </div>\n </div>\n <div className=\"grid gap-4 md:grid-cols-2 xl:grid-cols-5\">\n <MetricCard\n label={translate('configs.moduleTelemetry.overview.modules', 'Modules')}\n tooltip={translate('configs.moduleTelemetry.overview.modulesTooltip', 'Unique modules with tracked activity in the selected range. Startup and running are shown as separate rows inside each module group.')}\n value={formatCount(totals.modules)}\n />\n <MetricCard\n label={translate('configs.moduleTelemetry.overview.calls', 'Calls')}\n tooltip={translate('configs.moduleTelemetry.overview.callsTooltip', 'Total tracked operation calls in the selected range.')}\n value={formatCount(totals.calls)}\n />\n <MetricCard\n label={translate('configs.moduleTelemetry.overview.cpu', 'CPU')}\n tooltip={translate('configs.moduleTelemetry.overview.cpuTooltip', 'Total CPU time attributed to tracked module operations in the selected range.')}\n value={formatMs(totals.totalCpuMs)}\n />\n <MetricCard\n label={translate('configs.moduleTelemetry.overview.heapPerHour', 'Heap / hour')}\n tooltip={growthTooltip}\n value={formatBytes(totals.avgHeapGrowthPerHour)}\n subValue={heapSubValue}\n />\n <MetricCard\n label={translate('configs.moduleTelemetry.overview.rssPerHour', 'RSS / hour')}\n tooltip={growthTooltip}\n value={formatBytes(totals.avgRssGrowthPerHour)}\n subValue={rssSubValue}\n />\n </div>\n </div>\n )\n}\n\nfunction CandidateBadges({\n module,\n translate,\n}: {\n module: ModuleResourceUsageTimeBucketModule\n translate: (key: string, fallback?: string, values?: Record<string, string | number>) => string\n}) {\n if (!module.candidateReasons.length) {\n return (\n <StatusBadge variant=\"neutral\" dot>\n {translate('configs.moduleTelemetry.table.normal', 'Normal')}\n </StatusBadge>\n )\n }\n\n return (\n <div className=\"flex flex-wrap gap-1.5\">\n {module.candidateReasons.map((reason) => (\n <StatusBadge key={reason} variant=\"warning\" dot>\n {translate(REASON_LABEL_KEYS[reason] ?? `configs.moduleTelemetry.reason.${reason}`, REASON_FALLBACKS[reason] ?? reason)}\n </StatusBadge>\n ))}\n </div>\n )\n}\n\nfunction StageBadge({\n stage,\n translate,\n}: {\n stage: ModuleResourceUsageTimeBucket['stage']\n translate: (key: string, fallback?: string, values?: Record<string, string | number>) => string\n}) {\n return (\n <StatusBadge variant={stage === 'startup' ? 'info' : 'neutral'} dot>\n {usageStageLabel(stage, translate)}\n </StatusBadge>\n )\n}\n\nfunction copyRowStats(module: RangeModuleSummary, translate: (key: string, fallback?: string) => string): void {\n const json = JSON.stringify(module, null, 2)\n navigator.clipboard\n .writeText(json)\n .then(() => {\n flash(translate('configs.moduleTelemetry.table.copySuccess', 'Row stats copied to clipboard.'), 'success')\n })\n .catch((err) => {\n console.warn('[ModuleTelemetryPanel] clipboard write failed', err)\n flash(translate('configs.moduleTelemetry.table.copyError', 'Failed to copy row stats.'), 'error')\n })\n}\n\nfunction TopOperationsBreakdown({\n operations,\n translate,\n}: {\n operations: ModuleResourceUsageEntry[]\n translate: (key: string, fallback?: string, values?: Record<string, string | number>) => string\n}) {\n return (\n <div className=\"w-[26rem] max-w-[80vw] space-y-2\">\n <div className=\"text-xs font-semibold uppercase tracking-wide text-muted-foreground\">\n {translate('configs.moduleTelemetry.table.topOperationsBreakdown', 'Top operations in this range')}\n </div>\n <table className=\"w-full text-xs\">\n <thead>\n <tr className=\"text-muted-foreground\">\n <th className=\"pb-1 pr-2 text-left font-medium\">{translate('configs.moduleTelemetry.table.topOperation', 'Top operation')}</th>\n <th className=\"pb-1 pr-2 text-right font-medium\">{translate('configs.moduleTelemetry.table.calls', 'Calls')}</th>\n <th className=\"pb-1 pr-2 text-right font-medium\">{translate('configs.moduleTelemetry.table.worstP95', 'Worst p95')}</th>\n <th className=\"pb-1 pr-2 text-right font-medium\">{translate('configs.moduleTelemetry.table.cpu', 'CPU')}</th>\n <th className=\"pb-1 pr-2 text-right font-medium\">{translate('configs.moduleTelemetry.table.heap', 'Heap growth')}</th>\n <th className=\"pb-1 text-right font-medium\">{translate('configs.moduleTelemetry.table.rss', 'RSS growth')}</th>\n </tr>\n </thead>\n <tbody>\n {operations.map((operation, index) => (\n <tr key={`${operation.surface}\u0000${operation.operation}\u0000${index}`} className=\"border-t border-border/50\">\n <td className=\"py-1 pr-2 align-top\">\n <div className=\"font-medium text-foreground\">{operation.operation}</div>\n <div className=\"text-muted-foreground\">\n {operation.surface}\n {operation.errors > 0\n ? ` \u00B7 ${translate('configs.moduleTelemetry.table.errorCount', '{{count}} errors', { count: operation.errors })}`\n : ''}\n </div>\n {operation.concurrentCalls > 0 ? (\n <div className=\"text-muted-foreground\">\n {translate(\n 'configs.moduleTelemetry.table.concurrentOverlap',\n '{{percent}}% overlapped other calls \u2014 CPU/heap/RSS less certain',\n { percent: Math.round((operation.concurrentCalls / Math.max(operation.calls, 1)) * 100) },\n )}\n </div>\n ) : null}\n </td>\n <td className=\"py-1 pr-2 text-right align-top\">{formatCount(operation.calls)}</td>\n <td className=\"py-1 pr-2 text-right align-top\">{formatMs(operation.p95DurationMs)}</td>\n <td className=\"py-1 pr-2 text-right align-top\">{formatMs(operation.totalCpuUserMs + operation.totalCpuSystemMs)}</td>\n <td className=\"py-1 pr-2 text-right align-top\">{formatBytes(operation.positiveHeapDeltaBytes)}</td>\n <td className=\"py-1 text-right align-top\">{formatBytes(operation.positiveRssDeltaBytes)}</td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n )\n}\n\nfunction RangeModuleTable({\n modules,\n translate,\n}: {\n modules: RangeModuleSummary[]\n translate: (key: string, fallback?: string, values?: Record<string, string | number>) => string\n}) {\n if (!modules.length) {\n return (\n <p className=\"text-sm text-muted-foreground\">\n {translate('configs.moduleTelemetry.modules.empty', 'No module activity has been recorded for this range yet.')}\n </p>\n )\n }\n\n const groups = groupRangeModules(modules)\n\n return (\n <TooltipProvider delayDuration={200}>\n <div className=\"overflow-x-auto\">\n <table className=\"w-full min-w-[980px] text-sm\">\n <thead>\n <tr className=\"text-xs uppercase tracking-wide text-muted-foreground\">\n <th className=\"px-3 py-2 text-left\">{translate('configs.moduleTelemetry.table.module', 'Module')}</th>\n <th className=\"px-3 py-2 text-left\">{translate('configs.moduleTelemetry.table.stage', 'Stage')}</th>\n <th className=\"px-3 py-2 text-left\">\n <MetricTitle\n label={translate('configs.moduleTelemetry.table.signals', 'Signals')}\n tooltip={translate(\n 'configs.moduleTelemetry.table.signalsTooltip',\n 'Flags a module whose CPU, heap growth, RSS growth, or errors average at or above a heavy-usage threshold per 5-minute bucket it was active in during this range. This is a per-bucket average, not a raw range-wide total, so the same sustained workload looks the same regardless of the selected time range.',\n )}\n />\n </th>\n <th className=\"px-3 py-2 text-right\">{translate('configs.moduleTelemetry.table.calls', 'Calls')}</th>\n <th className=\"px-3 py-2 text-right\">{translate('configs.moduleTelemetry.table.worstP95', 'Worst p95')}</th>\n <th className=\"px-3 py-2 text-right\">{translate('configs.moduleTelemetry.table.cpu', 'CPU')}</th>\n <th className=\"px-3 py-2 text-right\">{translate('configs.moduleTelemetry.table.heap', 'Heap growth')}</th>\n <th className=\"px-3 py-2 text-right\">{translate('configs.moduleTelemetry.table.rss', 'RSS growth')}</th>\n <th className=\"px-3 py-2 text-left\">{translate('configs.moduleTelemetry.table.topOperation', 'Top operation')}</th>\n <th className=\"px-3 py-2 text-right\">{translate('configs.moduleTelemetry.table.actions', 'Actions')}</th>\n </tr>\n </thead>\n <tbody>\n {groups.map((group) => (\n <React.Fragment key={group.moduleId}>\n {group.stages.map((module, stageIndex) => {\n const topOperation = module.topOperations[0]\n const topSurface = module.surfaces[0]\n return (\n <tr\n key={`${module.moduleId}:${module.stage}`}\n className={stageIndex === 0 ? 'border-t' : 'border-t border-border/50'}\n >\n {stageIndex === 0 ? (\n <td className=\"w-56 px-3 py-3 align-top\" rowSpan={group.stages.length}>\n <div className=\"flex flex-col gap-1\">\n <span className=\"font-medium\">{group.moduleId}</span>\n <span className=\"text-xs text-muted-foreground\">\n {translate(\n 'configs.moduleTelemetry.table.stageCount',\n '{{count}} stage rows',\n { count: group.stages.length },\n )}\n </span>\n </div>\n </td>\n ) : null}\n <td className=\"px-3 py-3 align-top\">\n <div className=\"flex flex-col gap-1\">\n <StageBadge stage={module.stage} translate={translate} />\n <span className=\"text-xs text-muted-foreground\">\n {topSurface\n ? translate(\n 'configs.moduleTelemetry.table.surfaceSummary',\n '{{surface}} \u00B7 {{calls}} calls',\n { surface: topSurface.surface, calls: topSurface.calls },\n )\n : translate('configs.moduleTelemetry.table.noSurface', 'No surface data')}\n </span>\n </div>\n </td>\n <td className=\"px-3 py-3 align-top\">\n <CandidateBadges module={module} translate={translate} />\n </td>\n <td className=\"px-3 py-3 align-top text-right\">\n <div className=\"flex flex-col gap-1\">\n <span>{formatCount(module.calls)}</span>\n {module.errors > 0 ? (\n <span className=\"text-xs text-destructive\">\n {translate('configs.moduleTelemetry.table.errorCount', '{{count}} errors', { count: module.errors })}\n </span>\n ) : null}\n </div>\n </td>\n <td className=\"px-3 py-3 align-top text-right\">{formatMs(module.p95DurationMs)}</td>\n <td className=\"px-3 py-3 align-top text-right\">{formatMs(module.totalCpuMs)}</td>\n <td className=\"px-3 py-3 align-top text-right\">{formatBytes(module.positiveHeapDeltaBytes)}</td>\n <td className=\"px-3 py-3 align-top text-right\">{formatBytes(module.positiveRssDeltaBytes)}</td>\n <td className=\"px-3 py-3 align-top\">\n {topOperation ? (\n <Tooltip delayDuration={200}>\n <TooltipTrigger asChild>\n <div className=\"flex cursor-default flex-col gap-1\">\n <span className=\"font-medium underline decoration-dotted decoration-muted-foreground underline-offset-2\">\n {topOperation.operation}\n </span>\n <span className=\"text-xs text-muted-foreground\">\n {translate(\n 'configs.moduleTelemetry.table.topOperationMeta',\n '{{surface}} \u00B7 {{cpu}} CPU \u00B7 {{calls}} calls',\n {\n surface: topOperation.surface,\n cpu: formatMs(topOperation.totalCpuUserMs + topOperation.totalCpuSystemMs),\n calls: topOperation.calls,\n },\n )}\n </span>\n </div>\n </TooltipTrigger>\n <TooltipContent side=\"left\" align=\"start\" variant=\"light\" className=\"max-w-none p-3\">\n <TopOperationsBreakdown operations={module.topOperations} translate={translate} />\n </TooltipContent>\n </Tooltip>\n ) : (\n <span className=\"text-muted-foreground\">{translate('configs.moduleTelemetry.table.none', 'None')}</span>\n )}\n </td>\n <td className=\"px-3 py-3 align-top text-right\">\n <SimpleTooltip\n content={translate('configs.moduleTelemetry.table.copyStats', 'Copy row stats for debugging')}\n side=\"top\"\n align=\"center\"\n variant=\"light\"\n >\n <IconButton\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n aria-label={translate('configs.moduleTelemetry.table.copyStats', 'Copy row stats for debugging')}\n onClick={() => copyRowStats(module, translate)}\n >\n <Copy className=\"h-4 w-4\" aria-hidden=\"true\" />\n </IconButton>\n </SimpleTooltip>\n </td>\n </tr>\n )\n })}\n </React.Fragment>\n ))}\n </tbody>\n </table>\n </div>\n </TooltipProvider>\n )\n}\n\nfunction RangeModuleSection({\n modules,\n range,\n bucketIntervalMs,\n bucketsLabel,\n translate,\n}: {\n modules: RangeModuleSummary[]\n range: UsageRange\n bucketIntervalMs?: number\n bucketsLabel: string\n translate: (key: string, fallback?: string, values?: Record<string, string | number>) => string\n}) {\n return (\n <div className=\"space-y-4 rounded-lg border bg-card p-4\">\n <div className=\"space-y-1\">\n <h3 className=\"text-base font-semibold\">{translate('configs.moduleTelemetry.modules.title', 'Modules')}</h3>\n <p className=\"text-sm text-muted-foreground\">\n {translate(\n 'configs.moduleTelemetry.modules.description',\n 'Aggregated module stats from {{from}} to now across {{buckets}}. Startup and running rows are separated.',\n {\n from: formatRangeBoundary(range.startMs),\n buckets: bucketsLabel,\n },\n )}\n </p>\n <p className=\"text-xs text-muted-foreground\">\n {translate(\n 'configs.moduleTelemetry.modules.interval',\n 'Startup is the first {{interval}} bucket after telemetry starts. Later buckets are running.',\n { interval: formatBucketInterval(bucketIntervalMs) },\n )}\n </p>\n </div>\n <RangeModuleTable modules={modules} translate={translate} />\n </div>\n )\n}\n\nexport function ModuleTelemetryPanel() {\n const t = useT()\n const router = useRouter()\n const pathname = usePathname()\n const searchParams = useSearchParams()\n const [state, setState] = React.useState<FetchState>({ loading: true, error: null, report: null })\n const [clearingTelemetry, setClearingTelemetry] = React.useState(false)\n const rangeParam = searchParams.get('range')\n const [usageRangePreset, setUsageRangePreset] = React.useState<UsageRangePreset>(() => readUsageRangePreset(searchParams))\n const { confirm, ConfirmDialogElement } = useConfirmDialog()\n\n const { runMutation, retryLastMutation } = useGuardedMutation<{\n formId: string\n resourceKind: string\n retryLastMutation: () => Promise<boolean>\n }>({\n contextId: 'configs-module-telemetry',\n blockedMessage: t('ui.forms.flash.saveBlocked', 'Save blocked by validation'),\n })\n\n const clearMutationContext = React.useMemo(\n () => ({\n formId: 'configs-module-telemetry',\n resourceKind: 'configs.moduleTelemetry',\n retryLastMutation,\n }),\n [retryLastMutation],\n )\n\n const loadReport = React.useCallback(async () => {\n setState((current) => ({ ...current, loading: true, error: null }))\n try {\n const report = await readApiResultOrThrow<ModuleTelemetryApiResponse>(API_PATH, undefined, {\n errorMessage: t('configs.moduleTelemetry.loadError', 'Failed to load module telemetry.'),\n })\n setState({ loading: false, error: null, report })\n } catch (error) {\n const message =\n error instanceof Error && error.message\n ? error.message\n : t('configs.moduleTelemetry.loadError', 'Failed to load module telemetry.')\n setState({ loading: false, error: message, report: null })\n }\n }, [t])\n\n React.useEffect(() => {\n loadReport().catch(() => {})\n }, [loadReport])\n\n React.useEffect(() => {\n const nextRange = readUsageRangePreset(searchParams)\n setUsageRangePreset((current) => current === nextRange ? current : nextRange)\n }, [rangeParam, searchParams])\n\n const handleUsageRangeChange = React.useCallback((value: UsageRangePreset) => {\n setUsageRangePreset(value)\n const params = new URLSearchParams(searchParams.toString())\n params.set('range', value)\n const query = params.toString()\n router.replace(query ? `${pathname}?${query}` : pathname, { scroll: false })\n }, [pathname, router, searchParams])\n\n const handleRefresh = React.useCallback(() => {\n loadReport().catch(() => {})\n }, [loadReport])\n\n const handleClearTelemetry = React.useCallback(async () => {\n if (clearingTelemetry) return\n const confirmed = await confirm({\n title: t('configs.moduleTelemetry.clear.confirmTitle', 'Clear all telemetry data?'),\n text: t(\n 'configs.moduleTelemetry.clear.confirmText',\n 'This removes current module telemetry and local process telemetry files for this development instance.',\n ),\n confirmText: t('configs.moduleTelemetry.clear.confirmButton', 'Clear telemetry'),\n variant: 'destructive',\n })\n if (!confirmed) return\n\n setClearingTelemetry(true)\n try {\n await runMutation({\n // optimistic-lock-exempt: clears in-process/dev-only telemetry buckets and\n // local process telemetry files \u2014 there is no versioned entity (no updated_at)\n // to lock against, so no expected-version header applies.\n operation: () =>\n readApiResultOrThrow<ModuleTelemetryClearResponse>(\n API_PATH,\n { method: 'DELETE' },\n {\n errorMessage: t('configs.moduleTelemetry.clear.error', 'Failed to clear module telemetry.'),\n allowNullResult: true,\n },\n ),\n context: clearMutationContext,\n mutationPayload: {},\n })\n await loadReport()\n flash(t('configs.moduleTelemetry.clear.success', 'Module telemetry data cleared.'), 'success')\n } catch (error) {\n const message =\n error instanceof Error && error.message\n ? error.message\n : t('configs.moduleTelemetry.clear.error', 'Failed to clear module telemetry.')\n flash(message, 'error')\n } finally {\n setClearingTelemetry(false)\n }\n }, [clearMutationContext, clearingTelemetry, confirm, loadReport, runMutation, t])\n\n if (state.loading) {\n return (\n <section className=\"space-y-3 rounded-lg border bg-background p-6\">\n <header className=\"space-y-1\">\n <h2 className=\"text-lg font-semibold\">{t('configs.moduleTelemetry.title', 'Module telemetry')}</h2>\n <p className=\"text-sm text-muted-foreground\">\n {t('configs.moduleTelemetry.description', 'Preview module-level resource attribution collected in this process.')}\n </p>\n </header>\n <div className=\"flex items-center gap-2 text-sm text-muted-foreground\">\n <Spinner className=\"h-4 w-4\" />\n {t('configs.moduleTelemetry.loading', 'Loading module telemetry\u2026')}\n </div>\n </section>\n )\n }\n\n if (state.error) {\n return (\n <section className=\"space-y-3 rounded-lg border bg-background p-6\">\n <header className=\"space-y-1\">\n <h2 className=\"text-lg font-semibold\">{t('configs.moduleTelemetry.title', 'Module telemetry')}</h2>\n <p className=\"text-sm text-muted-foreground\">\n {t('configs.moduleTelemetry.description', 'Preview module-level resource attribution collected in this process.')}\n </p>\n </header>\n <ErrorMessage label={state.error} />\n <Button type=\"button\" variant=\"outline\" onClick={() => loadReport().catch(() => {})}>\n {t('configs.moduleTelemetry.retry', 'Retry')}\n </Button>\n </section>\n )\n }\n\n const report = state.report\n if (!report) return null\n const usageRange = resolveUsageRange(usageRangePreset, report.buckets ?? [], report.startedAt)\n const rangeBuckets = bucketsInRange(report.buckets ?? [], usageRange)\n const rangeModules = aggregateRangeModules(rangeBuckets, report.thresholds)\n const bucketsLabel = bucketCountLabel(rangeBuckets, report.bucketIntervalMs, t)\n const telemetryStartedAtMs = firstAvailableTelemetryMs(report.buckets ?? [], Date.parse(report.startedAt), Date.now())\n\n return (\n <section className=\"space-y-6 rounded-lg border bg-background p-6\">\n <header className=\"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between\">\n <div className=\"space-y-1\">\n <h2 className=\"text-lg font-semibold\">{t('configs.moduleTelemetry.title', 'Module telemetry')}</h2>\n <p className=\"text-sm text-muted-foreground\">\n {t('configs.moduleTelemetry.description', 'Preview module-level resource attribution collected in this process.')}\n </p>\n <p className=\"text-xs text-muted-foreground\">\n {t(\n 'configs.moduleTelemetry.generatedAt',\n 'Report generated {{timestamp}}',\n { timestamp: new Date(report.generatedAt).toLocaleString() },\n )}\n </p>\n <p className=\"text-xs text-muted-foreground\">\n {t(\n 'configs.moduleTelemetry.startedAt',\n 'Collecting since {{timestamp}}',\n { timestamp: new Date(telemetryStartedAtMs).toLocaleString() },\n )}\n </p>\n </div>\n <div className=\"flex flex-wrap gap-2\">\n {report.canClearTelemetry ? (\n <Button\n type=\"button\"\n variant=\"destructive-outline\"\n onClick={() => { void handleClearTelemetry() }}\n disabled={clearingTelemetry}\n >\n <Trash2 className=\"h-4 w-4\" aria-hidden=\"true\" />\n {clearingTelemetry\n ? t('configs.moduleTelemetry.clear.clearing', 'Clearing...')\n : t('configs.moduleTelemetry.clear.button', 'Clear all telemetry data')}\n </Button>\n ) : null}\n <Button type=\"button\" variant=\"outline\" onClick={handleRefresh}>\n <RefreshCw className=\"h-4 w-4\" aria-hidden=\"true\" />\n {t('configs.moduleTelemetry.refresh', 'Refresh')}\n </Button>\n </div>\n </header>\n\n <RangeOverview\n buckets={rangeBuckets}\n modules={rangeModules}\n range={usageRange}\n rangePreset={usageRangePreset}\n onRangePresetChange={handleUsageRangeChange}\n bucketIntervalMs={report.bucketIntervalMs}\n translate={t}\n />\n <RangeModuleSection\n modules={rangeModules}\n range={usageRange}\n bucketIntervalMs={report.bucketIntervalMs}\n bucketsLabel={bucketsLabel}\n translate={t}\n />\n\n {ConfirmDialogElement}\n </section>\n )\n}\n\nexport default ModuleTelemetryPanel\n"],
|
|
5
|
-
"mappings": ";AAsKI,SACE,KADF;AApKJ,YAAY,WAAW;AACvB,SAAS,aAAa,WAAW,uBAAuB;AACxD,SAAS,cAAc;AACvB;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,eAAe;AACxB,SAAS,mBAAmB;AAC5B,SAAS,eAAe,SAAS,gBAAgB,iBAAiB,sBAAsB;AACxF,SAAS,kBAAkB;AAC3B,SAAS,4BAA4B,mBAAmB;AACxD,SAAS,oBAAoB;AAC7B,SAAS,4BAA4B;AACrC,SAAS,aAAa;AACtB,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AACnC,SAAS,YAAY;AACrB,SAAS,MAAM,MAAM,WAAW,cAAc;AAQ9C,MAAM,WAAW;AAgBjB,MAAM,UAAU,KAAK,KAAK;AAE1B,MAAM,oBAA4C;AAAA,EAChD,cAAc;AAAA,EACd,KAAK;AAAA,EACL,kBAAkB;AAAA,EAClB,YAAY;AAAA,EACZ,QAAQ;AACV;AAEA,MAAM,mBAA2C;AAAA,EAC/C,cAAc;AAAA,EACd,KAAK;AAAA,EACL,kBAAkB;AAAA,EAClB,YAAY;AAAA,EACZ,QAAQ;AACV;AAuBA,MAAM,s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AEJ;AAEA,IAAO,+BAAQ;",
|
|
4
|
+
"sourcesContent": ["\"use client\"\n\nimport * as React from 'react'\nimport { usePathname, useRouter, useSearchParams } from 'next/navigation'\nimport { Button } from '@open-mercato/ui/primitives/button'\nimport {\n SegmentedControl,\n SegmentedControlItem,\n} from '@open-mercato/ui/primitives/segmented-control'\nimport { Spinner } from '@open-mercato/ui/primitives/spinner'\nimport { StatusBadge } from '@open-mercato/ui/primitives/status-badge'\nimport { SimpleTooltip, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@open-mercato/ui/primitives/tooltip'\nimport { IconButton } from '@open-mercato/ui/primitives/icon-button'\nimport { formatAttachmentFileSize as formatBytes } from '@open-mercato/ui/backend/detail/AttachmentVisualPreview'\nimport { ErrorMessage } from '@open-mercato/ui/backend/detail'\nimport { readApiResultOrThrow } from '@open-mercato/ui/backend/utils/apiCall'\nimport { flash } from '@open-mercato/ui/backend/FlashMessages'\nimport { useConfirmDialog } from '@open-mercato/ui/backend/confirm-dialog'\nimport { useGuardedMutation } from '@open-mercato/ui/backend/injection/useGuardedMutation'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { Copy, Info, RefreshCw, Trash2 } from 'lucide-react'\nimport type {\n ModuleResourceUsageEntry,\n ModuleResourceUsageReport,\n ModuleResourceUsageTimeBucket,\n ModuleResourceUsageTimeBucketModule,\n} from '@open-mercato/shared/lib/modules/resource-usage'\nimport { createLogger } from '@open-mercato/shared/lib/logger'\n\nconst logger = createLogger('configs')\n\nconst API_PATH = '/api/configs/module-telemetry'\n\ntype FetchState = {\n loading: boolean\n error: string | null\n report: ModuleTelemetryApiResponse | null\n}\n\ntype ModuleTelemetryApiResponse = ModuleResourceUsageReport & {\n canClearTelemetry?: boolean\n}\n\ntype ModuleTelemetryClearResponse = {\n cleared: boolean\n}\n\nconst HOUR_MS = 60 * 60 * 1000\n\nconst REASON_LABEL_KEYS: Record<string, string> = {\n p95_duration: 'configs.moduleTelemetry.reason.p95Duration',\n cpu: 'configs.moduleTelemetry.reason.cpu',\n heap_allocations: 'configs.moduleTelemetry.reason.heapAllocations',\n rss_growth: 'configs.moduleTelemetry.reason.rssGrowth',\n errors: 'configs.moduleTelemetry.reason.errors',\n}\n\nconst REASON_FALLBACKS: Record<string, string> = {\n p95_duration: 'Slow p95',\n cpu: 'CPU',\n heap_allocations: 'Heap',\n rss_growth: 'RSS growth',\n errors: 'Errors',\n}\n\ntype UsageRangePreset = 'today' | 'last_1h' | 'last_6h' | 'last_24h' | 'all'\n\ntype UsageRange = {\n preset: UsageRangePreset\n startMs: number\n endMs: number\n}\n\ntype RangeModuleSummary = ModuleResourceUsageTimeBucketModule & {\n stage: ModuleResourceUsageTimeBucket['stage']\n}\n\ntype RangeModuleGroup = {\n moduleId: string\n stages: RangeModuleSummary[]\n candidateReasons: string[]\n calls: number\n totalCpuMs: number\n positiveRssDeltaBytes: number\n}\n\nconst USAGE_RANGE_PRESETS: UsageRangePreset[] = ['today', 'last_1h', 'last_6h', 'last_24h', 'all']\n\nfunction formatMs(ms: number): string {\n if (!Number.isFinite(ms) || ms <= 0) return '0 ms'\n if (ms >= 1000) return `${(ms / 1000).toFixed(ms >= 10_000 ? 1 : 2)} s`\n return `${Math.round(ms)} ms`\n}\n\nfunction formatCount(value: number): string {\n return new Intl.NumberFormat().format(value)\n}\n\nfunction formatBucketInterval(ms: number | undefined): string {\n if (!ms || !Number.isFinite(ms)) return 'interval'\n if (ms >= 60 * 60 * 1000) {\n const hours = Math.round(ms / (60 * 60 * 1000))\n return `${hours}h`\n }\n const minutes = Math.round(ms / (60 * 1000))\n return `${minutes}m`\n}\n\nfunction bucketIntervalLabel(\n buckets: ModuleResourceUsageTimeBucket[],\n fallbackMs: number | undefined,\n translate: (key: string, fallback?: string, values?: Record<string, string | number>) => string,\n): string {\n const intervals = new Set(\n buckets\n .map((bucket) => bucket.bucketIntervalMs)\n .filter((value) => Number.isFinite(value) && value > 0),\n )\n if (intervals.size === 1) return formatBucketInterval(Array.from(intervals)[0])\n return formatBucketInterval(fallbackMs)\n}\n\nfunction bucketCountLabel(\n buckets: ModuleResourceUsageTimeBucket[],\n fallbackMs: number | undefined,\n translate: (key: string, fallback?: string, values?: Record<string, string | number>) => string,\n): string {\n const intervals = new Set(\n buckets\n .map((bucket) => bucket.bucketIntervalMs)\n .filter((value) => Number.isFinite(value) && value > 0),\n )\n if (intervals.size > 1) {\n return translate(\n 'configs.moduleTelemetry.overview.mixedBucketCount',\n '{{count}} buckets \u00B7 mixed intervals',\n { count: buckets.length },\n )\n }\n return translate(\n 'configs.moduleTelemetry.overview.bucketCount',\n '{{count}} {{bucketWord}} ({{interval}} interval)',\n {\n count: buckets.length,\n bucketWord: buckets.length === 1\n ? translate('configs.moduleTelemetry.overview.bucketSingular', 'bucket')\n : translate('configs.moduleTelemetry.overview.bucketPlural', 'buckets'),\n interval: bucketIntervalLabel(buckets, fallbackMs, translate),\n },\n )\n}\n\nfunction formatRangeBoundary(ms: number): string {\n return new Date(ms).toLocaleString(undefined, {\n month: 'short',\n day: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n })\n}\n\nfunction MetricTitle({\n label,\n tooltip,\n}: {\n label: string\n tooltip: string\n}) {\n return (\n <div className=\"inline-flex min-w-0 items-center gap-1.5 text-xs uppercase tracking-wide text-muted-foreground\">\n <span className=\"truncate\">{label}</span>\n <SimpleTooltip content={tooltip} side=\"top\" align=\"center\" variant=\"light\" size=\"lg\">\n <span\n className=\"inline-flex size-4 shrink-0 items-center justify-center rounded-full text-muted-foreground hover:text-foreground\"\n aria-label={tooltip}\n >\n <Info className=\"h-3.5 w-3.5\" aria-hidden=\"true\" />\n </span>\n </SimpleTooltip>\n </div>\n )\n}\n\nfunction MetricCard({\n label,\n tooltip,\n value,\n subValue,\n}: {\n label: string\n tooltip: string\n value: React.ReactNode\n subValue?: React.ReactNode\n}) {\n return (\n <div className=\"rounded-lg border bg-card p-4\">\n <MetricTitle label={label} tooltip={tooltip} />\n <div className=\"mt-2 text-2xl font-semibold\">{value}</div>\n {subValue ? <div className=\"mt-1 text-xs text-muted-foreground\">{subValue}</div> : null}\n </div>\n )\n}\n\nfunction firstBucketStartMs(buckets: ModuleResourceUsageTimeBucket[]): number | null {\n const starts = buckets\n .map((bucket) => Date.parse(bucket.bucketStart))\n .filter((value) => Number.isFinite(value))\n return starts.length ? Math.min(...starts) : null\n}\n\nfunction firstBucketEndMs(buckets: ModuleResourceUsageTimeBucket[]): number | null {\n const ends = buckets\n .map((bucket) => Date.parse(bucket.bucketEnd))\n .filter((value) => Number.isFinite(value))\n return ends.length ? Math.min(...ends) : null\n}\n\nfunction firstAvailableTelemetryMs(buckets: ModuleResourceUsageTimeBucket[], startedAtMs: number, nowMs: number): number {\n const firstBucketMs = firstBucketStartMs(buckets)\n if (firstBucketMs === null) return Number.isFinite(startedAtMs) ? startedAtMs : nowMs\n if (!Number.isFinite(startedAtMs)) return firstBucketMs\n\n const firstBucketEnd = firstBucketEndMs(buckets)\n if (firstBucketEnd !== null && firstBucketEnd > startedAtMs) return startedAtMs\n return firstBucketMs\n}\n\nfunction startOfTodayMs(nowMs: number): number {\n const date = new Date(nowMs)\n date.setHours(0, 0, 0, 0)\n return date.getTime()\n}\n\nfunction resolveUsageRange(\n preset: UsageRangePreset,\n buckets: ModuleResourceUsageTimeBucket[],\n startedAt: string,\n nowMs = Date.now(),\n): UsageRange {\n const startedAtMs = Date.parse(startedAt)\n const availableStartMs = firstAvailableTelemetryMs(buckets, startedAtMs, nowMs)\n const rawStartMs = preset === 'today'\n ? startOfTodayMs(nowMs)\n : preset === 'last_1h'\n ? nowMs - HOUR_MS\n : preset === 'last_6h'\n ? nowMs - 6 * HOUR_MS\n : preset === 'last_24h'\n ? nowMs - 24 * HOUR_MS\n : availableStartMs\n const boundedStartMs = preset === 'all' ? rawStartMs : Math.max(rawStartMs, availableStartMs)\n return {\n preset,\n startMs: Math.min(boundedStartMs, nowMs),\n endMs: nowMs,\n }\n}\n\nfunction bucketsInRange(buckets: ModuleResourceUsageTimeBucket[], range: UsageRange): ModuleResourceUsageTimeBucket[] {\n return buckets.filter((bucket) => {\n const bucketStartMs = Date.parse(bucket.bucketStart)\n const bucketEndMs = Date.parse(bucket.bucketEnd)\n if (!Number.isFinite(bucketStartMs) || !Number.isFinite(bucketEndMs)) return false\n return bucketEndMs > range.startMs && bucketStartMs <= range.endMs\n })\n}\n\n// Hours of telemetry actually observed in the range (sum of the returned buckets' own\n// intervals), not the wall-clock span of the range. Buckets are only created when an\n// operation runs, so idle stretches with no tracked calls would otherwise dilute the\n// wall-clock denominator and make \"per hour\" rates incomparable across range presets\n// (e.g. \"Today\" diluted by idle daytime vs. \"Last hour\" right after a burst).\nfunction activeRangeHours(buckets: ModuleResourceUsageTimeBucket[], bucketIntervalMs: number | undefined): number {\n const fallbackIntervalMs = bucketIntervalMs && Number.isFinite(bucketIntervalMs) && bucketIntervalMs > 0\n ? bucketIntervalMs\n : HOUR_MS\n if (!buckets.length) return fallbackIntervalMs / HOUR_MS\n const totalMs = buckets.reduce((sum, bucket) => {\n const interval = Number.isFinite(bucket.bucketIntervalMs) && bucket.bucketIntervalMs > 0\n ? bucket.bucketIntervalMs\n : fallbackIntervalMs\n return sum + interval\n }, 0)\n return Math.max(fallbackIntervalMs / HOUR_MS, totalMs / HOUR_MS)\n}\n\nfunction formatActiveDuration(hours: number): string {\n if (!Number.isFinite(hours) || hours <= 0) return '0m'\n if (hours < 1) return `${Math.max(Math.round(hours * 60), 1)}m`\n if (hours < 10) return `${hours.toFixed(1)}h`\n return `${Math.round(hours)}h`\n}\n\nfunction usageRangeLabel(preset: UsageRangePreset, translate: (key: string, fallback?: string) => string): string {\n if (preset === 'today') return translate('configs.moduleTelemetry.range.today', 'Today')\n if (preset === 'last_1h') return translate('configs.moduleTelemetry.range.last1h', 'Last hour')\n if (preset === 'last_6h') return translate('configs.moduleTelemetry.range.last6h', 'Last 6 hours')\n if (preset === 'last_24h') return translate('configs.moduleTelemetry.range.last24h', 'Last 24 hours')\n return translate('configs.moduleTelemetry.range.all', 'All available')\n}\n\nfunction isUsageRangePreset(value: string | null): value is UsageRangePreset {\n return !!value && USAGE_RANGE_PRESETS.includes(value as UsageRangePreset)\n}\n\nfunction readUsageRangePreset(searchParams: { get(name: string): string | null } | null): UsageRangePreset {\n const value = searchParams?.get('range') ?? null\n return isUsageRangePreset(value) ? value : 'today'\n}\n\nfunction usageStageLabel(stage: ModuleResourceUsageTimeBucket['stage'], translate: (key: string, fallback?: string) => string): string {\n if (stage === 'startup') return translate('configs.moduleTelemetry.stage.startup', 'Startup')\n return translate('configs.moduleTelemetry.stage.running', 'Running')\n}\n\nfunction sortStageRows(a: RangeModuleSummary, b: RangeModuleSummary): number {\n if (a.stage !== b.stage) return a.stage === 'startup' ? -1 : 1\n return b.totalCpuMs - a.totalCpuMs\n}\n\nfunction groupRangeModules(modules: RangeModuleSummary[]): RangeModuleGroup[] {\n const groups = new Map<string, RangeModuleSummary[]>()\n for (const module of modules) {\n const group = groups.get(module.moduleId) ?? []\n group.push(module)\n groups.set(module.moduleId, group)\n }\n\n return Array.from(groups.entries()).map(([moduleId, stages]) => {\n const candidateReasons = Array.from(new Set(stages.flatMap((stage) => stage.candidateReasons)))\n return {\n moduleId,\n stages: [...stages].sort(sortStageRows),\n candidateReasons,\n calls: stages.reduce((sum, stage) => sum + stage.calls, 0),\n totalCpuMs: stages.reduce((sum, stage) => sum + stage.totalCpuMs, 0),\n positiveRssDeltaBytes: stages.reduce((sum, stage) => sum + stage.positiveRssDeltaBytes, 0),\n }\n }).sort((a, b) =>\n b.candidateReasons.length - a.candidateReasons.length\n || b.totalCpuMs - a.totalCpuMs\n || b.positiveRssDeltaBytes - a.positiveRssDeltaBytes\n || b.calls - a.calls\n || a.moduleId.localeCompare(b.moduleId)\n )\n}\n\n// Thresholds are sized as \"per 5-minute bucket\" heavy-usage limits (see\n// getModuleResourceUsageThresholds()). A range can span anywhere from one bucket (\"Last hour\")\n// to hundreds (\"Today\"/\"All available\"), so comparing a raw range-wide sum against a per-bucket\n// threshold makes longer ranges strictly more likely to flag a signal regardless of actual\n// per-window intensity. Normalize CPU/heap/RSS/errors to \"average per bucket this module was\n// active in\" before comparing, so the same sustained workload reads the same way at any range.\n// p95DurationMs is already a max across buckets (not a sum), so it needs no normalization.\nfunction buildCandidateReasonsForModule(\n module: Pick<ModuleResourceUsageTimeBucketModule, 'p95DurationMs' | 'totalCpuMs' | 'positiveHeapDeltaBytes' | 'positiveRssDeltaBytes' | 'errors'>,\n thresholds: ModuleResourceUsageReport['thresholds'],\n bucketCount: number,\n): string[] {\n const divisor = Math.max(1, bucketCount)\n const reasons: string[] = []\n if (module.p95DurationMs >= thresholds.p95DurationMs) reasons.push('p95_duration')\n if (module.totalCpuMs / divisor >= thresholds.cpuMs) reasons.push('cpu')\n if (module.positiveHeapDeltaBytes / divisor >= thresholds.positiveHeapDeltaBytes) reasons.push('heap_allocations')\n if (module.positiveRssDeltaBytes / divisor >= thresholds.positiveRssDeltaBytes) reasons.push('rss_growth')\n if (module.errors / divisor >= thresholds.errors) reasons.push('errors')\n return reasons\n}\n\nfunction mergeRangeOperations(modules: ModuleResourceUsageTimeBucketModule[]) {\n const operations = new Map<string, ModuleResourceUsageTimeBucketModule['topOperations'][number]>()\n for (const module of modules) {\n for (const operation of module.topOperations) {\n const key = `${operation.surface}\\u0000${operation.operation}\\u0000${operation.resourceId ?? ''}`\n const existing = operations.get(key)\n if (!existing) {\n operations.set(key, { ...operation })\n continue\n }\n existing.calls += operation.calls\n existing.errors += operation.errors\n existing.totalDurationMs += operation.totalDurationMs\n existing.maxDurationMs = Math.max(existing.maxDurationMs, operation.maxDurationMs)\n existing.p95DurationMs = Math.max(existing.p95DurationMs, operation.p95DurationMs)\n existing.totalCpuUserMs += operation.totalCpuUserMs\n existing.totalCpuSystemMs += operation.totalCpuSystemMs\n existing.maxCpuMs = Math.max(existing.maxCpuMs, operation.maxCpuMs)\n existing.totalHeapDeltaBytes += operation.totalHeapDeltaBytes\n existing.positiveHeapDeltaBytes += operation.positiveHeapDeltaBytes\n existing.maxHeapDeltaBytes = Math.max(existing.maxHeapDeltaBytes, operation.maxHeapDeltaBytes)\n existing.totalRssDeltaBytes += operation.totalRssDeltaBytes\n existing.positiveRssDeltaBytes += operation.positiveRssDeltaBytes\n existing.maxRssDeltaBytes = Math.max(existing.maxRssDeltaBytes, operation.maxRssDeltaBytes)\n existing.firstSeenAt = existing.firstSeenAt < operation.firstSeenAt ? existing.firstSeenAt : operation.firstSeenAt\n existing.lastSeenAt = existing.lastSeenAt > operation.lastSeenAt ? existing.lastSeenAt : operation.lastSeenAt\n }\n }\n return Array.from(operations.values())\n .sort((a, b) =>\n (b.totalCpuUserMs + b.totalCpuSystemMs) - (a.totalCpuUserMs + a.totalCpuSystemMs)\n || b.totalDurationMs - a.totalDurationMs\n || b.calls - a.calls\n )\n .slice(0, 5)\n}\n\nfunction mergeRangeSurfaces(modules: ModuleResourceUsageTimeBucketModule[]): ModuleResourceUsageTimeBucketModule['surfaces'] {\n const surfaces = new Map<string, ModuleResourceUsageTimeBucketModule['surfaces'][number]>()\n for (const module of modules) {\n for (const surface of module.surfaces) {\n const existing = surfaces.get(surface.surface)\n if (!existing) {\n surfaces.set(surface.surface, { ...surface })\n continue\n }\n existing.calls += surface.calls\n existing.errors += surface.errors\n existing.totalDurationMs += surface.totalDurationMs\n existing.p95DurationMs = Math.max(existing.p95DurationMs, surface.p95DurationMs)\n existing.totalCpuMs += surface.totalCpuMs\n existing.positiveHeapDeltaBytes += surface.positiveHeapDeltaBytes\n existing.positiveRssDeltaBytes += surface.positiveRssDeltaBytes\n }\n }\n return Array.from(surfaces.values()).sort((a, b) => b.totalCpuMs - a.totalCpuMs || b.totalDurationMs - a.totalDurationMs)\n}\n\nfunction aggregateRangeModules(\n buckets: ModuleResourceUsageTimeBucket[],\n thresholds: ModuleResourceUsageReport['thresholds'],\n): RangeModuleSummary[] {\n const grouped = new Map<string, {\n moduleId: string\n stage: ModuleResourceUsageTimeBucket['stage']\n modules: ModuleResourceUsageTimeBucketModule[]\n // Distinct bucketStart values this module+stage appeared in. Tracked explicitly (rather than\n // relying on modules.length) so the \"per-bucket average\" candidate-signal divisor stays\n // correct even if a future change ever pushes more/fewer than one module entry per bucket.\n bucketKeys: Set<string>\n }>()\n for (const bucket of buckets) {\n for (const module of bucket.modules) {\n const key = `${module.moduleId}\\u0000${bucket.stage}`\n const group = grouped.get(key) ?? { moduleId: module.moduleId, stage: bucket.stage, modules: [], bucketKeys: new Set<string>() }\n group.modules.push(module)\n group.bucketKeys.add(bucket.bucketStart)\n grouped.set(key, group)\n }\n }\n\n return Array.from(grouped.values()).map(({ moduleId, stage, modules, bucketKeys }) => {\n const summaryBase = {\n moduleId,\n stage,\n calls: modules.reduce((sum, module) => sum + module.calls, 0),\n errors: modules.reduce((sum, module) => sum + module.errors, 0),\n totalDurationMs: modules.reduce((sum, module) => sum + module.totalDurationMs, 0),\n p95DurationMs: Math.max(...modules.map((module) => module.p95DurationMs), 0),\n totalCpuMs: modules.reduce((sum, module) => sum + module.totalCpuMs, 0),\n positiveHeapDeltaBytes: modules.reduce((sum, module) => sum + module.positiveHeapDeltaBytes, 0),\n positiveRssDeltaBytes: modules.reduce((sum, module) => sum + module.positiveRssDeltaBytes, 0),\n surfaces: mergeRangeSurfaces(modules),\n topOperations: mergeRangeOperations(modules),\n }\n return {\n ...summaryBase,\n candidateReasons: buildCandidateReasonsForModule(summaryBase, thresholds, bucketKeys.size),\n }\n }).sort((a, b) =>\n b.candidateReasons.length - a.candidateReasons.length\n || b.totalCpuMs - a.totalCpuMs\n || b.positiveRssDeltaBytes - a.positiveRssDeltaBytes\n || b.calls - a.calls\n )\n}\n\nfunction RangeOverview({\n buckets,\n modules,\n range,\n rangePreset,\n onRangePresetChange,\n bucketIntervalMs,\n translate,\n}: {\n buckets: ModuleResourceUsageTimeBucket[]\n modules: RangeModuleSummary[]\n range: UsageRange\n rangePreset: UsageRangePreset\n onRangePresetChange: (value: UsageRangePreset) => void\n bucketIntervalMs?: number\n translate: (key: string, fallback?: string, values?: Record<string, string | number>) => string\n}) {\n const selectedHours = activeRangeHours(buckets, bucketIntervalMs)\n const activeDurationLabel = formatActiveDuration(selectedHours)\n const bucketsLabel = bucketCountLabel(buckets, bucketIntervalMs, translate)\n const totalHeapGrowthBytes = modules.reduce((sum, module) => sum + module.positiveHeapDeltaBytes, 0)\n const totalRssGrowthBytes = modules.reduce((sum, module) => sum + module.positiveRssDeltaBytes, 0)\n const totals = {\n modules: new Set(modules.map((module) => module.moduleId)).size,\n calls: modules.reduce((sum, module) => sum + module.calls, 0),\n totalCpuMs: modules.reduce((sum, module) => sum + module.totalCpuMs, 0),\n avgHeapGrowthPerHour: totalHeapGrowthBytes / selectedHours,\n avgRssGrowthPerHour: totalRssGrowthBytes / selectedHours,\n }\n const growthTooltip = translate(\n 'configs.moduleTelemetry.overview.growthTooltip',\n 'Average positive growth per hour of measured activity in the selected range: total growth divided by the hours actually covered by tracked buckets, not the full wall-clock span. Idle stretches with no tracked calls do not dilute this rate, so it stays comparable across range presets. This is allocation pressure over time, not the current live process memory.',\n )\n const heapSubValue = translate(\n 'configs.moduleTelemetry.overview.growthSubValue',\n '{{total}} total over {{duration}}',\n { total: formatBytes(totalHeapGrowthBytes), duration: activeDurationLabel },\n )\n const rssSubValue = translate(\n 'configs.moduleTelemetry.overview.growthSubValue',\n '{{total}} total over {{duration}}',\n { total: formatBytes(totalRssGrowthBytes), duration: activeDurationLabel },\n )\n\n return (\n <div className=\"space-y-4 rounded-lg border bg-card p-4\">\n <div className=\"flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between\">\n <div className=\"space-y-1\">\n <h3 className=\"text-base font-semibold\">{translate('configs.moduleTelemetry.overview.title', 'Usage overview')}</h3>\n <p className=\"text-sm text-muted-foreground\">\n {translate(\n 'configs.moduleTelemetry.overview.description',\n 'From {{from}} to now \u00B7 {{buckets}}',\n {\n from: formatRangeBoundary(range.startMs),\n buckets: bucketsLabel,\n },\n )}\n </p>\n </div>\n <div className=\"flex flex-col gap-2 sm:flex-row\">\n <SegmentedControl\n value={rangePreset}\n onValueChange={(value) => onRangePresetChange(value as UsageRangePreset)}\n aria-label={translate('configs.moduleTelemetry.range.label', 'Time range')}\n size=\"sm\"\n className=\"max-w-full flex-wrap overflow-x-auto rounded-lg\"\n >\n {USAGE_RANGE_PRESETS.map((option) => (\n <SegmentedControlItem key={option} value={option}>\n {usageRangeLabel(option, translate)}\n </SegmentedControlItem>\n ))}\n </SegmentedControl>\n </div>\n </div>\n <div className=\"grid gap-4 md:grid-cols-2 xl:grid-cols-5\">\n <MetricCard\n label={translate('configs.moduleTelemetry.overview.modules', 'Modules')}\n tooltip={translate('configs.moduleTelemetry.overview.modulesTooltip', 'Unique modules with tracked activity in the selected range. Startup and running are shown as separate rows inside each module group.')}\n value={formatCount(totals.modules)}\n />\n <MetricCard\n label={translate('configs.moduleTelemetry.overview.calls', 'Calls')}\n tooltip={translate('configs.moduleTelemetry.overview.callsTooltip', 'Total tracked operation calls in the selected range.')}\n value={formatCount(totals.calls)}\n />\n <MetricCard\n label={translate('configs.moduleTelemetry.overview.cpu', 'CPU')}\n tooltip={translate('configs.moduleTelemetry.overview.cpuTooltip', 'Total CPU time attributed to tracked module operations in the selected range.')}\n value={formatMs(totals.totalCpuMs)}\n />\n <MetricCard\n label={translate('configs.moduleTelemetry.overview.heapPerHour', 'Heap / hour')}\n tooltip={growthTooltip}\n value={formatBytes(totals.avgHeapGrowthPerHour)}\n subValue={heapSubValue}\n />\n <MetricCard\n label={translate('configs.moduleTelemetry.overview.rssPerHour', 'RSS / hour')}\n tooltip={growthTooltip}\n value={formatBytes(totals.avgRssGrowthPerHour)}\n subValue={rssSubValue}\n />\n </div>\n </div>\n )\n}\n\nfunction CandidateBadges({\n module,\n translate,\n}: {\n module: ModuleResourceUsageTimeBucketModule\n translate: (key: string, fallback?: string, values?: Record<string, string | number>) => string\n}) {\n if (!module.candidateReasons.length) {\n return (\n <StatusBadge variant=\"neutral\" dot>\n {translate('configs.moduleTelemetry.table.normal', 'Normal')}\n </StatusBadge>\n )\n }\n\n return (\n <div className=\"flex flex-wrap gap-1.5\">\n {module.candidateReasons.map((reason) => (\n <StatusBadge key={reason} variant=\"warning\" dot>\n {translate(REASON_LABEL_KEYS[reason] ?? `configs.moduleTelemetry.reason.${reason}`, REASON_FALLBACKS[reason] ?? reason)}\n </StatusBadge>\n ))}\n </div>\n )\n}\n\nfunction StageBadge({\n stage,\n translate,\n}: {\n stage: ModuleResourceUsageTimeBucket['stage']\n translate: (key: string, fallback?: string, values?: Record<string, string | number>) => string\n}) {\n return (\n <StatusBadge variant={stage === 'startup' ? 'info' : 'neutral'} dot>\n {usageStageLabel(stage, translate)}\n </StatusBadge>\n )\n}\n\nfunction copyRowStats(module: RangeModuleSummary, translate: (key: string, fallback?: string) => string): void {\n const json = JSON.stringify(module, null, 2)\n navigator.clipboard\n .writeText(json)\n .then(() => {\n flash(translate('configs.moduleTelemetry.table.copySuccess', 'Row stats copied to clipboard.'), 'success')\n })\n .catch((err) => {\n logger.warn('clipboard write failed', { component: 'ModuleTelemetryPanel', err })\n flash(translate('configs.moduleTelemetry.table.copyError', 'Failed to copy row stats.'), 'error')\n })\n}\n\nfunction TopOperationsBreakdown({\n operations,\n translate,\n}: {\n operations: ModuleResourceUsageEntry[]\n translate: (key: string, fallback?: string, values?: Record<string, string | number>) => string\n}) {\n return (\n <div className=\"w-[26rem] max-w-[80vw] space-y-2\">\n <div className=\"text-xs font-semibold uppercase tracking-wide text-muted-foreground\">\n {translate('configs.moduleTelemetry.table.topOperationsBreakdown', 'Top operations in this range')}\n </div>\n <table className=\"w-full text-xs\">\n <thead>\n <tr className=\"text-muted-foreground\">\n <th className=\"pb-1 pr-2 text-left font-medium\">{translate('configs.moduleTelemetry.table.topOperation', 'Top operation')}</th>\n <th className=\"pb-1 pr-2 text-right font-medium\">{translate('configs.moduleTelemetry.table.calls', 'Calls')}</th>\n <th className=\"pb-1 pr-2 text-right font-medium\">{translate('configs.moduleTelemetry.table.worstP95', 'Worst p95')}</th>\n <th className=\"pb-1 pr-2 text-right font-medium\">{translate('configs.moduleTelemetry.table.cpu', 'CPU')}</th>\n <th className=\"pb-1 pr-2 text-right font-medium\">{translate('configs.moduleTelemetry.table.heap', 'Heap growth')}</th>\n <th className=\"pb-1 text-right font-medium\">{translate('configs.moduleTelemetry.table.rss', 'RSS growth')}</th>\n </tr>\n </thead>\n <tbody>\n {operations.map((operation, index) => (\n <tr key={`${operation.surface}\u0000${operation.operation}\u0000${index}`} className=\"border-t border-border/50\">\n <td className=\"py-1 pr-2 align-top\">\n <div className=\"font-medium text-foreground\">{operation.operation}</div>\n <div className=\"text-muted-foreground\">\n {operation.surface}\n {operation.errors > 0\n ? ` \u00B7 ${translate('configs.moduleTelemetry.table.errorCount', '{{count}} errors', { count: operation.errors })}`\n : ''}\n </div>\n {operation.concurrentCalls > 0 ? (\n <div className=\"text-muted-foreground\">\n {translate(\n 'configs.moduleTelemetry.table.concurrentOverlap',\n '{{percent}}% overlapped other calls \u2014 CPU/heap/RSS less certain',\n { percent: Math.round((operation.concurrentCalls / Math.max(operation.calls, 1)) * 100) },\n )}\n </div>\n ) : null}\n </td>\n <td className=\"py-1 pr-2 text-right align-top\">{formatCount(operation.calls)}</td>\n <td className=\"py-1 pr-2 text-right align-top\">{formatMs(operation.p95DurationMs)}</td>\n <td className=\"py-1 pr-2 text-right align-top\">{formatMs(operation.totalCpuUserMs + operation.totalCpuSystemMs)}</td>\n <td className=\"py-1 pr-2 text-right align-top\">{formatBytes(operation.positiveHeapDeltaBytes)}</td>\n <td className=\"py-1 text-right align-top\">{formatBytes(operation.positiveRssDeltaBytes)}</td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n )\n}\n\nfunction RangeModuleTable({\n modules,\n translate,\n}: {\n modules: RangeModuleSummary[]\n translate: (key: string, fallback?: string, values?: Record<string, string | number>) => string\n}) {\n if (!modules.length) {\n return (\n <p className=\"text-sm text-muted-foreground\">\n {translate('configs.moduleTelemetry.modules.empty', 'No module activity has been recorded for this range yet.')}\n </p>\n )\n }\n\n const groups = groupRangeModules(modules)\n\n return (\n <TooltipProvider delayDuration={200}>\n <div className=\"overflow-x-auto\">\n <table className=\"w-full min-w-[980px] text-sm\">\n <thead>\n <tr className=\"text-xs uppercase tracking-wide text-muted-foreground\">\n <th className=\"px-3 py-2 text-left\">{translate('configs.moduleTelemetry.table.module', 'Module')}</th>\n <th className=\"px-3 py-2 text-left\">{translate('configs.moduleTelemetry.table.stage', 'Stage')}</th>\n <th className=\"px-3 py-2 text-left\">\n <MetricTitle\n label={translate('configs.moduleTelemetry.table.signals', 'Signals')}\n tooltip={translate(\n 'configs.moduleTelemetry.table.signalsTooltip',\n 'Flags a module whose CPU, heap growth, RSS growth, or errors average at or above a heavy-usage threshold per 5-minute bucket it was active in during this range. This is a per-bucket average, not a raw range-wide total, so the same sustained workload looks the same regardless of the selected time range.',\n )}\n />\n </th>\n <th className=\"px-3 py-2 text-right\">{translate('configs.moduleTelemetry.table.calls', 'Calls')}</th>\n <th className=\"px-3 py-2 text-right\">{translate('configs.moduleTelemetry.table.worstP95', 'Worst p95')}</th>\n <th className=\"px-3 py-2 text-right\">{translate('configs.moduleTelemetry.table.cpu', 'CPU')}</th>\n <th className=\"px-3 py-2 text-right\">{translate('configs.moduleTelemetry.table.heap', 'Heap growth')}</th>\n <th className=\"px-3 py-2 text-right\">{translate('configs.moduleTelemetry.table.rss', 'RSS growth')}</th>\n <th className=\"px-3 py-2 text-left\">{translate('configs.moduleTelemetry.table.topOperation', 'Top operation')}</th>\n <th className=\"px-3 py-2 text-right\">{translate('configs.moduleTelemetry.table.actions', 'Actions')}</th>\n </tr>\n </thead>\n <tbody>\n {groups.map((group) => (\n <React.Fragment key={group.moduleId}>\n {group.stages.map((module, stageIndex) => {\n const topOperation = module.topOperations[0]\n const topSurface = module.surfaces[0]\n return (\n <tr\n key={`${module.moduleId}:${module.stage}`}\n className={stageIndex === 0 ? 'border-t' : 'border-t border-border/50'}\n >\n {stageIndex === 0 ? (\n <td className=\"w-56 px-3 py-3 align-top\" rowSpan={group.stages.length}>\n <div className=\"flex flex-col gap-1\">\n <span className=\"font-medium\">{group.moduleId}</span>\n <span className=\"text-xs text-muted-foreground\">\n {translate(\n 'configs.moduleTelemetry.table.stageCount',\n '{{count}} stage rows',\n { count: group.stages.length },\n )}\n </span>\n </div>\n </td>\n ) : null}\n <td className=\"px-3 py-3 align-top\">\n <div className=\"flex flex-col gap-1\">\n <StageBadge stage={module.stage} translate={translate} />\n <span className=\"text-xs text-muted-foreground\">\n {topSurface\n ? translate(\n 'configs.moduleTelemetry.table.surfaceSummary',\n '{{surface}} \u00B7 {{calls}} calls',\n { surface: topSurface.surface, calls: topSurface.calls },\n )\n : translate('configs.moduleTelemetry.table.noSurface', 'No surface data')}\n </span>\n </div>\n </td>\n <td className=\"px-3 py-3 align-top\">\n <CandidateBadges module={module} translate={translate} />\n </td>\n <td className=\"px-3 py-3 align-top text-right\">\n <div className=\"flex flex-col gap-1\">\n <span>{formatCount(module.calls)}</span>\n {module.errors > 0 ? (\n <span className=\"text-xs text-destructive\">\n {translate('configs.moduleTelemetry.table.errorCount', '{{count}} errors', { count: module.errors })}\n </span>\n ) : null}\n </div>\n </td>\n <td className=\"px-3 py-3 align-top text-right\">{formatMs(module.p95DurationMs)}</td>\n <td className=\"px-3 py-3 align-top text-right\">{formatMs(module.totalCpuMs)}</td>\n <td className=\"px-3 py-3 align-top text-right\">{formatBytes(module.positiveHeapDeltaBytes)}</td>\n <td className=\"px-3 py-3 align-top text-right\">{formatBytes(module.positiveRssDeltaBytes)}</td>\n <td className=\"px-3 py-3 align-top\">\n {topOperation ? (\n <Tooltip delayDuration={200}>\n <TooltipTrigger asChild>\n <div className=\"flex cursor-default flex-col gap-1\">\n <span className=\"font-medium underline decoration-dotted decoration-muted-foreground underline-offset-2\">\n {topOperation.operation}\n </span>\n <span className=\"text-xs text-muted-foreground\">\n {translate(\n 'configs.moduleTelemetry.table.topOperationMeta',\n '{{surface}} \u00B7 {{cpu}} CPU \u00B7 {{calls}} calls',\n {\n surface: topOperation.surface,\n cpu: formatMs(topOperation.totalCpuUserMs + topOperation.totalCpuSystemMs),\n calls: topOperation.calls,\n },\n )}\n </span>\n </div>\n </TooltipTrigger>\n <TooltipContent side=\"left\" align=\"start\" variant=\"light\" className=\"max-w-none p-3\">\n <TopOperationsBreakdown operations={module.topOperations} translate={translate} />\n </TooltipContent>\n </Tooltip>\n ) : (\n <span className=\"text-muted-foreground\">{translate('configs.moduleTelemetry.table.none', 'None')}</span>\n )}\n </td>\n <td className=\"px-3 py-3 align-top text-right\">\n <SimpleTooltip\n content={translate('configs.moduleTelemetry.table.copyStats', 'Copy row stats for debugging')}\n side=\"top\"\n align=\"center\"\n variant=\"light\"\n >\n <IconButton\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n aria-label={translate('configs.moduleTelemetry.table.copyStats', 'Copy row stats for debugging')}\n onClick={() => copyRowStats(module, translate)}\n >\n <Copy className=\"h-4 w-4\" aria-hidden=\"true\" />\n </IconButton>\n </SimpleTooltip>\n </td>\n </tr>\n )\n })}\n </React.Fragment>\n ))}\n </tbody>\n </table>\n </div>\n </TooltipProvider>\n )\n}\n\nfunction RangeModuleSection({\n modules,\n range,\n bucketIntervalMs,\n bucketsLabel,\n translate,\n}: {\n modules: RangeModuleSummary[]\n range: UsageRange\n bucketIntervalMs?: number\n bucketsLabel: string\n translate: (key: string, fallback?: string, values?: Record<string, string | number>) => string\n}) {\n return (\n <div className=\"space-y-4 rounded-lg border bg-card p-4\">\n <div className=\"space-y-1\">\n <h3 className=\"text-base font-semibold\">{translate('configs.moduleTelemetry.modules.title', 'Modules')}</h3>\n <p className=\"text-sm text-muted-foreground\">\n {translate(\n 'configs.moduleTelemetry.modules.description',\n 'Aggregated module stats from {{from}} to now across {{buckets}}. Startup and running rows are separated.',\n {\n from: formatRangeBoundary(range.startMs),\n buckets: bucketsLabel,\n },\n )}\n </p>\n <p className=\"text-xs text-muted-foreground\">\n {translate(\n 'configs.moduleTelemetry.modules.interval',\n 'Startup is the first {{interval}} bucket after telemetry starts. Later buckets are running.',\n { interval: formatBucketInterval(bucketIntervalMs) },\n )}\n </p>\n </div>\n <RangeModuleTable modules={modules} translate={translate} />\n </div>\n )\n}\n\nexport function ModuleTelemetryPanel() {\n const t = useT()\n const router = useRouter()\n const pathname = usePathname()\n const searchParams = useSearchParams()\n const [state, setState] = React.useState<FetchState>({ loading: true, error: null, report: null })\n const [clearingTelemetry, setClearingTelemetry] = React.useState(false)\n const rangeParam = searchParams.get('range')\n const [usageRangePreset, setUsageRangePreset] = React.useState<UsageRangePreset>(() => readUsageRangePreset(searchParams))\n const { confirm, ConfirmDialogElement } = useConfirmDialog()\n\n const { runMutation, retryLastMutation } = useGuardedMutation<{\n formId: string\n resourceKind: string\n retryLastMutation: () => Promise<boolean>\n }>({\n contextId: 'configs-module-telemetry',\n blockedMessage: t('ui.forms.flash.saveBlocked', 'Save blocked by validation'),\n })\n\n const clearMutationContext = React.useMemo(\n () => ({\n formId: 'configs-module-telemetry',\n resourceKind: 'configs.moduleTelemetry',\n retryLastMutation,\n }),\n [retryLastMutation],\n )\n\n const loadReport = React.useCallback(async () => {\n setState((current) => ({ ...current, loading: true, error: null }))\n try {\n const report = await readApiResultOrThrow<ModuleTelemetryApiResponse>(API_PATH, undefined, {\n errorMessage: t('configs.moduleTelemetry.loadError', 'Failed to load module telemetry.'),\n })\n setState({ loading: false, error: null, report })\n } catch (error) {\n const message =\n error instanceof Error && error.message\n ? error.message\n : t('configs.moduleTelemetry.loadError', 'Failed to load module telemetry.')\n setState({ loading: false, error: message, report: null })\n }\n }, [t])\n\n React.useEffect(() => {\n loadReport().catch(() => {})\n }, [loadReport])\n\n React.useEffect(() => {\n const nextRange = readUsageRangePreset(searchParams)\n setUsageRangePreset((current) => current === nextRange ? current : nextRange)\n }, [rangeParam, searchParams])\n\n const handleUsageRangeChange = React.useCallback((value: UsageRangePreset) => {\n setUsageRangePreset(value)\n const params = new URLSearchParams(searchParams.toString())\n params.set('range', value)\n const query = params.toString()\n router.replace(query ? `${pathname}?${query}` : pathname, { scroll: false })\n }, [pathname, router, searchParams])\n\n const handleRefresh = React.useCallback(() => {\n loadReport().catch(() => {})\n }, [loadReport])\n\n const handleClearTelemetry = React.useCallback(async () => {\n if (clearingTelemetry) return\n const confirmed = await confirm({\n title: t('configs.moduleTelemetry.clear.confirmTitle', 'Clear all telemetry data?'),\n text: t(\n 'configs.moduleTelemetry.clear.confirmText',\n 'This removes current module telemetry and local process telemetry files for this development instance.',\n ),\n confirmText: t('configs.moduleTelemetry.clear.confirmButton', 'Clear telemetry'),\n variant: 'destructive',\n })\n if (!confirmed) return\n\n setClearingTelemetry(true)\n try {\n await runMutation({\n // optimistic-lock-exempt: clears in-process/dev-only telemetry buckets and\n // local process telemetry files \u2014 there is no versioned entity (no updated_at)\n // to lock against, so no expected-version header applies.\n operation: () =>\n readApiResultOrThrow<ModuleTelemetryClearResponse>(\n API_PATH,\n { method: 'DELETE' },\n {\n errorMessage: t('configs.moduleTelemetry.clear.error', 'Failed to clear module telemetry.'),\n allowNullResult: true,\n },\n ),\n context: clearMutationContext,\n mutationPayload: {},\n })\n await loadReport()\n flash(t('configs.moduleTelemetry.clear.success', 'Module telemetry data cleared.'), 'success')\n } catch (error) {\n const message =\n error instanceof Error && error.message\n ? error.message\n : t('configs.moduleTelemetry.clear.error', 'Failed to clear module telemetry.')\n flash(message, 'error')\n } finally {\n setClearingTelemetry(false)\n }\n }, [clearMutationContext, clearingTelemetry, confirm, loadReport, runMutation, t])\n\n if (state.loading) {\n return (\n <section className=\"space-y-3 rounded-lg border bg-background p-6\">\n <header className=\"space-y-1\">\n <h2 className=\"text-lg font-semibold\">{t('configs.moduleTelemetry.title', 'Module telemetry')}</h2>\n <p className=\"text-sm text-muted-foreground\">\n {t('configs.moduleTelemetry.description', 'Preview module-level resource attribution collected in this process.')}\n </p>\n </header>\n <div className=\"flex items-center gap-2 text-sm text-muted-foreground\">\n <Spinner className=\"h-4 w-4\" />\n {t('configs.moduleTelemetry.loading', 'Loading module telemetry\u2026')}\n </div>\n </section>\n )\n }\n\n if (state.error) {\n return (\n <section className=\"space-y-3 rounded-lg border bg-background p-6\">\n <header className=\"space-y-1\">\n <h2 className=\"text-lg font-semibold\">{t('configs.moduleTelemetry.title', 'Module telemetry')}</h2>\n <p className=\"text-sm text-muted-foreground\">\n {t('configs.moduleTelemetry.description', 'Preview module-level resource attribution collected in this process.')}\n </p>\n </header>\n <ErrorMessage label={state.error} />\n <Button type=\"button\" variant=\"outline\" onClick={() => loadReport().catch(() => {})}>\n {t('configs.moduleTelemetry.retry', 'Retry')}\n </Button>\n </section>\n )\n }\n\n const report = state.report\n if (!report) return null\n const usageRange = resolveUsageRange(usageRangePreset, report.buckets ?? [], report.startedAt)\n const rangeBuckets = bucketsInRange(report.buckets ?? [], usageRange)\n const rangeModules = aggregateRangeModules(rangeBuckets, report.thresholds)\n const bucketsLabel = bucketCountLabel(rangeBuckets, report.bucketIntervalMs, t)\n const telemetryStartedAtMs = firstAvailableTelemetryMs(report.buckets ?? [], Date.parse(report.startedAt), Date.now())\n\n return (\n <section className=\"space-y-6 rounded-lg border bg-background p-6\">\n <header className=\"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between\">\n <div className=\"space-y-1\">\n <h2 className=\"text-lg font-semibold\">{t('configs.moduleTelemetry.title', 'Module telemetry')}</h2>\n <p className=\"text-sm text-muted-foreground\">\n {t('configs.moduleTelemetry.description', 'Preview module-level resource attribution collected in this process.')}\n </p>\n <p className=\"text-xs text-muted-foreground\">\n {t(\n 'configs.moduleTelemetry.generatedAt',\n 'Report generated {{timestamp}}',\n { timestamp: new Date(report.generatedAt).toLocaleString() },\n )}\n </p>\n <p className=\"text-xs text-muted-foreground\">\n {t(\n 'configs.moduleTelemetry.startedAt',\n 'Collecting since {{timestamp}}',\n { timestamp: new Date(telemetryStartedAtMs).toLocaleString() },\n )}\n </p>\n </div>\n <div className=\"flex flex-wrap gap-2\">\n {report.canClearTelemetry ? (\n <Button\n type=\"button\"\n variant=\"destructive-outline\"\n onClick={() => { void handleClearTelemetry() }}\n disabled={clearingTelemetry}\n >\n <Trash2 className=\"h-4 w-4\" aria-hidden=\"true\" />\n {clearingTelemetry\n ? t('configs.moduleTelemetry.clear.clearing', 'Clearing...')\n : t('configs.moduleTelemetry.clear.button', 'Clear all telemetry data')}\n </Button>\n ) : null}\n <Button type=\"button\" variant=\"outline\" onClick={handleRefresh}>\n <RefreshCw className=\"h-4 w-4\" aria-hidden=\"true\" />\n {t('configs.moduleTelemetry.refresh', 'Refresh')}\n </Button>\n </div>\n </header>\n\n <RangeOverview\n buckets={rangeBuckets}\n modules={rangeModules}\n range={usageRange}\n rangePreset={usageRangePreset}\n onRangePresetChange={handleUsageRangeChange}\n bucketIntervalMs={report.bucketIntervalMs}\n translate={t}\n />\n <RangeModuleSection\n modules={rangeModules}\n range={usageRange}\n bucketIntervalMs={report.bucketIntervalMs}\n bucketsLabel={bucketsLabel}\n translate={t}\n />\n\n {ConfirmDialogElement}\n </section>\n )\n}\n\nexport default ModuleTelemetryPanel\n"],
|
|
5
|
+
"mappings": ";AAyKI,SACE,KADF;AAvKJ,YAAY,WAAW;AACvB,SAAS,aAAa,WAAW,uBAAuB;AACxD,SAAS,cAAc;AACvB;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,eAAe;AACxB,SAAS,mBAAmB;AAC5B,SAAS,eAAe,SAAS,gBAAgB,iBAAiB,sBAAsB;AACxF,SAAS,kBAAkB;AAC3B,SAAS,4BAA4B,mBAAmB;AACxD,SAAS,oBAAoB;AAC7B,SAAS,4BAA4B;AACrC,SAAS,aAAa;AACtB,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AACnC,SAAS,YAAY;AACrB,SAAS,MAAM,MAAM,WAAW,cAAc;AAO9C,SAAS,oBAAoB;AAE7B,MAAM,SAAS,aAAa,SAAS;A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;AAAA,MAAC;AAAA;AAAA,QACC,SAAS;AAAA,QACT,SAAS;AAAA,QACT,OAAO;AAAA,QACP,aAAa;AAAA,QACb,qBAAqB;AAAA,QACrB,kBAAkB,OAAO;AAAA,QACzB,WAAW;AAAA;AAAA,IACb;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,SAAS;AAAA,QACT,OAAO;AAAA,QACP,kBAAkB,OAAO;AAAA,QACzB;AAAA,QACA,WAAW;AAAA;AAAA,IACb;AAAA,IAEC;AAAA,KACH;AAEJ;AAEA,IAAO,+BAAQ;",
|
|
6
6
|
"names": ["report"]
|
|
7
7
|
}
|
|
@@ -18,7 +18,8 @@ function findGeneratedDir(startDir) {
|
|
|
18
18
|
}
|
|
19
19
|
function touchGeneratedBarrels(options = {}) {
|
|
20
20
|
const cwd = options.cwd ?? process.cwd();
|
|
21
|
-
const log = options.log ?? ((message) =>
|
|
21
|
+
const log = options.log ?? ((message) => process.stdout.write(`${message}
|
|
22
|
+
`));
|
|
22
23
|
const quiet = options.quiet === true;
|
|
23
24
|
const generatedDir = findGeneratedDir(cwd);
|
|
24
25
|
if (!generatedDir) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/modules/configs/lib/touchGeneratedBarrels.ts"],
|
|
4
|
-
"sourcesContent": ["import fs from 'node:fs'\nimport path from 'node:path'\n\nconst GENERATED_DIR_RELATIVE = path.join('.mercato', 'generated')\nconst TOUCHABLE_PATTERN = /\\.generated(?:\\.[a-z0-9]+)?(?:\\.ts|\\.checksum)$/i\nconst MAX_PARENT_WALK = 5\n\nexport type TouchGeneratedBarrelsOptions = {\n cwd?: string\n quiet?: boolean\n log?: (message: string) => void\n}\n\nexport type TouchGeneratedBarrelsResult = {\n generatedDir: string | null\n files: string[]\n}\n\nexport function findGeneratedDir(startDir: string): string | null {\n let current = path.resolve(startDir)\n for (let depth = 0; depth <= MAX_PARENT_WALK; depth += 1) {\n const candidate = path.join(current, GENERATED_DIR_RELATIVE)\n if (fs.existsSync(candidate) && fs.statSync(candidate).isDirectory()) {\n return candidate\n }\n const parent = path.dirname(current)\n if (parent === current) break\n current = parent\n }\n return null\n}\n\nexport function touchGeneratedBarrels(\n options: TouchGeneratedBarrelsOptions = {},\n): TouchGeneratedBarrelsResult {\n const cwd = options.cwd ?? process.cwd()\n const log = options.log ?? ((message: string) =>
|
|
5
|
-
"mappings": "AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;AAEjB,MAAM,yBAAyB,KAAK,KAAK,YAAY,WAAW;AAChE,MAAM,oBAAoB;AAC1B,MAAM,kBAAkB;AAajB,SAAS,iBAAiB,UAAiC;AAChE,MAAI,UAAU,KAAK,QAAQ,QAAQ;AACnC,WAAS,QAAQ,GAAG,SAAS,iBAAiB,SAAS,GAAG;AACxD,UAAM,YAAY,KAAK,KAAK,SAAS,sBAAsB;AAC3D,QAAI,GAAG,WAAW,SAAS,KAAK,GAAG,SAAS,SAAS,EAAE,YAAY,GAAG;AACpE,aAAO;AAAA,IACT;AACA,UAAM,SAAS,KAAK,QAAQ,OAAO;AACnC,QAAI,WAAW,QAAS;AACxB,cAAU;AAAA,EACZ;AACA,SAAO;AACT;AAEO,SAAS,sBACd,UAAwC,CAAC,GACZ;AAC7B,QAAM,MAAM,QAAQ,OAAO,QAAQ,IAAI;AACvC,QAAM,MAAM,QAAQ,QAAQ,CAAC,YAAoB,QAAQ,
|
|
4
|
+
"sourcesContent": ["import fs from 'node:fs'\nimport path from 'node:path'\n\nconst GENERATED_DIR_RELATIVE = path.join('.mercato', 'generated')\nconst TOUCHABLE_PATTERN = /\\.generated(?:\\.[a-z0-9]+)?(?:\\.ts|\\.checksum)$/i\nconst MAX_PARENT_WALK = 5\n\nexport type TouchGeneratedBarrelsOptions = {\n cwd?: string\n quiet?: boolean\n log?: (message: string) => void\n}\n\nexport type TouchGeneratedBarrelsResult = {\n generatedDir: string | null\n files: string[]\n}\n\nexport function findGeneratedDir(startDir: string): string | null {\n let current = path.resolve(startDir)\n for (let depth = 0; depth <= MAX_PARENT_WALK; depth += 1) {\n const candidate = path.join(current, GENERATED_DIR_RELATIVE)\n if (fs.existsSync(candidate) && fs.statSync(candidate).isDirectory()) {\n return candidate\n }\n const parent = path.dirname(current)\n if (parent === current) break\n current = parent\n }\n return null\n}\n\nexport function touchGeneratedBarrels(\n options: TouchGeneratedBarrelsOptions = {},\n): TouchGeneratedBarrelsResult {\n const cwd = options.cwd ?? process.cwd()\n const log = options.log ?? ((message: string) => process.stdout.write(`${message}\\n`))\n const quiet = options.quiet === true\n\n const generatedDir = findGeneratedDir(cwd)\n if (!generatedDir) {\n return { generatedDir: null, files: [] }\n }\n\n const touched: string[] = []\n const entries = fs.readdirSync(generatedDir, { withFileTypes: true })\n for (const entry of entries) {\n if (!entry.isFile()) continue\n if (!TOUCHABLE_PATTERN.test(entry.name)) continue\n const filePath = path.join(generatedDir, entry.name)\n const contents = fs.readFileSync(filePath)\n fs.writeFileSync(filePath, contents)\n touched.push(filePath)\n }\n\n if (!quiet && touched.length > 0) {\n log(`\uD83D\uDD01 [structural] touched ${touched.length} generated barrel(s) \u2192 ${generatedDir}`)\n }\n\n return { generatedDir, files: touched }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;AAEjB,MAAM,yBAAyB,KAAK,KAAK,YAAY,WAAW;AAChE,MAAM,oBAAoB;AAC1B,MAAM,kBAAkB;AAajB,SAAS,iBAAiB,UAAiC;AAChE,MAAI,UAAU,KAAK,QAAQ,QAAQ;AACnC,WAAS,QAAQ,GAAG,SAAS,iBAAiB,SAAS,GAAG;AACxD,UAAM,YAAY,KAAK,KAAK,SAAS,sBAAsB;AAC3D,QAAI,GAAG,WAAW,SAAS,KAAK,GAAG,SAAS,SAAS,EAAE,YAAY,GAAG;AACpE,aAAO;AAAA,IACT;AACA,UAAM,SAAS,KAAK,QAAQ,OAAO;AACnC,QAAI,WAAW,QAAS;AACxB,cAAU;AAAA,EACZ;AACA,SAAO;AACT;AAEO,SAAS,sBACd,UAAwC,CAAC,GACZ;AAC7B,QAAM,MAAM,QAAQ,OAAO,QAAQ,IAAI;AACvC,QAAM,MAAM,QAAQ,QAAQ,CAAC,YAAoB,QAAQ,OAAO,MAAM,GAAG,OAAO;AAAA,CAAI;AACpF,QAAM,QAAQ,QAAQ,UAAU;AAEhC,QAAM,eAAe,iBAAiB,GAAG;AACzC,MAAI,CAAC,cAAc;AACjB,WAAO,EAAE,cAAc,MAAM,OAAO,CAAC,EAAE;AAAA,EACzC;AAEA,QAAM,UAAoB,CAAC;AAC3B,QAAM,UAAU,GAAG,YAAY,cAAc,EAAE,eAAe,KAAK,CAAC;AACpE,aAAW,SAAS,SAAS;AAC3B,QAAI,CAAC,MAAM,OAAO,EAAG;AACrB,QAAI,CAAC,kBAAkB,KAAK,MAAM,IAAI,EAAG;AACzC,UAAM,WAAW,KAAK,KAAK,cAAc,MAAM,IAAI;AACnD,UAAM,WAAW,GAAG,aAAa,QAAQ;AACzC,OAAG,cAAc,UAAU,QAAQ;AACnC,YAAQ,KAAK,QAAQ;AAAA,EACvB;AAEA,MAAI,CAAC,SAAS,QAAQ,SAAS,GAAG;AAChC,QAAI,kCAA2B,QAAQ,MAAM,+BAA0B,YAAY,EAAE;AAAA,EACvF;AAEA,SAAO,EAAE,cAAc,OAAO,QAAQ;AACxC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -3,6 +3,8 @@ import { appVersion } from "@open-mercato/shared/lib/version";
|
|
|
3
3
|
import { parseBooleanToken } from "@open-mercato/shared/lib/boolean";
|
|
4
4
|
import { UpgradeActionRun } from "../data/entities.js";
|
|
5
5
|
import { actionsUpToVersion, findUpgradeAction } from "../lib/upgrade-actions.js";
|
|
6
|
+
import { createLogger } from "@open-mercato/shared/lib/logger";
|
|
7
|
+
const logger = createLogger("configs");
|
|
6
8
|
function isUpgradeActionsEnabled() {
|
|
7
9
|
return parseBooleanToken(process.env.UPGRADE_ACTIONS_ENABLED ?? "") === true;
|
|
8
10
|
}
|
|
@@ -41,7 +43,8 @@ async function executeUpgradeAction(container, {
|
|
|
41
43
|
}
|
|
42
44
|
const em = container.resolve("em");
|
|
43
45
|
const status = await em.transactional(async (tem) => {
|
|
44
|
-
|
|
46
|
+
logger.info("Executing upgrade action", {
|
|
47
|
+
component: "upgrade-actions",
|
|
45
48
|
actionId: definition.id,
|
|
46
49
|
version: definition.version,
|
|
47
50
|
requestedVersion: version,
|
|
@@ -64,10 +67,10 @@ async function executeUpgradeAction(container, {
|
|
|
64
67
|
});
|
|
65
68
|
tem.persist(record);
|
|
66
69
|
await tem.flush();
|
|
67
|
-
|
|
70
|
+
logger.info("Upgrade action completed", { component: "upgrade-actions", actionId: definition.id, version, tenantId, organizationId });
|
|
68
71
|
return "completed";
|
|
69
72
|
}).catch((error) => {
|
|
70
|
-
|
|
73
|
+
logger.error("Upgrade action failed", { component: "upgrade-actions", actionId, tenantId, organizationId, version, err: error });
|
|
71
74
|
if (error instanceof UniqueConstraintViolationException) {
|
|
72
75
|
return "already_completed";
|
|
73
76
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/modules/configs/services/upgradeActionsService.ts"],
|
|
4
|
-
"sourcesContent": ["import { UniqueConstraintViolationException } from '@mikro-orm/core'\nimport type { EntityManager } from '@mikro-orm/postgresql'\nimport type { AwilixContainer } from 'awilix'\nimport { appVersion } from '@open-mercato/shared/lib/version'\nimport { parseBooleanToken } from '@open-mercato/shared/lib/boolean'\nimport { UpgradeActionRun } from '../data/entities'\nimport { actionsUpToVersion, findUpgradeAction, type UpgradeActionDefinition } from '../lib/upgrade-actions'\n\nexport type UpgradeActionStatus = 'completed' | 'already_completed'\n\nexport function isUpgradeActionsEnabled(): boolean {\n return parseBooleanToken(process.env.UPGRADE_ACTIONS_ENABLED ?? '') === true\n}\n\nexport function getCurrentVersion(): string {\n return appVersion\n}\n\nexport async function listPendingUpgradeActions(\n em: EntityManager,\n {\n tenantId,\n organizationId,\n version = appVersion,\n }: { tenantId: string; organizationId: string; version?: string },\n): Promise<UpgradeActionDefinition[]> {\n if (!isUpgradeActionsEnabled()) return []\n const definitions = actionsUpToVersion(version)\n if (!definitions.length) return []\n const versions = Array.from(new Set(definitions.map((definition) => definition.version)))\n const runs = await em.find(UpgradeActionRun, {\n tenantId,\n organizationId,\n version: { $in: versions },\n })\n const completed = new Set(runs.map((run) => `${run.version}::${run.actionId}`))\n return definitions.filter((definition) => !completed.has(`${definition.version}::${definition.id}`))\n}\n\nexport async function executeUpgradeAction(\n container: AwilixContainer,\n {\n actionId,\n tenantId,\n organizationId,\n version = appVersion,\n }: { actionId: string; tenantId: string; organizationId: string; version?: string },\n): Promise<{ action: UpgradeActionDefinition; status: UpgradeActionStatus }> {\n if (!isUpgradeActionsEnabled()) {\n throw new Error('UPGRADE_ACTIONS_DISABLED')\n }\n const definition = findUpgradeAction(actionId, version)\n if (!definition) {\n throw new Error('UPGRADE_ACTION_NOT_AVAILABLE')\n }\n const em = container.resolve<EntityManager>('em')\n const status = await em.transactional(async (tem) => {\n
|
|
5
|
-
"mappings": "AAAA,SAAS,0CAA0C;AAGnD,SAAS,kBAAkB;AAC3B,SAAS,yBAAyB;AAClC,SAAS,wBAAwB;AACjC,SAAS,oBAAoB,yBAAuD;
|
|
4
|
+
"sourcesContent": ["import { UniqueConstraintViolationException } from '@mikro-orm/core'\nimport type { EntityManager } from '@mikro-orm/postgresql'\nimport type { AwilixContainer } from 'awilix'\nimport { appVersion } from '@open-mercato/shared/lib/version'\nimport { parseBooleanToken } from '@open-mercato/shared/lib/boolean'\nimport { UpgradeActionRun } from '../data/entities'\nimport { actionsUpToVersion, findUpgradeAction, type UpgradeActionDefinition } from '../lib/upgrade-actions'\nimport { createLogger } from '@open-mercato/shared/lib/logger'\n\nconst logger = createLogger('configs')\n\nexport type UpgradeActionStatus = 'completed' | 'already_completed'\n\nexport function isUpgradeActionsEnabled(): boolean {\n return parseBooleanToken(process.env.UPGRADE_ACTIONS_ENABLED ?? '') === true\n}\n\nexport function getCurrentVersion(): string {\n return appVersion\n}\n\nexport async function listPendingUpgradeActions(\n em: EntityManager,\n {\n tenantId,\n organizationId,\n version = appVersion,\n }: { tenantId: string; organizationId: string; version?: string },\n): Promise<UpgradeActionDefinition[]> {\n if (!isUpgradeActionsEnabled()) return []\n const definitions = actionsUpToVersion(version)\n if (!definitions.length) return []\n const versions = Array.from(new Set(definitions.map((definition) => definition.version)))\n const runs = await em.find(UpgradeActionRun, {\n tenantId,\n organizationId,\n version: { $in: versions },\n })\n const completed = new Set(runs.map((run) => `${run.version}::${run.actionId}`))\n return definitions.filter((definition) => !completed.has(`${definition.version}::${definition.id}`))\n}\n\nexport async function executeUpgradeAction(\n container: AwilixContainer,\n {\n actionId,\n tenantId,\n organizationId,\n version = appVersion,\n }: { actionId: string; tenantId: string; organizationId: string; version?: string },\n): Promise<{ action: UpgradeActionDefinition; status: UpgradeActionStatus }> {\n if (!isUpgradeActionsEnabled()) {\n throw new Error('UPGRADE_ACTIONS_DISABLED')\n }\n const definition = findUpgradeAction(actionId, version)\n if (!definition) {\n throw new Error('UPGRADE_ACTION_NOT_AVAILABLE')\n }\n const em = container.resolve<EntityManager>('em')\n const status = await em.transactional(async (tem) => {\n logger.info('Executing upgrade action', {\n component: 'upgrade-actions',\n actionId: definition.id,\n version: definition.version,\n requestedVersion: version,\n tenantId,\n organizationId,\n })\n const alreadyCompleted = await tem.findOne(UpgradeActionRun, {\n actionId: definition.id,\n version: definition.version,\n tenantId,\n organizationId,\n })\n if (alreadyCompleted) return 'already_completed' as const\n await definition.run({ container, em: tem, tenantId, organizationId })\n const record = tem.create(UpgradeActionRun, {\n actionId: definition.id,\n version: definition.version,\n tenantId,\n organizationId,\n })\n tem.persist(record)\n await tem.flush()\n logger.info('Upgrade action completed', { component: 'upgrade-actions', actionId: definition.id, version, tenantId, organizationId })\n return 'completed' as const\n }).catch((error) => {\n logger.error('Upgrade action failed', { component: 'upgrade-actions', actionId, tenantId, organizationId, version, err: error })\n if (error instanceof UniqueConstraintViolationException) {\n return 'already_completed' as const\n }\n throw error\n })\n\n return { action: definition, status }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,0CAA0C;AAGnD,SAAS,kBAAkB;AAC3B,SAAS,yBAAyB;AAClC,SAAS,wBAAwB;AACjC,SAAS,oBAAoB,yBAAuD;AACpF,SAAS,oBAAoB;AAE7B,MAAM,SAAS,aAAa,SAAS;AAI9B,SAAS,0BAAmC;AACjD,SAAO,kBAAkB,QAAQ,IAAI,2BAA2B,EAAE,MAAM;AAC1E;AAEO,SAAS,oBAA4B;AAC1C,SAAO;AACT;AAEA,eAAsB,0BACpB,IACA;AAAA,EACE;AAAA,EACA;AAAA,EACA,UAAU;AACZ,GACoC;AACpC,MAAI,CAAC,wBAAwB,EAAG,QAAO,CAAC;AACxC,QAAM,cAAc,mBAAmB,OAAO;AAC9C,MAAI,CAAC,YAAY,OAAQ,QAAO,CAAC;AACjC,QAAM,WAAW,MAAM,KAAK,IAAI,IAAI,YAAY,IAAI,CAAC,eAAe,WAAW,OAAO,CAAC,CAAC;AACxF,QAAM,OAAO,MAAM,GAAG,KAAK,kBAAkB;AAAA,IAC3C;AAAA,IACA;AAAA,IACA,SAAS,EAAE,KAAK,SAAS;AAAA,EAC3B,CAAC;AACD,QAAM,YAAY,IAAI,IAAI,KAAK,IAAI,CAAC,QAAQ,GAAG,IAAI,OAAO,KAAK,IAAI,QAAQ,EAAE,CAAC;AAC9E,SAAO,YAAY,OAAO,CAAC,eAAe,CAAC,UAAU,IAAI,GAAG,WAAW,OAAO,KAAK,WAAW,EAAE,EAAE,CAAC;AACrG;AAEA,eAAsB,qBACpB,WACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AACZ,GAC2E;AAC3E,MAAI,CAAC,wBAAwB,GAAG;AAC9B,UAAM,IAA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
|
12
12
|
import { Alert } from "@open-mercato/ui/primitives/alert";
|
|
13
13
|
import { TimeInput } from "@open-mercato/ui/backend/inputs/TimeInput";
|
|
14
14
|
import { useT } from "@open-mercato/shared/lib/i18n/context";
|
|
15
|
+
import { createLogger } from "@open-mercato/shared/lib/logger";
|
|
16
|
+
const logger = createLogger("currencies").child({ component: "CurrencyFetchingConfig" });
|
|
15
17
|
const STATUS_BADGE_VARIANT = {
|
|
16
18
|
success: "success",
|
|
17
19
|
error: "error",
|
|
@@ -65,7 +67,7 @@ function CurrencyFetchingConfig() {
|
|
|
65
67
|
setConfigs(result.configs);
|
|
66
68
|
}
|
|
67
69
|
} catch (err) {
|
|
68
|
-
|
|
70
|
+
logger.error("Failed to initialize providers", { err });
|
|
69
71
|
} finally {
|
|
70
72
|
setInitializing(false);
|
|
71
73
|
}
|