@hed-hog/core 0.0.387 → 0.0.393
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/README.md +51 -11
- package/dist/access-log/access-log.controller.d.ts.map +1 -1
- package/dist/access-log/access-log.controller.js +1 -1
- package/dist/access-log/access-log.controller.js.map +1 -1
- package/dist/access-log/access-log.interceptor.d.ts.map +1 -1
- package/dist/access-log/access-log.interceptor.js +11 -6
- package/dist/access-log/access-log.interceptor.js.map +1 -1
- package/dist/access-log/access-log.service.d.ts +4 -0
- package/dist/access-log/access-log.service.d.ts.map +1 -1
- package/dist/access-log/access-log.service.js +31 -4
- package/dist/access-log/access-log.service.js.map +1 -1
- package/dist/access-log/dto/query-access-log.dto.d.ts +2 -0
- package/dist/access-log/dto/query-access-log.dto.d.ts.map +1 -1
- package/dist/access-log/dto/query-access-log.dto.js +5 -0
- package/dist/access-log/dto/query-access-log.dto.js.map +1 -1
- package/dist/ai/ai-attachment.fragments.d.ts +23 -0
- package/dist/ai/ai-attachment.fragments.d.ts.map +1 -0
- package/dist/ai/ai-attachment.fragments.js +34 -0
- package/dist/ai/ai-attachment.fragments.js.map +1 -0
- package/dist/ai/ai.controller.d.ts +12 -17
- package/dist/ai/ai.controller.d.ts.map +1 -1
- package/dist/ai/ai.controller.js +17 -2
- package/dist/ai/ai.controller.js.map +1 -1
- package/dist/ai/ai.module.d.ts.map +1 -1
- package/dist/ai/ai.module.js +3 -2
- package/dist/ai/ai.module.js.map +1 -1
- package/dist/ai/ai.prompts.d.ts +16 -0
- package/dist/ai/ai.prompts.d.ts.map +1 -0
- package/dist/ai/ai.prompts.js +37 -0
- package/dist/ai/ai.prompts.js.map +1 -0
- package/dist/ai/ai.service.d.ts +92 -12
- package/dist/ai/ai.service.d.ts.map +1 -1
- package/dist/ai/ai.service.js +309 -88
- package/dist/ai/ai.service.js.map +1 -1
- package/dist/ai/dto/chat.dto.d.ts +4 -1
- package/dist/ai/dto/chat.dto.d.ts.map +1 -1
- package/dist/ai/dto/chat.dto.js +23 -1
- package/dist/ai/dto/chat.dto.js.map +1 -1
- package/dist/ai/dto/create-agent.dto.d.ts +1 -1
- package/dist/ai/dto/create-agent.dto.d.ts.map +1 -1
- package/dist/ai/dto/create-agent.dto.js +1 -1
- package/dist/ai/dto/create-agent.dto.js.map +1 -1
- package/dist/ai/dto/richtext-edit-html.dto.d.ts +5 -0
- package/dist/ai/dto/richtext-edit-html.dto.d.ts.map +1 -0
- package/dist/ai/dto/richtext-edit-html.dto.js +27 -0
- package/dist/ai/dto/richtext-edit-html.dto.js.map +1 -0
- package/dist/ai/dto/update-agent.dto.d.ts +1 -1
- package/dist/ai/dto/update-agent.dto.d.ts.map +1 -1
- package/dist/ai/dto/update-agent.dto.js +1 -1
- package/dist/ai/dto/update-agent.dto.js.map +1 -1
- package/dist/ai/richtext-ai.prompts.d.ts +5 -0
- package/dist/ai/richtext-ai.prompts.d.ts.map +1 -0
- package/dist/ai/richtext-ai.prompts.js +57 -0
- package/dist/ai/richtext-ai.prompts.js.map +1 -0
- package/dist/ai/richtext-ai.service.d.ts +34 -0
- package/dist/ai/richtext-ai.service.d.ts.map +1 -0
- package/dist/ai/richtext-ai.service.js +95 -0
- package/dist/ai/richtext-ai.service.js.map +1 -0
- package/dist/ai-instruction/ai-instruction.controller.d.ts +59 -5
- package/dist/ai-instruction/ai-instruction.controller.d.ts.map +1 -1
- package/dist/ai-instruction/ai-instruction.controller.js +63 -20
- package/dist/ai-instruction/ai-instruction.controller.js.map +1 -1
- package/dist/ai-instruction/ai-instruction.module.d.ts.map +1 -1
- package/dist/ai-instruction/ai-instruction.module.js +13 -2
- package/dist/ai-instruction/ai-instruction.module.js.map +1 -1
- package/dist/ai-instruction/ai-instruction.service.d.ts +131 -6
- package/dist/ai-instruction/ai-instruction.service.d.ts.map +1 -1
- package/dist/ai-instruction/ai-instruction.service.js +533 -60
- package/dist/ai-instruction/ai-instruction.service.js.map +1 -1
- package/dist/ai-instruction/ai-prompt-builder.service.d.ts +8 -0
- package/dist/ai-instruction/ai-prompt-builder.service.d.ts.map +1 -1
- package/dist/ai-instruction/ai-prompt-builder.service.js +10 -1
- package/dist/ai-instruction/ai-prompt-builder.service.js.map +1 -1
- package/dist/ai-instruction/ai-prompt-registry.d.ts +45 -0
- package/dist/ai-instruction/ai-prompt-registry.d.ts.map +1 -0
- package/dist/ai-instruction/ai-prompt-registry.js +49 -0
- package/dist/ai-instruction/ai-prompt-registry.js.map +1 -0
- package/dist/ai-instruction/ai-prompt-resolver.service.d.ts +89 -0
- package/dist/ai-instruction/ai-prompt-resolver.service.d.ts.map +1 -0
- package/dist/ai-instruction/ai-prompt-resolver.service.js +222 -0
- package/dist/ai-instruction/ai-prompt-resolver.service.js.map +1 -0
- package/dist/ai-instruction/ai-prompt-template.util.d.ts +70 -0
- package/dist/ai-instruction/ai-prompt-template.util.d.ts.map +1 -0
- package/dist/ai-instruction/ai-prompt-template.util.js +154 -0
- package/dist/ai-instruction/ai-prompt-template.util.js.map +1 -0
- package/dist/ai-instruction/dto/create-ai-instruction.dto.d.ts +5 -0
- package/dist/ai-instruction/dto/create-ai-instruction.dto.d.ts.map +1 -1
- package/dist/ai-instruction/dto/create-ai-instruction.dto.js +27 -1
- package/dist/ai-instruction/dto/create-ai-instruction.dto.js.map +1 -1
- package/dist/ai-instruction/dto/preview-ai-instruction.dto.d.ts +14 -0
- package/dist/ai-instruction/dto/preview-ai-instruction.dto.d.ts.map +1 -0
- package/dist/ai-instruction/dto/preview-ai-instruction.dto.js +42 -0
- package/dist/ai-instruction/dto/preview-ai-instruction.dto.js.map +1 -0
- package/dist/ai-instruction/dto/update-ai-instruction.dto.d.ts +11 -0
- package/dist/ai-instruction/dto/update-ai-instruction.dto.d.ts.map +1 -1
- package/dist/ai-instruction/dto/update-ai-instruction.dto.js +34 -0
- package/dist/ai-instruction/dto/update-ai-instruction.dto.js.map +1 -1
- package/dist/ai-instruction/types/ai-instruction.types.d.ts +13 -1
- package/dist/ai-instruction/types/ai-instruction.types.d.ts.map +1 -1
- package/dist/ai-instruction/types/ai-instruction.types.js +10 -0
- package/dist/ai-instruction/types/ai-instruction.types.js.map +1 -1
- package/dist/auth/auth.controller.d.ts +89 -15
- package/dist/auth/auth.controller.d.ts.map +1 -1
- package/dist/auth/auth.controller.js +116 -44
- package/dist/auth/auth.controller.js.map +1 -1
- package/dist/auth/auth.module.d.ts.map +1 -1
- package/dist/auth/auth.module.js +2 -0
- package/dist/auth/auth.module.js.map +1 -1
- package/dist/auth/auth.service.d.ts +169 -12
- package/dist/auth/auth.service.d.ts.map +1 -1
- package/dist/auth/auth.service.js +314 -67
- package/dist/auth/auth.service.js.map +1 -1
- package/dist/auth/dto/confirm-email.dto.d.ts +4 -0
- package/dist/auth/dto/confirm-email.dto.d.ts.map +1 -0
- package/dist/auth/dto/confirm-email.dto.js +22 -0
- package/dist/auth/dto/confirm-email.dto.js.map +1 -0
- package/dist/auth/dto/resend-confirmation.dto.d.ts +8 -0
- package/dist/auth/dto/resend-confirmation.dto.d.ts.map +1 -0
- package/dist/auth/dto/resend-confirmation.dto.js +36 -0
- package/dist/auth/dto/resend-confirmation.dto.js.map +1 -0
- package/dist/authorize/authorize.controller.d.ts +1 -1
- package/dist/authorize/authorize.controller.d.ts.map +1 -1
- package/dist/authorize/authorize.controller.js +4 -2
- package/dist/authorize/authorize.controller.js.map +1 -1
- package/dist/authorize/authorize.service.d.ts +7 -0
- package/dist/authorize/authorize.service.d.ts.map +1 -1
- package/dist/authorize/authorize.service.js +1 -1
- package/dist/authorize/authorize.service.js.map +1 -1
- package/dist/captcha/captcha.module.d.ts +3 -0
- package/dist/captcha/captcha.module.d.ts.map +1 -0
- package/dist/captcha/captcha.module.js +23 -0
- package/dist/captcha/captcha.module.js.map +1 -0
- package/dist/captcha/captcha.service.d.ts +38 -0
- package/dist/captcha/captcha.service.d.ts.map +1 -0
- package/dist/captcha/captcha.service.js +144 -0
- package/dist/captcha/captcha.service.js.map +1 -0
- package/dist/challenge/challenge.service.d.ts +31 -9
- package/dist/challenge/challenge.service.d.ts.map +1 -1
- package/dist/challenge/challenge.service.js +111 -16
- package/dist/challenge/challenge.service.js.map +1 -1
- package/dist/core.module.d.ts +3 -1
- package/dist/core.module.d.ts.map +1 -1
- package/dist/core.module.js +46 -2
- package/dist/core.module.js.map +1 -1
- package/dist/dashboard/dashboard/dashboard.controller.d.ts +21 -21
- package/dist/dashboard/dashboard/dashboard.service.d.ts +21 -21
- package/dist/dashboard/dashboard-component/dashboard-component.controller.d.ts +10 -10
- package/dist/dashboard/dashboard-component/dashboard-component.service.d.ts +10 -10
- package/dist/dashboard/dashboard-component-role/dashboard-component-role.controller.d.ts +20 -20
- package/dist/dashboard/dashboard-component-role/dashboard-component-role.service.d.ts +20 -20
- package/dist/dashboard/dashboard-core/dashboard-core.controller.d.ts +3 -3
- package/dist/dashboard/dashboard-core/dashboard-core.service.d.ts +3 -3
- package/dist/dashboard/dashboard-item/dashboard-item.controller.d.ts +2 -2
- package/dist/dashboard/dashboard-item/dashboard-item.service.d.ts +2 -2
- package/dist/dashboard/dashboard-role/dashboard-role.controller.d.ts +13 -13
- package/dist/dashboard/dashboard-role/dashboard-role.service.d.ts +13 -13
- package/dist/file/file.controller.d.ts +8 -1
- package/dist/file/file.controller.d.ts.map +1 -1
- package/dist/file/file.controller.js +45 -7
- package/dist/file/file.controller.js.map +1 -1
- package/dist/file/file.service.d.ts +134 -1
- package/dist/file/file.service.d.ts.map +1 -1
- package/dist/file/file.service.js +363 -12
- package/dist/file/file.service.js.map +1 -1
- package/dist/file/image-optimization.service.d.ts +43 -0
- package/dist/file/image-optimization.service.d.ts.map +1 -1
- package/dist/file/image-optimization.service.js +154 -0
- package/dist/file/image-optimization.service.js.map +1 -1
- package/dist/file/provider/abstract.provider.d.ts +16 -0
- package/dist/file/provider/abstract.provider.d.ts.map +1 -1
- package/dist/file/provider/abstract.provider.js +4 -0
- package/dist/file/provider/abstract.provider.js.map +1 -1
- package/dist/file/provider/gcs.provider.d.ts +2 -0
- package/dist/file/provider/gcs.provider.d.ts.map +1 -1
- package/dist/file/provider/gcs.provider.js +10 -0
- package/dist/file/provider/gcs.provider.js.map +1 -1
- package/dist/file/provider/local.provider.d.ts +1 -0
- package/dist/file/provider/local.provider.d.ts.map +1 -1
- package/dist/file/provider/local.provider.js +13 -0
- package/dist/file/provider/local.provider.js.map +1 -1
- package/dist/file/provider/s3.provider.d.ts +5 -0
- package/dist/file/provider/s3.provider.d.ts.map +1 -1
- package/dist/file/provider/s3.provider.js +15 -0
- package/dist/file/provider/s3.provider.js.map +1 -1
- package/dist/file/provider/spaces.provider.d.ts +5 -0
- package/dist/file/provider/spaces.provider.d.ts.map +1 -1
- package/dist/file/provider/spaces.provider.js +16 -0
- package/dist/file/provider/spaces.provider.js.map +1 -1
- package/dist/impersonation/dto/redeem-impersonation.dto.d.ts +4 -0
- package/dist/impersonation/dto/redeem-impersonation.dto.d.ts.map +1 -0
- package/dist/impersonation/dto/redeem-impersonation.dto.js +23 -0
- package/dist/impersonation/dto/redeem-impersonation.dto.js.map +1 -0
- package/dist/impersonation/dto/start-impersonation.dto.d.ts +7 -0
- package/dist/impersonation/dto/start-impersonation.dto.d.ts.map +1 -0
- package/dist/impersonation/dto/start-impersonation.dto.js +27 -0
- package/dist/impersonation/dto/start-impersonation.dto.js.map +1 -0
- package/dist/impersonation/impersonation-restrictions.d.ts +26 -0
- package/dist/impersonation/impersonation-restrictions.d.ts.map +1 -0
- package/dist/impersonation/impersonation-restrictions.js +76 -0
- package/dist/impersonation/impersonation-restrictions.js.map +1 -0
- package/dist/impersonation/impersonation.controller.d.ts +90 -0
- package/dist/impersonation/impersonation.controller.d.ts.map +1 -0
- package/dist/impersonation/impersonation.controller.js +135 -0
- package/dist/impersonation/impersonation.controller.js.map +1 -0
- package/dist/impersonation/impersonation.module.d.ts +8 -0
- package/dist/impersonation/impersonation.module.d.ts.map +1 -0
- package/dist/impersonation/impersonation.module.js +44 -0
- package/dist/impersonation/impersonation.module.js.map +1 -0
- package/dist/impersonation/impersonation.service.d.ts +164 -0
- package/dist/impersonation/impersonation.service.d.ts.map +1 -0
- package/dist/impersonation/impersonation.service.js +408 -0
- package/dist/impersonation/impersonation.service.js.map +1 -0
- package/dist/incident/incident-notifier.service.d.ts +36 -0
- package/dist/incident/incident-notifier.service.d.ts.map +1 -0
- package/dist/incident/incident-notifier.service.js +208 -0
- package/dist/incident/incident-notifier.service.js.map +1 -0
- package/dist/incident/incident.controller.d.ts +23 -0
- package/dist/incident/incident.controller.d.ts.map +1 -0
- package/dist/incident/incident.controller.js +75 -0
- package/dist/incident/incident.controller.js.map +1 -0
- package/dist/incident/incident.module.d.ts +7 -0
- package/dist/incident/incident.module.d.ts.map +1 -0
- package/dist/incident/incident.module.js +32 -0
- package/dist/incident/incident.module.js.map +1 -0
- package/dist/incident/incident.service.d.ts +72 -0
- package/dist/incident/incident.service.d.ts.map +1 -0
- package/dist/incident/incident.service.js +184 -0
- package/dist/incident/incident.service.js.map +1 -0
- package/dist/index.d.ts +43 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +49 -0
- package/dist/index.js.map +1 -1
- package/dist/integration/services/outbox-polling.coordinator.d.ts +2 -0
- package/dist/integration/services/outbox-polling.coordinator.d.ts.map +1 -1
- package/dist/integration/services/outbox-polling.coordinator.js +50 -30
- package/dist/integration/services/outbox-polling.coordinator.js.map +1 -1
- package/dist/integration/services/outbox.service.d.ts.map +1 -1
- package/dist/integration/services/outbox.service.js +5 -1
- package/dist/integration/services/outbox.service.js.map +1 -1
- package/dist/integration-profile/dto/test.dto.d.ts +13 -0
- package/dist/integration-profile/dto/test.dto.d.ts.map +1 -0
- package/dist/integration-profile/dto/test.dto.js +26 -0
- package/dist/integration-profile/dto/test.dto.js.map +1 -0
- package/dist/integration-profile/integration-profile.controller.d.ts +12 -1
- package/dist/integration-profile/integration-profile.controller.d.ts.map +1 -1
- package/dist/integration-profile/integration-profile.controller.js +9 -1
- package/dist/integration-profile/integration-profile.controller.js.map +1 -1
- package/dist/integration-profile/integration-profile.module.d.ts +6 -1
- package/dist/integration-profile/integration-profile.module.d.ts.map +1 -1
- package/dist/integration-profile/integration-profile.module.js +26 -3
- package/dist/integration-profile/integration-profile.module.js.map +1 -1
- package/dist/integration-profile/integration-profile.secrets.d.ts.map +1 -1
- package/dist/integration-profile/integration-profile.secrets.js +12 -1
- package/dist/integration-profile/integration-profile.secrets.js.map +1 -1
- package/dist/integration-profile/integration-profile.service.d.ts +26 -7
- package/dist/integration-profile/integration-profile.service.d.ts.map +1 -1
- package/dist/integration-profile/integration-profile.service.js +94 -91
- package/dist/integration-profile/integration-profile.service.js.map +1 -1
- package/dist/integration-profile/integration-profile.utils.d.ts +27 -1
- package/dist/integration-profile/integration-profile.utils.d.ts.map +1 -1
- package/dist/integration-profile/integration-profile.utils.js +46 -5
- package/dist/integration-profile/integration-profile.utils.js.map +1 -1
- package/dist/integration-profile/testers/ai.testers.d.ts +3 -0
- package/dist/integration-profile/testers/ai.testers.d.ts.map +1 -0
- package/dist/integration-profile/testers/ai.testers.js +125 -0
- package/dist/integration-profile/testers/ai.testers.js.map +1 -0
- package/dist/integration-profile/testers/captcha.testers.d.ts +3 -0
- package/dist/integration-profile/testers/captcha.testers.d.ts.map +1 -0
- package/dist/integration-profile/testers/captcha.testers.js +121 -0
- package/dist/integration-profile/testers/captcha.testers.js.map +1 -0
- package/dist/integration-profile/testers/email.testers.d.ts +3 -0
- package/dist/integration-profile/testers/email.testers.d.ts.map +1 -0
- package/dist/integration-profile/testers/email.testers.js +156 -0
- package/dist/integration-profile/testers/email.testers.js.map +1 -0
- package/dist/integration-profile/testers/http-probe.d.ts +57 -0
- package/dist/integration-profile/testers/http-probe.d.ts.map +1 -0
- package/dist/integration-profile/testers/http-probe.js +140 -0
- package/dist/integration-profile/testers/http-probe.js.map +1 -0
- package/dist/integration-profile/testers/index.d.ts +12 -0
- package/dist/integration-profile/testers/index.d.ts.map +1 -0
- package/dist/integration-profile/testers/index.js +45 -0
- package/dist/integration-profile/testers/index.js.map +1 -0
- package/dist/integration-profile/testers/infrastructure.testers.d.ts +3 -0
- package/dist/integration-profile/testers/infrastructure.testers.d.ts.map +1 -0
- package/dist/integration-profile/testers/infrastructure.testers.js +105 -0
- package/dist/integration-profile/testers/infrastructure.testers.js.map +1 -0
- package/dist/integration-profile/testers/integration-tester.registry.d.ts +17 -0
- package/dist/integration-profile/testers/integration-tester.registry.d.ts.map +1 -0
- package/dist/integration-profile/testers/integration-tester.registry.js +52 -0
- package/dist/integration-profile/testers/integration-tester.registry.js.map +1 -0
- package/dist/integration-profile/testers/integration-tester.types.d.ts +55 -0
- package/dist/integration-profile/testers/integration-tester.types.d.ts.map +1 -0
- package/dist/integration-profile/testers/integration-tester.types.js +16 -0
- package/dist/integration-profile/testers/integration-tester.types.js.map +1 -0
- package/dist/integration-profile/testers/messaging.testers.d.ts +3 -0
- package/dist/integration-profile/testers/messaging.testers.d.ts.map +1 -0
- package/dist/integration-profile/testers/messaging.testers.js +70 -0
- package/dist/integration-profile/testers/messaging.testers.js.map +1 -0
- package/dist/integration-profile/testers/oauth.testers.d.ts +3 -0
- package/dist/integration-profile/testers/oauth.testers.d.ts.map +1 -0
- package/dist/integration-profile/testers/oauth.testers.js +285 -0
- package/dist/integration-profile/testers/oauth.testers.js.map +1 -0
- package/dist/integration-profile/testers/payment.testers.d.ts +3 -0
- package/dist/integration-profile/testers/payment.testers.d.ts.map +1 -0
- package/dist/integration-profile/testers/payment.testers.js +169 -0
- package/dist/integration-profile/testers/payment.testers.js.map +1 -0
- package/dist/integration-profile/testers/storage.testers.d.ts +3 -0
- package/dist/integration-profile/testers/storage.testers.d.ts.map +1 -0
- package/dist/integration-profile/testers/storage.testers.js +208 -0
- package/dist/integration-profile/testers/storage.testers.js.map +1 -0
- package/dist/language/en.json +15 -2
- package/dist/language/pt.json +15 -2
- package/dist/leaked-password/leaked-password.controller.d.ts +24 -0
- package/dist/leaked-password/leaked-password.controller.d.ts.map +1 -0
- package/dist/leaked-password/leaked-password.controller.js +78 -0
- package/dist/leaked-password/leaked-password.controller.js.map +1 -0
- package/dist/leaked-password/leaked-password.module.d.ts +8 -0
- package/dist/leaked-password/leaked-password.module.d.ts.map +1 -0
- package/dist/leaked-password/leaked-password.module.js +31 -0
- package/dist/leaked-password/leaked-password.module.js.map +1 -0
- package/dist/leaked-password/leaked-password.service.d.ts +64 -0
- package/dist/leaked-password/leaked-password.service.d.ts.map +1 -0
- package/dist/leaked-password/leaked-password.service.js +218 -0
- package/dist/leaked-password/leaked-password.service.js.map +1 -0
- package/dist/locale/locale.controller.d.ts +1 -1
- package/dist/locale/locale.service.d.ts +1 -1
- package/dist/mail/dto/preview.dto.d.ts +18 -0
- package/dist/mail/dto/preview.dto.d.ts.map +1 -0
- package/dist/mail/dto/preview.dto.js +66 -0
- package/dist/mail/dto/preview.dto.js.map +1 -0
- package/dist/mail/dto/send.dto.d.ts +44 -0
- package/dist/mail/dto/send.dto.d.ts.map +1 -1
- package/dist/mail/dto/send.dto.js +20 -0
- package/dist/mail/dto/send.dto.js.map +1 -1
- package/dist/mail/mail.controller.d.ts +5 -0
- package/dist/mail/mail.controller.d.ts.map +1 -1
- package/dist/mail/mail.controller.js +16 -2
- package/dist/mail/mail.controller.js.map +1 -1
- package/dist/mail/mail.module.d.ts.map +1 -1
- package/dist/mail/mail.module.js +2 -0
- package/dist/mail/mail.module.js.map +1 -1
- package/dist/mail/mail.service.d.ts +69 -4
- package/dist/mail/mail.service.d.ts.map +1 -1
- package/dist/mail/mail.service.js +278 -37
- package/dist/mail/mail.service.js.map +1 -1
- package/dist/mail-delivery/mail-delivery-provision.service.d.ts +21 -0
- package/dist/mail-delivery/mail-delivery-provision.service.d.ts.map +1 -0
- package/dist/mail-delivery/mail-delivery-provision.service.js +64 -0
- package/dist/mail-delivery/mail-delivery-provision.service.js.map +1 -0
- package/dist/mail-delivery/mail-delivery.constants.d.ts +17 -0
- package/dist/mail-delivery/mail-delivery.constants.d.ts.map +1 -0
- package/dist/mail-delivery/mail-delivery.constants.js +31 -0
- package/dist/mail-delivery/mail-delivery.constants.js.map +1 -0
- package/dist/mail-delivery/mail-delivery.controller.d.ts +19 -0
- package/dist/mail-delivery/mail-delivery.controller.d.ts.map +1 -0
- package/dist/mail-delivery/mail-delivery.controller.js +53 -0
- package/dist/mail-delivery/mail-delivery.controller.js.map +1 -0
- package/dist/mail-delivery/mail-delivery.module.d.ts +7 -0
- package/dist/mail-delivery/mail-delivery.module.d.ts.map +1 -0
- package/dist/mail-delivery/mail-delivery.module.js +36 -0
- package/dist/mail-delivery/mail-delivery.module.js.map +1 -0
- package/dist/mail-delivery/mail-delivery.service.d.ts +38 -0
- package/dist/mail-delivery/mail-delivery.service.d.ts.map +1 -0
- package/dist/mail-delivery/mail-delivery.service.js +140 -0
- package/dist/mail-delivery/mail-delivery.service.js.map +1 -0
- package/dist/mail-delivery/ses-event.parser.d.ts +27 -0
- package/dist/mail-delivery/ses-event.parser.d.ts.map +1 -0
- package/dist/mail-delivery/ses-event.parser.js +131 -0
- package/dist/mail-delivery/ses-event.parser.js.map +1 -0
- package/dist/mail-delivery/ses-webhook.service.d.ts +58 -0
- package/dist/mail-delivery/ses-webhook.service.d.ts.map +1 -0
- package/dist/mail-delivery/ses-webhook.service.js +214 -0
- package/dist/mail-delivery/ses-webhook.service.js.map +1 -0
- package/dist/mail-delivery/sns-message.util.d.ts +38 -0
- package/dist/mail-delivery/sns-message.util.d.ts.map +1 -0
- package/dist/mail-delivery/sns-message.util.js +109 -0
- package/dist/mail-delivery/sns-message.util.js.map +1 -0
- package/dist/mail-layout/dto/update.dto.d.ts +17 -0
- package/dist/mail-layout/dto/update.dto.d.ts.map +1 -0
- package/dist/mail-layout/dto/update.dto.js +27 -0
- package/dist/mail-layout/dto/update.dto.js.map +1 -0
- package/dist/mail-layout/mail-layout.controller.d.ts +15 -0
- package/dist/mail-layout/mail-layout.controller.d.ts.map +1 -0
- package/dist/mail-layout/mail-layout.controller.js +71 -0
- package/dist/mail-layout/mail-layout.controller.js.map +1 -0
- package/dist/mail-layout/mail-layout.module.d.ts +3 -0
- package/dist/mail-layout/mail-layout.module.d.ts.map +1 -0
- package/dist/mail-layout/mail-layout.module.js +35 -0
- package/dist/mail-layout/mail-layout.module.js.map +1 -0
- package/dist/mail-layout/mail-layout.service.d.ts +27 -0
- package/dist/mail-layout/mail-layout.service.d.ts.map +1 -0
- package/dist/mail-layout/mail-layout.service.js +80 -0
- package/dist/mail-layout/mail-layout.service.js.map +1 -0
- package/dist/mail-sent/dto/query-mail-sent-list.dto.d.ts +5 -0
- package/dist/mail-sent/dto/query-mail-sent-list.dto.d.ts.map +1 -1
- package/dist/mail-sent/dto/query-mail-sent-list.dto.js +6 -0
- package/dist/mail-sent/dto/query-mail-sent-list.dto.js.map +1 -1
- package/dist/mail-sent/mail-sent.controller.d.ts +39 -0
- package/dist/mail-sent/mail-sent.controller.d.ts.map +1 -1
- package/dist/mail-sent/mail-sent.service.d.ts +39 -0
- package/dist/mail-sent/mail-sent.service.d.ts.map +1 -1
- package/dist/mail-sent/mail-sent.service.js +45 -4
- package/dist/mail-sent/mail-sent.service.js.map +1 -1
- package/dist/mailbox/mailbox-fetcher.registry.d.ts +100 -0
- package/dist/mailbox/mailbox-fetcher.registry.d.ts.map +1 -0
- package/dist/mailbox/mailbox-fetcher.registry.js +59 -0
- package/dist/mailbox/mailbox-fetcher.registry.js.map +1 -0
- package/dist/mailbox/mailbox.module.d.ts +8 -0
- package/dist/mailbox/mailbox.module.d.ts.map +1 -0
- package/dist/mailbox/mailbox.module.js +27 -0
- package/dist/mailbox/mailbox.module.js.map +1 -0
- package/dist/mcp-chat/mcp-chat.controller.d.ts +2 -2
- package/dist/mcp-chat/mcp-chat.service.d.ts +24 -2
- package/dist/mcp-chat/mcp-chat.service.d.ts.map +1 -1
- package/dist/mcp-chat/mcp-chat.service.js +80 -24
- package/dist/mcp-chat/mcp-chat.service.js.map +1 -1
- package/dist/meeting/meeting-provider.registry.d.ts +155 -0
- package/dist/meeting/meeting-provider.registry.d.ts.map +1 -0
- package/dist/meeting/meeting-provider.registry.js +53 -0
- package/dist/meeting/meeting-provider.registry.js.map +1 -0
- package/dist/meeting/meeting.constants.d.ts +47 -0
- package/dist/meeting/meeting.constants.d.ts.map +1 -0
- package/dist/meeting/meeting.constants.js +21 -0
- package/dist/meeting/meeting.constants.js.map +1 -0
- package/dist/meeting/meeting.module.d.ts +7 -0
- package/dist/meeting/meeting.module.d.ts.map +1 -0
- package/dist/meeting/meeting.module.js +26 -0
- package/dist/meeting/meeting.module.js.map +1 -0
- package/dist/menu/menu.controller.d.ts +3 -3
- package/dist/menu/menu.service.d.ts +3 -3
- package/dist/middlewares/locale-injection.middleware.d.ts +12 -0
- package/dist/middlewares/locale-injection.middleware.d.ts.map +1 -1
- package/dist/middlewares/locale-injection.middleware.js +20 -4
- package/dist/middlewares/locale-injection.middleware.js.map +1 -1
- package/dist/notification/notification.controller.d.ts +12 -12
- package/dist/notification/notification.service.d.ts +12 -12
- package/dist/oauth/oauth-token-broker.service.d.ts +72 -0
- package/dist/oauth/oauth-token-broker.service.d.ts.map +1 -0
- package/dist/oauth/oauth-token-broker.service.js +258 -0
- package/dist/oauth/oauth-token-broker.service.js.map +1 -0
- package/dist/oauth/oauth.module.d.ts.map +1 -1
- package/dist/oauth/oauth.module.js +3 -1
- package/dist/oauth/oauth.module.js.map +1 -1
- package/dist/oauth/oauth.service.d.ts +2 -0
- package/dist/oauth/oauth.service.d.ts.map +1 -1
- package/dist/oauth/oauth.service.js +6 -3
- package/dist/oauth/oauth.service.js.map +1 -1
- package/dist/oauth/providers/google.provider.d.ts +7 -0
- package/dist/oauth/providers/google.provider.d.ts.map +1 -1
- package/dist/oauth/providers/google.provider.js +43 -13
- package/dist/oauth/providers/google.provider.js.map +1 -1
- package/dist/observability/monitored-cron.d.ts +34 -0
- package/dist/observability/monitored-cron.d.ts.map +1 -0
- package/dist/observability/monitored-cron.js +118 -0
- package/dist/observability/monitored-cron.js.map +1 -0
- package/dist/pairing/dto/approve-reverse-pairing.dto.d.ts +12 -0
- package/dist/pairing/dto/approve-reverse-pairing.dto.d.ts.map +1 -0
- package/dist/pairing/dto/approve-reverse-pairing.dto.js +30 -0
- package/dist/pairing/dto/approve-reverse-pairing.dto.js.map +1 -0
- package/dist/pairing/dto/claim-pairing.dto.d.ts +11 -0
- package/dist/pairing/dto/claim-pairing.dto.d.ts.map +1 -0
- package/dist/pairing/dto/claim-pairing.dto.js +35 -0
- package/dist/pairing/dto/claim-pairing.dto.js.map +1 -0
- package/dist/pairing/dto/confirm-pairing.dto.d.ts +10 -0
- package/dist/pairing/dto/confirm-pairing.dto.d.ts.map +1 -0
- package/dist/pairing/dto/confirm-pairing.dto.js +24 -0
- package/dist/pairing/dto/confirm-pairing.dto.js.map +1 -0
- package/dist/pairing/dto/poll-reverse-pairing.dto.d.ts +5 -0
- package/dist/pairing/dto/poll-reverse-pairing.dto.d.ts.map +1 -0
- package/dist/pairing/dto/poll-reverse-pairing.dto.js +24 -0
- package/dist/pairing/dto/poll-reverse-pairing.dto.js.map +1 -0
- package/dist/pairing/dto/start-pairing.dto.d.ts +11 -0
- package/dist/pairing/dto/start-pairing.dto.d.ts.map +1 -0
- package/dist/pairing/dto/start-pairing.dto.js +30 -0
- package/dist/pairing/dto/start-pairing.dto.js.map +1 -0
- package/dist/pairing/dto/start-reverse-pairing.dto.d.ts +24 -0
- package/dist/pairing/dto/start-reverse-pairing.dto.d.ts.map +1 -0
- package/dist/pairing/dto/start-reverse-pairing.dto.js +47 -0
- package/dist/pairing/dto/start-reverse-pairing.dto.js.map +1 -0
- package/dist/pairing/pairing.controller.d.ts +118 -0
- package/dist/pairing/pairing.controller.d.ts.map +1 -0
- package/dist/pairing/pairing.controller.js +296 -0
- package/dist/pairing/pairing.controller.js.map +1 -0
- package/dist/pairing/pairing.module.d.ts +10 -0
- package/dist/pairing/pairing.module.d.ts.map +1 -0
- package/dist/pairing/pairing.module.js +40 -0
- package/dist/pairing/pairing.module.js.map +1 -0
- package/dist/pairing/pairing.service.d.ts +238 -0
- package/dist/pairing/pairing.service.d.ts.map +1 -0
- package/dist/pairing/pairing.service.js +495 -0
- package/dist/pairing/pairing.service.js.map +1 -0
- package/dist/pdf/pdf.service.d.ts +11 -6
- package/dist/pdf/pdf.service.d.ts.map +1 -1
- package/dist/pdf/pdf.service.js +60 -20
- package/dist/pdf/pdf.service.js.map +1 -1
- package/dist/presence/presence.controller.d.ts +16 -0
- package/dist/presence/presence.controller.d.ts.map +1 -0
- package/dist/presence/presence.controller.js +60 -0
- package/dist/presence/presence.controller.js.map +1 -0
- package/dist/presence/presence.listener.d.ts +29 -0
- package/dist/presence/presence.listener.d.ts.map +1 -0
- package/dist/presence/presence.listener.js +82 -0
- package/dist/presence/presence.listener.js.map +1 -0
- package/dist/presence/presence.module.d.ts +3 -0
- package/dist/presence/presence.module.d.ts.map +1 -0
- package/dist/presence/presence.module.js +32 -0
- package/dist/presence/presence.module.js.map +1 -0
- package/dist/presence/presence.service.d.ts +42 -0
- package/dist/presence/presence.service.d.ts.map +1 -0
- package/dist/presence/presence.service.js +147 -0
- package/dist/presence/presence.service.js.map +1 -0
- package/dist/profile/dto/delete-account.dto.d.ts +8 -0
- package/dist/profile/dto/delete-account.dto.d.ts.map +1 -0
- package/dist/profile/dto/delete-account.dto.js +22 -0
- package/dist/profile/dto/delete-account.dto.js.map +1 -0
- package/dist/profile/events/profile-account-deleted.event.d.ts +12 -0
- package/dist/profile/events/profile-account-deleted.event.d.ts.map +1 -0
- package/dist/profile/events/profile-account-deleted.event.js +17 -0
- package/dist/profile/events/profile-account-deleted.event.js.map +1 -0
- package/dist/profile/profile.controller.d.ts +32 -15
- package/dist/profile/profile.controller.d.ts.map +1 -1
- package/dist/profile/profile.controller.js +75 -46
- package/dist/profile/profile.controller.js.map +1 -1
- package/dist/profile/profile.service.d.ts +41 -18
- package/dist/profile/profile.service.d.ts.map +1 -1
- package/dist/profile/profile.service.js +133 -48
- package/dist/profile/profile.service.js.map +1 -1
- package/dist/realtime/realtime.gateway.d.ts +48 -0
- package/dist/realtime/realtime.gateway.d.ts.map +1 -0
- package/dist/realtime/realtime.gateway.js +156 -0
- package/dist/realtime/realtime.gateway.js.map +1 -0
- package/dist/realtime/realtime.module.d.ts +8 -0
- package/dist/realtime/realtime.module.d.ts.map +1 -0
- package/dist/realtime/realtime.module.js +29 -0
- package/dist/realtime/realtime.module.js.map +1 -0
- package/dist/realtime/realtime.service.d.ts +51 -0
- package/dist/realtime/realtime.service.d.ts.map +1 -0
- package/dist/realtime/realtime.service.js +177 -0
- package/dist/realtime/realtime.service.js.map +1 -0
- package/dist/redis/redis-pubsub.d.ts +27 -0
- package/dist/redis/redis-pubsub.d.ts.map +1 -0
- package/dist/redis/redis-pubsub.js +184 -0
- package/dist/redis/redis-pubsub.js.map +1 -0
- package/dist/role/guards/role.guard.d.ts +5 -0
- package/dist/role/guards/role.guard.d.ts.map +1 -1
- package/dist/role/guards/role.guard.js +41 -39
- package/dist/role/guards/role.guard.js.map +1 -1
- package/dist/role/role.controller.d.ts +3 -3
- package/dist/role/role.service.d.ts +3 -3
- package/dist/session/session.controller.d.ts +2 -0
- package/dist/session/session.controller.d.ts.map +1 -1
- package/dist/session/session.service.d.ts +39 -0
- package/dist/session/session.service.d.ts.map +1 -1
- package/dist/session/session.service.js +91 -8
- package/dist/session/session.service.js.map +1 -1
- package/dist/setting/brand-asset.service.d.ts +48 -0
- package/dist/setting/brand-asset.service.d.ts.map +1 -0
- package/dist/setting/brand-asset.service.js +130 -0
- package/dist/setting/brand-asset.service.js.map +1 -0
- package/dist/setting/dto/create.dto.d.ts.map +1 -1
- package/dist/setting/dto/create.dto.js +9 -2
- package/dist/setting/dto/create.dto.js.map +1 -1
- package/dist/setting/setting.controller.d.ts +5 -5
- package/dist/setting/setting.module.d.ts.map +1 -1
- package/dist/setting/setting.module.js +3 -2
- package/dist/setting/setting.module.js.map +1 -1
- package/dist/setting/setting.service.d.ts +41 -5
- package/dist/setting/setting.service.d.ts.map +1 -1
- package/dist/setting/setting.service.js +113 -1
- package/dist/setting/setting.service.js.map +1 -1
- package/dist/token/token.service.d.ts +23 -2
- package/dist/token/token.service.d.ts.map +1 -1
- package/dist/token/token.service.js +39 -4
- package/dist/token/token.service.js.map +1 -1
- package/dist/user/dto/create-with-email-and-password.dto.d.ts +2 -0
- package/dist/user/dto/create-with-email-and-password.dto.d.ts.map +1 -1
- package/dist/user/dto/create-with-email-and-password.dto.js +5 -0
- package/dist/user/dto/create-with-email-and-password.dto.js.map +1 -1
- package/dist/user/dto/query-user-mail-list.dto.d.ts +5 -0
- package/dist/user/dto/query-user-mail-list.dto.d.ts.map +1 -0
- package/dist/user/dto/query-user-mail-list.dto.js +25 -0
- package/dist/user/dto/query-user-mail-list.dto.js.map +1 -0
- package/dist/user/user-credential.util.d.ts +19 -0
- package/dist/user/user-credential.util.d.ts.map +1 -0
- package/dist/user/user-credential.util.js +32 -0
- package/dist/user/user-credential.util.js.map +1 -0
- package/dist/user/user.controller.d.ts +24 -26
- package/dist/user/user.controller.d.ts.map +1 -1
- package/dist/user/user.controller.js +18 -3
- package/dist/user/user.controller.js.map +1 -1
- package/dist/user/user.service.d.ts +71 -29
- package/dist/user/user.service.d.ts.map +1 -1
- package/dist/user/user.service.js +291 -17
- package/dist/user/user.service.js.map +1 -1
- package/dist/user-device/user-device.controller.d.ts +54 -0
- package/dist/user-device/user-device.controller.d.ts.map +1 -0
- package/dist/user-device/user-device.controller.js +103 -0
- package/dist/user-device/user-device.controller.js.map +1 -0
- package/dist/user-device/user-device.module.d.ts +3 -0
- package/dist/user-device/user-device.module.d.ts.map +1 -0
- package/dist/user-device/user-device.module.js +26 -0
- package/dist/user-device/user-device.module.js.map +1 -0
- package/dist/user-device/user-device.service.d.ts +71 -0
- package/dist/user-device/user-device.service.d.ts.map +1 -0
- package/dist/user-device/user-device.service.js +158 -0
- package/dist/user-device/user-device.service.js.map +1 -0
- package/dist/utils/device-key.d.ts +23 -0
- package/dist/utils/device-key.d.ts.map +1 -0
- package/dist/utils/device-key.js +31 -0
- package/dist/utils/device-key.js.map +1 -0
- package/dist/utils/geo-ip.d.ts +38 -0
- package/dist/utils/geo-ip.d.ts.map +1 -0
- package/dist/utils/geo-ip.js +122 -0
- package/dist/utils/geo-ip.js.map +1 -0
- package/dist/utils/locale-context.d.ts +10 -7
- package/dist/utils/locale-context.d.ts.map +1 -1
- package/dist/utils/locale-context.js +14 -8
- package/dist/utils/locale-context.js.map +1 -1
- package/dist/utils/security-event-vars.d.ts +56 -0
- package/dist/utils/security-event-vars.d.ts.map +1 -0
- package/dist/utils/security-event-vars.js +109 -0
- package/dist/utils/security-event-vars.js.map +1 -0
- package/dist/utils/user-agent.d.ts +19 -0
- package/dist/utils/user-agent.d.ts.map +1 -0
- package/dist/utils/user-agent.js +36 -0
- package/dist/utils/user-agent.js.map +1 -0
- package/dist/validators/is-strong-password-with-settings.validator.d.ts.map +1 -1
- package/dist/validators/is-strong-password-with-settings.validator.js +11 -0
- package/dist/validators/is-strong-password-with-settings.validator.js.map +1 -1
- package/dist/validators/service-locator.d.ts +9 -0
- package/dist/validators/service-locator.d.ts.map +1 -1
- package/dist/validators/service-locator.js +12 -0
- package/dist/validators/service-locator.js.map +1 -1
- package/dist/webhook-integration/webhook-integration.service.d.ts +5 -0
- package/dist/webhook-integration/webhook-integration.service.d.ts.map +1 -1
- package/dist/webhook-integration/webhook-integration.service.js +50 -4
- package/dist/webhook-integration/webhook-integration.service.js.map +1 -1
- package/dist/webhook-integration/webhook-protocol.registry.d.ts +6 -0
- package/dist/webhook-integration/webhook-protocol.registry.d.ts.map +1 -1
- package/dist/webhook-integration/webhook-protocol.registry.js.map +1 -1
- package/dist/whatsapp-sender/whatsapp-sender.module.d.ts +3 -0
- package/dist/whatsapp-sender/whatsapp-sender.module.d.ts.map +1 -0
- package/dist/whatsapp-sender/whatsapp-sender.module.js +23 -0
- package/dist/whatsapp-sender/whatsapp-sender.module.js.map +1 -0
- package/dist/whatsapp-sender/whatsapp-sender.service.d.ts +50 -0
- package/dist/whatsapp-sender/whatsapp-sender.service.d.ts.map +1 -0
- package/dist/whatsapp-sender/whatsapp-sender.service.js +224 -0
- package/dist/whatsapp-sender/whatsapp-sender.service.js.map +1 -0
- package/hedhog/data/integration_provider.yaml +25 -0
- package/hedhog/data/mail.yaml +275 -112
- package/hedhog/data/mail_layout.yaml +198 -0
- package/hedhog/data/menu.yaml +69 -3
- package/hedhog/data/role.yaml +16 -0
- package/hedhog/data/route.yaml +307 -3
- package/hedhog/data/setting_group.yaml +315 -1
- package/hedhog/data/setting_subgroup.yaml +8 -0
- package/hedhog/frontend/app/_lib/hooks/use-core-access.test.tsx.ejs +125 -0
- package/hedhog/frontend/app/_lib/hooks/use-core-access.ts.ejs +29 -0
- package/hedhog/frontend/app/_lib/hooks/use-impersonation-access.test.ts.ejs +71 -0
- package/hedhog/frontend/app/_lib/hooks/use-impersonation-access.ts.ejs +32 -0
- package/hedhog/frontend/app/access-log/page.tsx.ejs +96 -22
- package/hedhog/frontend/app/account/components/active-sessions.tsx.ejs +17 -1
- package/hedhog/frontend/app/account/components/known-devices.tsx.ejs +89 -0
- package/hedhog/frontend/app/account/components/mfa-setup-dialog.tsx.ejs +36 -0
- package/hedhog/frontend/app/account/components/profile-form.tsx.ejs +2 -1
- package/hedhog/frontend/app/account/components/two-factor-auth.tsx.ejs +2 -0
- package/hedhog/frontend/app/account/components/user-devices-list.tsx.ejs +186 -0
- package/hedhog/frontend/app/account/devices/page.tsx.ejs +5 -0
- package/hedhog/frontend/app/account/hooks/use-mfa-setup.ts.ejs +10 -7
- package/hedhog/frontend/app/account/layout.tsx.ejs +2 -0
- package/hedhog/frontend/app/ai_agent/page.tsx.ejs +7 -4
- package/hedhog/frontend/app/ai_instruction/_components/ai-instruction-form.tsx.ejs +580 -0
- package/hedhog/frontend/app/ai_instruction/_components/ai-instruction-preview.tsx.ejs +150 -0
- package/hedhog/frontend/app/ai_instruction/_components/ai-instruction-versions.tsx.ejs +199 -0
- package/hedhog/frontend/app/ai_instruction/_components/prompt-diff.tsx.ejs +63 -0
- package/hedhog/frontend/app/ai_instruction/_lib/line-diff.spec.ts.ejs +59 -0
- package/hedhog/frontend/app/ai_instruction/_lib/line-diff.ts.ejs +72 -0
- package/hedhog/frontend/app/ai_instruction/_lib/prompt-template.spec.ts.ejs +170 -0
- package/hedhog/frontend/app/ai_instruction/_lib/prompt-template.ts.ejs +167 -0
- package/hedhog/frontend/app/ai_instruction/_lib/types.ts.ejs +99 -0
- package/hedhog/frontend/app/ai_instruction/page.tsx.ejs +422 -0
- package/hedhog/frontend/app/configurations/[slug]/components/setting-field.test.tsx.ejs +298 -0
- package/hedhog/frontend/app/configurations/[slug]/components/setting-field.tsx.ejs +410 -1223
- package/hedhog/frontend/app/incidents/page.tsx.ejs +400 -0
- package/hedhog/frontend/app/integration/profiles/page.tsx.ejs +153 -84
- package/hedhog/frontend/app/mail/layout/page.tsx.ejs +344 -0
- package/hedhog/frontend/app/mail/log/page.tsx.ejs +210 -3
- package/hedhog/frontend/app/mail/template/page.tsx.ejs +292 -200
- package/hedhog/frontend/app/mcp_chat/page.tsx.ejs +129 -17
- package/hedhog/frontend/app/pages/_components/page-delete-dialog.tsx.ejs +343 -0
- package/hedhog/frontend/app/pages/_components/page-detail-sheet.tsx.ejs +438 -0
- package/hedhog/frontend/app/pages/_components/page-wizard-sheet.tsx.ejs +1009 -0
- package/hedhog/frontend/app/pages/_components/system-page-types.ts.ejs +56 -0
- package/hedhog/frontend/app/pages/_components/use-system-pages.ts.ejs +171 -0
- package/hedhog/frontend/app/pages/page.tsx.ejs +514 -0
- package/hedhog/frontend/app/users/active-session.tsx.ejs +58 -11
- package/hedhog/frontend/app/users/page.tsx.ejs +186 -21
- package/hedhog/frontend/app/users/simulate-access-dialog.test.tsx.ejs +202 -0
- package/hedhog/frontend/app/users/simulate-access-dialog.tsx.ejs +170 -0
- package/hedhog/frontend/app/users/user-activity-timeline.tsx.ejs +250 -0
- package/hedhog/frontend/app/users/user-devices.tsx.ejs +89 -0
- package/hedhog/frontend/app/users/user-logs.tsx.ejs +13 -1
- package/hedhog/frontend/app/users/user-mails.tsx.ejs +399 -0
- package/hedhog/frontend/app/users/user-sheet.tsx.ejs +106 -99
- package/hedhog/frontend/messages/en.json +643 -49
- package/hedhog/frontend/messages/pt.json +643 -49
- package/hedhog/table/access_log.yaml +7 -0
- package/hedhog/table/ai_agent.yaml +1 -0
- package/hedhog/table/ai_instruction.yaml +15 -0
- package/hedhog/table/file.yaml +8 -0
- package/hedhog/table/leaked_password.yaml +18 -0
- package/hedhog/table/mail_delivery_event.yaml +76 -0
- package/hedhog/table/mail_layout.yaml +35 -0
- package/hedhog/table/mail_sent.yaml +23 -0
- package/hedhog/table/mail_var.yaml +4 -0
- package/hedhog/table/setting.yaml +1 -0
- package/hedhog/table/system_incident.yaml +59 -0
- package/hedhog/table/user_activity.yaml +9 -0
- package/hedhog/table/user_device.yaml +52 -0
- package/hedhog/table/user_presence.yaml +36 -0
- package/hedhog/table/user_session.yaml +20 -1
- package/package.json +7 -2
- package/src/access-log/access-log.controller.ts +1 -0
- package/src/access-log/access-log.interceptor.ts +9 -3
- package/src/access-log/access-log.service.spec.ts +33 -2
- package/src/access-log/access-log.service.ts +38 -0
- package/src/access-log/dto/query-access-log.dto.ts +5 -0
- package/src/ai/ai-attachment.fragments.spec.ts +319 -0
- package/src/ai/ai-attachment.fragments.ts +35 -0
- package/src/ai/ai.controller.ts +9 -0
- package/src/ai/ai.module.ts +3 -2
- package/src/ai/ai.prompts.ts +38 -0
- package/src/ai/ai.service.spec.ts +280 -0
- package/src/ai/ai.service.ts +475 -82
- package/src/ai/dto/chat.dto.ts +33 -3
- package/src/ai/dto/create-agent.dto.ts +2 -2
- package/src/ai/dto/richtext-edit-html.dto.ts +11 -0
- package/src/ai/dto/update-agent.dto.ts +2 -2
- package/src/ai/richtext-ai.prompts.ts +57 -0
- package/src/ai/richtext-ai.service.ts +109 -0
- package/src/ai-instruction/ai-instruction.controller.ts +40 -9
- package/src/ai-instruction/ai-instruction.module.ts +13 -2
- package/src/ai-instruction/ai-instruction.service.spec.ts +658 -0
- package/src/ai-instruction/ai-instruction.service.ts +661 -62
- package/src/ai-instruction/ai-prompt-builder.service.ts +10 -1
- package/src/ai-instruction/ai-prompt-registry.ts +87 -0
- package/src/ai-instruction/ai-prompt-resolver.service.spec.ts +375 -0
- package/src/ai-instruction/ai-prompt-resolver.service.ts +295 -0
- package/src/ai-instruction/ai-prompt-template.util.spec.ts +162 -0
- package/src/ai-instruction/ai-prompt-template.util.ts +199 -0
- package/src/ai-instruction/dto/create-ai-instruction.dto.ts +39 -3
- package/src/ai-instruction/dto/preview-ai-instruction.dto.ts +26 -0
- package/src/ai-instruction/dto/update-ai-instruction.dto.ts +42 -1
- package/src/ai-instruction/types/ai-instruction.types.ts +24 -1
- package/src/auth/auth.controller.ts +78 -13
- package/src/auth/auth.module.ts +2 -0
- package/src/auth/auth.service.spec.ts +386 -7
- package/src/auth/auth.service.ts +435 -81
- package/src/auth/dto/confirm-email.dto.ts +7 -0
- package/src/auth/dto/resend-confirmation.dto.ts +20 -0
- package/src/authorize/authorize.controller.ts +2 -0
- package/src/authorize/authorize.service.spec.ts +23 -0
- package/src/authorize/authorize.service.ts +8 -0
- package/src/captcha/captcha.module.ts +10 -0
- package/src/captcha/captcha.service.spec.ts +210 -0
- package/src/captcha/captcha.service.ts +191 -0
- package/src/challenge/challenge.service.spec.ts +112 -4
- package/src/challenge/challenge.service.ts +131 -17
- package/src/core.module.ts +46 -1
- package/src/file/file.controller.ts +54 -4
- package/src/file/file.service.spec.ts +275 -0
- package/src/file/file.service.ts +468 -16
- package/src/file/image-optimization.service.spec.ts +92 -0
- package/src/file/image-optimization.service.ts +202 -0
- package/src/file/provider/abstract.provider.ts +23 -0
- package/src/file/provider/gcs.provider.ts +17 -0
- package/src/file/provider/local.provider.ts +21 -0
- package/src/file/provider/s3.provider.ts +25 -0
- package/src/file/provider/spaces.provider.ts +26 -0
- package/src/impersonation/dto/redeem-impersonation.dto.ts +8 -0
- package/src/impersonation/dto/start-impersonation.dto.ts +13 -0
- package/src/impersonation/impersonation-restrictions.ts +84 -0
- package/src/impersonation/impersonation.controller.ts +109 -0
- package/src/impersonation/impersonation.module.ts +31 -0
- package/src/impersonation/impersonation.service.spec.ts +427 -0
- package/src/impersonation/impersonation.service.ts +577 -0
- package/src/incident/incident-notifier.service.spec.ts +205 -0
- package/src/incident/incident-notifier.service.ts +241 -0
- package/src/incident/incident.controller.ts +38 -0
- package/src/incident/incident.module.ts +19 -0
- package/src/incident/incident.service.spec.ts +150 -0
- package/src/incident/incident.service.ts +209 -0
- package/src/index.ts +58 -0
- package/src/integration/services/outbox-polling.coordinator.spec.ts +90 -0
- package/src/integration/services/outbox-polling.coordinator.ts +62 -40
- package/src/integration/services/outbox.service.spec.ts +8 -0
- package/src/integration/services/outbox.service.ts +19 -13
- package/src/integration-profile/dto/test.dto.ts +19 -0
- package/src/integration-profile/integration-profile.controller.ts +10 -1
- package/src/integration-profile/integration-profile.module.spec.ts +51 -0
- package/src/integration-profile/integration-profile.module.ts +23 -4
- package/src/integration-profile/integration-profile.secrets.ts +12 -1
- package/src/integration-profile/integration-profile.service.spec.ts +279 -0
- package/src/integration-profile/integration-profile.service.ts +120 -124
- package/src/integration-profile/integration-profile.utils.spec.ts +22 -0
- package/src/integration-profile/integration-profile.utils.ts +78 -3
- package/src/integration-profile/testers/ai.testers.ts +165 -0
- package/src/integration-profile/testers/captcha.testers.spec.ts +92 -0
- package/src/integration-profile/testers/captcha.testers.ts +139 -0
- package/src/integration-profile/testers/email.testers.ts +194 -0
- package/src/integration-profile/testers/http-probe.spec.ts +153 -0
- package/src/integration-profile/testers/http-probe.ts +171 -0
- package/src/integration-profile/testers/index.ts +30 -0
- package/src/integration-profile/testers/infrastructure.testers.ts +122 -0
- package/src/integration-profile/testers/integration-tester.registry.spec.ts +75 -0
- package/src/integration-profile/testers/integration-tester.registry.ts +43 -0
- package/src/integration-profile/testers/integration-tester.types.ts +61 -0
- package/src/integration-profile/testers/messaging.testers.ts +102 -0
- package/src/integration-profile/testers/oauth.testers.spec.ts +220 -0
- package/src/integration-profile/testers/oauth.testers.ts +305 -0
- package/src/integration-profile/testers/payment.testers.ts +185 -0
- package/src/integration-profile/testers/remaining.testers.spec.ts +401 -0
- package/src/integration-profile/testers/storage.testers.spec.ts +185 -0
- package/src/integration-profile/testers/storage.testers.ts +226 -0
- package/src/integration-profile/testers/tester-coverage.spec.ts +58 -0
- package/src/language/en.json +15 -2
- package/src/language/pt.json +15 -2
- package/src/leaked-password/README.md +83 -0
- package/src/leaked-password/leaked-password.controller.ts +52 -0
- package/src/leaked-password/leaked-password.module.ts +18 -0
- package/src/leaked-password/leaked-password.service.ts +242 -0
- package/src/leaked-password/seed/build-seed-sql.mjs +180 -0
- package/src/leaked-password/seed/common-passwords.txt +335 -0
- package/src/mail/dto/preview.dto.ts +50 -0
- package/src/mail/dto/send.dto.ts +58 -1
- package/src/mail/mail-template.spec.ts +274 -0
- package/src/mail/mail.controller.ts +9 -2
- package/src/mail/mail.module.ts +2 -0
- package/src/mail/mail.service.spec.ts +422 -6
- package/src/mail/mail.service.ts +337 -34
- package/src/mail-delivery/mail-delivery-provision.service.ts +66 -0
- package/src/mail-delivery/mail-delivery.constants.ts +31 -0
- package/src/mail-delivery/mail-delivery.controller.ts +38 -0
- package/src/mail-delivery/mail-delivery.module.ts +23 -0
- package/src/mail-delivery/mail-delivery.service.spec.ts +136 -0
- package/src/mail-delivery/mail-delivery.service.ts +152 -0
- package/src/mail-delivery/ses-event.parser.spec.ts +140 -0
- package/src/mail-delivery/ses-event.parser.ts +191 -0
- package/src/mail-delivery/ses-webhook.service.spec.ts +170 -0
- package/src/mail-delivery/ses-webhook.service.ts +240 -0
- package/src/mail-delivery/sns-message.util.spec.ts +163 -0
- package/src/mail-delivery/sns-message.util.ts +125 -0
- package/src/mail-layout/dto/update.dto.ts +19 -0
- package/src/mail-layout/mail-layout.controller.ts +47 -0
- package/src/mail-layout/mail-layout.module.ts +22 -0
- package/src/mail-layout/mail-layout.service.ts +94 -0
- package/src/mail-sent/dto/query-mail-sent-list.dto.ts +15 -0
- package/src/mail-sent/mail-sent.service.ts +46 -2
- package/src/mailbox/mailbox-fetcher.registry.ts +132 -0
- package/src/mailbox/mailbox.module.ts +14 -0
- package/src/mcp-chat/mcp-chat.service.spec.ts +236 -0
- package/src/mcp-chat/mcp-chat.service.ts +122 -26
- package/src/meeting/meeting-provider.registry.ts +193 -0
- package/src/meeting/meeting.constants.ts +53 -0
- package/src/meeting/meeting.module.ts +13 -0
- package/src/middlewares/locale-injection.middleware.ts +25 -6
- package/src/oauth/oauth-token-broker.service.spec.ts +172 -0
- package/src/oauth/oauth-token-broker.service.ts +363 -0
- package/src/oauth/oauth.module.ts +3 -1
- package/src/oauth/oauth.service.ts +8 -2
- package/src/oauth/providers/google.provider.ts +49 -15
- package/src/observability/monitored-cron.spec.ts +102 -0
- package/src/observability/monitored-cron.ts +110 -0
- package/src/pairing/dto/approve-reverse-pairing.dto.ts +20 -0
- package/src/pairing/dto/claim-pairing.dto.ts +19 -0
- package/src/pairing/dto/confirm-pairing.dto.ts +14 -0
- package/src/pairing/dto/poll-reverse-pairing.dto.ts +9 -0
- package/src/pairing/dto/start-pairing.dto.ts +19 -0
- package/src/pairing/dto/start-reverse-pairing.dto.ts +45 -0
- package/src/pairing/pairing.controller.ts +246 -0
- package/src/pairing/pairing.module.ts +27 -0
- package/src/pairing/pairing.service.spec.ts +462 -0
- package/src/pairing/pairing.service.ts +614 -0
- package/src/pdf/pdf.service.ts +81 -24
- package/src/presence/presence.controller.ts +29 -0
- package/src/presence/presence.listener.ts +53 -0
- package/src/presence/presence.module.ts +19 -0
- package/src/presence/presence.service.spec.ts +97 -0
- package/src/presence/presence.service.ts +160 -0
- package/src/profile/dto/delete-account.dto.ts +11 -0
- package/src/profile/events/profile-account-deleted.event.ts +13 -0
- package/src/profile/profile.controller.ts +46 -34
- package/src/profile/profile.service.ts +164 -46
- package/src/realtime/realtime.gateway.ts +138 -0
- package/src/realtime/realtime.module.ts +16 -0
- package/src/realtime/realtime.service.spec.ts +50 -0
- package/src/realtime/realtime.service.ts +187 -0
- package/src/redis/redis-pubsub.ts +190 -0
- package/src/role/guards/role.guard.spec.ts +75 -0
- package/src/role/guards/role.guard.ts +64 -46
- package/src/session/session.service.spec.ts +81 -0
- package/src/session/session.service.ts +93 -6
- package/src/setting/brand-asset.service.ts +137 -0
- package/src/setting/dto/create.dto.ts +13 -2
- package/src/setting/setting.module.ts +3 -2
- package/src/setting/setting.service.spec.ts +135 -1
- package/src/setting/setting.service.ts +138 -2
- package/src/token/token.service.spec.ts +62 -0
- package/src/token/token.service.ts +57 -3
- package/src/user/dto/create-with-email-and-password.dto.ts +6 -1
- package/src/user/dto/query-user-mail-list.dto.ts +10 -0
- package/src/user/user-credential.util.ts +35 -0
- package/src/user/user.controller.ts +17 -2
- package/src/user/user.service.spec.ts +186 -2
- package/src/user/user.service.ts +361 -16
- package/src/user-device/user-device.controller.ts +77 -0
- package/src/user-device/user-device.module.ts +13 -0
- package/src/user-device/user-device.service.spec.ts +234 -0
- package/src/user-device/user-device.service.ts +168 -0
- package/src/utils/device-key.spec.ts +57 -0
- package/src/utils/device-key.ts +32 -0
- package/src/utils/geo-ip.spec.ts +134 -0
- package/src/utils/geo-ip.ts +93 -0
- package/src/utils/locale-context.spec.ts +27 -1
- package/src/utils/locale-context.ts +15 -12
- package/src/utils/security-event-vars.spec.ts +161 -0
- package/src/utils/security-event-vars.ts +153 -0
- package/src/utils/user-agent.spec.ts +37 -0
- package/src/utils/user-agent.ts +46 -0
- package/src/validators/is-strong-password-with-settings.validator.ts +12 -0
- package/src/validators/service-locator.ts +15 -0
- package/src/webhook-integration/webhook-integration.service.ts +57 -3
- package/src/webhook-integration/webhook-protocol.registry.ts +6 -0
- package/src/whatsapp-sender/whatsapp-sender.module.ts +10 -0
- package/src/whatsapp-sender/whatsapp-sender.service.ts +313 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mail.module.d.ts","sourceRoot":"","sources":["../../src/mail/mail.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mail.module.d.ts","sourceRoot":"","sources":["../../src/mail/mail.module.ts"],"names":[],"mappings":"AAWA,qBA6Fa,UAAU;CAAI"}
|
package/dist/mail/mail.module.js
CHANGED
|
@@ -12,6 +12,7 @@ const api_mail_1 = require("@hed-hog/api-mail");
|
|
|
12
12
|
const api_pagination_1 = require("@hed-hog/api-pagination");
|
|
13
13
|
const api_prisma_1 = require("@hed-hog/api-prisma");
|
|
14
14
|
const common_1 = require("@nestjs/common");
|
|
15
|
+
const config_1 = require("@nestjs/config");
|
|
15
16
|
const mail_sent_module_1 = require("../mail-sent/mail-sent.module");
|
|
16
17
|
const setting_module_1 = require("../setting/setting.module");
|
|
17
18
|
const mail_controller_1 = require("./mail.controller");
|
|
@@ -97,6 +98,7 @@ exports.MailModule = MailModule = __decorate([
|
|
|
97
98
|
(0, common_1.forwardRef)(() => api_pagination_1.PaginationModule),
|
|
98
99
|
(0, common_1.forwardRef)(() => api_locale_1.LocaleModule),
|
|
99
100
|
(0, common_1.forwardRef)(() => setting_module_1.SettingModule),
|
|
101
|
+
config_1.ConfigModule,
|
|
100
102
|
],
|
|
101
103
|
controllers: [mail_controller_1.MailController],
|
|
102
104
|
providers: [mail_service_1.MailService],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mail.module.js","sourceRoot":"","sources":["../../src/mail/mail.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,oDAAmD;AACnD,gDAAoF;AACpF,4DAA2D;AAC3D,oDAAkE;AAClE,2CAAoD;AACpD,oEAA+D;AAC/D,8DAA0D;AAC1D,uDAAmD;AACnD,iDAA6C;
|
|
1
|
+
{"version":3,"file":"mail.module.js","sourceRoot":"","sources":["../../src/mail/mail.module.ts"],"names":[],"m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AI,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAuB,CAAC;wBACzI,CAAC;oBACH,CAAC;oBAAC,OAAO,KAAK,EAAE,CAAC;wBACf,OAAO,CAAC,KAAK,CAAC,8BAA8B,EAAE,KAAK,CAAC,CAAC;wBACrD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAuB,CAAC;oBACvI,CAAC;gBACH,CAAC;aACF,CAAC,CAAC;YACH,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,iCAAc,CAAC;YAChC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,yBAAY,CAAC;YAC9B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,iCAAgB,CAAC;YAClC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,yBAAY,CAAC;YAC9B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,8BAAa,CAAC;YAC/B,qBAAY;SACb;QACD,WAAW,EAAE,CAAC,gCAAc,CAAC;QAC7B,SAAS,EAAE,CAAC,0BAAW,CAAC;QACxB,OAAO,EAAE,CAAC,0BAAW,CAAC;KACvB,CAAC;GACW,UAAU,CAAI"}
|
|
@@ -5,25 +5,39 @@ import { PaginationDTO } from '@hed-hog/api-pagination';
|
|
|
5
5
|
import { PrismaService } from '@hed-hog/api-prisma';
|
|
6
6
|
import { OnModuleInit } from '@nestjs/common';
|
|
7
7
|
import { IntegrationDeveloperApiService } from '../integration/services/integration-developer-api.service';
|
|
8
|
+
import { BrandAssetService } from '../setting/brand-asset.service';
|
|
8
9
|
import { SettingService } from '../setting/setting.service';
|
|
9
10
|
import { CreateDTO } from './dto/create.dto';
|
|
10
11
|
import { ImportDTO } from './dto/import.dto';
|
|
11
|
-
import {
|
|
12
|
+
import { PreviewDTO } from './dto/preview.dto';
|
|
13
|
+
import { SendTemplatedMailDTO, SendTemplatedMailResult } from './dto/send.dto';
|
|
12
14
|
import { TestMailDTO } from './dto/test-mail.dto';
|
|
13
15
|
import { UpdateDTO } from './dto/update.dto';
|
|
16
|
+
import { IncidentService } from '../incident/incident.service';
|
|
17
|
+
export type { SendTemplatedMailResult } from './dto/send.dto';
|
|
14
18
|
export declare class MailService implements OnModuleInit {
|
|
15
19
|
private readonly prismaService;
|
|
16
20
|
private readonly mailMainService;
|
|
17
21
|
private readonly localeService;
|
|
18
22
|
private readonly setting;
|
|
19
23
|
private readonly integrationApi;
|
|
24
|
+
private readonly incident;
|
|
25
|
+
private readonly brandAsset;
|
|
20
26
|
private readonly logger;
|
|
21
27
|
private readonly modelName;
|
|
22
28
|
private readonly integrationProfileSettingSlug;
|
|
23
|
-
constructor(prismaService: PrismaService, mailMainService: MailMainService, localeService: LocaleService, setting: SettingService, integrationApi: IntegrationDeveloperApiService);
|
|
29
|
+
constructor(prismaService: PrismaService, mailMainService: MailMainService, localeService: LocaleService, setting: SettingService, integrationApi: IntegrationDeveloperApiService, incident: IncidentService, brandAsset: BrandAssetService);
|
|
24
30
|
onModuleInit(): void;
|
|
31
|
+
/** Settings que compoem o cabecalho do e-mail resolvido em `resolveLayout`. */
|
|
32
|
+
private static readonly BRAND_SLUGS;
|
|
25
33
|
private isMailConfigSlug;
|
|
26
34
|
private isSettingEnabled;
|
|
35
|
+
/**
|
|
36
|
+
* Cor de marca (`theme-primary-light`) e seu contraste (`theme-primary-foreground-light`),
|
|
37
|
+
* disponibilizadas como `{{primaryColor}}`/`{{primaryForeground}}` no corpo Handlebars dos
|
|
38
|
+
* templates (ex.: o botao de CTA de um convite) e no layout base do e-mail.
|
|
39
|
+
*/
|
|
40
|
+
private getThemeVariables;
|
|
27
41
|
private syncConfiguredMailFlag;
|
|
28
42
|
/**
|
|
29
43
|
* Reload mail configuration from database and update MailMainService.
|
|
@@ -35,6 +49,7 @@ export declare class MailService implements OnModuleInit {
|
|
|
35
49
|
success: boolean;
|
|
36
50
|
provider: string;
|
|
37
51
|
from: string;
|
|
52
|
+
replyTo?: string;
|
|
38
53
|
config: any;
|
|
39
54
|
}>;
|
|
40
55
|
/**
|
|
@@ -126,10 +141,60 @@ export declare class MailService implements OnModuleInit {
|
|
|
126
141
|
delete({ ids }: DeleteDTO): Promise<{
|
|
127
142
|
count: number;
|
|
128
143
|
}>;
|
|
129
|
-
|
|
130
|
-
|
|
144
|
+
/**
|
|
145
|
+
* Continua sem lancar: ha dezenas de call sites que disparam e-mail sem
|
|
146
|
+
* `await`, e transformar isto em excecao derrubaria fluxos que hoje so perdem
|
|
147
|
+
* a notificacao. O que muda e o *retorno* - quem se importa (a fila do SAC,
|
|
148
|
+
* por exemplo) agora consegue distinguir enviado de engolido, em vez de
|
|
149
|
+
* assumir sucesso porque a promise resolveu.
|
|
150
|
+
*/
|
|
151
|
+
sendTemplatedMail(locale: string, { email, slug, variables, profileSlug, replyTo, app, userId }: SendTemplatedMailDTO): Promise<SendTemplatedMailResult>;
|
|
152
|
+
/**
|
|
153
|
+
* Idioma em que ESTE destinatario deve receber o e-mail.
|
|
154
|
+
*
|
|
155
|
+
* Publico porque quem pre-formata variaveis antes de enviar (data e pais do
|
|
156
|
+
* alerta de seguranca) precisa do mesmo idioma que o corpo, senao o texto sai
|
|
157
|
+
* em portugues com a data em ingles. E idempotente: chamar aqui e passar o
|
|
158
|
+
* resultado como `locale` no envio da no mesmo lugar.
|
|
159
|
+
*
|
|
160
|
+
* Ordem:
|
|
161
|
+
* 1. preferencia gravada do destinatario - escolha explicita sempre vence;
|
|
162
|
+
* 2. locale do chamador, se o cliente realmente declarou um idioma;
|
|
163
|
+
* 3. setting global `language`;
|
|
164
|
+
* 4. `en`.
|
|
165
|
+
*/
|
|
166
|
+
resolveRecipientLocale(email: string, callerLocale?: string | null, userId?: number): Promise<string>;
|
|
167
|
+
/** `user_identifier` tem unique (type, value), entao e busca por indice. */
|
|
168
|
+
private findUserIdByEmail;
|
|
169
|
+
/**
|
|
170
|
+
* Escolhe a traducao do template, caindo para o que existir.
|
|
171
|
+
*
|
|
172
|
+
* O filtro por locale ficava na propria query e `mail_locale[0]` era acessado
|
|
173
|
+
* sem checagem: template sem a traducao pedida virava TypeError silencioso.
|
|
174
|
+
* Trazendo todas as traducoes numa query so, a escolha vira decisao explicita
|
|
175
|
+
* - e o `locale.findUnique` que estourava com `pt-BR` deixa de ser preciso.
|
|
176
|
+
*/
|
|
177
|
+
private pickTranslation;
|
|
131
178
|
private getMailTemplate;
|
|
132
179
|
private interpolateTemplate;
|
|
180
|
+
/**
|
|
181
|
+
* Le o layout padrao direto do banco, sem passar pelo cache do api-mail.
|
|
182
|
+
*
|
|
183
|
+
* O preview tem que refletir o que acabou de ser salvo, entao aqui o cache de
|
|
184
|
+
* 60s atrapalharia em vez de ajudar.
|
|
185
|
+
*/
|
|
186
|
+
private resolveDefaultLayout;
|
|
187
|
+
/**
|
|
188
|
+
* Renderiza exatamente o HTML que sairia no envio.
|
|
189
|
+
*
|
|
190
|
+
* Usa o mesmo `interpolateTemplate` de `sendTemplatedMail` (inclusive a troca
|
|
191
|
+
* de quebras de linha por `<br/>`) e o mesmo `renderMailTemplate`. Qualquer
|
|
192
|
+
* atalho aqui recriaria a divergencia entre o que o admin ve e o que o
|
|
193
|
+
* destinatario recebe.
|
|
194
|
+
*/
|
|
195
|
+
preview(locale: string, { subject, body, variables, use_layout, layout }: PreviewDTO): Promise<{
|
|
196
|
+
html: string;
|
|
197
|
+
}>;
|
|
133
198
|
sendTestMail(locale: string, { slug, email, subject, body, variables, }: TestMailDTO): Promise<any>;
|
|
134
199
|
importTemplates({ data, overwrite }: ImportDTO): Promise<{
|
|
135
200
|
conflicts: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mail.service.d.ts","sourceRoot":"","sources":["../../src/mail/mail.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,
|
|
1
|
+
{"version":3,"file":"mail.service.d.ts","sourceRoot":"","sources":["../../src/mail/mail.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAGL,aAAa,EAEd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAIL,WAAW,IAAI,eAAe,EAE/B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAOL,YAAY,EACb,MAAM,gBAAgB,CAAC;AAOxB,OAAO,EAAE,8BAA8B,EAAE,MAAM,2DAA2D,CAAC;AAC3G,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,YAAY,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAE9D,qBACa,WAAY,YAAW,YAAY;IAQ5C,OAAO,CAAC,QAAQ,CAAC,aAAa;IAE9B,OAAO,CAAC,QAAQ,CAAC,eAAe;IAEh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,SAAS,GACV,EAAE,WAAW;IA+BR,eAAe,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,SAAS;;;;;;;;;;;CAwGrD"}
|
|
@@ -54,14 +54,18 @@ const common_1 = require("@nestjs/common");
|
|
|
54
54
|
const Handlebars = __importStar(require("handlebars"));
|
|
55
55
|
const integration_profile_utils_1 = require("../integration-profile/integration-profile.utils");
|
|
56
56
|
const integration_developer_api_service_1 = require("../integration/services/integration-developer-api.service");
|
|
57
|
+
const brand_asset_service_1 = require("../setting/brand-asset.service");
|
|
57
58
|
const setting_service_1 = require("../setting/setting.service");
|
|
59
|
+
const incident_service_1 = require("../incident/incident.service");
|
|
58
60
|
let MailService = MailService_1 = class MailService {
|
|
59
|
-
constructor(prismaService, mailMainService, localeService, setting, integrationApi) {
|
|
61
|
+
constructor(prismaService, mailMainService, localeService, setting, integrationApi, incident, brandAsset) {
|
|
60
62
|
this.prismaService = prismaService;
|
|
61
63
|
this.mailMainService = mailMainService;
|
|
62
64
|
this.localeService = localeService;
|
|
63
65
|
this.setting = setting;
|
|
64
66
|
this.integrationApi = integrationApi;
|
|
67
|
+
this.incident = incident;
|
|
68
|
+
this.brandAsset = brandAsset;
|
|
65
69
|
this.logger = new common_1.Logger(MailService_1.name);
|
|
66
70
|
this.modelName = 'mail';
|
|
67
71
|
this.integrationProfileSettingSlug = 'mail-integration-profile-id';
|
|
@@ -74,6 +78,12 @@ let MailService = MailService_1 = class MailService {
|
|
|
74
78
|
handler: async (event) => {
|
|
75
79
|
var _a;
|
|
76
80
|
const slug = String(((_a = event.payload) === null || _a === void 0 ? void 0 : _a.slug) || '').trim();
|
|
81
|
+
// O layout resolvido (logo, cores, nome) fica ate 60s em cache no
|
|
82
|
+
// api-mail. Sem descartar aqui, "subi o logo e mandei um teste" - o
|
|
83
|
+
// fluxo natural de validacao - mostraria o valor antigo.
|
|
84
|
+
if (MailService_1.BRAND_SLUGS.has(slug)) {
|
|
85
|
+
this.mailMainService.invalidateLayoutCache();
|
|
86
|
+
}
|
|
77
87
|
if (!this.isMailConfigSlug(slug)) {
|
|
78
88
|
return;
|
|
79
89
|
}
|
|
@@ -87,6 +97,22 @@ let MailService = MailService_1 = class MailService {
|
|
|
87
97
|
isSettingEnabled(value) {
|
|
88
98
|
return value === true || value === 'true';
|
|
89
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* Cor de marca (`theme-primary-light`) e seu contraste (`theme-primary-foreground-light`),
|
|
102
|
+
* disponibilizadas como `{{primaryColor}}`/`{{primaryForeground}}` no corpo Handlebars dos
|
|
103
|
+
* templates (ex.: o botao de CTA de um convite) e no layout base do e-mail.
|
|
104
|
+
*/
|
|
105
|
+
async getThemeVariables() {
|
|
106
|
+
const settings = await this.setting.getSettingValues([
|
|
107
|
+
'theme-primary-light',
|
|
108
|
+
'theme-primary-foreground-light',
|
|
109
|
+
]);
|
|
110
|
+
return {
|
|
111
|
+
primaryColor: settings['theme-primary-light'] || api_mail_1.DEFAULT_PRIMARY_COLOR,
|
|
112
|
+
primaryForeground: settings['theme-primary-foreground-light'] ||
|
|
113
|
+
api_mail_1.DEFAULT_PRIMARY_FOREGROUND,
|
|
114
|
+
};
|
|
115
|
+
}
|
|
90
116
|
async syncConfiguredMailFlag() {
|
|
91
117
|
var _a;
|
|
92
118
|
try {
|
|
@@ -149,7 +175,8 @@ let MailService = MailService_1 = class MailService {
|
|
|
149
175
|
this.mailMainService.setConfig(config);
|
|
150
176
|
this.logger.log(`Mail configuration reloaded from profile "${profile.name}" (${providerSlug})`);
|
|
151
177
|
const from = (0, integration_profile_utils_1.getFromAddress)(profile.config);
|
|
152
|
-
|
|
178
|
+
const replyTo = (0, integration_profile_utils_1.getReplyToAddress)(profile.config);
|
|
179
|
+
return { success: true, provider: providerSlug, from, replyTo, config };
|
|
153
180
|
}
|
|
154
181
|
catch (error) {
|
|
155
182
|
this.logger.error('Error reloading mail configuration:', error);
|
|
@@ -342,48 +369,170 @@ let MailService = MailService_1 = class MailService {
|
|
|
342
369
|
},
|
|
343
370
|
});
|
|
344
371
|
}
|
|
345
|
-
|
|
372
|
+
/**
|
|
373
|
+
* Continua sem lancar: ha dezenas de call sites que disparam e-mail sem
|
|
374
|
+
* `await`, e transformar isto em excecao derrubaria fluxos que hoje so perdem
|
|
375
|
+
* a notificacao. O que muda e o *retorno* - quem se importa (a fila do SAC,
|
|
376
|
+
* por exemplo) agora consegue distinguir enviado de engolido, em vez de
|
|
377
|
+
* assumir sucesso porque a promise resolveu.
|
|
378
|
+
*/
|
|
379
|
+
async sendTemplatedMail(locale, { email, slug, variables, profileSlug, replyTo, app, userId }) {
|
|
380
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
346
381
|
const settings = await this.setting.getSettingValues(['configured-mail']);
|
|
347
382
|
if (!this.isSettingEnabled(settings['configured-mail'])) {
|
|
348
383
|
this.logger.warn('Mail service is not configured. Aborting sending email.');
|
|
349
|
-
|
|
384
|
+
// Aborto silencioso: sem isto, todo e-mail transacional do sistema para
|
|
385
|
+
// de sair e ninguem fica sabendo ate um usuario reclamar.
|
|
386
|
+
this.incident.record({
|
|
387
|
+
source: 'core.mail',
|
|
388
|
+
code: 'mail_not_configured',
|
|
389
|
+
severity: 'critical',
|
|
390
|
+
message: 'Envio de e-mail abortado: a configuracao de e-mail nao esta ativa.',
|
|
391
|
+
context: { slug },
|
|
392
|
+
});
|
|
393
|
+
return { sent: false, reason: 'mail-not-configured' };
|
|
350
394
|
}
|
|
351
395
|
try {
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
const
|
|
357
|
-
const
|
|
358
|
-
await this.
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
396
|
+
// O `replyTo` do perfil de integracao entra como padrao para que a
|
|
397
|
+
// resposta de quem trata o e-mail transacional como conversa caia numa
|
|
398
|
+
// caixa monitorada, e nao no remetente. Quem passa `replyTo` no DTO
|
|
399
|
+
// continua mandando.
|
|
400
|
+
const { from, replyTo: profileReplyTo } = await this.reloadConfig(profileSlug);
|
|
401
|
+
const resolvedReplyTo = (replyTo === null || replyTo === void 0 ? void 0 : replyTo.trim()) || profileReplyTo;
|
|
402
|
+
const recipientLocale = await this.resolveRecipientLocale(email, locale, userId);
|
|
403
|
+
const mail = await this.getMailTemplate(slug);
|
|
404
|
+
const translation = this.pickTranslation(mail, recipientLocale);
|
|
405
|
+
if (!translation) {
|
|
406
|
+
// Antes isto era um TypeError em `mail_locale[0]`, engolido pelo catch
|
|
407
|
+
// abaixo e reportado como `send-failed` - um template sem traducao
|
|
408
|
+
// nenhuma parecia falha do provedor.
|
|
409
|
+
this.logger.error(`Template "${slug}" has no translation available.`);
|
|
410
|
+
this.incident.record({
|
|
411
|
+
source: 'core.mail',
|
|
412
|
+
code: 'mail_template_no_locale',
|
|
413
|
+
severity: 'critical',
|
|
414
|
+
message: `Template "${slug}" nao tem nenhuma traducao cadastrada.`,
|
|
415
|
+
key: slug,
|
|
416
|
+
context: { slug, locale: recipientLocale },
|
|
417
|
+
});
|
|
418
|
+
return { sent: false, reason: 'template-locale-missing' };
|
|
419
|
+
}
|
|
420
|
+
const { subject, body, code: templateLocale } = translation;
|
|
421
|
+
const brandName = await this.mailMainService.getBrandName(app, templateLocale);
|
|
422
|
+
const { primaryColor, primaryForeground } = await this.getThemeVariables();
|
|
423
|
+
const mergedVariables = Object.assign({ brandName, primaryColor, primaryForeground }, variables);
|
|
424
|
+
const parsedSubject = this.interpolateTemplate(subject, mergedVariables);
|
|
425
|
+
const parsedBody = this.interpolateTemplate(body, mergedVariables);
|
|
426
|
+
const sendResult = await this.mailMainService.send(Object.assign(Object.assign({ to: email, from }, (resolvedReplyTo ? { replyTo: resolvedReplyTo } : {})), { subject: parsedSubject, body: parsedBody, mail_id: mail.id,
|
|
427
|
+
// O layout (header/footer) e escolhido por este locale la no api-mail,
|
|
428
|
+
// entao tem que ser o do template escolhido, nao o cru do request.
|
|
429
|
+
locale: templateLocale, app }));
|
|
430
|
+
const providerMessageId = (_g = (_d = (_b = (_a = sendResult === null || sendResult === void 0 ? void 0 : sendResult.result) === null || _a === void 0 ? void 0 : _a.MessageId) !== null && _b !== void 0 ? _b : (_c = sendResult === null || sendResult === void 0 ? void 0 : sendResult.result) === null || _c === void 0 ? void 0 : _c.messageId) !== null && _d !== void 0 ? _d : (_f = (_e = sendResult === null || sendResult === void 0 ? void 0 : sendResult.result) === null || _e === void 0 ? void 0 : _e.data) === null || _f === void 0 ? void 0 : _f.id) !== null && _g !== void 0 ? _g : null;
|
|
431
|
+
return {
|
|
432
|
+
sent: true,
|
|
433
|
+
providerMessageId: providerMessageId ? String(providerMessageId) : null,
|
|
434
|
+
};
|
|
365
435
|
}
|
|
366
436
|
catch (error) {
|
|
367
437
|
this.logger.error('Error sending templated mail:', error);
|
|
368
|
-
|
|
438
|
+
// Agrupado por slug: um template quebrado vira um incidente com contador,
|
|
439
|
+
// nao uma linha por destinatario.
|
|
440
|
+
this.incident.record({
|
|
441
|
+
source: 'core.mail',
|
|
442
|
+
code: 'mail_send_failed',
|
|
443
|
+
message: error instanceof Error ? error.message : String(error),
|
|
444
|
+
key: slug,
|
|
445
|
+
context: { slug, locale },
|
|
446
|
+
});
|
|
447
|
+
return {
|
|
448
|
+
sent: false,
|
|
449
|
+
reason: 'send-failed',
|
|
450
|
+
error: error instanceof Error ? error.message : String(error),
|
|
451
|
+
};
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
/**
|
|
455
|
+
* Idioma em que ESTE destinatario deve receber o e-mail.
|
|
456
|
+
*
|
|
457
|
+
* Publico porque quem pre-formata variaveis antes de enviar (data e pais do
|
|
458
|
+
* alerta de seguranca) precisa do mesmo idioma que o corpo, senao o texto sai
|
|
459
|
+
* em portugues com a data em ingles. E idempotente: chamar aqui e passar o
|
|
460
|
+
* resultado como `locale` no envio da no mesmo lugar.
|
|
461
|
+
*
|
|
462
|
+
* Ordem:
|
|
463
|
+
* 1. preferencia gravada do destinatario - escolha explicita sempre vence;
|
|
464
|
+
* 2. locale do chamador, se o cliente realmente declarou um idioma;
|
|
465
|
+
* 3. setting global `language`;
|
|
466
|
+
* 4. `en`.
|
|
467
|
+
*/
|
|
468
|
+
async resolveRecipientLocale(email, callerLocale, userId) {
|
|
469
|
+
var _a, _b;
|
|
470
|
+
try {
|
|
471
|
+
const recipientId = userId !== null && userId !== void 0 ? userId : (await this.findUserIdByEmail(email));
|
|
472
|
+
const resolved = await this.setting.resolveUserLocale(recipientId);
|
|
473
|
+
// A cadeia do `SettingService` usa o locale do CONTEXTO da requisicao.
|
|
474
|
+
// Quase sempre e o mesmo que chegou aqui, mas ha envios fora de request
|
|
475
|
+
// (fila, cron) e chamadores que passam um locale proprio: nesses, o
|
|
476
|
+
// `callerLocale` e a unica pista que existe.
|
|
477
|
+
if (resolved !== 'en') {
|
|
478
|
+
return resolved;
|
|
479
|
+
}
|
|
480
|
+
return (_a = (0, api_locale_1.normalizeLocaleCode)(callerLocale)) !== null && _a !== void 0 ? _a : resolved;
|
|
481
|
+
}
|
|
482
|
+
catch (error) {
|
|
483
|
+
this.logger.warn(`Falling back to caller locale while resolving recipient language: ${error}`);
|
|
484
|
+
return (_b = (0, api_locale_1.normalizeLocaleCode)(callerLocale)) !== null && _b !== void 0 ? _b : 'en';
|
|
369
485
|
}
|
|
370
486
|
}
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
487
|
+
/** `user_identifier` tem unique (type, value), entao e busca por indice. */
|
|
488
|
+
async findUserIdByEmail(email) {
|
|
489
|
+
var _a;
|
|
490
|
+
const value = String(email !== null && email !== void 0 ? email : '').trim();
|
|
491
|
+
if (!value) {
|
|
492
|
+
return null;
|
|
493
|
+
}
|
|
494
|
+
const identifier = await this.prismaService.user_identifier.findFirst({
|
|
495
|
+
where: { type: 'email', value },
|
|
496
|
+
select: { user_id: true },
|
|
374
497
|
});
|
|
375
|
-
|
|
376
|
-
|
|
498
|
+
return (_a = identifier === null || identifier === void 0 ? void 0 : identifier.user_id) !== null && _a !== void 0 ? _a : null;
|
|
499
|
+
}
|
|
500
|
+
/**
|
|
501
|
+
* Escolhe a traducao do template, caindo para o que existir.
|
|
502
|
+
*
|
|
503
|
+
* O filtro por locale ficava na propria query e `mail_locale[0]` era acessado
|
|
504
|
+
* sem checagem: template sem a traducao pedida virava TypeError silencioso.
|
|
505
|
+
* Trazendo todas as traducoes numa query so, a escolha vira decisao explicita
|
|
506
|
+
* - e o `locale.findUnique` que estourava com `pt-BR` deixa de ser preciso.
|
|
507
|
+
*/
|
|
508
|
+
pickTranslation(mail, requested) {
|
|
509
|
+
var _a, _b, _c, _d;
|
|
510
|
+
const translations = ((_a = mail === null || mail === void 0 ? void 0 : mail.mail_locale) !== null && _a !== void 0 ? _a : [])
|
|
511
|
+
.map((item) => {
|
|
512
|
+
var _a;
|
|
513
|
+
return ({
|
|
514
|
+
subject: item === null || item === void 0 ? void 0 : item.subject,
|
|
515
|
+
body: item === null || item === void 0 ? void 0 : item.body,
|
|
516
|
+
code: (_a = item === null || item === void 0 ? void 0 : item.locale) === null || _a === void 0 ? void 0 : _a.code,
|
|
517
|
+
});
|
|
518
|
+
})
|
|
519
|
+
.filter((item) => item.code && item.subject != null && item.body != null);
|
|
520
|
+
if (!translations.length) {
|
|
521
|
+
return null;
|
|
377
522
|
}
|
|
378
|
-
|
|
523
|
+
const byCode = (code) => translations.find((item) => item.code === code);
|
|
524
|
+
return (_d = (_c = (_b = byCode(requested)) !== null && _b !== void 0 ? _b : byCode('pt')) !== null && _c !== void 0 ? _c : byCode('en')) !== null && _d !== void 0 ? _d : translations[0];
|
|
379
525
|
}
|
|
380
|
-
async getMailTemplate(slug
|
|
526
|
+
async getMailTemplate(slug) {
|
|
381
527
|
const mail = await this.prismaService.mail.findUnique({
|
|
382
528
|
where: { slug },
|
|
383
529
|
include: {
|
|
384
530
|
mail_locale: {
|
|
385
|
-
|
|
386
|
-
|
|
531
|
+
select: {
|
|
532
|
+
subject: true,
|
|
533
|
+
body: true,
|
|
534
|
+
locale: { select: { code: true } },
|
|
535
|
+
},
|
|
387
536
|
},
|
|
388
537
|
mail_var: {
|
|
389
538
|
select: { name: true },
|
|
@@ -391,7 +540,7 @@ let MailService = MailService_1 = class MailService {
|
|
|
391
540
|
},
|
|
392
541
|
});
|
|
393
542
|
if (!mail) {
|
|
394
|
-
throw new Error(`Template "${slug}" not found
|
|
543
|
+
throw new Error(`Template "${slug}" not found`);
|
|
395
544
|
}
|
|
396
545
|
return mail;
|
|
397
546
|
}
|
|
@@ -405,27 +554,106 @@ let MailService = MailService_1 = class MailService {
|
|
|
405
554
|
throw new common_1.BadRequestException(`Invalid template syntax: ${error.message}. Please use {{variable}} format for variables.`);
|
|
406
555
|
}
|
|
407
556
|
}
|
|
557
|
+
/**
|
|
558
|
+
* Le o layout padrao direto do banco, sem passar pelo cache do api-mail.
|
|
559
|
+
*
|
|
560
|
+
* O preview tem que refletir o que acabou de ser salvo, entao aqui o cache de
|
|
561
|
+
* 60s atrapalharia em vez de ajudar.
|
|
562
|
+
*/
|
|
563
|
+
async resolveDefaultLayout(locale) {
|
|
564
|
+
var _a, _b;
|
|
565
|
+
const layoutRow = await this.prismaService.mail_layout.findFirst({
|
|
566
|
+
where: { is_default: true },
|
|
567
|
+
include: {
|
|
568
|
+
mail_layout_locale: {
|
|
569
|
+
include: { locale: { select: { code: true } } },
|
|
570
|
+
},
|
|
571
|
+
},
|
|
572
|
+
});
|
|
573
|
+
if (!layoutRow) {
|
|
574
|
+
return null;
|
|
575
|
+
}
|
|
576
|
+
const translations = layoutRow.mail_layout_locale || [];
|
|
577
|
+
const translation = translations.find((t) => { var _a; return ((_a = t.locale) === null || _a === void 0 ? void 0 : _a.code) === locale; }) ||
|
|
578
|
+
translations.find((t) => { var _a; return ((_a = t.locale) === null || _a === void 0 ? void 0 : _a.code) === 'en'; }) ||
|
|
579
|
+
translations[0];
|
|
580
|
+
return {
|
|
581
|
+
wrapper: layoutRow.wrapper,
|
|
582
|
+
header: (_a = translation === null || translation === void 0 ? void 0 : translation.header) !== null && _a !== void 0 ? _a : '',
|
|
583
|
+
footer: (_b = translation === null || translation === void 0 ? void 0 : translation.footer) !== null && _b !== void 0 ? _b : '',
|
|
584
|
+
};
|
|
585
|
+
}
|
|
586
|
+
/**
|
|
587
|
+
* Renderiza exatamente o HTML que sairia no envio.
|
|
588
|
+
*
|
|
589
|
+
* Usa o mesmo `interpolateTemplate` de `sendTemplatedMail` (inclusive a troca
|
|
590
|
+
* de quebras de linha por `<br/>`) e o mesmo `renderMailTemplate`. Qualquer
|
|
591
|
+
* atalho aqui recriaria a divergencia entre o que o admin ve e o que o
|
|
592
|
+
* destinatario recebe.
|
|
593
|
+
*/
|
|
594
|
+
async preview(locale, { subject, body, variables, use_layout, layout }) {
|
|
595
|
+
var _a, _b, _c;
|
|
596
|
+
const settings = await this.setting.getSettingValues([
|
|
597
|
+
'system-name',
|
|
598
|
+
'theme-primary-light',
|
|
599
|
+
'theme-primary-foreground-light',
|
|
600
|
+
'image-url',
|
|
601
|
+
]);
|
|
602
|
+
const brandName = settings['system-name'];
|
|
603
|
+
const primaryColor = settings['theme-primary-light'] || api_mail_1.DEFAULT_PRIMARY_COLOR;
|
|
604
|
+
const primaryForeground = settings['theme-primary-foreground-light'] ||
|
|
605
|
+
api_mail_1.DEFAULT_PRIMARY_FOREGROUND;
|
|
606
|
+
const rawLogoUrl = settings['image-url'];
|
|
607
|
+
const logoUrl = rawLogoUrl
|
|
608
|
+
? (await this.brandAsset.resolveAssetUrl(rawLogoUrl)) || undefined
|
|
609
|
+
: undefined;
|
|
610
|
+
const data = Object.assign({ brandName, primaryColor, primaryForeground }, (variables || {}));
|
|
611
|
+
const parsedSubject = subject ? this.interpolateTemplate(subject, data) : '';
|
|
612
|
+
const parsedBody = body ? this.interpolateTemplate(body, data) : '';
|
|
613
|
+
let resolvedLayout = null;
|
|
614
|
+
if (use_layout !== false) {
|
|
615
|
+
resolvedLayout = layout
|
|
616
|
+
? {
|
|
617
|
+
wrapper: (_a = layout.wrapper) !== null && _a !== void 0 ? _a : '',
|
|
618
|
+
header: (_b = layout.header) !== null && _b !== void 0 ? _b : '',
|
|
619
|
+
footer: (_c = layout.footer) !== null && _c !== void 0 ? _c : '',
|
|
620
|
+
}
|
|
621
|
+
: await this.resolveDefaultLayout(locale);
|
|
622
|
+
}
|
|
623
|
+
const html = (0, api_mail_1.renderMailTemplate)({
|
|
624
|
+
subject: parsedSubject,
|
|
625
|
+
body: parsedBody,
|
|
626
|
+
// use_layout === false vira um layout sem wrapper, o que faz o render
|
|
627
|
+
// devolver o corpo cru.
|
|
628
|
+
layout: use_layout === false ? { wrapper: '' } : resolvedLayout,
|
|
629
|
+
brandName,
|
|
630
|
+
primaryColor,
|
|
631
|
+
primaryForeground,
|
|
632
|
+
logoUrl,
|
|
633
|
+
lang: locale,
|
|
634
|
+
});
|
|
635
|
+
return { html };
|
|
636
|
+
}
|
|
408
637
|
async sendTestMail(locale, { slug, email, subject, body, variables, }) {
|
|
409
|
-
const
|
|
410
|
-
const mail = await this.getMailTemplate(slug, localeRecord.id);
|
|
638
|
+
const mail = await this.getMailTemplate(slug);
|
|
411
639
|
const settings = await this.setting.getSettingValues(['configured-mail']);
|
|
412
640
|
if (!this.isSettingEnabled(settings['configured-mail'])) {
|
|
413
641
|
throw new common_1.BadRequestException('Mail service is not configured.');
|
|
414
642
|
}
|
|
415
643
|
const { from } = await this.reloadConfig();
|
|
416
644
|
try {
|
|
417
|
-
const
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
const
|
|
421
|
-
|
|
422
|
-
: body;
|
|
645
|
+
const brandName = await this.mailMainService.getBrandName(undefined, locale);
|
|
646
|
+
const { primaryColor, primaryForeground } = await this.getThemeVariables();
|
|
647
|
+
const mergedVariables = Object.assign({ brandName, primaryColor, primaryForeground }, (variables || {}));
|
|
648
|
+
const parsedSubject = this.interpolateTemplate(subject, mergedVariables);
|
|
649
|
+
const parsedBody = this.interpolateTemplate(body, mergedVariables);
|
|
423
650
|
return this.mailMainService.send({
|
|
424
651
|
to: email,
|
|
425
652
|
subject: parsedSubject,
|
|
426
653
|
body: parsedBody,
|
|
427
654
|
mail_id: mail.id,
|
|
428
655
|
from,
|
|
656
|
+
locale,
|
|
429
657
|
});
|
|
430
658
|
}
|
|
431
659
|
catch (error) {
|
|
@@ -524,6 +752,15 @@ let MailService = MailService_1 = class MailService {
|
|
|
524
752
|
}
|
|
525
753
|
};
|
|
526
754
|
exports.MailService = MailService;
|
|
755
|
+
/** Settings que compoem o cabecalho do e-mail resolvido em `resolveLayout`. */
|
|
756
|
+
MailService.BRAND_SLUGS = new Set([
|
|
757
|
+
'image-url',
|
|
758
|
+
'url',
|
|
759
|
+
'api-url',
|
|
760
|
+
'system-name',
|
|
761
|
+
'theme-primary-light',
|
|
762
|
+
'theme-primary-foreground-light',
|
|
763
|
+
]);
|
|
527
764
|
exports.MailService = MailService = MailService_1 = __decorate([
|
|
528
765
|
(0, common_1.Injectable)(),
|
|
529
766
|
__param(0, (0, common_1.Inject)((0, common_1.forwardRef)(() => api_prisma_1.PrismaService))),
|
|
@@ -531,10 +768,14 @@ exports.MailService = MailService = MailService_1 = __decorate([
|
|
|
531
768
|
__param(2, (0, common_1.Inject)((0, common_1.forwardRef)(() => api_locale_1.LocaleService))),
|
|
532
769
|
__param(3, (0, common_1.Inject)((0, common_1.forwardRef)(() => setting_service_1.SettingService))),
|
|
533
770
|
__param(4, (0, common_1.Inject)((0, common_1.forwardRef)(() => integration_developer_api_service_1.IntegrationDeveloperApiService))),
|
|
771
|
+
__param(5, (0, common_1.Inject)((0, common_1.forwardRef)(() => incident_service_1.IncidentService))),
|
|
772
|
+
__param(6, (0, common_1.Inject)((0, common_1.forwardRef)(() => brand_asset_service_1.BrandAssetService))),
|
|
534
773
|
__metadata("design:paramtypes", [api_prisma_1.PrismaService,
|
|
535
774
|
api_mail_1.MailService,
|
|
536
775
|
api_locale_1.LocaleService,
|
|
537
776
|
setting_service_1.SettingService,
|
|
538
|
-
integration_developer_api_service_1.IntegrationDeveloperApiService
|
|
777
|
+
integration_developer_api_service_1.IntegrationDeveloperApiService,
|
|
778
|
+
incident_service_1.IncidentService,
|
|
779
|
+
brand_asset_service_1.BrandAssetService])
|
|
539
780
|
], MailService);
|
|
540
781
|
//# sourceMappingURL=mail.service.js.map
|