@flusys/nestjs-email 1.1.0-beta
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/cjs/config/email-config.service.js +94 -0
- package/cjs/config/email.constants.js +40 -0
- package/cjs/config/index.js +19 -0
- package/cjs/controllers/email-config.controller.js +59 -0
- package/cjs/controllers/email-send.controller.js +142 -0
- package/cjs/controllers/email-template.controller.js +84 -0
- package/cjs/controllers/index.js +20 -0
- package/cjs/docs/email-swagger.config.js +176 -0
- package/cjs/docs/index.js +11 -0
- package/cjs/dtos/email-config.dto.js +238 -0
- package/cjs/dtos/email-send.dto.js +376 -0
- package/cjs/dtos/email-template.dto.js +283 -0
- package/cjs/dtos/index.js +20 -0
- package/cjs/entities/email-config-base.entity.js +111 -0
- package/cjs/entities/email-config-with-company.entity.js +63 -0
- package/cjs/entities/email-config.entity.js +25 -0
- package/cjs/entities/email-template-base.entity.js +134 -0
- package/cjs/entities/email-template-with-company.entity.js +63 -0
- package/cjs/entities/email-template.entity.js +25 -0
- package/cjs/entities/index.js +41 -0
- package/cjs/enums/email-provider-type.enum.js +18 -0
- package/cjs/enums/index.js +18 -0
- package/cjs/index.js +27 -0
- package/cjs/interfaces/email-config.interface.js +4 -0
- package/cjs/interfaces/email-module-options.interface.js +4 -0
- package/cjs/interfaces/email-provider.interface.js +6 -0
- package/cjs/interfaces/email-template.interface.js +4 -0
- package/cjs/interfaces/index.js +21 -0
- package/cjs/modules/email.module.js +177 -0
- package/cjs/modules/index.js +18 -0
- package/cjs/providers/email-factory.service.js +160 -0
- package/cjs/providers/email-provider.registry.js +51 -0
- package/cjs/providers/index.js +22 -0
- package/cjs/providers/mailgun-provider.js +125 -0
- package/cjs/providers/sendgrid-provider.js +156 -0
- package/cjs/providers/smtp-provider.js +185 -0
- package/cjs/services/email-datasource.provider.js +215 -0
- package/cjs/services/email-provider-config.service.js +180 -0
- package/cjs/services/email-send.service.js +228 -0
- package/cjs/services/email-template.service.js +186 -0
- package/cjs/services/index.js +21 -0
- package/config/email-config.service.d.ts +13 -0
- package/config/email.constants.d.ts +11 -0
- package/config/index.d.ts +2 -0
- package/controllers/email-config.controller.d.ts +17 -0
- package/controllers/email-send.controller.d.ts +19 -0
- package/controllers/email-template.controller.d.ts +25 -0
- package/controllers/index.d.ts +3 -0
- package/docs/email-swagger.config.d.ts +3 -0
- package/docs/index.d.ts +1 -0
- package/dtos/email-config.dto.d.ts +33 -0
- package/dtos/email-send.dto.d.ts +45 -0
- package/dtos/email-template.dto.d.ts +42 -0
- package/dtos/index.d.ts +3 -0
- package/entities/email-config-base.entity.d.ts +11 -0
- package/entities/email-config-with-company.entity.d.ts +4 -0
- package/entities/email-config.entity.d.ts +3 -0
- package/entities/email-template-base.entity.d.ts +14 -0
- package/entities/email-template-with-company.entity.d.ts +4 -0
- package/entities/email-template.entity.d.ts +3 -0
- package/entities/index.d.ts +7 -0
- package/enums/email-provider-type.enum.d.ts +5 -0
- package/enums/index.d.ts +1 -0
- package/fesm/config/email-config.service.js +84 -0
- package/fesm/config/email.constants.js +13 -0
- package/fesm/config/index.js +2 -0
- package/fesm/controllers/email-config.controller.js +49 -0
- package/fesm/controllers/email-send.controller.js +132 -0
- package/fesm/controllers/email-template.controller.js +74 -0
- package/fesm/controllers/index.js +3 -0
- package/fesm/docs/email-swagger.config.js +172 -0
- package/fesm/docs/index.js +1 -0
- package/fesm/dtos/email-config.dto.js +223 -0
- package/fesm/dtos/email-send.dto.js +360 -0
- package/fesm/dtos/email-template.dto.js +268 -0
- package/fesm/dtos/index.js +3 -0
- package/fesm/entities/email-config-base.entity.js +101 -0
- package/fesm/entities/email-config-with-company.entity.js +53 -0
- package/fesm/entities/email-config.entity.js +15 -0
- package/fesm/entities/email-template-base.entity.js +124 -0
- package/fesm/entities/email-template-with-company.entity.js +53 -0
- package/fesm/entities/email-template.entity.js +15 -0
- package/fesm/entities/index.js +20 -0
- package/fesm/enums/email-provider-type.enum.js +8 -0
- package/fesm/enums/index.js +1 -0
- package/fesm/index.js +10 -0
- package/fesm/interfaces/email-config.interface.js +3 -0
- package/fesm/interfaces/email-module-options.interface.js +3 -0
- package/fesm/interfaces/email-provider.interface.js +5 -0
- package/fesm/interfaces/email-template.interface.js +3 -0
- package/fesm/interfaces/index.js +4 -0
- package/fesm/modules/email.module.js +167 -0
- package/fesm/modules/index.js +1 -0
- package/fesm/providers/email-factory.service.js +109 -0
- package/fesm/providers/email-provider.registry.js +44 -0
- package/fesm/providers/index.js +5 -0
- package/fesm/providers/mailgun-provider.js +119 -0
- package/fesm/providers/sendgrid-provider.js +150 -0
- package/fesm/providers/smtp-provider.js +137 -0
- package/fesm/services/email-datasource.provider.js +164 -0
- package/fesm/services/email-provider-config.service.js +170 -0
- package/fesm/services/email-send.service.js +218 -0
- package/fesm/services/email-template.service.js +176 -0
- package/fesm/services/index.js +4 -0
- package/index.d.ts +9 -0
- package/interfaces/email-config.interface.d.ts +28 -0
- package/interfaces/email-module-options.interface.d.ts +26 -0
- package/interfaces/email-provider.interface.d.ts +34 -0
- package/interfaces/email-template.interface.d.ts +64 -0
- package/interfaces/index.d.ts +4 -0
- package/modules/email.module.d.ts +9 -0
- package/modules/index.d.ts +1 -0
- package/package.json +105 -0
- package/providers/email-factory.service.d.ts +14 -0
- package/providers/email-provider.registry.d.ts +10 -0
- package/providers/index.d.ts +5 -0
- package/providers/mailgun-provider.d.ts +11 -0
- package/providers/sendgrid-provider.d.ts +11 -0
- package/providers/smtp-provider.d.ts +11 -0
- package/services/email-datasource.provider.d.ts +25 -0
- package/services/email-provider-config.service.d.ts +32 -0
- package/services/email-send.service.d.ts +20 -0
- package/services/email-template.service.d.ts +31 -0
- package/services/index.d.ts +4 -0
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/** Schema properties to exclude when company feature is disabled */ const COMPANY_SCHEMA_EXCLUSIONS = [
|
|
2
|
+
{
|
|
3
|
+
schemaName: 'EmailConfigResponseDto',
|
|
4
|
+
properties: [
|
|
5
|
+
'companyId'
|
|
6
|
+
]
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
schemaName: 'EmailTemplateResponseDto',
|
|
10
|
+
properties: [
|
|
11
|
+
'companyId'
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
];
|
|
15
|
+
/**
|
|
16
|
+
* Email Module Swagger Configuration
|
|
17
|
+
* Use this with setupSwaggerDocs() from @flusys/nestjs-core
|
|
18
|
+
*
|
|
19
|
+
* @param bootstrapConfig - Bootstrap configuration to determine feature visibility
|
|
20
|
+
* @returns Swagger configuration with appropriate excludeSchemaProperties based on enableCompanyFeature
|
|
21
|
+
*/ export function emailSwaggerConfig(bootstrapConfig) {
|
|
22
|
+
const enableCompanyFeature = bootstrapConfig?.enableCompanyFeature ?? true;
|
|
23
|
+
return {
|
|
24
|
+
title: 'Email API',
|
|
25
|
+
description: enableCompanyFeature ? `
|
|
26
|
+
# Email Management API
|
|
27
|
+
|
|
28
|
+
Complete email management system with multi-tenant and company support.
|
|
29
|
+
|
|
30
|
+
## Features
|
|
31
|
+
|
|
32
|
+
### 📧 Email Configuration
|
|
33
|
+
- Multiple email providers (SMTP, SendGrid, Mailgun)
|
|
34
|
+
- Provider-specific configurations
|
|
35
|
+
- Default sender settings
|
|
36
|
+
- **Company-level email configs**
|
|
37
|
+
|
|
38
|
+
### 📝 Email Templates
|
|
39
|
+
- Visual template builder
|
|
40
|
+
- Variable interpolation ({{variable}})
|
|
41
|
+
- HTML and plain text support
|
|
42
|
+
- Template versioning
|
|
43
|
+
- **Company isolation**
|
|
44
|
+
|
|
45
|
+
### ✉️ Email Sending
|
|
46
|
+
- Direct email sending
|
|
47
|
+
- Template-based sending
|
|
48
|
+
- Attachments support
|
|
49
|
+
- CC/BCC recipients
|
|
50
|
+
|
|
51
|
+
### 🔒 Security
|
|
52
|
+
- JWT authentication required
|
|
53
|
+
- **Company isolation**
|
|
54
|
+
- Secure credential storage
|
|
55
|
+
|
|
56
|
+
## Supported Providers
|
|
57
|
+
|
|
58
|
+
### SMTP
|
|
59
|
+
- Universal email protocol
|
|
60
|
+
- Custom server support
|
|
61
|
+
- TLS/SSL encryption
|
|
62
|
+
|
|
63
|
+
### SendGrid (optional)
|
|
64
|
+
- Cloud email service
|
|
65
|
+
- High deliverability
|
|
66
|
+
- Install: \`npm install @sendgrid/mail\`
|
|
67
|
+
|
|
68
|
+
### Mailgun (optional)
|
|
69
|
+
- Developer-friendly API
|
|
70
|
+
- Detailed analytics
|
|
71
|
+
- Install: \`npm install mailgun.js\`
|
|
72
|
+
|
|
73
|
+
## Template Variables
|
|
74
|
+
|
|
75
|
+
Templates support Handlebars-style variables:
|
|
76
|
+
- \`{{userName}}\` - Simple variable
|
|
77
|
+
- \`{{user.email}}\` - Nested properties
|
|
78
|
+
- Variables are replaced at send time
|
|
79
|
+
|
|
80
|
+
## Multi-Tenant Support
|
|
81
|
+
|
|
82
|
+
Emails are automatically isolated by:
|
|
83
|
+
- **Company ID**: Company-level templates and configs
|
|
84
|
+
|
|
85
|
+
All queries automatically filter by current user's company context.
|
|
86
|
+
|
|
87
|
+
## API Endpoints
|
|
88
|
+
|
|
89
|
+
All email endpoints are prefixed with \`/email\`:
|
|
90
|
+
- \`/email/email-config/*\` - Email provider configurations
|
|
91
|
+
- \`/email/email-template/*\` - Email templates
|
|
92
|
+
- \`/email/email-send/*\` - Send emails
|
|
93
|
+
|
|
94
|
+
## Getting Started
|
|
95
|
+
|
|
96
|
+
1. **Authenticate**: Obtain JWT token from /auth/login
|
|
97
|
+
2. **Configure Provider**: Create email config via /email/email-config/insert
|
|
98
|
+
3. **Create Templates**: Add templates via /email/email-template/insert
|
|
99
|
+
4. **Send Emails**: Send via /email/email-send/send or /email/email-send/send-template
|
|
100
|
+
` : `
|
|
101
|
+
# Email Management API
|
|
102
|
+
|
|
103
|
+
Complete email management system.
|
|
104
|
+
|
|
105
|
+
## Features
|
|
106
|
+
|
|
107
|
+
### 📧 Email Configuration
|
|
108
|
+
- Multiple email providers (SMTP, SendGrid, Mailgun)
|
|
109
|
+
- Provider-specific configurations
|
|
110
|
+
- Default sender settings
|
|
111
|
+
|
|
112
|
+
### 📝 Email Templates
|
|
113
|
+
- Visual template builder
|
|
114
|
+
- Variable interpolation ({{variable}})
|
|
115
|
+
- HTML and plain text support
|
|
116
|
+
- Template versioning
|
|
117
|
+
|
|
118
|
+
### ✉️ Email Sending
|
|
119
|
+
- Direct email sending
|
|
120
|
+
- Template-based sending
|
|
121
|
+
- Attachments support
|
|
122
|
+
- CC/BCC recipients
|
|
123
|
+
|
|
124
|
+
### 🔒 Security
|
|
125
|
+
- JWT authentication required
|
|
126
|
+
- Secure credential storage
|
|
127
|
+
|
|
128
|
+
## Supported Providers
|
|
129
|
+
|
|
130
|
+
### SMTP
|
|
131
|
+
- Universal email protocol
|
|
132
|
+
- Custom server support
|
|
133
|
+
- TLS/SSL encryption
|
|
134
|
+
|
|
135
|
+
### SendGrid (optional)
|
|
136
|
+
- Cloud email service
|
|
137
|
+
- High deliverability
|
|
138
|
+
- Install: \`npm install @sendgrid/mail\`
|
|
139
|
+
|
|
140
|
+
### Mailgun (optional)
|
|
141
|
+
- Developer-friendly API
|
|
142
|
+
- Detailed analytics
|
|
143
|
+
- Install: \`npm install mailgun.js\`
|
|
144
|
+
|
|
145
|
+
## Template Variables
|
|
146
|
+
|
|
147
|
+
Templates support Handlebars-style variables:
|
|
148
|
+
- \`{{userName}}\` - Simple variable
|
|
149
|
+
- \`{{user.email}}\` - Nested properties
|
|
150
|
+
- Variables are replaced at send time
|
|
151
|
+
|
|
152
|
+
## API Endpoints
|
|
153
|
+
|
|
154
|
+
All email endpoints are prefixed with \`/email\`:
|
|
155
|
+
- \`/email/email-config/*\` - Email provider configurations
|
|
156
|
+
- \`/email/email-template/*\` - Email templates
|
|
157
|
+
- \`/email/email-send/*\` - Send emails
|
|
158
|
+
|
|
159
|
+
## Getting Started
|
|
160
|
+
|
|
161
|
+
1. **Authenticate**: Obtain JWT token from /auth/login
|
|
162
|
+
2. **Configure Provider**: Create email config via /email/email-config/insert
|
|
163
|
+
3. **Create Templates**: Add templates via /email/email-template/insert
|
|
164
|
+
4. **Send Emails**: Send via /email/email-send/send or /email/email-send/send-template
|
|
165
|
+
`,
|
|
166
|
+
version: '1.0',
|
|
167
|
+
path: 'api/docs/email',
|
|
168
|
+
bearerAuth: true,
|
|
169
|
+
excludeTags: [],
|
|
170
|
+
excludeSchemaProperties: enableCompanyFeature ? undefined : COMPANY_SCHEMA_EXCLUSIONS
|
|
171
|
+
};
|
|
172
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { emailSwaggerConfig } from './email-swagger.config';
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
function _define_property(obj, key, value) {
|
|
2
|
+
if (key in obj) {
|
|
3
|
+
Object.defineProperty(obj, key, {
|
|
4
|
+
value: value,
|
|
5
|
+
enumerable: true,
|
|
6
|
+
configurable: true,
|
|
7
|
+
writable: true
|
|
8
|
+
});
|
|
9
|
+
} else {
|
|
10
|
+
obj[key] = value;
|
|
11
|
+
}
|
|
12
|
+
return obj;
|
|
13
|
+
}
|
|
14
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
15
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
17
|
+
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;
|
|
18
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
19
|
+
}
|
|
20
|
+
function _ts_metadata(k, v) {
|
|
21
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
22
|
+
}
|
|
23
|
+
import { IdentityResponseDto } from '@flusys/nestjs-shared/dtos';
|
|
24
|
+
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
25
|
+
import { IsBoolean, IsEmail, IsEnum, IsNotEmpty, IsObject, IsOptional, IsString, MaxLength } from 'class-validator';
|
|
26
|
+
import { EmailProviderTypeEnum } from '../enums';
|
|
27
|
+
/**
|
|
28
|
+
* DTO for creating email configuration
|
|
29
|
+
*/ export class CreateEmailConfigDto {
|
|
30
|
+
constructor(){
|
|
31
|
+
_define_property(this, "name", void 0);
|
|
32
|
+
_define_property(this, "provider", void 0);
|
|
33
|
+
_define_property(this, "config", void 0);
|
|
34
|
+
_define_property(this, "fromEmail", void 0);
|
|
35
|
+
_define_property(this, "fromName", void 0);
|
|
36
|
+
_define_property(this, "isActive", void 0);
|
|
37
|
+
_define_property(this, "isDefault", void 0);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
_ts_decorate([
|
|
41
|
+
ApiProperty({
|
|
42
|
+
example: 'Production SMTP'
|
|
43
|
+
}),
|
|
44
|
+
IsString(),
|
|
45
|
+
IsNotEmpty(),
|
|
46
|
+
MaxLength(255),
|
|
47
|
+
_ts_metadata("design:type", String)
|
|
48
|
+
], CreateEmailConfigDto.prototype, "name", void 0);
|
|
49
|
+
_ts_decorate([
|
|
50
|
+
ApiProperty({
|
|
51
|
+
enum: EmailProviderTypeEnum,
|
|
52
|
+
example: EmailProviderTypeEnum.SMTP,
|
|
53
|
+
description: 'Email provider type'
|
|
54
|
+
}),
|
|
55
|
+
IsEnum(EmailProviderTypeEnum),
|
|
56
|
+
IsNotEmpty(),
|
|
57
|
+
_ts_metadata("design:type", typeof EmailProviderTypeEnum === "undefined" ? Object : EmailProviderTypeEnum)
|
|
58
|
+
], CreateEmailConfigDto.prototype, "provider", void 0);
|
|
59
|
+
_ts_decorate([
|
|
60
|
+
ApiProperty({
|
|
61
|
+
type: 'object',
|
|
62
|
+
properties: {
|
|
63
|
+
host: {
|
|
64
|
+
type: 'string',
|
|
65
|
+
example: 'smtp.gmail.com',
|
|
66
|
+
description: 'SMTP host'
|
|
67
|
+
},
|
|
68
|
+
port: {
|
|
69
|
+
type: 'number',
|
|
70
|
+
example: 587,
|
|
71
|
+
description: 'SMTP port'
|
|
72
|
+
},
|
|
73
|
+
secure: {
|
|
74
|
+
type: 'boolean',
|
|
75
|
+
example: false,
|
|
76
|
+
description: 'Use TLS'
|
|
77
|
+
},
|
|
78
|
+
auth: {
|
|
79
|
+
type: 'object',
|
|
80
|
+
properties: {
|
|
81
|
+
user: {
|
|
82
|
+
type: 'string',
|
|
83
|
+
example: 'user@gmail.com'
|
|
84
|
+
},
|
|
85
|
+
pass: {
|
|
86
|
+
type: 'string',
|
|
87
|
+
example: 'app-password'
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
additionalProperties: true,
|
|
93
|
+
description: 'Provider-specific configuration'
|
|
94
|
+
}),
|
|
95
|
+
IsObject(),
|
|
96
|
+
IsNotEmpty(),
|
|
97
|
+
_ts_metadata("design:type", typeof Record === "undefined" ? Object : Record)
|
|
98
|
+
], CreateEmailConfigDto.prototype, "config", void 0);
|
|
99
|
+
_ts_decorate([
|
|
100
|
+
ApiPropertyOptional({
|
|
101
|
+
example: 'noreply@example.com'
|
|
102
|
+
}),
|
|
103
|
+
IsEmail(),
|
|
104
|
+
IsOptional(),
|
|
105
|
+
_ts_metadata("design:type", String)
|
|
106
|
+
], CreateEmailConfigDto.prototype, "fromEmail", void 0);
|
|
107
|
+
_ts_decorate([
|
|
108
|
+
ApiPropertyOptional({
|
|
109
|
+
example: 'FLUSYS'
|
|
110
|
+
}),
|
|
111
|
+
IsString(),
|
|
112
|
+
IsOptional(),
|
|
113
|
+
MaxLength(255),
|
|
114
|
+
_ts_metadata("design:type", String)
|
|
115
|
+
], CreateEmailConfigDto.prototype, "fromName", void 0);
|
|
116
|
+
_ts_decorate([
|
|
117
|
+
ApiPropertyOptional({
|
|
118
|
+
example: true
|
|
119
|
+
}),
|
|
120
|
+
IsBoolean(),
|
|
121
|
+
IsOptional(),
|
|
122
|
+
_ts_metadata("design:type", Boolean)
|
|
123
|
+
], CreateEmailConfigDto.prototype, "isActive", void 0);
|
|
124
|
+
_ts_decorate([
|
|
125
|
+
ApiPropertyOptional({
|
|
126
|
+
example: false,
|
|
127
|
+
description: 'Set as default email configuration'
|
|
128
|
+
}),
|
|
129
|
+
IsBoolean(),
|
|
130
|
+
IsOptional(),
|
|
131
|
+
_ts_metadata("design:type", Boolean)
|
|
132
|
+
], CreateEmailConfigDto.prototype, "isDefault", void 0);
|
|
133
|
+
/**
|
|
134
|
+
* DTO for updating email configuration
|
|
135
|
+
*/ export class UpdateEmailConfigDto {
|
|
136
|
+
constructor(){
|
|
137
|
+
_define_property(this, "id", void 0);
|
|
138
|
+
_define_property(this, "name", void 0);
|
|
139
|
+
_define_property(this, "provider", void 0);
|
|
140
|
+
_define_property(this, "config", void 0);
|
|
141
|
+
_define_property(this, "fromEmail", void 0);
|
|
142
|
+
_define_property(this, "fromName", void 0);
|
|
143
|
+
_define_property(this, "isActive", void 0);
|
|
144
|
+
_define_property(this, "isDefault", void 0);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
_ts_decorate([
|
|
148
|
+
ApiProperty({
|
|
149
|
+
example: '123e4567-e89b-12d3-a456-426614174000'
|
|
150
|
+
}),
|
|
151
|
+
IsString(),
|
|
152
|
+
IsNotEmpty(),
|
|
153
|
+
_ts_metadata("design:type", String)
|
|
154
|
+
], UpdateEmailConfigDto.prototype, "id", void 0);
|
|
155
|
+
_ts_decorate([
|
|
156
|
+
ApiPropertyOptional({
|
|
157
|
+
example: 'Production SMTP'
|
|
158
|
+
}),
|
|
159
|
+
IsString(),
|
|
160
|
+
IsOptional(),
|
|
161
|
+
MaxLength(255),
|
|
162
|
+
_ts_metadata("design:type", String)
|
|
163
|
+
], UpdateEmailConfigDto.prototype, "name", void 0);
|
|
164
|
+
_ts_decorate([
|
|
165
|
+
ApiPropertyOptional({
|
|
166
|
+
enum: EmailProviderTypeEnum,
|
|
167
|
+
example: EmailProviderTypeEnum.SMTP
|
|
168
|
+
}),
|
|
169
|
+
IsEnum(EmailProviderTypeEnum),
|
|
170
|
+
IsOptional(),
|
|
171
|
+
_ts_metadata("design:type", typeof EmailProviderTypeEnum === "undefined" ? Object : EmailProviderTypeEnum)
|
|
172
|
+
], UpdateEmailConfigDto.prototype, "provider", void 0);
|
|
173
|
+
_ts_decorate([
|
|
174
|
+
ApiPropertyOptional({
|
|
175
|
+
type: 'object',
|
|
176
|
+
additionalProperties: true,
|
|
177
|
+
description: 'Provider-specific configuration'
|
|
178
|
+
}),
|
|
179
|
+
IsObject(),
|
|
180
|
+
IsOptional(),
|
|
181
|
+
_ts_metadata("design:type", typeof Record === "undefined" ? Object : Record)
|
|
182
|
+
], UpdateEmailConfigDto.prototype, "config", void 0);
|
|
183
|
+
_ts_decorate([
|
|
184
|
+
ApiPropertyOptional({
|
|
185
|
+
example: 'noreply@example.com'
|
|
186
|
+
}),
|
|
187
|
+
IsEmail(),
|
|
188
|
+
IsOptional(),
|
|
189
|
+
_ts_metadata("design:type", String)
|
|
190
|
+
], UpdateEmailConfigDto.prototype, "fromEmail", void 0);
|
|
191
|
+
_ts_decorate([
|
|
192
|
+
ApiPropertyOptional({
|
|
193
|
+
example: 'FLUSYS'
|
|
194
|
+
}),
|
|
195
|
+
IsString(),
|
|
196
|
+
IsOptional(),
|
|
197
|
+
MaxLength(255),
|
|
198
|
+
_ts_metadata("design:type", String)
|
|
199
|
+
], UpdateEmailConfigDto.prototype, "fromName", void 0);
|
|
200
|
+
_ts_decorate([
|
|
201
|
+
ApiPropertyOptional({
|
|
202
|
+
example: true
|
|
203
|
+
}),
|
|
204
|
+
IsBoolean(),
|
|
205
|
+
IsOptional(),
|
|
206
|
+
_ts_metadata("design:type", Boolean)
|
|
207
|
+
], UpdateEmailConfigDto.prototype, "isActive", void 0);
|
|
208
|
+
_ts_decorate([
|
|
209
|
+
ApiPropertyOptional({
|
|
210
|
+
example: false,
|
|
211
|
+
description: 'Set as default email configuration'
|
|
212
|
+
}),
|
|
213
|
+
IsBoolean(),
|
|
214
|
+
IsOptional(),
|
|
215
|
+
_ts_metadata("design:type", Boolean)
|
|
216
|
+
], UpdateEmailConfigDto.prototype, "isDefault", void 0);
|
|
217
|
+
/**
|
|
218
|
+
* Response DTO for email configuration
|
|
219
|
+
*/ export class EmailConfigResponseDto extends IdentityResponseDto {
|
|
220
|
+
constructor(...args){
|
|
221
|
+
super(...args), _define_property(this, "name", void 0), _define_property(this, "provider", void 0), _define_property(this, "config", void 0), _define_property(this, "fromEmail", void 0), _define_property(this, "fromName", void 0), _define_property(this, "isActive", void 0), _define_property(this, "isDefault", void 0);
|
|
222
|
+
}
|
|
223
|
+
}
|