@flusys/nestjs-email 5.0.3 → 5.0.4
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/controllers/email-send.controller.js +1 -4
- package/cjs/controllers/email-template.controller.js +1 -1
- package/cjs/services/email-provider-config.service.js +1 -1
- package/cjs/services/email-template.service.js +1 -1
- package/fesm/controllers/email-send.controller.js +2 -5
- package/fesm/controllers/email-template.controller.js +2 -2
- package/fesm/services/email-provider-config.service.js +2 -2
- package/fesm/services/email-template.service.js +2 -2
- package/package.json +3 -3
- package/services/email-provider-config.service.d.ts +4 -4
- package/services/email-template.service.d.ts +4 -4
|
@@ -8,12 +8,12 @@ Object.defineProperty(exports, "EmailSendController", {
|
|
|
8
8
|
return EmailSendController;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const _config = require("../config");
|
|
12
11
|
const _decorators = require("@flusys/nestjs-shared/decorators");
|
|
13
12
|
const _guards = require("@flusys/nestjs-shared/guards");
|
|
14
13
|
const _interfaces = require("@flusys/nestjs-shared/interfaces");
|
|
15
14
|
const _common = require("@nestjs/common");
|
|
16
15
|
const _swagger = require("@nestjs/swagger");
|
|
16
|
+
const _config = require("../config");
|
|
17
17
|
const _dtos = require("../dtos");
|
|
18
18
|
const _services = require("../services");
|
|
19
19
|
function _define_property(obj, key, value) {
|
|
@@ -75,7 +75,6 @@ let EmailSendController = class EmailSendController {
|
|
|
75
75
|
};
|
|
76
76
|
_ts_decorate([
|
|
77
77
|
(0, _common.Post)('direct'),
|
|
78
|
-
(0, _decorators.RequirePermission)('email.send'),
|
|
79
78
|
(0, _swagger.ApiOperation)({
|
|
80
79
|
summary: 'Send email directly with custom content'
|
|
81
80
|
}),
|
|
@@ -90,7 +89,6 @@ _ts_decorate([
|
|
|
90
89
|
], EmailSendController.prototype, "sendEmail", null);
|
|
91
90
|
_ts_decorate([
|
|
92
91
|
(0, _common.Post)('template'),
|
|
93
|
-
(0, _decorators.RequirePermission)('email.send'),
|
|
94
92
|
(0, _swagger.ApiOperation)({
|
|
95
93
|
summary: 'Send email using a template with variable interpolation'
|
|
96
94
|
}),
|
|
@@ -105,7 +103,6 @@ _ts_decorate([
|
|
|
105
103
|
], EmailSendController.prototype, "sendTemplateEmail", null);
|
|
106
104
|
_ts_decorate([
|
|
107
105
|
(0, _common.Post)('test'),
|
|
108
|
-
(0, _decorators.RequirePermission)('email.send'),
|
|
109
106
|
(0, _swagger.ApiOperation)({
|
|
110
107
|
summary: 'Send a test email to verify configuration'
|
|
111
108
|
}),
|
|
@@ -112,7 +112,7 @@ let EmailTemplateController = class EmailTemplateController extends (0, _classes
|
|
|
112
112
|
};
|
|
113
113
|
_ts_decorate([
|
|
114
114
|
(0, _common.Post)('get-by-slug'),
|
|
115
|
-
(0, _common.UseGuards)(_guards.JwtAuthGuard),
|
|
115
|
+
(0, _common.UseGuards)(_guards.JwtAuthGuard, _guards.PermissionGuard),
|
|
116
116
|
(0, _swagger.ApiBearerAuth)(),
|
|
117
117
|
(0, _decorators.RequirePermission)(_classes.EMAIL_TEMPLATE_PERMISSIONS.READ),
|
|
118
118
|
(0, _swagger.ApiOperation)({
|
|
@@ -12,8 +12,8 @@ const _classes = require("@flusys/nestjs-shared/classes");
|
|
|
12
12
|
const _modules = require("@flusys/nestjs-shared/modules");
|
|
13
13
|
const _utils = require("@flusys/nestjs-shared/utils");
|
|
14
14
|
const _common = require("@nestjs/common");
|
|
15
|
-
const _emailconfigservice = require("./email-config.service");
|
|
16
15
|
const _entities = require("../entities");
|
|
16
|
+
const _emailconfigservice = require("./email-config.service");
|
|
17
17
|
const _emaildatasourceprovider = require("./email-datasource.provider");
|
|
18
18
|
function _define_property(obj, key, value) {
|
|
19
19
|
if (key in obj) {
|
|
@@ -12,8 +12,8 @@ const _classes = require("@flusys/nestjs-shared/classes");
|
|
|
12
12
|
const _modules = require("@flusys/nestjs-shared/modules");
|
|
13
13
|
const _utils = require("@flusys/nestjs-shared/utils");
|
|
14
14
|
const _common = require("@nestjs/common");
|
|
15
|
-
const _emailconfigservice = require("./email-config.service");
|
|
16
15
|
const _entities = require("../entities");
|
|
16
|
+
const _emailconfigservice = require("./email-config.service");
|
|
17
17
|
const _emaildatasourceprovider = require("./email-datasource.provider");
|
|
18
18
|
function _define_property(obj, key, value) {
|
|
19
19
|
if (key in obj) {
|
|
@@ -25,12 +25,12 @@ function _ts_param(paramIndex, decorator) {
|
|
|
25
25
|
decorator(target, key, paramIndex);
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
import {
|
|
29
|
-
import { CurrentUser, RequirePermission } from '@flusys/nestjs-shared/decorators';
|
|
28
|
+
import { CurrentUser } from '@flusys/nestjs-shared/decorators';
|
|
30
29
|
import { JwtAuthGuard } from '@flusys/nestjs-shared/guards';
|
|
31
30
|
import { ILoggedUserInfo } from '@flusys/nestjs-shared/interfaces';
|
|
32
31
|
import { Body, Controller, Inject, Post, UseGuards } from '@nestjs/common';
|
|
33
32
|
import { ApiBearerAuth, ApiOperation, ApiTags } from '@nestjs/swagger';
|
|
33
|
+
import { EMAIL_SEND_MESSAGES } from '../config';
|
|
34
34
|
import { SendEmailDto, SendTemplateEmailDto, TestEmailDto } from '../dtos';
|
|
35
35
|
import { EmailSendService } from '../services';
|
|
36
36
|
export class EmailSendController {
|
|
@@ -65,7 +65,6 @@ export class EmailSendController {
|
|
|
65
65
|
}
|
|
66
66
|
_ts_decorate([
|
|
67
67
|
Post('direct'),
|
|
68
|
-
RequirePermission('email.send'),
|
|
69
68
|
ApiOperation({
|
|
70
69
|
summary: 'Send email directly with custom content'
|
|
71
70
|
}),
|
|
@@ -80,7 +79,6 @@ _ts_decorate([
|
|
|
80
79
|
], EmailSendController.prototype, "sendEmail", null);
|
|
81
80
|
_ts_decorate([
|
|
82
81
|
Post('template'),
|
|
83
|
-
RequirePermission('email.send'),
|
|
84
82
|
ApiOperation({
|
|
85
83
|
summary: 'Send email using a template with variable interpolation'
|
|
86
84
|
}),
|
|
@@ -95,7 +93,6 @@ _ts_decorate([
|
|
|
95
93
|
], EmailSendController.prototype, "sendTemplateEmail", null);
|
|
96
94
|
_ts_decorate([
|
|
97
95
|
Post('test'),
|
|
98
|
-
RequirePermission('email.send'),
|
|
99
96
|
ApiOperation({
|
|
100
97
|
summary: 'Send a test email to verify configuration'
|
|
101
98
|
}),
|
|
@@ -27,7 +27,7 @@ function _ts_param(paramIndex, decorator) {
|
|
|
27
27
|
}
|
|
28
28
|
import { createApiController, EMAIL_TEMPLATE_PERMISSIONS } from '@flusys/nestjs-shared/classes';
|
|
29
29
|
import { CurrentUser, RequirePermission } from '@flusys/nestjs-shared/decorators';
|
|
30
|
-
import { JwtAuthGuard } from '@flusys/nestjs-shared/guards';
|
|
30
|
+
import { JwtAuthGuard, PermissionGuard } from '@flusys/nestjs-shared/guards';
|
|
31
31
|
import { ILoggedUserInfo } from '@flusys/nestjs-shared/interfaces';
|
|
32
32
|
import { Body, Controller, Inject, NotFoundException, Post, UseGuards } from '@nestjs/common';
|
|
33
33
|
import { ApiBearerAuth, ApiOperation, ApiResponse, ApiTags } from '@nestjs/swagger';
|
|
@@ -102,7 +102,7 @@ export class EmailTemplateController extends createApiController(CreateEmailTemp
|
|
|
102
102
|
}
|
|
103
103
|
_ts_decorate([
|
|
104
104
|
Post('get-by-slug'),
|
|
105
|
-
UseGuards(JwtAuthGuard),
|
|
105
|
+
UseGuards(JwtAuthGuard, PermissionGuard),
|
|
106
106
|
ApiBearerAuth(),
|
|
107
107
|
RequirePermission(EMAIL_TEMPLATE_PERMISSIONS.READ),
|
|
108
108
|
ApiOperation({
|
|
@@ -25,12 +25,12 @@ function _ts_param(paramIndex, decorator) {
|
|
|
25
25
|
decorator(target, key, paramIndex);
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
import {
|
|
28
|
+
import { HybridCache, RequestScopedApiService } from '@flusys/nestjs-shared/classes';
|
|
29
29
|
import { UtilsService } from '@flusys/nestjs-shared/modules';
|
|
30
30
|
import { applyCompanyFilter, buildCompanyWhereCondition } from '@flusys/nestjs-shared/utils';
|
|
31
31
|
import { Inject, Injectable, Scope } from '@nestjs/common';
|
|
32
|
-
import { EmailConfigService } from './email-config.service';
|
|
33
32
|
import { EmailConfig, EmailConfigWithCompany } from '../entities';
|
|
33
|
+
import { EmailConfigService } from './email-config.service';
|
|
34
34
|
import { EmailDataSourceProvider } from './email-datasource.provider';
|
|
35
35
|
export class EmailProviderConfigService extends RequestScopedApiService {
|
|
36
36
|
resolveEntity() {
|
|
@@ -25,12 +25,12 @@ function _ts_param(paramIndex, decorator) {
|
|
|
25
25
|
decorator(target, key, paramIndex);
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
import {
|
|
28
|
+
import { HybridCache, RequestScopedApiService } from '@flusys/nestjs-shared/classes';
|
|
29
29
|
import { UtilsService } from '@flusys/nestjs-shared/modules';
|
|
30
30
|
import { applyCompanyFilter, buildCompanyWhereCondition } from '@flusys/nestjs-shared/utils';
|
|
31
31
|
import { Inject, Injectable, Scope } from '@nestjs/common';
|
|
32
|
-
import { EmailConfigService } from './email-config.service';
|
|
33
32
|
import { EmailTemplate, EmailTemplateWithCompany } from '../entities';
|
|
33
|
+
import { EmailConfigService } from './email-config.service';
|
|
34
34
|
import { EmailDataSourceProvider } from './email-datasource.provider';
|
|
35
35
|
const DEFAULT_SELECT_FIELDS = [
|
|
36
36
|
'id',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flusys/nestjs-email",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.4",
|
|
4
4
|
"description": "Modular email package with SMTP, SendGrid, and Mailgun providers",
|
|
5
5
|
"main": "cjs/index.js",
|
|
6
6
|
"module": "fesm/index.js",
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
}
|
|
106
106
|
},
|
|
107
107
|
"dependencies": {
|
|
108
|
-
"@flusys/nestjs-core": "5.0.
|
|
109
|
-
"@flusys/nestjs-shared": "5.0.
|
|
108
|
+
"@flusys/nestjs-core": "5.0.4",
|
|
109
|
+
"@flusys/nestjs-shared": "5.0.4"
|
|
110
110
|
}
|
|
111
111
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HybridCache, RequestScopedApiService } from '@flusys/nestjs-shared/classes';
|
|
2
2
|
import { FilterAndPaginationDto } from '@flusys/nestjs-shared/dtos';
|
|
3
3
|
import { ILoggedUserInfo } from '@flusys/nestjs-shared/interfaces';
|
|
4
4
|
import { UtilsService } from '@flusys/nestjs-shared/modules';
|
|
5
|
-
import { EntityTarget,
|
|
6
|
-
import { EmailConfigService } from './email-config.service';
|
|
5
|
+
import { EntityTarget, SelectQueryBuilder } from 'typeorm';
|
|
7
6
|
import { CreateEmailConfigDto, UpdateEmailConfigDto } from '../dtos';
|
|
8
7
|
import { EmailConfig, EmailConfigBase } from '../entities';
|
|
9
8
|
import { IEmailConfig } from '../interfaces';
|
|
9
|
+
import { EmailConfigService } from './email-config.service';
|
|
10
10
|
import { EmailDataSourceProvider } from './email-datasource.provider';
|
|
11
|
-
export declare class EmailProviderConfigService extends RequestScopedApiService<CreateEmailConfigDto, UpdateEmailConfigDto, IEmailConfig, EmailConfigBase
|
|
11
|
+
export declare class EmailProviderConfigService extends RequestScopedApiService<CreateEmailConfigDto, UpdateEmailConfigDto, IEmailConfig, EmailConfigBase> {
|
|
12
12
|
protected cacheManager: HybridCache;
|
|
13
13
|
protected utilsService: UtilsService;
|
|
14
14
|
private readonly emailConfig;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HybridCache, RequestScopedApiService } from '@flusys/nestjs-shared/classes';
|
|
2
2
|
import { FilterAndPaginationDto } from '@flusys/nestjs-shared/dtos';
|
|
3
3
|
import { ILoggedUserInfo } from '@flusys/nestjs-shared/interfaces';
|
|
4
4
|
import { UtilsService } from '@flusys/nestjs-shared/modules';
|
|
5
|
-
import { EntityTarget,
|
|
6
|
-
import { EmailConfigService } from './email-config.service';
|
|
5
|
+
import { EntityTarget, SelectQueryBuilder } from 'typeorm';
|
|
7
6
|
import { CreateEmailTemplateDto, UpdateEmailTemplateDto } from '../dtos';
|
|
8
7
|
import { EmailTemplate, EmailTemplateBase } from '../entities';
|
|
9
8
|
import { IEmailTemplate } from '../interfaces';
|
|
9
|
+
import { EmailConfigService } from './email-config.service';
|
|
10
10
|
import { EmailDataSourceProvider } from './email-datasource.provider';
|
|
11
|
-
export declare class EmailTemplateService extends RequestScopedApiService<CreateEmailTemplateDto, UpdateEmailTemplateDto, IEmailTemplate, EmailTemplateBase
|
|
11
|
+
export declare class EmailTemplateService extends RequestScopedApiService<CreateEmailTemplateDto, UpdateEmailTemplateDto, IEmailTemplate, EmailTemplateBase> {
|
|
12
12
|
protected cacheManager: HybridCache;
|
|
13
13
|
protected utilsService: UtilsService;
|
|
14
14
|
private readonly emailConfig;
|