@hed-hog/core 0.0.355 → 0.0.358

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 (287) hide show
  1. package/dist/ai/ai.service.d.ts +3 -12
  2. package/dist/ai/ai.service.d.ts.map +1 -1
  3. package/dist/ai/ai.service.js +34 -125
  4. package/dist/ai/ai.service.js.map +1 -1
  5. package/dist/auth/guards/auth.guard.d.ts +6 -1
  6. package/dist/auth/guards/auth.guard.d.ts.map +1 -1
  7. package/dist/auth/guards/auth.guard.js +33 -2
  8. package/dist/auth/guards/auth.guard.js.map +1 -1
  9. package/dist/core.module.d.ts.map +1 -1
  10. package/dist/core.module.js +3 -3
  11. package/dist/core.module.js.map +1 -1
  12. package/dist/file/file.controller.d.ts +4 -2
  13. package/dist/file/file.controller.d.ts.map +1 -1
  14. package/dist/file/file.controller.js +44 -38
  15. package/dist/file/file.controller.js.map +1 -1
  16. package/dist/file/file.service.d.ts +2 -2
  17. package/dist/file/file.service.d.ts.map +1 -1
  18. package/dist/file/file.service.js +58 -89
  19. package/dist/file/file.service.js.map +1 -1
  20. package/dist/file/provider/azure.provider.d.ts.map +1 -1
  21. package/dist/file/provider/azure.provider.js +10 -15
  22. package/dist/file/provider/azure.provider.js.map +1 -1
  23. package/dist/file/provider/gcs.provider.d.ts.map +1 -1
  24. package/dist/file/provider/gcs.provider.js +8 -9
  25. package/dist/file/provider/gcs.provider.js.map +1 -1
  26. package/dist/file/provider/local.provider.d.ts.map +1 -1
  27. package/dist/file/provider/local.provider.js +11 -10
  28. package/dist/file/provider/local.provider.js.map +1 -1
  29. package/dist/file/provider/provider.enum.d.ts +2 -1
  30. package/dist/file/provider/provider.enum.d.ts.map +1 -1
  31. package/dist/file/provider/provider.enum.js +1 -0
  32. package/dist/file/provider/provider.enum.js.map +1 -1
  33. package/dist/file/provider/provider.factory.d.ts +1 -1
  34. package/dist/file/provider/provider.factory.d.ts.map +1 -1
  35. package/dist/file/provider/provider.factory.js +18 -5
  36. package/dist/file/provider/provider.factory.js.map +1 -1
  37. package/dist/file/provider/s3.provider.d.ts.map +1 -1
  38. package/dist/file/provider/s3.provider.js +4 -20
  39. package/dist/file/provider/s3.provider.js.map +1 -1
  40. package/dist/file/provider/spaces.provider.d.ts +27 -0
  41. package/dist/file/provider/spaces.provider.d.ts.map +1 -0
  42. package/dist/file/provider/spaces.provider.js +203 -0
  43. package/dist/file/provider/spaces.provider.js.map +1 -0
  44. package/dist/index.d.ts +4 -3
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +4 -3
  47. package/dist/index.js.map +1 -1
  48. package/dist/integration-profile/dto/create.dto.d.ts +9 -0
  49. package/dist/integration-profile/dto/create.dto.d.ts.map +1 -0
  50. package/dist/integration-profile/dto/create.dto.js +54 -0
  51. package/dist/integration-profile/dto/create.dto.js.map +1 -0
  52. package/dist/integration-profile/dto/export.dto.d.ts +5 -0
  53. package/dist/integration-profile/dto/export.dto.d.ts.map +1 -0
  54. package/dist/integration-profile/dto/export.dto.js +29 -0
  55. package/dist/integration-profile/dto/export.dto.js.map +1 -0
  56. package/dist/integration-profile/dto/import-confirm.dto.d.ts +17 -0
  57. package/dist/integration-profile/dto/import-confirm.dto.d.ts.map +1 -0
  58. package/dist/integration-profile/dto/import-confirm.dto.js +77 -0
  59. package/dist/integration-profile/dto/import-confirm.dto.js.map +1 -0
  60. package/dist/integration-profile/dto/update.dto.d.ts.map +1 -0
  61. package/dist/integration-profile/dto/update.dto.js.map +1 -0
  62. package/dist/integration-profile/integration-profile.controller.d.ts +142 -0
  63. package/dist/integration-profile/integration-profile.controller.d.ts.map +1 -0
  64. package/dist/integration-profile/integration-profile.controller.js +166 -0
  65. package/dist/integration-profile/integration-profile.controller.js.map +1 -0
  66. package/dist/integration-profile/integration-profile.module.d.ts +3 -0
  67. package/dist/integration-profile/integration-profile.module.d.ts.map +1 -0
  68. package/dist/{mail-profile/mail-profile.module.js → integration-profile/integration-profile.module.js} +11 -13
  69. package/dist/integration-profile/integration-profile.module.js.map +1 -0
  70. package/dist/integration-profile/integration-profile.service.d.ts +160 -0
  71. package/dist/integration-profile/integration-profile.service.d.ts.map +1 -0
  72. package/dist/integration-profile/integration-profile.service.js +609 -0
  73. package/dist/integration-profile/integration-profile.service.js.map +1 -0
  74. package/dist/integration-profile/integration-profile.utils.d.ts +30 -0
  75. package/dist/integration-profile/integration-profile.utils.d.ts.map +1 -0
  76. package/dist/integration-profile/integration-profile.utils.js +156 -0
  77. package/dist/integration-profile/integration-profile.utils.js.map +1 -0
  78. package/dist/mail/mail.module.d.ts.map +1 -1
  79. package/dist/mail/mail.module.js +36 -23
  80. package/dist/mail/mail.module.js.map +1 -1
  81. package/dist/mail/mail.service.d.ts +4 -2
  82. package/dist/mail/mail.service.d.ts.map +1 -1
  83. package/dist/mail/mail.service.js +33 -51
  84. package/dist/mail/mail.service.js.map +1 -1
  85. package/dist/mcp/guards/mcp-auth.guard.js +1 -1
  86. package/dist/mcp/guards/mcp-auth.guard.js.map +1 -1
  87. package/dist/mcp/mcp-api-key.controller.d.ts +2 -0
  88. package/dist/mcp/mcp-api-key.controller.d.ts.map +1 -1
  89. package/dist/mcp/mcp-api-key.controller.js +1 -1
  90. package/dist/mcp/mcp-api-key.controller.js.map +1 -1
  91. package/dist/mcp/mcp-api-key.service.d.ts +2 -1
  92. package/dist/mcp/mcp-api-key.service.d.ts.map +1 -1
  93. package/dist/mcp/mcp-api-key.service.js +6 -2
  94. package/dist/mcp/mcp-api-key.service.js.map +1 -1
  95. package/dist/mcp/mcp.module.d.ts.map +1 -1
  96. package/dist/mcp/mcp.module.js +3 -5
  97. package/dist/mcp/mcp.module.js.map +1 -1
  98. package/dist/mcp-chat/mcp-chat.service.d.ts.map +1 -1
  99. package/dist/mcp-chat/mcp-chat.service.js +17 -16
  100. package/dist/mcp-chat/mcp-chat.service.js.map +1 -1
  101. package/dist/oauth/interfaces/OAuthProvider.d.ts +1 -1
  102. package/dist/oauth/interfaces/OAuthProvider.d.ts.map +1 -1
  103. package/dist/oauth/oauth.controller.d.ts +4 -1
  104. package/dist/oauth/oauth.controller.d.ts.map +1 -1
  105. package/dist/oauth/oauth.controller.js +31 -5
  106. package/dist/oauth/oauth.controller.js.map +1 -1
  107. package/dist/oauth/oauth.service.d.ts +12 -1
  108. package/dist/oauth/oauth.service.d.ts.map +1 -1
  109. package/dist/oauth/oauth.service.js +125 -23
  110. package/dist/oauth/oauth.service.js.map +1 -1
  111. package/dist/oauth/providers/abstract.provider.d.ts +1 -1
  112. package/dist/oauth/providers/abstract.provider.d.ts.map +1 -1
  113. package/dist/oauth/providers/facebook.provider.d.ts +5 -2
  114. package/dist/oauth/providers/facebook.provider.d.ts.map +1 -1
  115. package/dist/oauth/providers/facebook.provider.js +34 -19
  116. package/dist/oauth/providers/facebook.provider.js.map +1 -1
  117. package/dist/oauth/providers/github.provider.d.ts +6 -2
  118. package/dist/oauth/providers/github.provider.d.ts.map +1 -1
  119. package/dist/oauth/providers/github.provider.js +43 -20
  120. package/dist/oauth/providers/github.provider.js.map +1 -1
  121. package/dist/oauth/providers/google.provider.d.ts +5 -2
  122. package/dist/oauth/providers/google.provider.d.ts.map +1 -1
  123. package/dist/oauth/providers/google.provider.js +34 -19
  124. package/dist/oauth/providers/google.provider.js.map +1 -1
  125. package/dist/oauth/providers/microsoft-entra-id.provider.d.ts +5 -2
  126. package/dist/oauth/providers/microsoft-entra-id.provider.d.ts.map +1 -1
  127. package/dist/oauth/providers/microsoft-entra-id.provider.js +43 -40
  128. package/dist/oauth/providers/microsoft-entra-id.provider.js.map +1 -1
  129. package/dist/oauth/providers/microsoft.provider.d.ts +5 -2
  130. package/dist/oauth/providers/microsoft.provider.d.ts.map +1 -1
  131. package/dist/oauth/providers/microsoft.provider.js +34 -19
  132. package/dist/oauth/providers/microsoft.provider.js.map +1 -1
  133. package/dist/profile/profile.controller.js +1 -1
  134. package/dist/profile/profile.controller.js.map +1 -1
  135. package/dist/security/security.service.d.ts +2 -0
  136. package/dist/security/security.service.d.ts.map +1 -1
  137. package/dist/security/security.service.js +21 -0
  138. package/dist/security/security.service.js.map +1 -1
  139. package/dist/setting/setting.service.d.ts +26 -1
  140. package/dist/setting/setting.service.d.ts.map +1 -1
  141. package/dist/setting/setting.service.js +240 -7
  142. package/dist/setting/setting.service.js.map +1 -1
  143. package/dist/user/user.controller.d.ts +2 -1
  144. package/dist/user/user.controller.d.ts.map +1 -1
  145. package/dist/user/user.controller.js +5 -4
  146. package/dist/user/user.controller.js.map +1 -1
  147. package/dist/user/user.service.d.ts +4 -2
  148. package/dist/user/user.service.d.ts.map +1 -1
  149. package/dist/user/user.service.js +19 -4
  150. package/dist/user/user.service.js.map +1 -1
  151. package/dist/webhook-integration/dto/webhook-action.dto.d.ts +17 -2
  152. package/dist/webhook-integration/dto/webhook-action.dto.d.ts.map +1 -1
  153. package/dist/webhook-integration/dto/webhook-action.dto.js +93 -2
  154. package/dist/webhook-integration/dto/webhook-action.dto.js.map +1 -1
  155. package/dist/webhook-integration/event-webhook.controller.d.ts +1 -0
  156. package/dist/webhook-integration/event-webhook.controller.d.ts.map +1 -1
  157. package/dist/webhook-integration/event-webhook.controller.js +10 -0
  158. package/dist/webhook-integration/event-webhook.controller.js.map +1 -1
  159. package/dist/webhook-integration/event-webhook.service.d.ts +2 -0
  160. package/dist/webhook-integration/event-webhook.service.d.ts.map +1 -1
  161. package/dist/webhook-integration/event-webhook.service.js +30 -0
  162. package/dist/webhook-integration/event-webhook.service.js.map +1 -1
  163. package/dist/webhook-integration/webhook-command.registry.d.ts +15 -0
  164. package/dist/webhook-integration/webhook-command.registry.d.ts.map +1 -0
  165. package/dist/webhook-integration/webhook-command.registry.js +36 -0
  166. package/dist/webhook-integration/webhook-command.registry.js.map +1 -0
  167. package/dist/webhook-integration/webhook-integration.controller.d.ts +20 -0
  168. package/dist/webhook-integration/webhook-integration.controller.d.ts.map +1 -1
  169. package/dist/webhook-integration/webhook-integration.controller.js +48 -0
  170. package/dist/webhook-integration/webhook-integration.controller.js.map +1 -1
  171. package/dist/webhook-integration/webhook-integration.module.d.ts.map +1 -1
  172. package/dist/webhook-integration/webhook-integration.module.js +5 -0
  173. package/dist/webhook-integration/webhook-integration.module.js.map +1 -1
  174. package/dist/webhook-integration/webhook-integration.service.d.ts +27 -2
  175. package/dist/webhook-integration/webhook-integration.service.d.ts.map +1 -1
  176. package/dist/webhook-integration/webhook-integration.service.js +377 -50
  177. package/dist/webhook-integration/webhook-integration.service.js.map +1 -1
  178. package/hedhog/data/file_provider.yaml +9 -1
  179. package/hedhog/data/integration_provider.yaml +148 -0
  180. package/hedhog/data/integration_type.yaml +29 -0
  181. package/hedhog/data/menu.yaml +6 -21
  182. package/hedhog/data/role.yaml +8 -0
  183. package/hedhog/data/route.yaml +73 -373
  184. package/hedhog/data/setting_group.yaml +209 -365
  185. package/hedhog/data/setting_subgroup.yaml +21 -13
  186. package/hedhog/frontend/app/account/components/connected-accounts.tsx.ejs +25 -20
  187. package/hedhog/frontend/app/account/components/tokens.tsx.ejs +421 -0
  188. package/hedhog/frontend/app/account/layout.tsx.ejs +6 -3
  189. package/hedhog/frontend/app/account/mcp-tokens/page.tsx.ejs +2 -2
  190. package/hedhog/frontend/app/account/tokens/page.tsx.ejs +5 -0
  191. package/hedhog/frontend/app/configurations/[slug]/components/setting-field.tsx.ejs +938 -225
  192. package/hedhog/frontend/app/configurations/layout.tsx.ejs +1 -1
  193. package/hedhog/frontend/app/dashboard/dashboard-home-tabs.tsx.ejs +3 -1
  194. package/hedhog/frontend/app/integration/profiles/page.tsx.ejs +1830 -0
  195. package/hedhog/frontend/app/integrations-webhooks/page.tsx.ejs +829 -128
  196. package/hedhog/frontend/app/mail/profiles/page.tsx.ejs +1 -820
  197. package/hedhog/frontend/app/setting-list/page.tsx.ejs +229 -395
  198. package/hedhog/frontend/app/users/permissions.tsx.ejs +79 -2
  199. package/hedhog/frontend/app/users/user-sheet.tsx.ejs +7 -2
  200. package/hedhog/frontend/messages/en.json +239 -3
  201. package/hedhog/frontend/messages/pt.json +239 -3
  202. package/hedhog/table/file.yaml +1 -1
  203. package/hedhog/table/integration_profile.yaml +34 -0
  204. package/hedhog/table/integration_provider.yaml +23 -0
  205. package/hedhog/table/integration_type.yaml +19 -0
  206. package/hedhog/table/mcp_api_key.yaml +4 -0
  207. package/hedhog/table/webhook_action.yaml +141 -85
  208. package/package.json +4 -3
  209. package/src/ai/ai.service.ts +35 -153
  210. package/src/auth/guards/auth.guard.ts +32 -0
  211. package/src/core.module.ts +3 -3
  212. package/src/file/file.controller.ts +51 -42
  213. package/src/file/file.service.ts +67 -104
  214. package/src/file/provider/azure.provider.ts +14 -28
  215. package/src/file/provider/gcs.provider.ts +9 -9
  216. package/src/file/provider/local.provider.ts +10 -13
  217. package/src/file/provider/provider.enum.ts +1 -0
  218. package/src/file/provider/provider.factory.ts +21 -6
  219. package/src/file/provider/s3.provider.ts +4 -20
  220. package/src/file/provider/spaces.provider.ts +246 -0
  221. package/src/index.ts +6 -3
  222. package/src/integration-profile/dto/create.dto.ts +44 -0
  223. package/src/integration-profile/dto/export.dto.ts +15 -0
  224. package/src/integration-profile/dto/import-confirm.dto.ts +61 -0
  225. package/src/integration-profile/integration-profile.controller.ts +131 -0
  226. package/src/integration-profile/integration-profile.module.ts +16 -0
  227. package/src/integration-profile/integration-profile.service.ts +793 -0
  228. package/src/integration-profile/integration-profile.utils.ts +173 -0
  229. package/src/mail/mail.module.ts +41 -22
  230. package/src/mail/mail.service.ts +40 -64
  231. package/src/mcp/guards/mcp-auth.guard.ts +1 -1
  232. package/src/mcp/mcp-api-key.controller.ts +2 -2
  233. package/src/mcp/mcp-api-key.service.ts +6 -2
  234. package/src/mcp/mcp.module.ts +3 -5
  235. package/src/mcp-chat/mcp-chat.service.ts +23 -20
  236. package/src/oauth/interfaces/OAuthProvider.ts +1 -1
  237. package/src/oauth/oauth.controller.ts +30 -2
  238. package/src/oauth/oauth.service.ts +194 -35
  239. package/src/oauth/providers/abstract.provider.ts +1 -1
  240. package/src/oauth/providers/facebook.provider.ts +36 -20
  241. package/src/oauth/providers/github.provider.ts +46 -23
  242. package/src/oauth/providers/google.provider.ts +36 -20
  243. package/src/oauth/providers/microsoft-entra-id.provider.ts +42 -46
  244. package/src/oauth/providers/microsoft.provider.ts +36 -21
  245. package/src/profile/profile.controller.ts +2 -2
  246. package/src/security/security.service.ts +34 -1
  247. package/src/setting/setting.service.ts +307 -9
  248. package/src/user/user.controller.ts +4 -1
  249. package/src/user/user.service.ts +20 -2
  250. package/src/webhook-integration/dto/webhook-action.dto.ts +85 -4
  251. package/src/webhook-integration/event-webhook.controller.ts +55 -50
  252. package/src/webhook-integration/event-webhook.service.ts +422 -384
  253. package/src/webhook-integration/webhook-command.registry.ts +42 -0
  254. package/src/webhook-integration/webhook-integration.controller.ts +25 -0
  255. package/src/webhook-integration/webhook-integration.module.ts +50 -45
  256. package/src/webhook-integration/webhook-integration.service.ts +444 -53
  257. package/dist/mail-profile/dto/create.dto.d.ts +0 -23
  258. package/dist/mail-profile/dto/create.dto.d.ts.map +0 -1
  259. package/dist/mail-profile/dto/create.dto.js +0 -139
  260. package/dist/mail-profile/dto/create.dto.js.map +0 -1
  261. package/dist/mail-profile/dto/update.dto.d.ts.map +0 -1
  262. package/dist/mail-profile/dto/update.dto.js.map +0 -1
  263. package/dist/mail-profile/mail-profile.controller.d.ts +0 -94
  264. package/dist/mail-profile/mail-profile.controller.d.ts.map +0 -1
  265. package/dist/mail-profile/mail-profile.controller.js +0 -95
  266. package/dist/mail-profile/mail-profile.controller.js.map +0 -1
  267. package/dist/mail-profile/mail-profile.module.d.ts +0 -3
  268. package/dist/mail-profile/mail-profile.module.d.ts.map +0 -1
  269. package/dist/mail-profile/mail-profile.module.js.map +0 -1
  270. package/dist/mail-profile/mail-profile.service.d.ts +0 -109
  271. package/dist/mail-profile/mail-profile.service.d.ts.map +0 -1
  272. package/dist/mail-profile/mail-profile.service.js +0 -278
  273. package/dist/mail-profile/mail-profile.service.js.map +0 -1
  274. package/dist/mcp/tools/core-mail-profile.mcp-tools.d.ts +0 -32
  275. package/dist/mcp/tools/core-mail-profile.mcp-tools.d.ts.map +0 -1
  276. package/dist/mcp/tools/core-mail-profile.mcp-tools.js +0 -178
  277. package/dist/mcp/tools/core-mail-profile.mcp-tools.js.map +0 -1
  278. package/hedhog/data/mail_profile.yaml +0 -18
  279. package/hedhog/table/mail_profile.yaml +0 -75
  280. package/src/mail-profile/dto/create.dto.ts +0 -145
  281. package/src/mail-profile/mail-profile.controller.ts +0 -56
  282. package/src/mail-profile/mail-profile.module.ts +0 -18
  283. package/src/mail-profile/mail-profile.service.ts +0 -308
  284. package/src/mcp/tools/core-mail-profile.mcp-tools.ts +0 -128
  285. /package/dist/{mail-profile → integration-profile}/dto/update.dto.d.ts +0 -0
  286. /package/dist/{mail-profile → integration-profile}/dto/update.dto.js +0 -0
  287. /package/src/{mail-profile → integration-profile}/dto/update.dto.ts +0 -0
@@ -1,278 +0,0 @@
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
- var __param = (this && this.__param) || function (paramIndex, decorator) {
12
- return function (target, key) { decorator(target, key, paramIndex); }
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.MailProfileService = void 0;
16
- const api_mail_1 = require("@hed-hog/api-mail");
17
- const api_pagination_1 = require("@hed-hog/api-pagination");
18
- const api_prisma_1 = require("@hed-hog/api-prisma");
19
- const common_1 = require("@nestjs/common");
20
- const mail_service_1 = require("../mail/mail.service");
21
- let MailProfileService = class MailProfileService {
22
- constructor(prismaService, paginationService, mailMainService, mailService) {
23
- this.prismaService = prismaService;
24
- this.paginationService = paginationService;
25
- this.mailMainService = mailMainService;
26
- this.mailService = mailService;
27
- }
28
- async list(paginationParams) {
29
- const fields = ['slug', 'name', 'from_email', 'reply_to_email'];
30
- const OR = this.prismaService.createInsensitiveSearch(fields, paginationParams);
31
- return this.paginationService.paginate(this.prismaService.mail_profile, paginationParams, {
32
- where: OR.length > 0 ? { OR } : {},
33
- select: {
34
- id: true,
35
- slug: true,
36
- name: true,
37
- provider: true,
38
- from_name: true,
39
- from_email: true,
40
- reply_to_name: true,
41
- reply_to_email: true,
42
- created_at: true,
43
- updated_at: true,
44
- },
45
- orderBy: [{ updated_at: 'desc' }, { id: 'desc' }],
46
- });
47
- }
48
- async get(id) {
49
- const profile = await this.prismaService.mail_profile.findUnique({
50
- where: { id },
51
- });
52
- if (!profile) {
53
- throw new common_1.NotFoundException(`Mail profile with id ${id} not found.`);
54
- }
55
- return profile;
56
- }
57
- async create(data) {
58
- await this.ensureSlugIsAvailable(data.slug);
59
- this.validateProviderFields(data);
60
- return this.prismaService.mail_profile.create({
61
- data: this.normalizeData(data),
62
- });
63
- }
64
- async update({ id, data }) {
65
- const existing = await this.prismaService.mail_profile.findUnique({
66
- where: { id },
67
- });
68
- if (!existing) {
69
- throw new common_1.NotFoundException(`Mail profile with id ${id} not found.`);
70
- }
71
- if (data.slug && data.slug !== existing.slug) {
72
- await this.ensureSlugIsAvailable(data.slug);
73
- }
74
- const merged = Object.assign(Object.assign({}, existing), data);
75
- this.validateProviderFields(merged);
76
- return this.prismaService.mail_profile.update({
77
- where: { id },
78
- data: this.normalizeData(merged),
79
- });
80
- }
81
- async delete({ ids }) {
82
- if (!(ids === null || ids === void 0 ? void 0 : ids.length)) {
83
- throw new common_1.BadRequestException('You must select at least one item to delete.');
84
- }
85
- return this.prismaService.mail_profile.deleteMany({
86
- where: {
87
- id: {
88
- in: ids,
89
- },
90
- },
91
- });
92
- }
93
- async test(data) {
94
- this.validateProviderFields(data);
95
- const normalized = this.normalizeData(data);
96
- const config = this.buildMailConfig(normalized);
97
- const destinationEmail = normalized.from_email;
98
- const sender = normalized.from_name
99
- ? `${normalized.from_name} <${normalized.from_email}>`
100
- : normalized.from_email;
101
- const replyTo = normalized.reply_to_email
102
- ? normalized.reply_to_name
103
- ? `${normalized.reply_to_name} <${normalized.reply_to_email}>`
104
- : normalized.reply_to_email
105
- : undefined;
106
- try {
107
- this.mailMainService.setConfig(config);
108
- await this.mailMainService.send({
109
- to: destinationEmail,
110
- from: sender,
111
- replyTo,
112
- subject: `[HedHog] Teste do perfil ${normalized.name}`,
113
- body: `
114
- <p>Este e-mail confirma que o perfil <strong>${normalized.name}</strong> foi validado com sucesso.</p>
115
- <p><strong>Slug:</strong> ${normalized.slug}</p>
116
- <p><strong>Provedor:</strong> ${normalized.provider}</p>
117
- <p><strong>Remetente:</strong> ${sender}</p>
118
- `,
119
- });
120
- return {
121
- success: true,
122
- destination: destinationEmail,
123
- };
124
- }
125
- finally {
126
- await this.mailService.reloadConfig().catch(() => undefined);
127
- }
128
- }
129
- async ensureSlugIsAvailable(slug) {
130
- const existing = await this.prismaService.mail_profile.findUnique({
131
- where: { slug },
132
- select: { id: true },
133
- });
134
- if (existing) {
135
- throw new common_1.BadRequestException(`Mail profile with slug "${slug}" already exists.`);
136
- }
137
- }
138
- validateProviderFields(input) {
139
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
140
- const provider = String((_a = input.provider) !== null && _a !== void 0 ? _a : '').toUpperCase();
141
- if (!provider) {
142
- throw new common_1.BadRequestException('Provider is required.');
143
- }
144
- if (!String((_b = input.from_email) !== null && _b !== void 0 ? _b : '').trim()) {
145
- throw new common_1.BadRequestException('Sender email is required.');
146
- }
147
- switch (provider) {
148
- case 'SMTP':
149
- if (!String((_c = input.smtp_host) !== null && _c !== void 0 ? _c : '').trim()) {
150
- throw new common_1.BadRequestException('SMTP host is required.');
151
- }
152
- if (!input.smtp_port) {
153
- throw new common_1.BadRequestException('SMTP port is required.');
154
- }
155
- if (!String((_d = input.smtp_username) !== null && _d !== void 0 ? _d : '').trim()) {
156
- throw new common_1.BadRequestException('SMTP username is required.');
157
- }
158
- if (!String((_e = input.smtp_password) !== null && _e !== void 0 ? _e : '').trim()) {
159
- throw new common_1.BadRequestException('SMTP password is required.');
160
- }
161
- break;
162
- case 'GMAIL':
163
- if (!String((_f = input.gmail_client_id) !== null && _f !== void 0 ? _f : '').trim()) {
164
- throw new common_1.BadRequestException('Gmail client ID is required.');
165
- }
166
- if (!String((_g = input.gmail_client_secret) !== null && _g !== void 0 ? _g : '').trim()) {
167
- throw new common_1.BadRequestException('Gmail client secret is required.');
168
- }
169
- if (!String((_h = input.gmail_refresh_token) !== null && _h !== void 0 ? _h : '').trim()) {
170
- throw new common_1.BadRequestException('Gmail refresh token is required.');
171
- }
172
- break;
173
- case 'SES':
174
- if (!String((_j = input.ses_access_key_id) !== null && _j !== void 0 ? _j : '').trim()) {
175
- throw new common_1.BadRequestException('SES access key ID is required.');
176
- }
177
- if (!String((_k = input.ses_secret_access_key) !== null && _k !== void 0 ? _k : '').trim()) {
178
- throw new common_1.BadRequestException('SES secret access key is required.');
179
- }
180
- if (!String((_l = input.ses_region) !== null && _l !== void 0 ? _l : '').trim()) {
181
- throw new common_1.BadRequestException('SES region is required.');
182
- }
183
- break;
184
- default:
185
- throw new common_1.BadRequestException(`Invalid provider: ${provider}`);
186
- }
187
- }
188
- normalizeData(input) {
189
- var _a;
190
- const provider = String((_a = input.provider) !== null && _a !== void 0 ? _a : '').toUpperCase();
191
- return {
192
- slug: this.normalizeString(input.slug),
193
- name: this.normalizeString(input.name),
194
- provider,
195
- from_name: this.normalizeNullableString(input.from_name),
196
- from_email: this.normalizeString(input.from_email),
197
- reply_to_name: this.normalizeNullableString(input.reply_to_name),
198
- reply_to_email: this.normalizeNullableString(input.reply_to_email),
199
- smtp_host: provider === 'SMTP' ? this.normalizeNullableString(input.smtp_host) : null,
200
- smtp_port: provider === 'SMTP' && input.smtp_port !== undefined && input.smtp_port !== null
201
- ? Number(input.smtp_port)
202
- : null,
203
- smtp_secure: provider === 'SMTP' ? Boolean(input.smtp_secure) : false,
204
- smtp_username: provider === 'SMTP' ? this.normalizeNullableString(input.smtp_username) : null,
205
- smtp_password: provider === 'SMTP' ? this.normalizeNullableString(input.smtp_password) : null,
206
- gmail_client_id: provider === 'GMAIL' ? this.normalizeNullableString(input.gmail_client_id) : null,
207
- gmail_client_secret: provider === 'GMAIL'
208
- ? this.normalizeNullableString(input.gmail_client_secret)
209
- : null,
210
- gmail_refresh_token: provider === 'GMAIL'
211
- ? this.normalizeNullableString(input.gmail_refresh_token)
212
- : null,
213
- ses_access_key_id: provider === 'SES' ? this.normalizeNullableString(input.ses_access_key_id) : null,
214
- ses_secret_access_key: provider === 'SES'
215
- ? this.normalizeNullableString(input.ses_secret_access_key)
216
- : null,
217
- ses_region: provider === 'SES' ? this.normalizeNullableString(input.ses_region) : null,
218
- };
219
- }
220
- buildMailConfig(input) {
221
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
222
- switch (input.provider) {
223
- case 'SMTP':
224
- return {
225
- global: true,
226
- type: 'SMTP',
227
- host: (_a = input.smtp_host) !== null && _a !== void 0 ? _a : '',
228
- port: (_b = input.smtp_port) !== null && _b !== void 0 ? _b : 587,
229
- secure: input.smtp_secure,
230
- username: (_c = input.smtp_username) !== null && _c !== void 0 ? _c : '',
231
- password: (_d = input.smtp_password) !== null && _d !== void 0 ? _d : '',
232
- };
233
- case 'GMAIL':
234
- return {
235
- global: true,
236
- type: 'GMAIL',
237
- clientId: (_e = input.gmail_client_id) !== null && _e !== void 0 ? _e : '',
238
- clientSecret: (_f = input.gmail_client_secret) !== null && _f !== void 0 ? _f : '',
239
- refreshToken: (_g = input.gmail_refresh_token) !== null && _g !== void 0 ? _g : '',
240
- from: input.from_email,
241
- };
242
- case 'SES':
243
- return {
244
- global: true,
245
- type: 'SES',
246
- region: (_h = input.ses_region) !== null && _h !== void 0 ? _h : '',
247
- accessKeyId: (_j = input.ses_access_key_id) !== null && _j !== void 0 ? _j : '',
248
- secretAccessKey: (_k = input.ses_secret_access_key) !== null && _k !== void 0 ? _k : '',
249
- from: input.from_email,
250
- };
251
- default:
252
- throw new common_1.BadRequestException(`Invalid provider: ${input.provider}`);
253
- }
254
- }
255
- normalizeString(value) {
256
- return String(value !== null && value !== void 0 ? value : '').trim();
257
- }
258
- normalizeNullableString(value) {
259
- if (value === undefined || value === null) {
260
- return null;
261
- }
262
- const normalized = String(value).trim();
263
- return normalized.length > 0 ? normalized : null;
264
- }
265
- };
266
- exports.MailProfileService = MailProfileService;
267
- exports.MailProfileService = MailProfileService = __decorate([
268
- (0, common_1.Injectable)(),
269
- __param(0, (0, common_1.Inject)((0, common_1.forwardRef)(() => api_prisma_1.PrismaService))),
270
- __param(1, (0, common_1.Inject)((0, common_1.forwardRef)(() => api_pagination_1.PaginationService))),
271
- __param(2, (0, common_1.Inject)((0, common_1.forwardRef)(() => api_mail_1.MailService))),
272
- __param(3, (0, common_1.Inject)((0, common_1.forwardRef)(() => mail_service_1.MailService))),
273
- __metadata("design:paramtypes", [api_prisma_1.PrismaService,
274
- api_pagination_1.PaginationService,
275
- api_mail_1.MailService,
276
- mail_service_1.MailService])
277
- ], MailProfileService);
278
- //# sourceMappingURL=mail-profile.service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mail-profile.service.js","sourceRoot":"","sources":["../../src/mail-profile/mail-profile.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,gDAAmE;AACnE,4DAA2E;AAC3E,oDAAoD;AACpD,2CAMwB;AACxB,uDAAmD;AAK5C,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAC7B,YAEmB,aAA4B,EAE5B,iBAAoC,EAEpC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C;IACH,CAAC;IAEO,eAAe,CAAC,KAAc;QACpC,OAAO,MAAM,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACpC,CAAC;IAEO,uBAAuB,CAAC,KAAc;QAC5C,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YAC1C,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;QACxC,OAAO,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC;IACnD,CAAC;CACF,CAAA;AAnSY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,0BAAa,CAAC,CAAC,CAAA;IAEvC,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,kCAAiB,CAAC,CAAC,CAAA;IAE3C,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,sBAAe,CAAC,CAAC,CAAA;IAEzC,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,0BAAW,CAAC,CAAC,CAAA;qCALN,0BAAa;QAET,kCAAiB;QAEnB,sBAAe;QAEnB,0BAAW;GAThC,kBAAkB,CAmS9B"}
@@ -1,32 +0,0 @@
1
- import { MailProfileService } from '../../mail-profile/mail-profile.service';
2
- import { McpContext } from '../types/mcp-context.type';
3
- export declare class CoreMailProfileMcpTools {
4
- private readonly mailProfileService;
5
- constructor(mailProfileService: MailProfileService);
6
- listMailProfiles(args: {
7
- page?: number;
8
- pageSize?: number;
9
- search?: string;
10
- sortField?: string;
11
- sortOrder?: string;
12
- }, _context: McpContext): Promise<any>;
13
- getMailProfile(args: {
14
- id: number;
15
- }, _context: McpContext): Promise<any>;
16
- createMailProfile(args: {
17
- name: string;
18
- host: string;
19
- port: number;
20
- username: string;
21
- password?: string;
22
- }, _context: McpContext): Promise<any>;
23
- updateMailProfile(args: {
24
- id: number;
25
- [key: string]: any;
26
- }, _context: McpContext): Promise<any>;
27
- deleteMailProfiles(args: {
28
- ids: number[];
29
- }, _context: McpContext): Promise<any>;
30
- testMailProfile(args: Record<string, any>, _context: McpContext): Promise<any>;
31
- }
32
- //# sourceMappingURL=core-mail-profile.mcp-tools.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"core-mail-profile.mcp-tools.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/core-mail-profile.mcp-tools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAE7E,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvD,qBACa,uBAAuB;IACtB,OAAO,CAAC,QAAQ,CAAC,kBAAkB;gBAAlB,kBAAkB,EAAE,kBAAkB;IAiB7D,gBAAgB,CACpB,IAAI,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,EACnG,QAAQ,EAAE,UAAU,GACnB,OAAO,CAAC,GAAG,CAAC;IAuBT,cAAc,CAAC,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,QAAQ,EAAE,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC;IAmBxE,iBAAiB,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,QAAQ,EAAE,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC;IAoB9I,iBAAiB,CAAC,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,EAAE,QAAQ,EAAE,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC;IAgB/F,kBAAkB,CAAC,IAAI,EAAE;QAAE,GAAG,EAAE,MAAM,EAAE,CAAA;KAAE,EAAE,QAAQ,EAAE,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC;IAmB/E,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,QAAQ,EAAE,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC;CAGrF"}
@@ -1,178 +0,0 @@
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
- var __rest = (this && this.__rest) || function (s, e) {
12
- var t = {};
13
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
14
- t[p] = s[p];
15
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
16
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
17
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
18
- t[p[i]] = s[p[i]];
19
- }
20
- return t;
21
- };
22
- Object.defineProperty(exports, "__esModule", { value: true });
23
- exports.CoreMailProfileMcpTools = void 0;
24
- const common_1 = require("@nestjs/common");
25
- const mail_profile_service_1 = require("../../mail-profile/mail-profile.service");
26
- const mcp_tool_decorator_1 = require("../decorators/mcp-tool.decorator");
27
- let CoreMailProfileMcpTools = class CoreMailProfileMcpTools {
28
- constructor(mailProfileService) {
29
- this.mailProfileService = mailProfileService;
30
- }
31
- async listMailProfiles(args, _context) {
32
- var _a, _b, _c, _d, _e;
33
- return this.mailProfileService.list({
34
- page: (_a = args.page) !== null && _a !== void 0 ? _a : 1,
35
- pageSize: (_b = args.pageSize) !== null && _b !== void 0 ? _b : 20,
36
- search: (_c = args.search) !== null && _c !== void 0 ? _c : '',
37
- sortField: (_d = args.sortField) !== null && _d !== void 0 ? _d : 'id',
38
- sortOrder: (_e = args.sortOrder) !== null && _e !== void 0 ? _e : 'asc',
39
- fields: '',
40
- });
41
- }
42
- async getMailProfile(args, _context) {
43
- return this.mailProfileService.get(args.id);
44
- }
45
- async createMailProfile(args, _context) {
46
- return this.mailProfileService.create(args);
47
- }
48
- async updateMailProfile(args, _context) {
49
- const { id } = args, data = __rest(args, ["id"]);
50
- return this.mailProfileService.update({ id, data: data });
51
- }
52
- async deleteMailProfiles(args, _context) {
53
- return this.mailProfileService.delete({ ids: args.ids });
54
- }
55
- async testMailProfile(args, _context) {
56
- return this.mailProfileService.test(args);
57
- }
58
- };
59
- exports.CoreMailProfileMcpTools = CoreMailProfileMcpTools;
60
- __decorate([
61
- (0, mcp_tool_decorator_1.McpTool)({
62
- name: 'core.mail-profile.list',
63
- description: 'Lists mail profiles with optional pagination. Admin only.',
64
- inputSchema: {
65
- type: 'object',
66
- properties: {
67
- page: { type: 'number', description: 'Page number (default: 1)' },
68
- pageSize: { type: 'number', description: 'Items per page (default: 20)' },
69
- search: { type: 'string', description: 'Search term' },
70
- sortField: { type: 'string', description: 'Field to sort by' },
71
- sortOrder: { type: 'string', enum: ['asc', 'desc'], description: 'Sort direction' },
72
- },
73
- },
74
- readOnly: true,
75
- }),
76
- __metadata("design:type", Function),
77
- __metadata("design:paramtypes", [Object, Object]),
78
- __metadata("design:returntype", Promise)
79
- ], CoreMailProfileMcpTools.prototype, "listMailProfiles", null);
80
- __decorate([
81
- (0, mcp_tool_decorator_1.McpTool)({
82
- name: 'core.mail-profile.get',
83
- description: 'Returns a single mail profile by ID. Admin only.',
84
- inputSchema: {
85
- type: 'object',
86
- properties: {
87
- id: { type: 'number', description: 'Mail profile ID' },
88
- },
89
- required: ['id'],
90
- },
91
- readOnly: true,
92
- }),
93
- __metadata("design:type", Function),
94
- __metadata("design:paramtypes", [Object, Object]),
95
- __metadata("design:returntype", Promise)
96
- ], CoreMailProfileMcpTools.prototype, "getMailProfile", null);
97
- __decorate([
98
- (0, mcp_tool_decorator_1.McpTool)({
99
- name: 'core.mail-profile.create',
100
- description: 'Creates a new mail profile (SMTP configuration). Admin only.',
101
- inputSchema: {
102
- type: 'object',
103
- properties: {
104
- name: { type: 'string', description: 'Profile name' },
105
- host: { type: 'string', description: 'SMTP host' },
106
- port: { type: 'number', description: 'SMTP port' },
107
- username: { type: 'string', description: 'SMTP username' },
108
- password: { type: 'string', description: 'SMTP password' },
109
- },
110
- required: ['name', 'host', 'port', 'username'],
111
- },
112
- }),
113
- __metadata("design:type", Function),
114
- __metadata("design:paramtypes", [Object, Object]),
115
- __metadata("design:returntype", Promise)
116
- ], CoreMailProfileMcpTools.prototype, "createMailProfile", null);
117
- __decorate([
118
- (0, mcp_tool_decorator_1.McpTool)({
119
- name: 'core.mail-profile.update',
120
- description: 'Updates an existing mail profile by ID. Admin only.',
121
- inputSchema: {
122
- type: 'object',
123
- properties: {
124
- id: { type: 'number', description: 'Mail profile ID' },
125
- name: { type: 'string', description: 'New profile name' },
126
- host: { type: 'string', description: 'New SMTP host' },
127
- port: { type: 'number', description: 'New SMTP port' },
128
- username: { type: 'string', description: 'New SMTP username' },
129
- password: { type: 'string', description: 'New SMTP password' },
130
- },
131
- required: ['id'],
132
- },
133
- }),
134
- __metadata("design:type", Function),
135
- __metadata("design:paramtypes", [Object, Object]),
136
- __metadata("design:returntype", Promise)
137
- ], CoreMailProfileMcpTools.prototype, "updateMailProfile", null);
138
- __decorate([
139
- (0, mcp_tool_decorator_1.McpTool)({
140
- name: 'core.mail-profile.delete',
141
- description: 'Deletes one or more mail profiles by their IDs. Admin only.',
142
- inputSchema: {
143
- type: 'object',
144
- properties: {
145
- ids: { type: 'array', items: { type: 'number' }, description: 'Mail profile IDs to delete' },
146
- },
147
- required: ['ids'],
148
- },
149
- }),
150
- __metadata("design:type", Function),
151
- __metadata("design:paramtypes", [Object, Object]),
152
- __metadata("design:returntype", Promise)
153
- ], CoreMailProfileMcpTools.prototype, "deleteMailProfiles", null);
154
- __decorate([
155
- (0, mcp_tool_decorator_1.McpTool)({
156
- name: 'core.mail-profile.test',
157
- description: 'Tests a mail profile by sending a test message. Admin only.',
158
- inputSchema: {
159
- type: 'object',
160
- properties: {
161
- name: { type: 'string', description: 'Profile name' },
162
- host: { type: 'string', description: 'SMTP host' },
163
- port: { type: 'number', description: 'SMTP port' },
164
- username: { type: 'string', description: 'SMTP username' },
165
- password: { type: 'string', description: 'SMTP password' },
166
- },
167
- required: ['host', 'port', 'username'],
168
- },
169
- }),
170
- __metadata("design:type", Function),
171
- __metadata("design:paramtypes", [Object, Object]),
172
- __metadata("design:returntype", Promise)
173
- ], CoreMailProfileMcpTools.prototype, "testMailProfile", null);
174
- exports.CoreMailProfileMcpTools = CoreMailProfileMcpTools = __decorate([
175
- (0, common_1.Injectable)(),
176
- __metadata("design:paramtypes", [mail_profile_service_1.MailProfileService])
177
- ], CoreMailProfileMcpTools);
178
- //# sourceMappingURL=core-mail-profile.mcp-tools.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"core-mail-profile.mcp-tools.js","sourceRoot":"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P
4
- from_name: Hedhog
5
- from_email: noreply@hedhog.local
6
- reply_to_name: null
7
- reply_to_email: null
8
- smtp_host: localhost
9
- smtp_port: 1025
10
- smtp_secure: false
11
- smtp_username: null
12
- smtp_password: null
13
- gmail_client_id: null
14
- gmail_client_secret: null
15
- gmail_refresh_token: null
16
- ses_access_key_id: null
17
- ses_secret_access_key: null
18
- ses_region: null
@@ -1,75 +0,0 @@
1
- columns:
2
- - type: pk
3
- - type: slug
4
- - name: name
5
- type: varchar
6
- length: 127
7
- - name: provider
8
- type: enum
9
- enum:
10
- - SMTP
11
- - GMAIL
12
- - SES
13
- default: SMTP
14
- - name: from_name
15
- type: varchar
16
- length: 127
17
- isNullable: true
18
- - name: from_email
19
- type: varchar
20
- length: 255
21
- - name: reply_to_name
22
- type: varchar
23
- length: 127
24
- isNullable: true
25
- - name: reply_to_email
26
- type: varchar
27
- length: 255
28
- isNullable: true
29
- - name: smtp_host
30
- type: varchar
31
- length: 255
32
- isNullable: true
33
- - name: smtp_port
34
- type: int
35
- isNullable: true
36
- - name: smtp_secure
37
- type: boolean
38
- default: false
39
- - name: smtp_username
40
- type: varchar
41
- length: 255
42
- isNullable: true
43
- - name: smtp_password
44
- type: varchar
45
- length: 255
46
- isNullable: true
47
- - name: gmail_client_id
48
- type: varchar
49
- length: 255
50
- isNullable: true
51
- - name: gmail_client_secret
52
- type: varchar
53
- length: 255
54
- isNullable: true
55
- - name: gmail_refresh_token
56
- type: text
57
- isNullable: true
58
- - name: ses_access_key_id
59
- type: varchar
60
- length: 255
61
- isNullable: true
62
- - name: ses_secret_access_key
63
- type: varchar
64
- length: 255
65
- isNullable: true
66
- - name: ses_region
67
- type: varchar
68
- length: 127
69
- isNullable: true
70
- - type: created_at
71
- - type: updated_at
72
- indices:
73
- - columns:
74
- - slug
75
- isUnique: true