@breadstone/archipel-platform-mailing 0.0.21 → 0.0.23
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/README.md +1 -1
- package/package.json +31 -6
- package/src/index.d.ts +1 -5
- package/src/index.js +1 -5
- package/src/logger/index.d.ts +1 -0
- package/src/logger/index.js +6 -0
- package/src/services/MailVerificationService.d.ts +1 -1
- package/src/services/MailVerificationService.js +1 -1
- package/src/smtp/env.d.ts +13 -0
- package/src/smtp/env.js +31 -0
- package/src/smtp/index.d.ts +2 -0
- package/src/smtp/index.js +13 -0
- package/src/templating/strategies/FileTemplateFetchStrategy.d.ts +1 -1
- package/src/templating/strategies/FileTemplateFetchStrategy.js +2 -2
- package/src/terminus/MailHealthIndicator.d.ts +1 -1
- package/src/{MailModule.js → tokens/MailModule.js} +23 -21
- /package/src/{MailModule.d.ts → tokens/MailModule.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -66,7 +66,7 @@ Set `MAIL_DELIVERY_STRATEGY` to one of: `smtp`, `postmark`, `resend`, `sendgrid`
|
|
|
66
66
|
## Features
|
|
67
67
|
|
|
68
68
|
- **Multi-provider**: Switch between SMTP, Postmark, Resend, SendGrid, or Mailgun via config
|
|
69
|
-
- **Subpath imports**: Each provider lives in its own subpath
|
|
69
|
+
- **Subpath imports**: Each provider lives in its own subpath - install only the SDK you need
|
|
70
70
|
- **Template engines**: File-based or blob-based template fetching with variable substitution
|
|
71
71
|
- **Health checks**: Built-in `MailHealthIndicator` for readiness probes
|
|
72
72
|
- **Email verification**: `MailVerificationService` for address verification flows
|
package/package.json
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@breadstone/archipel-platform-mailing",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.23",
|
|
4
4
|
"description": "Email delivery with strategy-based transport and template engines for NestJS applications.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./src/index.js",
|
|
7
7
|
"types": "./src/index.d.ts",
|
|
8
8
|
"typesVersions": {
|
|
9
9
|
"*": {
|
|
10
|
+
"log": [
|
|
11
|
+
"./src/log/index.d.ts"
|
|
12
|
+
],
|
|
13
|
+
"smtp": [
|
|
14
|
+
"./src/smtp/index.d.ts"
|
|
15
|
+
],
|
|
10
16
|
"mailgun": [
|
|
11
17
|
"./src/mailgun/index.d.ts"
|
|
12
18
|
],
|
|
@@ -26,6 +32,14 @@
|
|
|
26
32
|
"types": "./src/index.d.ts",
|
|
27
33
|
"default": "./src/index.js"
|
|
28
34
|
},
|
|
35
|
+
"./log": {
|
|
36
|
+
"types": "./src/log/index.d.ts",
|
|
37
|
+
"default": "./src/log/index.js"
|
|
38
|
+
},
|
|
39
|
+
"./smtp": {
|
|
40
|
+
"types": "./src/smtp/index.d.ts",
|
|
41
|
+
"default": "./src/smtp/index.js"
|
|
42
|
+
},
|
|
29
43
|
"./mailgun": {
|
|
30
44
|
"types": "./src/mailgun/index.d.ts",
|
|
31
45
|
"default": "./src/mailgun/index.js"
|
|
@@ -43,6 +57,7 @@
|
|
|
43
57
|
"default": "./src/sendgrid/index.js"
|
|
44
58
|
},
|
|
45
59
|
"./package.json": "./package.json",
|
|
60
|
+
"./smtp/index": "./src/smtp/index.js",
|
|
46
61
|
"./postmark/index": "./src/postmark/index.js",
|
|
47
62
|
"./resend/index": "./src/resend/index.js",
|
|
48
63
|
"./sendgrid/index": "./src/sendgrid/index.js",
|
|
@@ -58,6 +73,7 @@
|
|
|
58
73
|
"nestjs",
|
|
59
74
|
"email",
|
|
60
75
|
"mailing",
|
|
76
|
+
"log",
|
|
61
77
|
"smtp",
|
|
62
78
|
"postmark",
|
|
63
79
|
"resend",
|
|
@@ -75,18 +91,20 @@
|
|
|
75
91
|
"README.md"
|
|
76
92
|
],
|
|
77
93
|
"dependencies": {
|
|
78
|
-
"@breadstone/archipel-platform-blob-storage": "0.0.
|
|
79
|
-
"@breadstone/archipel-platform-configuration": "0.0.
|
|
80
|
-
"@breadstone/archipel-platform-core": "0.0.
|
|
81
|
-
"
|
|
82
|
-
"
|
|
94
|
+
"@breadstone/archipel-platform-blob-storage": "0.0.23",
|
|
95
|
+
"@breadstone/archipel-platform-configuration": "0.0.23",
|
|
96
|
+
"@breadstone/archipel-platform-core": "0.0.23",
|
|
97
|
+
"@breadstone/archipel-platform-health": "0.0.23",
|
|
98
|
+
"@breadstone/archipel-platform-resources": "0.0.23",
|
|
83
99
|
"tslib": "2.8.1"
|
|
84
100
|
},
|
|
85
101
|
"peerDependencies": {
|
|
86
102
|
"@nestjs/common": ">=11.0.0",
|
|
87
103
|
"@nestjs/terminus": ">=11.0.0",
|
|
88
104
|
"@sendgrid/mail": ">=8.0.0",
|
|
105
|
+
"form-data": ">=4.0.0",
|
|
89
106
|
"mailgun.js": ">=10.0.0",
|
|
107
|
+
"nodemailer": ">=8.0.0",
|
|
90
108
|
"postmark": ">=4.0.0",
|
|
91
109
|
"resend": ">=4.0.0",
|
|
92
110
|
"rxjs": ">=7.0.0"
|
|
@@ -95,9 +113,15 @@
|
|
|
95
113
|
"@sendgrid/mail": {
|
|
96
114
|
"optional": true
|
|
97
115
|
},
|
|
116
|
+
"form-data": {
|
|
117
|
+
"optional": true
|
|
118
|
+
},
|
|
98
119
|
"mailgun.js": {
|
|
99
120
|
"optional": true
|
|
100
121
|
},
|
|
122
|
+
"nodemailer": {
|
|
123
|
+
"optional": true
|
|
124
|
+
},
|
|
101
125
|
"postmark": {
|
|
102
126
|
"optional": true
|
|
103
127
|
},
|
|
@@ -111,6 +135,7 @@
|
|
|
111
135
|
"@sendgrid/mail": "8.1.6",
|
|
112
136
|
"form-data": "4.0.5",
|
|
113
137
|
"mailgun.js": "13.0.0",
|
|
138
|
+
"nodemailer": "8.0.5",
|
|
114
139
|
"postmark": "4.0.7",
|
|
115
140
|
"resend": "6.12.2",
|
|
116
141
|
"rxjs": "7.8.2",
|
package/src/index.d.ts
CHANGED
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
export * from './env';
|
|
2
2
|
export * from './errors/MailDeliveryError';
|
|
3
3
|
export * from './events';
|
|
4
|
-
export * from './MailModule';
|
|
5
4
|
export * from './MailTokens';
|
|
6
5
|
export * from './models/IMailAttachment';
|
|
7
6
|
export * from './services/MailService';
|
|
8
7
|
export * from './services/MailVerificationService';
|
|
9
8
|
export * from './services/strategies/abstracts/DeliveryStrategyBase';
|
|
10
|
-
export * from './services/strategies/LogDeliveryStrategy';
|
|
11
|
-
export * from './services/strategies/SmtpDeliveryStrategy';
|
|
12
9
|
export * from './templating/MailTemplateEngine';
|
|
13
10
|
export * from './templating/strategies/abstracts/TemplateFetchStrategyBase';
|
|
14
|
-
export * from './templating/strategies/BlobTemplateFetchStrategy';
|
|
15
|
-
export * from './templating/strategies/FileTemplateFetchStrategy';
|
|
16
11
|
export * from './terminus/MailHealthIndicator';
|
|
12
|
+
export * from './tokens/MailModule';
|
package/src/index.js
CHANGED
|
@@ -4,17 +4,13 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
tslib_1.__exportStar(require("./env"), exports);
|
|
5
5
|
tslib_1.__exportStar(require("./errors/MailDeliveryError"), exports);
|
|
6
6
|
tslib_1.__exportStar(require("./events"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./MailModule"), exports);
|
|
8
7
|
tslib_1.__exportStar(require("./MailTokens"), exports);
|
|
9
8
|
tslib_1.__exportStar(require("./models/IMailAttachment"), exports);
|
|
10
9
|
tslib_1.__exportStar(require("./services/MailService"), exports);
|
|
11
10
|
tslib_1.__exportStar(require("./services/MailVerificationService"), exports);
|
|
12
11
|
tslib_1.__exportStar(require("./services/strategies/abstracts/DeliveryStrategyBase"), exports);
|
|
13
|
-
tslib_1.__exportStar(require("./services/strategies/LogDeliveryStrategy"), exports);
|
|
14
|
-
tslib_1.__exportStar(require("./services/strategies/SmtpDeliveryStrategy"), exports);
|
|
15
12
|
tslib_1.__exportStar(require("./templating/MailTemplateEngine"), exports);
|
|
16
13
|
tslib_1.__exportStar(require("./templating/strategies/abstracts/TemplateFetchStrategyBase"), exports);
|
|
17
|
-
tslib_1.__exportStar(require("./templating/strategies/BlobTemplateFetchStrategy"), exports);
|
|
18
|
-
tslib_1.__exportStar(require("./templating/strategies/FileTemplateFetchStrategy"), exports);
|
|
19
14
|
tslib_1.__exportStar(require("./terminus/MailHealthIndicator"), exports);
|
|
15
|
+
tslib_1.__exportStar(require("./tokens/MailModule"), exports);
|
|
20
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { LogDeliveryStrategy } from '../services/strategies/LogDeliveryStrategy';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LogDeliveryStrategy = void 0;
|
|
4
|
+
var LogDeliveryStrategy_1 = require("../services/strategies/LogDeliveryStrategy");
|
|
5
|
+
Object.defineProperty(exports, "LogDeliveryStrategy", { enumerable: true, get: function () { return LogDeliveryStrategy_1.LogDeliveryStrategy; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ConfigService } from '@breadstone/archipel-platform-configuration';
|
|
2
2
|
/**
|
|
3
3
|
* Verifies SMTP server connectivity. Does **not** validate individual email
|
|
4
|
-
* addresses
|
|
4
|
+
* addresses - only checks whether the configured SMTP transport is reachable.
|
|
5
5
|
*
|
|
6
6
|
* @public
|
|
7
7
|
* @deprecated Renamed to `SmtpConnectionVerifier` in a future release to better
|
|
@@ -11,7 +11,7 @@ const env_1 = require("../env");
|
|
|
11
11
|
// #endregion
|
|
12
12
|
/**
|
|
13
13
|
* Verifies SMTP server connectivity. Does **not** validate individual email
|
|
14
|
-
* addresses
|
|
14
|
+
* addresses - only checks whether the configured SMTP transport is reachable.
|
|
15
15
|
*
|
|
16
16
|
* @public
|
|
17
17
|
* @deprecated Renamed to `SmtpConnectionVerifier` in a future release to better
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IConfigRegistryEntry } from '@breadstone/archipel-platform-configuration';
|
|
2
|
+
/** SMTP server host. */
|
|
3
|
+
export declare const SMTP_HOST: import("@breadstone/archipel-platform-configuration").IConfigKey<string>;
|
|
4
|
+
/** SMTP server port. */
|
|
5
|
+
export declare const SMTP_PORT: import("@breadstone/archipel-platform-configuration").IConfigKey<number>;
|
|
6
|
+
/** Whether the SMTP connection uses TLS. */
|
|
7
|
+
export declare const SMTP_SECURE: import("@breadstone/archipel-platform-configuration").IConfigKey<boolean>;
|
|
8
|
+
/** SMTP authentication username. */
|
|
9
|
+
export declare const SMTP_USER: import("@breadstone/archipel-platform-configuration").IConfigKey<string>;
|
|
10
|
+
/** SMTP authentication password. */
|
|
11
|
+
export declare const SMTP_PASSWORD: import("@breadstone/archipel-platform-configuration").IConfigKey<string>;
|
|
12
|
+
/** Configuration entries required by the SMTP delivery provider. */
|
|
13
|
+
export declare const SMTP_CONFIG_ENTRIES: ReadonlyArray<Omit<IConfigRegistryEntry, 'module'>>;
|
package/src/smtp/env.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// #region Imports
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.SMTP_CONFIG_ENTRIES = exports.SMTP_PASSWORD = exports.SMTP_USER = exports.SMTP_SECURE = exports.SMTP_PORT = exports.SMTP_HOST = void 0;
|
|
5
|
+
const archipel_platform_configuration_1 = require("@breadstone/archipel-platform-configuration");
|
|
6
|
+
// #endregion
|
|
7
|
+
// ──────────────────────────────────────────────────────────────
|
|
8
|
+
// SMTP
|
|
9
|
+
// ──────────────────────────────────────────────────────────────
|
|
10
|
+
/** SMTP server host. */
|
|
11
|
+
exports.SMTP_HOST = (0, archipel_platform_configuration_1.createConfigKey)('MAIL_SMTP_HOST');
|
|
12
|
+
/** SMTP server port. */
|
|
13
|
+
exports.SMTP_PORT = (0, archipel_platform_configuration_1.createConfigKey)('MAIL_SMTP_PORT');
|
|
14
|
+
/** Whether the SMTP connection uses TLS. */
|
|
15
|
+
exports.SMTP_SECURE = (0, archipel_platform_configuration_1.createConfigKey)('MAIL_SMTP_SECURE');
|
|
16
|
+
/** SMTP authentication username. */
|
|
17
|
+
exports.SMTP_USER = (0, archipel_platform_configuration_1.createConfigKey)('MAIL_SMTP_USER');
|
|
18
|
+
/** SMTP authentication password. */
|
|
19
|
+
exports.SMTP_PASSWORD = (0, archipel_platform_configuration_1.createConfigKey)('MAIL_SMTP_PASSWORD');
|
|
20
|
+
// ──────────────────────────────────────────────────────────────
|
|
21
|
+
// Registry entries
|
|
22
|
+
// ──────────────────────────────────────────────────────────────
|
|
23
|
+
/** Configuration entries required by the SMTP delivery provider. */
|
|
24
|
+
exports.SMTP_CONFIG_ENTRIES = [
|
|
25
|
+
{ key: exports.SMTP_HOST, required: true, defaultValue: 'localhost', description: 'SMTP server host.' },
|
|
26
|
+
{ key: exports.SMTP_PORT, required: true, defaultValue: 587, description: 'SMTP server port.' },
|
|
27
|
+
{ key: exports.SMTP_SECURE, required: false, defaultValue: true, description: 'Whether SMTP uses TLS.' },
|
|
28
|
+
{ key: exports.SMTP_USER, required: false, defaultValue: '', description: 'SMTP authentication username.' },
|
|
29
|
+
{ key: exports.SMTP_PASSWORD, required: false, defaultValue: '', description: 'SMTP authentication password.' },
|
|
30
|
+
];
|
|
31
|
+
//# sourceMappingURL=env.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SMTP_USER = exports.SMTP_SECURE = exports.SMTP_PORT = exports.SMTP_PASSWORD = exports.SMTP_HOST = exports.SMTP_CONFIG_ENTRIES = exports.SmtpDeliveryStrategy = void 0;
|
|
4
|
+
var SmtpDeliveryStrategy_1 = require("../services/strategies/SmtpDeliveryStrategy");
|
|
5
|
+
Object.defineProperty(exports, "SmtpDeliveryStrategy", { enumerable: true, get: function () { return SmtpDeliveryStrategy_1.SmtpDeliveryStrategy; } });
|
|
6
|
+
var env_1 = require("./env");
|
|
7
|
+
Object.defineProperty(exports, "SMTP_CONFIG_ENTRIES", { enumerable: true, get: function () { return env_1.SMTP_CONFIG_ENTRIES; } });
|
|
8
|
+
Object.defineProperty(exports, "SMTP_HOST", { enumerable: true, get: function () { return env_1.SMTP_HOST; } });
|
|
9
|
+
Object.defineProperty(exports, "SMTP_PASSWORD", { enumerable: true, get: function () { return env_1.SMTP_PASSWORD; } });
|
|
10
|
+
Object.defineProperty(exports, "SMTP_PORT", { enumerable: true, get: function () { return env_1.SMTP_PORT; } });
|
|
11
|
+
Object.defineProperty(exports, "SMTP_SECURE", { enumerable: true, get: function () { return env_1.SMTP_SECURE; } });
|
|
12
|
+
Object.defineProperty(exports, "SMTP_USER", { enumerable: true, get: function () { return env_1.SMTP_USER; } });
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ResourceManager } from '@breadstone/archipel-platform-
|
|
1
|
+
import { ResourceManager } from '@breadstone/archipel-platform-resources';
|
|
2
2
|
import { TemplateFetchStrategyBase } from './abstracts/TemplateFetchStrategyBase';
|
|
3
3
|
import { IMailTemplateVariants } from '../../MailTokens';
|
|
4
4
|
/**
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
5
5
|
exports.FileTemplateFetchStrategy = void 0;
|
|
6
6
|
const tslib_1 = require("tslib");
|
|
7
7
|
const common_1 = require("@nestjs/common");
|
|
8
|
-
const
|
|
8
|
+
const archipel_platform_resources_1 = require("@breadstone/archipel-platform-resources");
|
|
9
9
|
const TemplateFetchStrategyBase_1 = require("./abstracts/TemplateFetchStrategyBase");
|
|
10
10
|
// #endregion
|
|
11
11
|
/**
|
|
@@ -66,6 +66,6 @@ let FileTemplateFetchStrategy = FileTemplateFetchStrategy_1 = class FileTemplate
|
|
|
66
66
|
exports.FileTemplateFetchStrategy = FileTemplateFetchStrategy;
|
|
67
67
|
exports.FileTemplateFetchStrategy = FileTemplateFetchStrategy = FileTemplateFetchStrategy_1 = tslib_1.__decorate([
|
|
68
68
|
(0, common_1.Injectable)(),
|
|
69
|
-
tslib_1.__metadata("design:paramtypes", [
|
|
69
|
+
tslib_1.__metadata("design:paramtypes", [archipel_platform_resources_1.ResourceManager])
|
|
70
70
|
], FileTemplateFetchStrategy);
|
|
71
71
|
//# sourceMappingURL=FileTemplateFetchStrategy.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ConfigService } from '@breadstone/archipel-platform-configuration';
|
|
2
|
-
import { IHealthIndicator } from '@breadstone/archipel-platform-
|
|
2
|
+
import { IHealthIndicator } from '@breadstone/archipel-platform-health';
|
|
3
3
|
import { HealthIndicatorResult } from '@nestjs/terminus';
|
|
4
4
|
/**
|
|
5
5
|
* Health indicator for mail service.
|
|
@@ -6,16 +6,16 @@ const tslib_1 = require("tslib");
|
|
|
6
6
|
const archipel_platform_blob_storage_1 = require("@breadstone/archipel-platform-blob-storage");
|
|
7
7
|
const archipel_platform_configuration_1 = require("@breadstone/archipel-platform-configuration");
|
|
8
8
|
const archipel_platform_core_1 = require("@breadstone/archipel-platform-core");
|
|
9
|
+
const archipel_platform_health_1 = require("@breadstone/archipel-platform-health");
|
|
10
|
+
const archipel_platform_resources_1 = require("@breadstone/archipel-platform-resources");
|
|
9
11
|
const common_1 = require("@nestjs/common");
|
|
10
|
-
const env_1 = require("
|
|
11
|
-
const MailEventSubscriber_1 = require("
|
|
12
|
-
const MailTokens_1 = require("
|
|
13
|
-
const MailService_1 = require("
|
|
14
|
-
const MailVerificationService_1 = require("
|
|
15
|
-
const MailTemplateEngine_1 = require("
|
|
16
|
-
const
|
|
17
|
-
const FileTemplateFetchStrategy_1 = require("./templating/strategies/FileTemplateFetchStrategy");
|
|
18
|
-
const MailHealthIndicator_1 = require("./terminus/MailHealthIndicator");
|
|
12
|
+
const env_1 = require("../env");
|
|
13
|
+
const MailEventSubscriber_1 = require("../events/listeners/MailEventSubscriber");
|
|
14
|
+
const MailTokens_1 = require("../MailTokens");
|
|
15
|
+
const MailService_1 = require("../services/MailService");
|
|
16
|
+
const MailVerificationService_1 = require("../services/MailVerificationService");
|
|
17
|
+
const MailTemplateEngine_1 = require("../templating/MailTemplateEngine");
|
|
18
|
+
const MailHealthIndicator_1 = require("../terminus/MailHealthIndicator");
|
|
19
19
|
// #endregion
|
|
20
20
|
/**
|
|
21
21
|
* Represents the mail module.
|
|
@@ -32,49 +32,51 @@ exports.MailModule = MailModule = tslib_1.__decorate([
|
|
|
32
32
|
archipel_platform_configuration_1.ConfigModule.register('platform-mailing', env_1.PLATFORM_MAILING_CONFIG_ENTRIES),
|
|
33
33
|
archipel_platform_blob_storage_1.BlobModule,
|
|
34
34
|
archipel_platform_core_1.EventModule,
|
|
35
|
-
|
|
35
|
+
archipel_platform_health_1.HealthModule,
|
|
36
36
|
],
|
|
37
37
|
providers: [
|
|
38
38
|
{
|
|
39
39
|
provide: MailTokens_1.MAIL_TEMPLATE_FETCH_STRATEGY_TOKEN,
|
|
40
|
-
useFactory: (configService, blobService, resourceManager) => {
|
|
40
|
+
useFactory: async (configService, blobService, resourceManager) => {
|
|
41
41
|
const templateStrategy = configService.get(env_1.MAIL_TEMPLATE_STRATEGY.key);
|
|
42
42
|
if (templateStrategy === 'file') {
|
|
43
|
-
|
|
43
|
+
const { FileTemplateFetchStrategy } = await Promise.resolve().then(() => tslib_1.__importStar(require('../templating/strategies/FileTemplateFetchStrategy')));
|
|
44
|
+
return new FileTemplateFetchStrategy(resourceManager);
|
|
44
45
|
}
|
|
45
46
|
if (templateStrategy === 'blob') {
|
|
46
|
-
|
|
47
|
+
const { BlobTemplateFetchStrategy } = await Promise.resolve().then(() => tslib_1.__importStar(require('../templating/strategies/BlobTemplateFetchStrategy')));
|
|
48
|
+
return new BlobTemplateFetchStrategy(blobService);
|
|
47
49
|
}
|
|
48
50
|
throw new Error(`Unknown template strategy: ${templateStrategy}`);
|
|
49
51
|
},
|
|
50
|
-
inject: [archipel_platform_configuration_1.ConfigService, archipel_platform_blob_storage_1.BlobService,
|
|
52
|
+
inject: [archipel_platform_configuration_1.ConfigService, archipel_platform_blob_storage_1.BlobService, archipel_platform_resources_1.ResourceManager],
|
|
51
53
|
},
|
|
52
54
|
{
|
|
53
55
|
provide: MailTokens_1.MAIL_DELIVERY_STRATEGY_TOKEN,
|
|
54
56
|
useFactory: async (configService) => {
|
|
55
57
|
const deliveryStrategy = configService.get(env_1.MAIL_DELIVERY_STRATEGY.key);
|
|
56
58
|
if (deliveryStrategy === 'log') {
|
|
57
|
-
const { LogDeliveryStrategy } = await Promise.resolve().then(() => tslib_1.__importStar(require('
|
|
59
|
+
const { LogDeliveryStrategy } = await Promise.resolve().then(() => tslib_1.__importStar(require('../services/strategies/LogDeliveryStrategy')));
|
|
58
60
|
return new LogDeliveryStrategy();
|
|
59
61
|
}
|
|
60
62
|
if (deliveryStrategy === 'smtp') {
|
|
61
|
-
const { SmtpDeliveryStrategy } = await Promise.resolve().then(() => tslib_1.__importStar(require('
|
|
63
|
+
const { SmtpDeliveryStrategy } = await Promise.resolve().then(() => tslib_1.__importStar(require('../services/strategies/SmtpDeliveryStrategy')));
|
|
62
64
|
return new SmtpDeliveryStrategy(configService);
|
|
63
65
|
}
|
|
64
66
|
if (deliveryStrategy === 'postmark') {
|
|
65
|
-
const { PostmarkDeliveryStrategy } = await Promise.resolve().then(() => tslib_1.__importStar(require('
|
|
67
|
+
const { PostmarkDeliveryStrategy } = await Promise.resolve().then(() => tslib_1.__importStar(require('../services/strategies/PostmarkDeliveryStrategy')));
|
|
66
68
|
return new PostmarkDeliveryStrategy(configService);
|
|
67
69
|
}
|
|
68
70
|
if (deliveryStrategy === 'resend') {
|
|
69
|
-
const { ResendDeliveryStrategy } = await Promise.resolve().then(() => tslib_1.__importStar(require('
|
|
71
|
+
const { ResendDeliveryStrategy } = await Promise.resolve().then(() => tslib_1.__importStar(require('../services/strategies/ResendDeliveryStrategy')));
|
|
70
72
|
return new ResendDeliveryStrategy(configService);
|
|
71
73
|
}
|
|
72
74
|
if (deliveryStrategy === 'sendgrid') {
|
|
73
|
-
const { SendGridDeliveryStrategy } = await Promise.resolve().then(() => tslib_1.__importStar(require('
|
|
75
|
+
const { SendGridDeliveryStrategy } = await Promise.resolve().then(() => tslib_1.__importStar(require('../services/strategies/SendGridDeliveryStrategy')));
|
|
74
76
|
return new SendGridDeliveryStrategy(configService);
|
|
75
77
|
}
|
|
76
78
|
if (deliveryStrategy === 'mailgun') {
|
|
77
|
-
const { MailgunDeliveryStrategy } = await Promise.resolve().then(() => tslib_1.__importStar(require('
|
|
79
|
+
const { MailgunDeliveryStrategy } = await Promise.resolve().then(() => tslib_1.__importStar(require('../services/strategies/MailgunDeliveryStrategy')));
|
|
78
80
|
return new MailgunDeliveryStrategy(configService);
|
|
79
81
|
}
|
|
80
82
|
throw new Error(`Unknown delivery strategy: ${deliveryStrategy}`);
|
|
@@ -93,7 +95,7 @@ exports.MailModule = MailModule = tslib_1.__decorate([
|
|
|
93
95
|
orchestrator.registerIndicator(indicator);
|
|
94
96
|
return true;
|
|
95
97
|
},
|
|
96
|
-
inject: [
|
|
98
|
+
inject: [archipel_platform_health_1.HealthOrchestrator, MailHealthIndicator_1.MailHealthIndicator],
|
|
97
99
|
},
|
|
98
100
|
],
|
|
99
101
|
exports: [MailService_1.MailService, MailVerificationService_1.MailVerificationService, MailHealthIndicator_1.MailHealthIndicator],
|
|
File without changes
|