@hed-hog/core 0.0.321 → 0.0.322

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 (64) hide show
  1. package/dist/auth/auth.controller.d.ts +3 -3
  2. package/dist/auth/auth.service.d.ts +8 -8
  3. package/dist/core.module.d.ts.map +1 -1
  4. package/dist/core.module.js +3 -0
  5. package/dist/core.module.js.map +1 -1
  6. package/dist/dashboard/dashboard-user/dashboard-user.controller.d.ts +3 -3
  7. package/dist/dashboard/dashboard-user/dashboard-user.service.d.ts +3 -3
  8. package/dist/file/file.controller.d.ts +2 -2
  9. package/dist/file/file.service.d.ts +4 -4
  10. package/dist/index.d.ts +2 -0
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +2 -0
  13. package/dist/index.js.map +1 -1
  14. package/dist/mail-profile/dto/create.dto.d.ts +23 -0
  15. package/dist/mail-profile/dto/create.dto.d.ts.map +1 -0
  16. package/dist/mail-profile/dto/create.dto.js +139 -0
  17. package/dist/mail-profile/dto/create.dto.js.map +1 -0
  18. package/dist/mail-profile/dto/update.dto.d.ts +6 -0
  19. package/dist/mail-profile/dto/update.dto.d.ts.map +1 -0
  20. package/dist/mail-profile/dto/update.dto.js +9 -0
  21. package/dist/mail-profile/dto/update.dto.js.map +1 -0
  22. package/dist/mail-profile/mail-profile.controller.d.ts +94 -0
  23. package/dist/mail-profile/mail-profile.controller.d.ts.map +1 -0
  24. package/dist/mail-profile/mail-profile.controller.js +95 -0
  25. package/dist/mail-profile/mail-profile.controller.js.map +1 -0
  26. package/dist/mail-profile/mail-profile.module.d.ts +3 -0
  27. package/dist/mail-profile/mail-profile.module.d.ts.map +1 -0
  28. package/dist/mail-profile/mail-profile.module.js +31 -0
  29. package/dist/mail-profile/mail-profile.module.js.map +1 -0
  30. package/dist/mail-profile/mail-profile.service.d.ts +109 -0
  31. package/dist/mail-profile/mail-profile.service.d.ts.map +1 -0
  32. package/dist/mail-profile/mail-profile.service.js +278 -0
  33. package/dist/mail-profile/mail-profile.service.js.map +1 -0
  34. package/dist/session/session.controller.d.ts +1 -1
  35. package/dist/session/session.service.d.ts +3 -3
  36. package/dist/user/user.controller.d.ts +18 -3
  37. package/dist/user/user.controller.d.ts.map +1 -1
  38. package/dist/user/user.controller.js +22 -0
  39. package/dist/user/user.controller.js.map +1 -1
  40. package/dist/user/user.service.d.ts +22 -7
  41. package/dist/user/user.service.d.ts.map +1 -1
  42. package/dist/user/user.service.js +99 -0
  43. package/dist/user/user.service.js.map +1 -1
  44. package/hedhog/data/menu.yaml +35 -3
  45. package/hedhog/data/route.yaml +64 -0
  46. package/hedhog/frontend/app/mail/page.tsx.ejs +5 -0
  47. package/hedhog/frontend/app/mail/profiles/page.tsx.ejs +828 -0
  48. package/hedhog/frontend/app/users/page.tsx.ejs +25 -1383
  49. package/hedhog/frontend/app/users/permissions.tsx.ejs +109 -55
  50. package/hedhog/frontend/app/users/user-access-sheet.tsx.ejs +304 -0
  51. package/hedhog/frontend/app/users/user-sheet.tsx.ejs +1385 -0
  52. package/hedhog/frontend/messages/en.json +91 -0
  53. package/hedhog/frontend/messages/pt.json +91 -0
  54. package/hedhog/table/mail_profile.yaml +75 -0
  55. package/package.json +4 -4
  56. package/src/core.module.ts +3 -0
  57. package/src/index.ts +2 -0
  58. package/src/mail-profile/dto/create.dto.ts +145 -0
  59. package/src/mail-profile/dto/update.dto.ts +4 -0
  60. package/src/mail-profile/mail-profile.controller.ts +56 -0
  61. package/src/mail-profile/mail-profile.module.ts +18 -0
  62. package/src/mail-profile/mail-profile.service.ts +308 -0
  63. package/src/user/user.controller.ts +13 -0
  64. package/src/user/user.service.ts +98 -5
@@ -205,6 +205,17 @@
205
205
  "permissionsTitle": "User Permissions",
206
206
  "permissionsDescription": "Manage roles assigned to this user",
207
207
  "noRolesAvailable": "No roles available in the system",
208
+ "filterRolesPlaceholder": "Filter roles...",
209
+ "noRolesMatch": "No roles found for this filter",
210
+ "viewAccessButton": "View access",
211
+ "accessViewTitle": "User access",
212
+ "accessViewDescription": "Menus and routes accessible based on assigned roles",
213
+ "accessViewDescriptionUser": "{name}'s accessible menus and routes based on assigned roles",
214
+ "accessTabMenu": "Menus",
215
+ "accessTabRoutes": "Routes",
216
+ "accessNoMenus": "This user has no access to any menu",
217
+ "accessNoRoutes": "This user has no access to any routes",
218
+ "loading": "Loading...",
208
219
  "loadingRoles": "Loading roles...",
209
220
  "roleAssigned": "Role assigned successfully",
210
221
  "roleRemoved": "Role removed successfully",
@@ -398,6 +409,86 @@
398
409
  "conflictingSlugs": "Conflicting slugs",
399
410
  "overwrite": "Overwrite"
400
411
  },
412
+ "MailProfilePage": {
413
+ "breadcrumbHome": "Home",
414
+ "breadcrumbTitle": "Email Sending Profiles",
415
+ "title": "Email Sending Profiles",
416
+ "description": "Manage the profiles and credentials used to send emails.",
417
+ "searchPlaceholder": "Search profiles by name, slug, provider, or sender...",
418
+ "newProfile": "New Profile",
419
+ "newProfileTitle": "New Sending Profile",
420
+ "newProfileDescription": "Create a new profile with the selected provider credentials.",
421
+ "editProfile": "Edit Sending Profile",
422
+ "editProfileDescription": "Update this sending profile and its credentials.",
423
+ "nameLabel": "Name",
424
+ "namePlaceholder": "Primary transactional",
425
+ "slugLabel": "Slug",
426
+ "slugPlaceholder": "primary-transactional",
427
+ "providerLabel": "Provider",
428
+ "providerSMTP": "SMTP",
429
+ "providerGmail": "Gmail",
430
+ "providerSES": "Amazon SES",
431
+ "fromNameLabel": "Sender name",
432
+ "fromNamePlaceholder": "Sales Team",
433
+ "fromEmailLabel": "Sender email",
434
+ "fromEmailPlaceholder": "sales@company.com",
435
+ "replyToNameLabel": "Reply-to name",
436
+ "replyToNamePlaceholder": "Support",
437
+ "replyToEmailLabel": "Reply-to email",
438
+ "replyToEmailPlaceholder": "support@company.com",
439
+ "smtpSectionTitle": "SMTP Configuration",
440
+ "smtpHostLabel": "SMTP host",
441
+ "smtpHostPlaceholder": "smtp.yourdomain.com",
442
+ "smtpPortLabel": "SMTP port",
443
+ "smtpPortPlaceholder": "587",
444
+ "smtpUsernameLabel": "SMTP username",
445
+ "smtpUsernamePlaceholder": "user@company.com",
446
+ "smtpPasswordLabel": "SMTP password",
447
+ "smtpPasswordPlaceholder": "Enter the SMTP password",
448
+ "smtpSecureLabel": "Secure connection",
449
+ "smtpSecureHelp": "Enable when the server requires TLS/SSL.",
450
+ "gmailSectionTitle": "Gmail Configuration",
451
+ "gmailClientIdLabel": "Client ID",
452
+ "gmailClientIdPlaceholder": "Google OAuth client id",
453
+ "gmailClientSecretLabel": "Client Secret",
454
+ "gmailClientSecretPlaceholder": "Google OAuth client secret",
455
+ "gmailRefreshTokenLabel": "Refresh Token",
456
+ "gmailRefreshTokenPlaceholder": "Google OAuth refresh token",
457
+ "sesSectionTitle": "Amazon SES Configuration",
458
+ "sesAccessKeyIdLabel": "Access Key ID",
459
+ "sesAccessKeyIdPlaceholder": "AWS access key id",
460
+ "sesSecretAccessKeyLabel": "Secret Access Key",
461
+ "sesSecretAccessKeyPlaceholder": "AWS secret access key",
462
+ "sesRegionLabel": "Region",
463
+ "sesRegionPlaceholder": "us-east-1",
464
+ "tableName": "Name",
465
+ "tableSlug": "Slug",
466
+ "tableProvider": "Provider",
467
+ "tableSender": "Sender",
468
+ "tableReplyTo": "Reply-to",
469
+ "tableUpdated": "Updated",
470
+ "tableActions": "Actions",
471
+ "notConfigured": "Not configured",
472
+ "noProfilesFound": "No profiles found",
473
+ "noProfilesHint": "Create the first profile to centralize sending credentials.",
474
+ "testProfile": "Test",
475
+ "testing": "Testing...",
476
+ "testSuccess": "Test email sent successfully to {email}. You can now create the profile.",
477
+ "testError": "Unable to validate the profile with a test email.",
478
+ "createProfile": "Create Profile",
479
+ "saveChanges": "Save Changes",
480
+ "cancel": "Cancel",
481
+ "delete": "Delete",
482
+ "deleteConfirmTitle": "Confirm Deletion",
483
+ "deleteConfirmDescription": "Are you sure you want to delete this sending profile? This action cannot be undone.",
484
+ "createSuccess": "Sending profile created successfully!",
485
+ "createError": "Failed to create the sending profile.",
486
+ "updateSuccess": "Sending profile updated successfully!",
487
+ "updateError": "Failed to update the sending profile.",
488
+ "deleteSuccess": "Sending profile deleted successfully!",
489
+ "deleteError": "Failed to delete the sending profile.",
490
+ "loadError": "Failed to load the sending profile."
491
+ },
401
492
  "UserActivity": {
402
493
  "login": "Logged in",
403
494
  "register": "Registered",
@@ -205,6 +205,17 @@
205
205
  "permissionsTitle": "Permissões do Usuário",
206
206
  "permissionsDescription": "Gerencie os cargos atribuídos a este usuário",
207
207
  "noRolesAvailable": "Nenhum cargo disponível no sistema",
208
+ "filterRolesPlaceholder": "Filtrar cargos...",
209
+ "noRolesMatch": "Nenhum cargo encontrado para este filtro",
210
+ "viewAccessButton": "Ver acesso",
211
+ "accessViewTitle": "Acesso do usuário",
212
+ "accessViewDescription": "Menus e rotas acessíveis com base nos cargos atribuídos",
213
+ "accessViewDescriptionUser": "Menus e rotas acessíveis a {name} com base nos cargos atribuídos",
214
+ "accessTabMenu": "Menus",
215
+ "accessTabRoutes": "Rotas",
216
+ "accessNoMenus": "Este usuário não tem acesso a nenhum menu",
217
+ "accessNoRoutes": "Este usuário não tem acesso a nenhuma rota",
218
+ "loading": "Carregando...",
208
219
  "loadingRoles": "Carregando cargos...",
209
220
  "roleAssigned": "Cargo atribuído com sucesso",
210
221
  "roleRemoved": "Cargo removido com sucesso",
@@ -398,6 +409,86 @@
398
409
  "conflictingSlugs": "Slugs conflitantes",
399
410
  "overwrite": "Sobrescrever"
400
411
  },
412
+ "MailProfilePage": {
413
+ "breadcrumbHome": "Início",
414
+ "breadcrumbTitle": "Perfis de Envio E-mails",
415
+ "title": "Perfis de Envio E-mails",
416
+ "description": "Gerencie os perfis e credenciais usados para envio de e-mails.",
417
+ "searchPlaceholder": "Buscar perfis por nome, slug, provedor ou remetente...",
418
+ "newProfile": "Novo Perfil",
419
+ "newProfileTitle": "Novo Perfil de Envio",
420
+ "newProfileDescription": "Cadastre um novo perfil com as credenciais do provedor escolhido.",
421
+ "editProfile": "Editar Perfil de Envio",
422
+ "editProfileDescription": "Atualize os dados e credenciais deste perfil de envio.",
423
+ "nameLabel": "Nome",
424
+ "namePlaceholder": "Transacional principal",
425
+ "slugLabel": "Slug",
426
+ "slugPlaceholder": "transacional-principal",
427
+ "providerLabel": "Provedor",
428
+ "providerSMTP": "SMTP",
429
+ "providerGmail": "Gmail",
430
+ "providerSES": "Amazon SES",
431
+ "fromNameLabel": "Nome do remetente",
432
+ "fromNamePlaceholder": "Equipe Comercial",
433
+ "fromEmailLabel": "E-mail do remetente",
434
+ "fromEmailPlaceholder": "comercial@empresa.com",
435
+ "replyToNameLabel": "Nome do reply-to",
436
+ "replyToNamePlaceholder": "Suporte",
437
+ "replyToEmailLabel": "E-mail do reply-to",
438
+ "replyToEmailPlaceholder": "suporte@empresa.com",
439
+ "smtpSectionTitle": "Configuracao SMTP",
440
+ "smtpHostLabel": "Host SMTP",
441
+ "smtpHostPlaceholder": "smtp.seudominio.com",
442
+ "smtpPortLabel": "Porta SMTP",
443
+ "smtpPortPlaceholder": "587",
444
+ "smtpUsernameLabel": "Usuario SMTP",
445
+ "smtpUsernamePlaceholder": "usuario@empresa.com",
446
+ "smtpPasswordLabel": "Senha SMTP",
447
+ "smtpPasswordPlaceholder": "Digite a senha SMTP",
448
+ "smtpSecureLabel": "Conexão segura",
449
+ "smtpSecureHelp": "Ative quando o servidor exigir TLS/SSL.",
450
+ "gmailSectionTitle": "Configuração Gmail",
451
+ "gmailClientIdLabel": "Client ID",
452
+ "gmailClientIdPlaceholder": "Google OAuth client id",
453
+ "gmailClientSecretLabel": "Client Secret",
454
+ "gmailClientSecretPlaceholder": "Google OAuth client secret",
455
+ "gmailRefreshTokenLabel": "Refresh Token",
456
+ "gmailRefreshTokenPlaceholder": "Google OAuth refresh token",
457
+ "sesSectionTitle": "Configuracao Amazon SES",
458
+ "sesAccessKeyIdLabel": "Access Key ID",
459
+ "sesAccessKeyIdPlaceholder": "AWS access key id",
460
+ "sesSecretAccessKeyLabel": "Secret Access Key",
461
+ "sesSecretAccessKeyPlaceholder": "AWS secret access key",
462
+ "sesRegionLabel": "Regiao",
463
+ "sesRegionPlaceholder": "us-east-1",
464
+ "tableName": "Nome",
465
+ "tableSlug": "Slug",
466
+ "tableProvider": "Provedor",
467
+ "tableSender": "Remetente",
468
+ "tableReplyTo": "Reply-to",
469
+ "tableUpdated": "Atualizado",
470
+ "tableActions": "Acoes",
471
+ "notConfigured": "Nao configurado",
472
+ "noProfilesFound": "Nenhum perfil encontrado",
473
+ "noProfilesHint": "Crie o primeiro perfil para centralizar as configuracoes de envio.",
474
+ "testProfile": "Testar",
475
+ "testing": "Testando...",
476
+ "testSuccess": "E-mail de teste enviado com sucesso para {email}. Agora voce pode criar o perfil.",
477
+ "testError": "Nao foi possivel validar o perfil com um e-mail de teste.",
478
+ "createProfile": "Criar Perfil",
479
+ "saveChanges": "Salvar Alteracoes",
480
+ "cancel": "Cancelar",
481
+ "delete": "Excluir",
482
+ "deleteConfirmTitle": "Confirmar Exclusão",
483
+ "deleteConfirmDescription": "Tem certeza que deseja excluir este perfil de envio? Esta ação não pode ser desfeita.",
484
+ "createSuccess": "Perfil de envio criado com sucesso!",
485
+ "createError": "Erro ao criar perfil de envio.",
486
+ "updateSuccess": "Perfil de envio atualizado com sucesso!",
487
+ "updateError": "Erro ao atualizar perfil de envio.",
488
+ "deleteSuccess": "Perfil de envio excluído com sucesso!",
489
+ "deleteError": "Erro ao excluir perfil de envio.",
490
+ "loadError": "Erro ao carregar perfil de envio."
491
+ },
401
492
  "UserActivity": {
402
493
  "login": "Realizou login",
403
494
  "register": "Registrado",
@@ -0,0 +1,75 @@
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hed-hog/core",
3
- "version": "0.0.321",
3
+ "version": "0.0.322",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "dependencies": {
@@ -31,11 +31,11 @@
31
31
  "speakeasy": "^2.0.0",
32
32
  "uuid": "^11.1.0",
33
33
  "@hed-hog/api": "0.0.8",
34
+ "@hed-hog/api-pagination": "0.0.7",
34
35
  "@hed-hog/api-locale": "0.0.14",
35
- "@hed-hog/api-types": "0.0.1",
36
- "@hed-hog/api-prisma": "0.0.6",
37
36
  "@hed-hog/api-mail": "0.0.9",
38
- "@hed-hog/api-pagination": "0.0.7"
37
+ "@hed-hog/api-types": "0.0.1",
38
+ "@hed-hog/api-prisma": "0.0.6"
39
39
  },
40
40
  "exports": {
41
41
  ".": {
@@ -15,6 +15,7 @@ import { FileModule } from './file/file.module';
15
15
  import { InstallModule } from './install/install.module';
16
16
  import { IntegrationModule } from './integration/integration.module';
17
17
  import { MailSentModule } from './mail-sent/mail-sent.module';
18
+ import { MailProfileModule } from './mail-profile/mail-profile.module';
18
19
  import { MailModule } from './mail/mail.module';
19
20
  import { MenuModule } from './menu/menu.module';
20
21
  import { LocaleInjectionMiddleware } from './middlewares/locale-injection.middleware';
@@ -55,6 +56,7 @@ import { ValidatorServiceLocator } from './validators/service-locator';
55
56
  forwardRef(() => SystemModule),
56
57
  forwardRef(() => SettingModule),
57
58
  forwardRef(() => MailModule),
59
+ forwardRef(() => MailProfileModule),
58
60
  forwardRef(() => MailSentModule),
59
61
  forwardRef(() => FileModule),
60
62
  forwardRef(() => TaskModule),
@@ -68,6 +70,7 @@ import { ValidatorServiceLocator } from './validators/service-locator';
68
70
  UserModule,
69
71
  AuthModule,
70
72
  MailModule,
73
+ MailProfileModule,
71
74
  RouteModule,
72
75
  RoleModule,
73
76
  MenuModule,
package/src/index.ts CHANGED
@@ -21,6 +21,8 @@ export * from './user/user.service';
21
21
 
22
22
  export * from './mail/mail.module';
23
23
  export * from './mail/mail.service';
24
+ export * from './mail-profile/mail-profile.module';
25
+ export * from './mail-profile/mail-profile.service';
24
26
 
25
27
  export * from './file/file.module';
26
28
  export * from './file/file.service';
@@ -0,0 +1,145 @@
1
+ import { getLocaleText } from '@hed-hog/api-locale';
2
+ import { Transform } from 'class-transformer';
3
+ import {
4
+ IsBoolean,
5
+ IsEmail,
6
+ IsIn,
7
+ IsInt,
8
+ IsOptional,
9
+ IsString,
10
+ MaxLength,
11
+ Min,
12
+ } from 'class-validator';
13
+
14
+ const providerOptions = ['SMTP', 'GMAIL', 'SES'] as const;
15
+
16
+ export class CreateDTO {
17
+ @IsString({ message: (args) => getLocaleText('validation.stringRequired', args.value) })
18
+ @MaxLength(127)
19
+ @Transform(({ value }) => String(value ?? '').trim())
20
+ slug: string;
21
+
22
+ @IsString({ message: (args) => getLocaleText('validation.stringRequired', args.value) })
23
+ @MaxLength(127)
24
+ @Transform(({ value }) => String(value ?? '').trim())
25
+ name: string;
26
+
27
+ @IsIn(providerOptions)
28
+ @Transform(({ value }) => String(value ?? '').trim().toUpperCase())
29
+ provider: (typeof providerOptions)[number];
30
+
31
+ @IsOptional()
32
+ @IsString()
33
+ @MaxLength(127)
34
+ @Transform(({ value }) =>
35
+ value === undefined || value === null || value === '' ? undefined : String(value).trim(),
36
+ )
37
+ from_name?: string;
38
+
39
+ @IsEmail({}, { message: 'Invalid email address.' })
40
+ @MaxLength(255)
41
+ @Transform(({ value }) => String(value ?? '').trim())
42
+ from_email: string;
43
+
44
+ @IsOptional()
45
+ @IsString()
46
+ @MaxLength(127)
47
+ @Transform(({ value }) =>
48
+ value === undefined || value === null || value === '' ? undefined : String(value).trim(),
49
+ )
50
+ reply_to_name?: string;
51
+
52
+ @IsOptional()
53
+ @IsEmail({}, { message: 'Invalid email address.' })
54
+ @MaxLength(255)
55
+ @Transform(({ value }) =>
56
+ value === undefined || value === null || value === '' ? undefined : String(value).trim(),
57
+ )
58
+ reply_to_email?: string;
59
+
60
+ @IsOptional()
61
+ @IsString()
62
+ @MaxLength(255)
63
+ @Transform(({ value }) =>
64
+ value === undefined || value === null || value === '' ? undefined : String(value).trim(),
65
+ )
66
+ smtp_host?: string;
67
+
68
+ @IsOptional()
69
+ @Transform(({ value }) =>
70
+ value === undefined || value === null || value === '' ? undefined : Number(value),
71
+ )
72
+ @IsInt()
73
+ @Min(1)
74
+ smtp_port?: number;
75
+
76
+ @IsOptional()
77
+ @Transform(({ value }) =>
78
+ value === true || value === 'true' || value === 1 || value === '1',
79
+ )
80
+ @IsBoolean()
81
+ smtp_secure?: boolean;
82
+
83
+ @IsOptional()
84
+ @IsString()
85
+ @MaxLength(255)
86
+ @Transform(({ value }) =>
87
+ value === undefined || value === null || value === '' ? undefined : String(value).trim(),
88
+ )
89
+ smtp_username?: string;
90
+
91
+ @IsOptional()
92
+ @IsString()
93
+ @MaxLength(255)
94
+ @Transform(({ value }) =>
95
+ value === undefined || value === null || value === '' ? undefined : String(value),
96
+ )
97
+ smtp_password?: string;
98
+
99
+ @IsOptional()
100
+ @IsString()
101
+ @MaxLength(255)
102
+ @Transform(({ value }) =>
103
+ value === undefined || value === null || value === '' ? undefined : String(value).trim(),
104
+ )
105
+ gmail_client_id?: string;
106
+
107
+ @IsOptional()
108
+ @IsString()
109
+ @MaxLength(255)
110
+ @Transform(({ value }) =>
111
+ value === undefined || value === null || value === '' ? undefined : String(value),
112
+ )
113
+ gmail_client_secret?: string;
114
+
115
+ @IsOptional()
116
+ @IsString()
117
+ @Transform(({ value }) =>
118
+ value === undefined || value === null || value === '' ? undefined : String(value),
119
+ )
120
+ gmail_refresh_token?: string;
121
+
122
+ @IsOptional()
123
+ @IsString()
124
+ @MaxLength(255)
125
+ @Transform(({ value }) =>
126
+ value === undefined || value === null || value === '' ? undefined : String(value).trim(),
127
+ )
128
+ ses_access_key_id?: string;
129
+
130
+ @IsOptional()
131
+ @IsString()
132
+ @MaxLength(255)
133
+ @Transform(({ value }) =>
134
+ value === undefined || value === null || value === '' ? undefined : String(value),
135
+ )
136
+ ses_secret_access_key?: string;
137
+
138
+ @IsOptional()
139
+ @IsString()
140
+ @MaxLength(127)
141
+ @Transform(({ value }) =>
142
+ value === undefined || value === null || value === '' ? undefined : String(value).trim(),
143
+ )
144
+ ses_region?: string;
145
+ }
@@ -0,0 +1,4 @@
1
+ import { PartialType } from '@nestjs/mapped-types';
2
+ import { CreateDTO } from './create.dto';
3
+
4
+ export class UpdateDTO extends PartialType(CreateDTO) {}
@@ -0,0 +1,56 @@
1
+ import { DeleteDTO, Role } from '@hed-hog/api';
2
+ import { Pagination } from '@hed-hog/api-pagination';
3
+ import {
4
+ Body,
5
+ Controller,
6
+ Delete,
7
+ Get,
8
+ Inject,
9
+ Param,
10
+ ParseIntPipe,
11
+ Patch,
12
+ Post,
13
+ forwardRef,
14
+ } from '@nestjs/common';
15
+ import { CreateDTO } from './dto/create.dto';
16
+ import { UpdateDTO } from './dto/update.dto';
17
+ import { MailProfileService } from './mail-profile.service';
18
+
19
+ @Role()
20
+ @Controller('mail-profile')
21
+ export class MailProfileController {
22
+ constructor(
23
+ @Inject(forwardRef(() => MailProfileService))
24
+ private readonly mailProfileService: MailProfileService,
25
+ ) {}
26
+
27
+ @Get()
28
+ async list(@Pagination() paginationParams) {
29
+ return this.mailProfileService.list(paginationParams);
30
+ }
31
+
32
+ @Get(':id')
33
+ async get(@Param('id', ParseIntPipe) id: number) {
34
+ return this.mailProfileService.get(id);
35
+ }
36
+
37
+ @Post()
38
+ async create(@Body() data: CreateDTO) {
39
+ return this.mailProfileService.create(data);
40
+ }
41
+
42
+ @Post('test')
43
+ async test(@Body() data: CreateDTO) {
44
+ return this.mailProfileService.test(data);
45
+ }
46
+
47
+ @Patch(':id')
48
+ async update(@Param('id', ParseIntPipe) id: number, @Body() data: UpdateDTO) {
49
+ return this.mailProfileService.update({ id, data });
50
+ }
51
+
52
+ @Delete()
53
+ async delete(@Body() data: DeleteDTO) {
54
+ return this.mailProfileService.delete(data);
55
+ }
56
+ }
@@ -0,0 +1,18 @@
1
+ import { PaginationModule } from '@hed-hog/api-pagination';
2
+ import { PrismaModule } from '@hed-hog/api-prisma';
3
+ import { forwardRef, Module } from '@nestjs/common';
4
+ import { MailModule } from '../mail/mail.module';
5
+ import { MailProfileController } from './mail-profile.controller';
6
+ import { MailProfileService } from './mail-profile.service';
7
+
8
+ @Module({
9
+ imports: [
10
+ forwardRef(() => PrismaModule),
11
+ forwardRef(() => PaginationModule),
12
+ forwardRef(() => MailModule),
13
+ ],
14
+ controllers: [MailProfileController],
15
+ providers: [MailProfileService],
16
+ exports: [MailProfileService],
17
+ })
18
+ export class MailProfileModule {}