@hed-hog/core 0.0.385 → 0.0.386

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.
Files changed (115) hide show
  1. package/dist/app-command/app-command.registry.d.ts +2 -0
  2. package/dist/app-command/app-command.registry.d.ts.map +1 -1
  3. package/dist/app-command/app-command.registry.js.map +1 -1
  4. package/dist/auth/auth.controller.d.ts +22 -0
  5. package/dist/auth/auth.controller.d.ts.map +1 -1
  6. package/dist/auth/auth.controller.js +27 -0
  7. package/dist/auth/auth.controller.js.map +1 -1
  8. package/dist/auth/auth.service.d.ts +50 -0
  9. package/dist/auth/auth.service.d.ts.map +1 -1
  10. package/dist/auth/auth.service.js +108 -0
  11. package/dist/auth/auth.service.js.map +1 -1
  12. package/dist/auth/dto/complete-account.dto.d.ts +9 -0
  13. package/dist/auth/dto/complete-account.dto.d.ts.map +1 -0
  14. package/dist/auth/dto/complete-account.dto.js +43 -0
  15. package/dist/auth/dto/complete-account.dto.js.map +1 -0
  16. package/dist/authorize/authorize.controller.d.ts +45 -0
  17. package/dist/authorize/authorize.controller.d.ts.map +1 -0
  18. package/dist/authorize/authorize.controller.js +120 -0
  19. package/dist/authorize/authorize.controller.js.map +1 -0
  20. package/dist/authorize/authorize.module.d.ts +8 -0
  21. package/dist/authorize/authorize.module.d.ts.map +1 -0
  22. package/dist/authorize/authorize.module.js +36 -0
  23. package/dist/authorize/authorize.module.js.map +1 -0
  24. package/dist/authorize/authorize.service.d.ts +79 -0
  25. package/dist/authorize/authorize.service.d.ts.map +1 -0
  26. package/dist/authorize/authorize.service.js +196 -0
  27. package/dist/authorize/authorize.service.js.map +1 -0
  28. package/dist/authorize/dto/authorize-info.dto.d.ts +8 -0
  29. package/dist/authorize/dto/authorize-info.dto.d.ts.map +1 -0
  30. package/dist/authorize/dto/authorize-info.dto.js +42 -0
  31. package/dist/authorize/dto/authorize-info.dto.js.map +1 -0
  32. package/dist/authorize/dto/consent.dto.d.ts +8 -0
  33. package/dist/authorize/dto/consent.dto.d.ts.map +1 -0
  34. package/dist/authorize/dto/consent.dto.js +42 -0
  35. package/dist/authorize/dto/consent.dto.js.map +1 -0
  36. package/dist/authorize/dto/token.dto.d.ts +8 -0
  37. package/dist/authorize/dto/token.dto.d.ts.map +1 -0
  38. package/dist/authorize/dto/token.dto.js +42 -0
  39. package/dist/authorize/dto/token.dto.js.map +1 -0
  40. package/dist/challenge/challenge.service.d.ts +7 -0
  41. package/dist/challenge/challenge.service.d.ts.map +1 -1
  42. package/dist/challenge/challenge.service.js +22 -0
  43. package/dist/challenge/challenge.service.js.map +1 -1
  44. package/dist/core.module.d.ts.map +1 -1
  45. package/dist/core.module.js +2 -0
  46. package/dist/core.module.js.map +1 -1
  47. package/dist/file/file.service.d.ts +7 -0
  48. package/dist/file/file.service.d.ts.map +1 -1
  49. package/dist/file/file.service.js +16 -0
  50. package/dist/file/file.service.js.map +1 -1
  51. package/dist/integration-profile/integration-profile.secrets.d.ts +6 -2
  52. package/dist/integration-profile/integration-profile.secrets.d.ts.map +1 -1
  53. package/dist/integration-profile/integration-profile.secrets.js +11 -2
  54. package/dist/integration-profile/integration-profile.secrets.js.map +1 -1
  55. package/dist/integration-profile/integration-profile.service.d.ts.map +1 -1
  56. package/dist/integration-profile/integration-profile.service.js +18 -2
  57. package/dist/integration-profile/integration-profile.service.js.map +1 -1
  58. package/dist/integration-profile/integration-profile.utils.d.ts +10 -0
  59. package/dist/integration-profile/integration-profile.utils.d.ts.map +1 -1
  60. package/dist/integration-profile/integration-profile.utils.js +24 -1
  61. package/dist/integration-profile/integration-profile.utils.js.map +1 -1
  62. package/dist/oauth/interfaces/OAuthProvider.d.ts +1 -1
  63. package/dist/oauth/interfaces/OAuthProvider.d.ts.map +1 -1
  64. package/dist/oauth/oauth.controller.d.ts +26 -0
  65. package/dist/oauth/oauth.controller.d.ts.map +1 -1
  66. package/dist/oauth/oauth.controller.js +94 -0
  67. package/dist/oauth/oauth.controller.js.map +1 -1
  68. package/dist/oauth/oauth.service.d.ts +39 -1
  69. package/dist/oauth/oauth.service.d.ts.map +1 -1
  70. package/dist/oauth/oauth.service.js +115 -7
  71. package/dist/oauth/oauth.service.js.map +1 -1
  72. package/dist/oauth/providers/microsoft-entra-id.provider.d.ts +5 -1
  73. package/dist/oauth/providers/microsoft-entra-id.provider.d.ts.map +1 -1
  74. package/dist/oauth/providers/microsoft-entra-id.provider.js +37 -6
  75. package/dist/oauth/providers/microsoft-entra-id.provider.js.map +1 -1
  76. package/dist/profile/profile.controller.d.ts +1 -1
  77. package/dist/profile/profile.service.d.ts +1 -1
  78. package/dist/webhook-integration/webhook-integration.service.d.ts.map +1 -1
  79. package/dist/webhook-integration/webhook-integration.service.js +7 -1
  80. package/dist/webhook-integration/webhook-integration.service.js.map +1 -1
  81. package/hedhog/data/integration_provider.yaml +8 -0
  82. package/hedhog/data/integration_type.yaml +6 -0
  83. package/hedhog/data/mail.yaml +39 -0
  84. package/hedhog/data/route.yaml +12 -0
  85. package/hedhog/data/setting_group.yaml +15 -1
  86. package/hedhog/frontend/app/account/components/regenerate-codes-dialog.tsx.ejs +11 -7
  87. package/hedhog/frontend/app/account/components/verify-before-add-dialog.tsx.ejs +9 -7
  88. package/hedhog/frontend/app/account/hooks/use-mfa-setup.ts.ejs +6 -2
  89. package/hedhog/frontend/app/dashboard/dashboard-home-tabs.tsx.ejs +130 -34
  90. package/hedhog/frontend/messages/en.json +33 -1
  91. package/hedhog/frontend/messages/pt.json +33 -1
  92. package/package.json +10 -5
  93. package/src/app-command/app-command.registry.ts +2 -0
  94. package/src/auth/auth.controller.ts +21 -0
  95. package/src/auth/auth.service.ts +133 -0
  96. package/src/auth/dto/complete-account.dto.ts +24 -0
  97. package/src/authorize/authorize.controller.ts +99 -0
  98. package/src/authorize/authorize.module.ts +23 -0
  99. package/src/authorize/authorize.service.spec.ts +307 -0
  100. package/src/authorize/authorize.service.ts +245 -0
  101. package/src/authorize/dto/authorize-info.dto.ts +23 -0
  102. package/src/authorize/dto/consent.dto.ts +23 -0
  103. package/src/authorize/dto/token.dto.ts +23 -0
  104. package/src/challenge/challenge.service.ts +28 -0
  105. package/src/core.module.ts +2 -0
  106. package/src/file/file.service.ts +19 -0
  107. package/src/integration-profile/integration-profile.secrets.spec.ts +114 -0
  108. package/src/integration-profile/integration-profile.secrets.ts +11 -2
  109. package/src/integration-profile/integration-profile.service.ts +19 -0
  110. package/src/integration-profile/integration-profile.utils.ts +40 -0
  111. package/src/oauth/interfaces/OAuthProvider.ts +5 -1
  112. package/src/oauth/oauth.controller.ts +89 -0
  113. package/src/oauth/oauth.service.ts +190 -8
  114. package/src/oauth/providers/microsoft-entra-id.provider.ts +45 -5
  115. package/src/webhook-integration/webhook-integration.service.ts +18 -2
@@ -610,6 +610,10 @@ export class WebhookIntegrationService {
610
610
  body,
611
611
  remoteIp,
612
612
  webhookHeaders: normalizeJsonObject(headers) || {},
613
+ // `rawBody` is stashed onto the request by the API's global body-parser `verify`
614
+ // callback (apps/api/src/main.ts); typed loosely here since this package doesn't
615
+ // own that Express.Request augmentation.
616
+ webhookRawBody: (req as Request & { rawBody?: Buffer }).rawBody,
613
617
  startedAt,
614
618
  });
615
619
  }
@@ -625,10 +629,18 @@ export class WebhookIntegrationService {
625
629
  body: any;
626
630
  remoteIp: string | null;
627
631
  webhookHeaders: Record<string, unknown>;
632
+ webhookRawBody?: Buffer;
628
633
  startedAt: number;
629
634
  }) {
630
- const { integration, uuid, body, remoteIp, webhookHeaders, startedAt } =
631
- input;
635
+ const {
636
+ integration,
637
+ uuid,
638
+ body,
639
+ remoteIp,
640
+ webhookHeaders,
641
+ webhookRawBody,
642
+ startedAt,
643
+ } = input;
632
644
  const actionLogs: ActionExecutionLog[] = [];
633
645
 
634
646
  try {
@@ -639,6 +651,7 @@ export class WebhookIntegrationService {
639
651
  try {
640
652
  const result = await this.executeAction(action, body, {
641
653
  webhookHeaders,
654
+ webhookRawBody,
642
655
  remoteIp,
643
656
  publicUuid: uuid,
644
657
  integrationId: integration.id,
@@ -811,6 +824,7 @@ export class WebhookIntegrationService {
811
824
  body: any,
812
825
  context?: {
813
826
  webhookHeaders?: Record<string, unknown>;
827
+ webhookRawBody?: Buffer;
814
828
  remoteIp?: string | null;
815
829
  publicUuid?: string;
816
830
  integrationId?: number;
@@ -1138,6 +1152,7 @@ export class WebhookIntegrationService {
1138
1152
  body: any,
1139
1153
  context?: {
1140
1154
  webhookHeaders?: Record<string, unknown>;
1155
+ webhookRawBody?: Buffer;
1141
1156
  remoteIp?: string | null;
1142
1157
  publicUuid?: string;
1143
1158
  integrationId?: number;
@@ -1172,6 +1187,7 @@ export class WebhookIntegrationService {
1172
1187
  result = await this.commandRegistry.dispatch(slug, renderedParams, {
1173
1188
  webhookBody: body,
1174
1189
  webhookHeaders: context?.webhookHeaders,
1190
+ webhookRawBody: context?.webhookRawBody,
1175
1191
  remoteIp: context?.remoteIp,
1176
1192
  publicUuid: context?.publicUuid,
1177
1193
  integrationId: context?.integrationId,