@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
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.TestDTO = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const create_dto_1 = require("./create.dto");
|
|
16
|
+
class TestDTO extends create_dto_1.CreateDTO {
|
|
17
|
+
}
|
|
18
|
+
exports.TestDTO = TestDTO;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, class_validator_1.IsOptional)(),
|
|
21
|
+
(0, class_validator_1.IsInt)(),
|
|
22
|
+
(0, class_validator_1.Min)(1),
|
|
23
|
+
(0, class_transformer_1.Type)(() => Number),
|
|
24
|
+
__metadata("design:type", Number)
|
|
25
|
+
], TestDTO.prototype, "profile_id", void 0);
|
|
26
|
+
//# sourceMappingURL=test.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test.dto.js","sourceRoot":"","sources":["../../../src/integration-profile/dto/test.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAAyC;AACzC,qDAAyD;AACzD,6CAAyC;AAEzC,MAAa,OAAQ,SAAQ,sBAAS;CAcrC;AAdD,0BAcC;AADC;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAG,EAAC,CAAC,CAAC;IACN,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;;2CACC"}
|
|
@@ -3,6 +3,7 @@ import { Response } from 'express';
|
|
|
3
3
|
import { CreateDTO } from './dto/create.dto';
|
|
4
4
|
import { ExportDTO } from './dto/export.dto';
|
|
5
5
|
import { ImportConfirmDTO } from './dto/import-confirm.dto';
|
|
6
|
+
import { TestDTO } from './dto/test.dto';
|
|
6
7
|
import { UpdateDTO } from './dto/update.dto';
|
|
7
8
|
import { IntegrationProfileService } from './integration-profile.service';
|
|
8
9
|
export declare class IntegrationProfileController {
|
|
@@ -81,9 +82,19 @@ export declare class IntegrationProfileController {
|
|
|
81
82
|
type_id: number;
|
|
82
83
|
config: import("@prisma/client/runtime/library").JsonValue | null;
|
|
83
84
|
}>;
|
|
84
|
-
|
|
85
|
+
/**
|
|
86
|
+
* Dispara chamadas HTTP de saída para o endereço do provider, então tem taxa
|
|
87
|
+
* limitada — o ThrottlerGuard não é global neste projeto.
|
|
88
|
+
*/
|
|
89
|
+
test(data: TestDTO): Promise<{
|
|
90
|
+
tested_at: string;
|
|
91
|
+
persisted: boolean;
|
|
92
|
+
warning?: string;
|
|
93
|
+
info?: string;
|
|
85
94
|
success: boolean;
|
|
86
95
|
destination: string;
|
|
96
|
+
ok: boolean;
|
|
97
|
+
provider: string;
|
|
87
98
|
}>;
|
|
88
99
|
update(id: number, data: UpdateDTO): Promise<{
|
|
89
100
|
id: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration-profile.controller.d.ts","sourceRoot":"","sources":["../../src/integration-profile/integration-profile.controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAQ,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"integration-profile.controller.d.ts","sourceRoot":"","sources":["../../src/integration-profile/integration-profile.controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAQ,MAAM,cAAc,CAAC;AAsB/C,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAE1E,qBAEa,4BAA4B;IAGrC,OAAO,CAAC,QAAQ,CAAC,yBAAyB;gBAAzB,yBAAyB,EAAE,yBAAyB;IAIjE,SAAS;;;;;;;;;;;IAKT,aAAa,CACA,MAAM,CAAC,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,MAAM;;;;;;;;;;;IAShC,IAAI,CACM,gBAAgB,KAAA,EACb,MAAM,CAAC,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,MAAM,EACb,YAAY,CAAC,EAAE,MAAM,EAC7B,IAAI,CAAC,EAAE,MAAM;;;;;;;;;IAiBxB,MAAM,CACD,EAAE,GAAG,EAAE,eAAuB,EAAE,EAAE,SAAS,EAC7C,GAAG,EAAE,QAAQ;IAgBhB,GAAG,CAA4B,EAAE,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKzC,MAAM,CAAS,IAAI,EAAE,SAAS;;;;;;;;;;;IAIpC;;;OAGG;IAIG,IAAI,CAAS,IAAI,EAAE,OAAO;;;;;;;;;;IAK1B,MAAM,CACiB,EAAE,EAAE,MAAM,EAC7B,IAAI,EAAE,SAAS;;;;;;;;;;;IAMnB,MAAM,CAAS,IAAI,EAAE,SAAS;;;IAM9B,cAAc,CAAiB,IAAI,EAAE,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAK/C,aAAa,CAAS,IAAI,EAAE,gBAAgB;;;;;;;;;CAMnD"}
|
|
@@ -17,9 +17,11 @@ const api_1 = require("@hed-hog/api");
|
|
|
17
17
|
const api_pagination_1 = require("@hed-hog/api-pagination");
|
|
18
18
|
const common_1 = require("@nestjs/common");
|
|
19
19
|
const platform_express_1 = require("@nestjs/platform-express");
|
|
20
|
+
const throttler_1 = require("@nestjs/throttler");
|
|
20
21
|
const create_dto_1 = require("./dto/create.dto");
|
|
21
22
|
const export_dto_1 = require("./dto/export.dto");
|
|
22
23
|
const import_confirm_dto_1 = require("./dto/import-confirm.dto");
|
|
24
|
+
const test_dto_1 = require("./dto/test.dto");
|
|
23
25
|
const update_dto_1 = require("./dto/update.dto");
|
|
24
26
|
const integration_profile_service_1 = require("./integration-profile.service");
|
|
25
27
|
let IntegrationProfileController = class IntegrationProfileController {
|
|
@@ -52,6 +54,10 @@ let IntegrationProfileController = class IntegrationProfileController {
|
|
|
52
54
|
async create(data) {
|
|
53
55
|
return this.integrationProfileService.create(data);
|
|
54
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Dispara chamadas HTTP de saída para o endereço do provider, então tem taxa
|
|
59
|
+
* limitada — o ThrottlerGuard não é global neste projeto.
|
|
60
|
+
*/
|
|
55
61
|
async test(data) {
|
|
56
62
|
return this.integrationProfileService.test(data);
|
|
57
63
|
}
|
|
@@ -122,10 +128,12 @@ __decorate([
|
|
|
122
128
|
__metadata("design:returntype", Promise)
|
|
123
129
|
], IntegrationProfileController.prototype, "create", null);
|
|
124
130
|
__decorate([
|
|
131
|
+
(0, common_1.UseGuards)(throttler_1.ThrottlerGuard),
|
|
132
|
+
(0, throttler_1.Throttle)({ default: { limit: 10, ttl: 60000 } }),
|
|
125
133
|
(0, common_1.Post)('test'),
|
|
126
134
|
__param(0, (0, common_1.Body)()),
|
|
127
135
|
__metadata("design:type", Function),
|
|
128
|
-
__metadata("design:paramtypes", [
|
|
136
|
+
__metadata("design:paramtypes", [test_dto_1.TestDTO]),
|
|
129
137
|
__metadata("design:returntype", Promise)
|
|
130
138
|
], IntegrationProfileController.prototype, "test", null);
|
|
131
139
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration-profile.controller.js","sourceRoot":"","sources":["../../src/integration-profile/integration-profile.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sCAA+C;AAC/C,4DAAqD;AACrD,
|
|
1
|
+
{"version":3,"file":"integration-profile.controller.js","sourceRoot":"","sources":["../../src/integration-profile/integration-profile.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sCAA+C;AAC/C,4DAAqD;AACrD,2CAiBwB;AACxB,+DAA2D;AAC3D,iDAA6D;AAE7D,iDAA6C;AAC7C,iDAA6C;AAC7C,iEAA4D;AAC5D,6CAAyC;AACzC,iDAA6C;AAC7C,+EAA0E;AAInE,IAAM,4BAA4B,GAAlC,MAAM,4BAA4B;IACvC,YAEmB,yBAAoD;QAApD,8BAAyB,GAAzB,yBAAyB,CAA2B;IACpE,CAAC;IAGE,AAAN,KAAK,CAAC,SAAS;QACb,OAAO,IAAI,CAAC,yBAAyB,CAAC,SAAS,EAAE,CAAC;IACpD,CAAC;IAGK,AAAN,KAAK,CAAC,aAAa,CACA,MAAe,EACb,QAAiB;QAEpC,OAAO,IAAI,CAAC,yBAAyB,CAAC,aAAa,CACjD,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,EACzC,QAAQ,CACT,CAAC;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,IAAI,CACM,gBAAgB,EACb,MAAe,EACb,QAAiB,EACb,YAAqB,EAC7B,IAAa;QAE5B,OAAO,IAAI,CAAC,yBAAyB,CAAC,IAAI,CACxC,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AAC,uDAAyB,CAAC,CAAC,CAAA;qCACR,uDAAyB;GAH5D,4BAA4B,CA6GxC"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { OnModuleInit } from '@nestjs/common';
|
|
2
|
+
import { IntegrationTesterRegistry } from './testers/integration-tester.registry';
|
|
3
|
+
export declare class IntegrationProfileModule implements OnModuleInit {
|
|
4
|
+
private readonly testerRegistry;
|
|
5
|
+
constructor(testerRegistry: IntegrationTesterRegistry);
|
|
6
|
+
onModuleInit(): void;
|
|
2
7
|
}
|
|
3
8
|
//# sourceMappingURL=integration-profile.module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration-profile.module.d.ts","sourceRoot":"","sources":["../../src/integration-profile/integration-profile.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"integration-profile.module.d.ts","sourceRoot":"","sources":["../../src/integration-profile/integration-profile.module.ts"],"names":[],"mappings":"AAEA,OAAO,EAAsB,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAMlE,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAElF,qBAkBa,wBAAyB,YAAW,YAAY;IAC/C,OAAO,CAAC,QAAQ,CAAC,cAAc;gBAAd,cAAc,EAAE,yBAAyB;IAEtE,YAAY;CAMb"}
|
|
@@ -5,6 +5,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
7
|
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
8
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
12
|
exports.IntegrationProfileModule = void 0;
|
|
10
13
|
const api_pagination_1 = require("@hed-hog/api-pagination");
|
|
@@ -14,7 +17,18 @@ const security_module_1 = require("../security/security.module");
|
|
|
14
17
|
const integration_credential_crypto_service_1 = require("./integration-credential-crypto.service");
|
|
15
18
|
const integration_profile_controller_1 = require("./integration-profile.controller");
|
|
16
19
|
const integration_profile_service_1 = require("./integration-profile.service");
|
|
20
|
+
const testers_1 = require("./testers");
|
|
21
|
+
const integration_tester_registry_1 = require("./testers/integration-tester.registry");
|
|
17
22
|
let IntegrationProfileModule = class IntegrationProfileModule {
|
|
23
|
+
constructor(testerRegistry) {
|
|
24
|
+
this.testerRegistry = testerRegistry;
|
|
25
|
+
}
|
|
26
|
+
onModuleInit() {
|
|
27
|
+
// Libraries externas (fiscal) registram os seus depois, no boot dos próprios módulos.
|
|
28
|
+
for (const tester of testers_1.BUILTIN_INTEGRATION_TESTERS) {
|
|
29
|
+
this.testerRegistry.register(tester);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
18
32
|
};
|
|
19
33
|
exports.IntegrationProfileModule = IntegrationProfileModule;
|
|
20
34
|
exports.IntegrationProfileModule = IntegrationProfileModule = __decorate([
|
|
@@ -25,8 +39,17 @@ exports.IntegrationProfileModule = IntegrationProfileModule = __decorate([
|
|
|
25
39
|
(0, common_1.forwardRef)(() => security_module_1.SecurityModule),
|
|
26
40
|
],
|
|
27
41
|
controllers: [integration_profile_controller_1.IntegrationProfileController],
|
|
28
|
-
providers: [
|
|
29
|
-
|
|
30
|
-
|
|
42
|
+
providers: [
|
|
43
|
+
integration_profile_service_1.IntegrationProfileService,
|
|
44
|
+
integration_credential_crypto_service_1.IntegrationCredentialCryptoService,
|
|
45
|
+
integration_tester_registry_1.IntegrationTesterRegistry,
|
|
46
|
+
],
|
|
47
|
+
exports: [
|
|
48
|
+
integration_profile_service_1.IntegrationProfileService,
|
|
49
|
+
integration_credential_crypto_service_1.IntegrationCredentialCryptoService,
|
|
50
|
+
integration_tester_registry_1.IntegrationTesterRegistry,
|
|
51
|
+
],
|
|
52
|
+
}),
|
|
53
|
+
__metadata("design:paramtypes", [integration_tester_registry_1.IntegrationTesterRegistry])
|
|
31
54
|
], IntegrationProfileModule);
|
|
32
55
|
//# sourceMappingURL=integration-profile.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration-profile.module.js","sourceRoot":"","sources":["../../src/integration-profile/integration-profile.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"integration-profile.module.js","sourceRoot":"","sources":["../../src/integration-profile/integration-profile.module.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4DAA2D;AAC3D,oDAAmD;AACnD,2CAAkE;AAClE,iEAA6D;AAC7D,mGAA6F;AAC7F,qFAAgF;AAChF,+EAA0E;AAC1E,uCAAwD;AACxD,uFAAkF;AAoB3E,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IACnC,YAA6B,cAAyC;QAAzC,mBAAc,GAAd,cAAc,CAA2B;IAAG,CAAC;IAE1E,YAAY;QACV,sFAAsF;QACtF,KAAK,MAAM,MAAM,IAAI,qCAA2B,EAAE,CAAC;YACjD,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QACvC,CAAC;IACH,CAAC;CACF,CAAA;AATY,4DAAwB;mCAAxB,wBAAwB;IAlBpC,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,yBAAY,CAAC;YAC9B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,iCAAgB,CAAC;YAClC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,gCAAc,CAAC;SACjC;QACD,WAAW,EAAE,CAAC,6DAA4B,CAAC;QAC3C,SAAS,EAAE;YACT,uDAAyB;YACzB,0EAAkC;YAClC,uDAAyB;SAC1B;QACD,OAAO,EAAE;YACP,uDAAyB;YACzB,0EAAkC;YAClC,uDAAyB;SAC1B;KACF,CAAC;qCAE6C,uDAAyB;GAD3D,wBAAwB,CASpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration-profile.secrets.d.ts","sourceRoot":"","sources":["../../src/integration-profile/integration-profile.secrets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"integration-profile.secrets.d.ts","sourceRoot":"","sources":["../../src/integration-profile/integration-profile.secrets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAuD5D,CAAC;AAEF,+DAA+D;AAC/D,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,CAErE"}
|
|
@@ -24,13 +24,18 @@ exports.INTEGRATION_SECRET_KEYS = {
|
|
|
24
24
|
gmail: ['client_secret', 'refresh_token'],
|
|
25
25
|
ses: ['secret_access_key'],
|
|
26
26
|
resend: ['api_token', 'webhook_secret'],
|
|
27
|
+
// IMAP e um perfil de RECEBIMENTO: a senha (ou senha de app, no Google
|
|
28
|
+
// Workspace e no M365) da acesso de leitura a caixa inteira.
|
|
29
|
+
imap: ['password'],
|
|
27
30
|
// Mensageria
|
|
28
31
|
'evolution-api': ['token'],
|
|
29
32
|
// app_secret assina o HMAC do webhook (X-Hub-Signature-256) e verify_token é
|
|
30
33
|
// comparado no handshake da Meta: quem tem qualquer um dos dois forja eventos.
|
|
31
34
|
'whatsapp-official': ['access_token', 'app_secret', 'verify_token'],
|
|
32
35
|
// Storage
|
|
33
|
-
|
|
36
|
+
// session_token acompanha credenciais temporárias (STS) usadas pelo upload em
|
|
37
|
+
// massa do LMS: vale como credencial completa enquanto não expira.
|
|
38
|
+
s3: ['secret_access_key', 'session_token'],
|
|
34
39
|
gcs: ['key_file_json'],
|
|
35
40
|
'azure-blob': ['key'],
|
|
36
41
|
's3-compatible': ['secret_access_key'],
|
|
@@ -38,6 +43,9 @@ exports.INTEGRATION_SECRET_KEYS = {
|
|
|
38
43
|
openai: ['api_key'],
|
|
39
44
|
gemini: ['api_key'],
|
|
40
45
|
claude: ['api_key'],
|
|
46
|
+
deepseek: ['api_key'],
|
|
47
|
+
// Geração de vídeo
|
|
48
|
+
luma: ['api_key'],
|
|
41
49
|
// OAuth
|
|
42
50
|
'google-oauth': ['client_secret'],
|
|
43
51
|
'github-oauth': ['client_secret'],
|
|
@@ -51,6 +59,9 @@ exports.INTEGRATION_SECRET_KEYS = {
|
|
|
51
59
|
// Pagamento
|
|
52
60
|
stripe: ['secret_key', 'webhook_secret'],
|
|
53
61
|
mercado_pago: ['access_token', 'webhook_secret'],
|
|
62
|
+
// A service account do Google Play assina o JWT trocado por access token: tanto
|
|
63
|
+
// o JSON inteiro quanto a private_key avulsa dão acesso à API do app.
|
|
64
|
+
google_play: ['service_account_json', 'private_key'],
|
|
54
65
|
// Captcha
|
|
55
66
|
recaptcha: ['secret_key'],
|
|
56
67
|
'cloudflare-turnstile': ['secret_key'],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration-profile.secrets.js","sourceRoot":"","sources":["../../src/integration-profile/integration-profile.secrets.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"integration-profile.secrets.js","sourceRoot":"","sources":["../../src/integration-profile/integration-profile.secrets.ts"],"names":[],"mappings":";;;AA0EA,wDAEC;AA5ED;;;;;;;;;;;;;;;GAeG;AACU,QAAA,uBAAuB,GAA6B;IAC/D,QAAQ;IACR,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,KAAK,EAAE,CAAC,eAAe,EAAE,eAAe,CAAC;IACzC,GAAG,EAAE,CAAC,mBAAmB,CAAC;IAC1B,MAAM,EAAE,CAAC,WAAW,EAAE,gBAAgB,CAAC;IACvC,uEAAuE;IACvE,6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IAC/B,YAAY,EAAE,CAAC,WAAW,CAAC;IAC3B,UAAU,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC;IAChC,SAAS;IACT,0EAA0E;IAC1E,qDAAqD;IACrD,eAAe,EAAE,CAAC,wBAAwB,EAAE,sBAAsB,CAAC;CACpE,CAAC;AAEF,+DAA+D;AAC/D,SAAgB,sBAAsB,CAAC,YAAoB;;IACzD,OAAO,MAAA,+BAAuB,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC,mCAAI,EAAE,CAAC;AACnE,CAAC"}
|
|
@@ -3,8 +3,10 @@ import { PaginationDTO, PaginationService } from '@hed-hog/api-pagination';
|
|
|
3
3
|
import { PrismaService } from '@hed-hog/api-prisma';
|
|
4
4
|
import { CreateDTO } from './dto/create.dto';
|
|
5
5
|
import { ConflictResolutionDTO, ImportProfileItemDTO } from './dto/import-confirm.dto';
|
|
6
|
+
import { TestDTO } from './dto/test.dto';
|
|
6
7
|
import { UpdateDTO } from './dto/update.dto';
|
|
7
8
|
import { IntegrationCredentialCryptoService } from './integration-credential-crypto.service';
|
|
9
|
+
import { IntegrationTesterRegistry } from './testers/integration-tester.registry';
|
|
8
10
|
type IntegrationProfileExportItem = {
|
|
9
11
|
slug: string;
|
|
10
12
|
name: string;
|
|
@@ -32,7 +34,9 @@ export declare class IntegrationProfileService {
|
|
|
32
34
|
private readonly prismaService;
|
|
33
35
|
private readonly paginationService;
|
|
34
36
|
private readonly credentialCrypto;
|
|
35
|
-
|
|
37
|
+
private readonly testerRegistry;
|
|
38
|
+
private readonly logger;
|
|
39
|
+
constructor(prismaService: PrismaService, paginationService: PaginationService, credentialCrypto: IntegrationCredentialCryptoService, testerRegistry: IntegrationTesterRegistry);
|
|
36
40
|
listTypes(): Promise<{
|
|
37
41
|
id: number;
|
|
38
42
|
slug: string;
|
|
@@ -187,17 +191,32 @@ export declare class IntegrationProfileService {
|
|
|
187
191
|
delete({ ids }: DeleteDTO): Promise<{
|
|
188
192
|
count: number;
|
|
189
193
|
}>;
|
|
190
|
-
|
|
194
|
+
/**
|
|
195
|
+
* Testa as credenciais de um perfil contra o serviço real, sem salvar.
|
|
196
|
+
*
|
|
197
|
+
* Só despacha: quem sabe falar com cada provider é o `IntegrationTester` registrado
|
|
198
|
+
* no `IntegrationTesterRegistry`. Funciona tanto na edição (herda os segredos
|
|
199
|
+
* armazenados no lugar da máscara) quanto na criação de um perfil ainda inexistente.
|
|
200
|
+
*/
|
|
201
|
+
test(data: TestDTO): Promise<{
|
|
202
|
+
tested_at: string;
|
|
203
|
+
persisted: boolean;
|
|
204
|
+
warning?: string;
|
|
205
|
+
info?: string;
|
|
191
206
|
success: boolean;
|
|
192
207
|
destination: string;
|
|
208
|
+
ok: boolean;
|
|
209
|
+
provider: string;
|
|
193
210
|
}>;
|
|
211
|
+
/** Rejeita depois de `ms`, para o caso de um tester ignorar o AbortSignal. */
|
|
212
|
+
private hardTimeout;
|
|
194
213
|
/**
|
|
195
|
-
*
|
|
196
|
-
*
|
|
214
|
+
* Grava metadados (não-secretos) da última validação no config do perfil.
|
|
215
|
+
*
|
|
216
|
+
* Devolve se gravou: no fluxo de criação não existe linha ainda, e a UI usa isso
|
|
217
|
+
* para avisar que o resultado não ficou registrado.
|
|
197
218
|
*/
|
|
198
|
-
private
|
|
199
|
-
/** Grava metadados (não-secretos) da última validação no config do perfil. */
|
|
200
|
-
private recordWhatsappValidation;
|
|
219
|
+
private recordValidation;
|
|
201
220
|
exportProfiles({ ids, includeSecrets, }: {
|
|
202
221
|
ids?: number[];
|
|
203
222
|
includeSecrets?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration-profile.service.d.ts","sourceRoot":"","sources":["../../src/integration-profile/integration-profile.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"integration-profile.service.d.ts","sourceRoot":"","sources":["../../src/integration-profile/integration-profile.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAUpD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,kCAAkC,EAAE,MAAM,yCAAyC,CAAC;AAG7F,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAMlF,KAAK,4BAA4B,GAAG;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACvC,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAUF,KAAK,mBAAmB,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACvC,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACvB,KAAK,EAAE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Aa,EAAE,MAAM,CAAA;KAAE,EAAE,GAClE,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAyC3B,kBAAkB,CAAC,IAAI,EAAE,UAAU;;;;;;;;;;;;;;;;IAwInC,aAAa,CAAC,EAClB,QAAQ,EACR,mBAAmB,GACpB,EAAE;QACD,QAAQ,EAAE,oBAAoB,EAAE,CAAC;QACjC,mBAAmB,CAAC,EAAE,qBAAqB,EAAE,CAAC;KAC/C;;;;;;;;;IAqBD;;;;;;;;;OASG;IACG,oBAAoB,CACxB,QAAQ,EAAE,oBAAoB,EAAE,EAChC,mBAAmB,CAAC,EAAE,qBAAqB,EAAE,GAC5C,OAAO,CAAC;QACT,OAAO,EAAE,GAAG,CACV,MAAM,EACN;YACE,EAAE,EAAE,MAAM,CAAC;YACX,IAAI,EAAE,MAAM,CAAC;YACb,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC;SACxD,CACF,CAAC;QACF,MAAM,EAAE;YAAE,OAAO,EAAE,MAAM,CAAC;YAAC,QAAQ,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE,CAAC;KACjF,CAAC;YA6JY,qBAAqB;YAarB,uBAAuB;IAmBrC,OAAO,CAAC,mBAAmB;IA4C3B,OAAO,CAAC,uBAAuB;YAkBjB,kBAAkB;CAiBjC"}
|
|
@@ -55,20 +55,25 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
55
55
|
}
|
|
56
56
|
return t;
|
|
57
57
|
};
|
|
58
|
+
var IntegrationProfileService_1;
|
|
58
59
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
59
60
|
exports.IntegrationProfileService = void 0;
|
|
60
61
|
const api_pagination_1 = require("@hed-hog/api-pagination");
|
|
61
62
|
const api_prisma_1 = require("@hed-hog/api-prisma");
|
|
62
63
|
const common_1 = require("@nestjs/common");
|
|
63
64
|
const pako = __importStar(require("pako"));
|
|
64
|
-
const integration_profile_utils_1 = require("./integration-profile.utils");
|
|
65
65
|
const integration_credential_crypto_service_1 = require("./integration-credential-crypto.service");
|
|
66
66
|
const integration_profile_secrets_1 = require("./integration-profile.secrets");
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
const http_probe_1 = require("./testers/http-probe");
|
|
68
|
+
const integration_tester_registry_1 = require("./testers/integration-tester.registry");
|
|
69
|
+
const integration_tester_types_1 = require("./testers/integration-tester.types");
|
|
70
|
+
let IntegrationProfileService = IntegrationProfileService_1 = class IntegrationProfileService {
|
|
71
|
+
constructor(prismaService, paginationService, credentialCrypto, testerRegistry) {
|
|
69
72
|
this.prismaService = prismaService;
|
|
70
73
|
this.paginationService = paginationService;
|
|
71
74
|
this.credentialCrypto = credentialCrypto;
|
|
75
|
+
this.testerRegistry = testerRegistry;
|
|
76
|
+
this.logger = new common_1.Logger(IntegrationProfileService_1.name);
|
|
72
77
|
}
|
|
73
78
|
async listTypes() {
|
|
74
79
|
return this.prismaService.integration_type.findMany({
|
|
@@ -334,8 +339,15 @@ let IntegrationProfileService = class IntegrationProfileService {
|
|
|
334
339
|
where: { id: { in: ids } },
|
|
335
340
|
});
|
|
336
341
|
}
|
|
342
|
+
/**
|
|
343
|
+
* Testa as credenciais de um perfil contra o serviço real, sem salvar.
|
|
344
|
+
*
|
|
345
|
+
* Só despacha: quem sabe falar com cada provider é o `IntegrationTester` registrado
|
|
346
|
+
* no `IntegrationTesterRegistry`. Funciona tanto na edição (herda os segredos
|
|
347
|
+
* armazenados no lugar da máscara) quanto na criação de um perfil ainda inexistente.
|
|
348
|
+
*/
|
|
337
349
|
async test(data) {
|
|
338
|
-
var _a, _b, _c
|
|
350
|
+
var _a, _b, _c;
|
|
339
351
|
await this.validateTypeAndProvider(data.type_id, data.provider_id);
|
|
340
352
|
const provider = await this.prismaService.integration_provider.findUnique({
|
|
341
353
|
where: { id: data.provider_id },
|
|
@@ -352,114 +364,103 @@ let IntegrationProfileService = class IntegrationProfileService {
|
|
|
352
364
|
throw new common_1.BadRequestException(`Provider with id ${data.provider_id} not found.`);
|
|
353
365
|
}
|
|
354
366
|
const typeSlug = provider.integration_type.slug;
|
|
355
|
-
|
|
356
|
-
|
|
367
|
+
const slug = data.slug.trim();
|
|
368
|
+
const tester = this.testerRegistry.find(provider.slug);
|
|
369
|
+
if (!tester) {
|
|
370
|
+
throw new common_1.BadRequestException(`Connection test is not available for provider "${provider.slug}".`);
|
|
357
371
|
}
|
|
358
372
|
// "Deixe em branco para manter": ao testar na edição, herda os segredos já
|
|
359
373
|
// armazenados (decifrados pelo middleware) para os campos vazios/mascarados.
|
|
374
|
+
// Resolve por id quando ele veio: o slug é editável e pode ter mudado no form.
|
|
360
375
|
let effectiveConfig = (_a = data.config) !== null && _a !== void 0 ? _a : null;
|
|
361
376
|
const stored = await this.prismaService.integration_profile.findUnique({
|
|
362
|
-
where: {
|
|
377
|
+
where: data.profile_id ? { id: data.profile_id } : { slug },
|
|
363
378
|
select: { config: true },
|
|
364
379
|
});
|
|
365
380
|
if (stored === null || stored === void 0 ? void 0 : stored.config) {
|
|
366
381
|
effectiveConfig = this.credentialCrypto.mergeKeepingStoredSecrets(provider.slug, effectiveConfig, stored.config);
|
|
367
382
|
}
|
|
368
|
-
|
|
369
|
-
|
|
383
|
+
const config = effectiveConfig !== null && effectiveConfig !== void 0 ? effectiveConfig : {};
|
|
384
|
+
const secretValues = (0, integration_profile_secrets_1.getSensitiveConfigKeys)(provider.slug)
|
|
385
|
+
.map((key) => { var _a; return String((_a = config[key]) !== null && _a !== void 0 ? _a : ''); })
|
|
386
|
+
.filter((value) => value.length > 0);
|
|
387
|
+
const timeoutMs = (_b = tester.timeoutMs) !== null && _b !== void 0 ? _b : integration_tester_types_1.INTEGRATION_TEST_TIMEOUT_MS;
|
|
388
|
+
let outcome;
|
|
389
|
+
try {
|
|
390
|
+
// Duplo guarda de tempo: o AbortSignal cobre quem o respeita (fetch/SDKs) e o
|
|
391
|
+
// race cobre quem não respeita (o transporter do nodemailer, por exemplo).
|
|
392
|
+
outcome = await Promise.race([
|
|
393
|
+
tester.test(config, {
|
|
394
|
+
signal: AbortSignal.timeout(timeoutMs),
|
|
395
|
+
typeSlug,
|
|
396
|
+
providerSlug: provider.slug,
|
|
397
|
+
secretValues,
|
|
398
|
+
}),
|
|
399
|
+
this.hardTimeout(timeoutMs + 2000),
|
|
400
|
+
]);
|
|
370
401
|
}
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
const domain = String((_d = resendCfg.domain) !== null && _d !== void 0 ? _d : '').trim();
|
|
376
|
-
if (!apiToken) {
|
|
377
|
-
throw new common_1.BadRequestException('Resend API token is required.');
|
|
378
|
-
}
|
|
379
|
-
if (!domain) {
|
|
380
|
-
throw new common_1.BadRequestException('Resend sending domain is required.');
|
|
381
|
-
}
|
|
382
|
-
return {
|
|
383
|
-
success: true,
|
|
384
|
-
destination: domain,
|
|
402
|
+
catch (error) {
|
|
403
|
+
outcome = {
|
|
404
|
+
ok: false,
|
|
405
|
+
error: (0, http_probe_1.sanitizeTesterError)(error, secretValues),
|
|
385
406
|
};
|
|
386
407
|
}
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
throw new common_1.BadRequestException('
|
|
408
|
+
const persisted = await this.recordValidation(provider.slug, slug, outcome, data.profile_id);
|
|
409
|
+
if (!outcome.ok) {
|
|
410
|
+
this.logger.warn(`Integration test failed for provider "${provider.slug}" (profile "${slug}"): ${outcome.error}`);
|
|
411
|
+
throw new common_1.BadRequestException(outcome.error || 'Connection test failed.');
|
|
391
412
|
}
|
|
392
|
-
return {
|
|
393
|
-
success
|
|
394
|
-
|
|
395
|
-
|
|
413
|
+
return Object.assign(Object.assign(Object.assign({
|
|
414
|
+
// `success` e `destination` são o contrato legado consumido pela tela de
|
|
415
|
+
// e-mail (core/integrations-webhooks): mantidos com o mesmo significado.
|
|
416
|
+
success: true, destination: String((_c = config.from_email) !== null && _c !== void 0 ? _c : '').trim() || outcome.info || '', ok: true, provider: provider.slug }, (outcome.info ? { info: outcome.info } : {})), (outcome.warning ? { warning: outcome.warning } : {})), { tested_at: new Date().toISOString(), persisted });
|
|
417
|
+
}
|
|
418
|
+
/** Rejeita depois de `ms`, para o caso de um tester ignorar o AbortSignal. */
|
|
419
|
+
hardTimeout(ms) {
|
|
420
|
+
return new Promise((_resolve, reject) => {
|
|
421
|
+
var _a;
|
|
422
|
+
const timer = setTimeout(() => {
|
|
423
|
+
const error = new Error('Connection test timed out.');
|
|
424
|
+
error.name = 'TimeoutError';
|
|
425
|
+
reject(error);
|
|
426
|
+
}, ms);
|
|
427
|
+
// Não segura o processo vivo caso o teste termine antes.
|
|
428
|
+
(_a = timer.unref) === null || _a === void 0 ? void 0 : _a.call(timer);
|
|
429
|
+
});
|
|
396
430
|
}
|
|
397
431
|
/**
|
|
398
|
-
*
|
|
399
|
-
*
|
|
432
|
+
* Grava metadados (não-secretos) da última validação no config do perfil.
|
|
433
|
+
*
|
|
434
|
+
* Devolve se gravou: no fluxo de criação não existe linha ainda, e a UI usa isso
|
|
435
|
+
* para avisar que o resultado não ficou registrado.
|
|
400
436
|
*/
|
|
401
|
-
async
|
|
437
|
+
async recordValidation(providerSlug, slug, outcome, profileId) {
|
|
402
438
|
var _a, _b, _c;
|
|
403
|
-
if (providerSlug !== 'whatsapp-official') {
|
|
404
|
-
throw new common_1.BadRequestException(`Integration profile test is not available for provider "${providerSlug}".`);
|
|
405
|
-
}
|
|
406
|
-
const cfg = (0, integration_profile_utils_1.buildWhatsappOfficialConfigFromIntegration)(effectiveConfig);
|
|
407
|
-
if (!cfg.accessToken) {
|
|
408
|
-
throw new common_1.BadRequestException('WhatsApp access token is required.');
|
|
409
|
-
}
|
|
410
|
-
if (!cfg.wabaId) {
|
|
411
|
-
throw new common_1.BadRequestException('WhatsApp Business Account ID is required.');
|
|
412
|
-
}
|
|
413
|
-
if (!cfg.appSecret) {
|
|
414
|
-
throw new common_1.BadRequestException('Meta App Secret is required to validate webhook signatures.');
|
|
415
|
-
}
|
|
416
|
-
if (!cfg.verifyToken) {
|
|
417
|
-
throw new common_1.BadRequestException('Webhook verify token is required.');
|
|
418
|
-
}
|
|
419
|
-
const url = `https://graph.facebook.com/${cfg.graphApiVersion}/${encodeURIComponent(cfg.wabaId)}?fields=id,name`;
|
|
420
|
-
let name = '';
|
|
421
|
-
let failure = null;
|
|
422
439
|
try {
|
|
423
|
-
const
|
|
424
|
-
|
|
440
|
+
const stored = await this.prismaService.integration_profile.findUnique({
|
|
441
|
+
where: profileId ? { id: profileId } : { slug },
|
|
442
|
+
select: { id: true, config: true },
|
|
425
443
|
});
|
|
426
|
-
|
|
427
|
-
if (!
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
444
|
+
// Perfil ainda não salvo (teste no fluxo de criação): nada a registrar.
|
|
445
|
+
if (!stored)
|
|
446
|
+
return false;
|
|
447
|
+
// Parte de `stored.config`, NUNCA do config recebido: o que o usuário digitou
|
|
448
|
+
// e ainda não salvou não pode ser persistido de carona num teste.
|
|
449
|
+
// `stored.config` vem decifrado pelo middleware; recifra-mos ao gravar.
|
|
450
|
+
const plain = Object.assign(Object.assign({}, ((_a = stored.config) !== null && _a !== void 0 ? _a : {})), { last_validated_at: new Date().toISOString(), last_validation_status: outcome.ok ? 'ok' : 'error', last_error: outcome.ok ? null : ((_b = outcome.error) !== null && _b !== void 0 ? _b : null), last_validation_info: outcome.ok ? ((_c = outcome.info) !== null && _c !== void 0 ? _c : null) : null });
|
|
451
|
+
await this.prismaService.integration_profile.update({
|
|
452
|
+
where: { id: stored.id },
|
|
453
|
+
data: {
|
|
454
|
+
config: this.credentialCrypto.encryptConfig(providerSlug, plain),
|
|
455
|
+
},
|
|
456
|
+
});
|
|
457
|
+
return true;
|
|
435
458
|
}
|
|
436
459
|
catch (error) {
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
if (failure) {
|
|
441
|
-
throw new common_1.BadRequestException(`WhatsApp validation failed: ${failure}`);
|
|
460
|
+
// Falhar ao REGISTRAR não pode transformar um teste bem-sucedido em erro 500.
|
|
461
|
+
this.logger.error(`Failed to record validation for profile "${slug}": ${error instanceof Error ? error.message : String(error)}`);
|
|
462
|
+
return false;
|
|
442
463
|
}
|
|
443
|
-
return { success: true, destination: name || cfg.wabaId };
|
|
444
|
-
}
|
|
445
|
-
/** Grava metadados (não-secretos) da última validação no config do perfil. */
|
|
446
|
-
async recordWhatsappValidation(providerSlug, slug, failure) {
|
|
447
|
-
var _a;
|
|
448
|
-
const stored = await this.prismaService.integration_profile.findUnique({
|
|
449
|
-
where: { slug },
|
|
450
|
-
select: { id: true, config: true },
|
|
451
|
-
});
|
|
452
|
-
// Perfil ainda não salvo (teste no fluxo de criação): nada a registrar.
|
|
453
|
-
if (!stored)
|
|
454
|
-
return;
|
|
455
|
-
// `stored.config` vem decifrado pelo middleware; recifra-mos ao gravar.
|
|
456
|
-
const plain = Object.assign(Object.assign({}, ((_a = stored.config) !== null && _a !== void 0 ? _a : {})), { last_validated_at: new Date().toISOString(), last_validation_status: failure ? 'error' : 'ok', last_error: failure !== null && failure !== void 0 ? failure : null });
|
|
457
|
-
await this.prismaService.integration_profile.update({
|
|
458
|
-
where: { id: stored.id },
|
|
459
|
-
data: {
|
|
460
|
-
config: this.credentialCrypto.encryptConfig(providerSlug, plain),
|
|
461
|
-
},
|
|
462
|
-
});
|
|
463
464
|
}
|
|
464
465
|
async exportProfiles({ ids, includeSecrets = false, }) {
|
|
465
466
|
const items = await this.exportProfileItemsByIds(ids, includeSecrets);
|
|
@@ -864,13 +865,15 @@ let IntegrationProfileService = class IntegrationProfileService {
|
|
|
864
865
|
}
|
|
865
866
|
};
|
|
866
867
|
exports.IntegrationProfileService = IntegrationProfileService;
|
|
867
|
-
exports.IntegrationProfileService = IntegrationProfileService = __decorate([
|
|
868
|
+
exports.IntegrationProfileService = IntegrationProfileService = IntegrationProfileService_1 = __decorate([
|
|
868
869
|
(0, common_1.Injectable)(),
|
|
869
870
|
__param(0, (0, common_1.Inject)((0, common_1.forwardRef)(() => api_prisma_1.PrismaService))),
|
|
870
871
|
__param(1, (0, common_1.Inject)((0, common_1.forwardRef)(() => api_pagination_1.PaginationService))),
|
|
871
872
|
__param(2, (0, common_1.Inject)((0, common_1.forwardRef)(() => integration_credential_crypto_service_1.IntegrationCredentialCryptoService))),
|
|
873
|
+
__param(3, (0, common_1.Inject)((0, common_1.forwardRef)(() => integration_tester_registry_1.IntegrationTesterRegistry))),
|
|
872
874
|
__metadata("design:paramtypes", [api_prisma_1.PrismaService,
|
|
873
875
|
api_pagination_1.PaginationService,
|
|
874
|
-
integration_credential_crypto_service_1.IntegrationCredentialCryptoService
|
|
876
|
+
integration_credential_crypto_service_1.IntegrationCredentialCryptoService,
|
|
877
|
+
integration_tester_registry_1.IntegrationTesterRegistry])
|
|
875
878
|
], IntegrationProfileService);
|
|
876
879
|
//# sourceMappingURL=integration-profile.service.js.map
|