@webiny/api-mailer 0.0.0-unstable.e6f0dc8ca7 → 0.0.0-unstable.eb81deee7e
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/MailerFeature.d.ts +4 -0
- package/MailerFeature.js +25 -0
- package/MailerFeature.js.map +1 -0
- package/constants.js +2 -1
- package/constants.js.map +1 -1
- package/domain/CodeMailerSettings/abstractions.js +2 -1
- package/domain/CodeMailerSettings/abstractions.js.map +1 -1
- package/domain/MailTransport/abstractions.d.ts +1 -7
- package/domain/MailTransport/abstractions.js +3 -3
- package/domain/MailTransport/abstractions.js.map +1 -1
- package/domain/MailerService/abstractions.d.ts +2 -2
- package/domain/MailerService/abstractions.js +2 -1
- package/domain/MailerService/abstractions.js.map +1 -1
- package/domain/MailerService/errors.d.ts +4 -0
- package/domain/MailerService/errors.js +29 -24
- package/domain/MailerService/errors.js.map +1 -1
- package/domain/errors.js +40 -44
- package/domain/errors.js.map +1 -1
- package/exports/api/mailer.js +3 -5
- package/features/CodeMailerSettings/CodeMailerSettings.js +23 -0
- package/features/CodeMailerSettings/CodeMailerSettings.js.map +1 -0
- package/features/CodeMailerSettings/feature.js +7 -6
- package/features/CodeMailerSettings/feature.js.map +1 -1
- package/features/DummyTransport/DummyMailTransport.js +11 -9
- package/features/DummyTransport/DummyMailTransport.js.map +1 -1
- package/features/DummyTransport/DummyMailTransportFactory.d.ts +1 -0
- package/features/DummyTransport/DummyMailTransportFactory.js +13 -7
- package/features/DummyTransport/DummyMailTransportFactory.js.map +1 -1
- package/features/DummyTransport/feature.js +6 -5
- package/features/DummyTransport/feature.js.map +1 -1
- package/features/GetSettings/GetSettingsRepository.js +43 -45
- package/features/GetSettings/GetSettingsRepository.js.map +1 -1
- package/features/GetSettings/GetSettingsUseCase.js +13 -10
- package/features/GetSettings/GetSettingsUseCase.js.map +1 -1
- package/features/GetSettings/abstractions.js +3 -2
- package/features/GetSettings/abstractions.js.map +1 -1
- package/features/GetSettings/feature.js +7 -6
- package/features/GetSettings/feature.js.map +1 -1
- package/features/GetSettings/index.js +1 -3
- package/features/MailerService/MailerService.d.ts +3 -4
- package/features/MailerService/MailerService.js +49 -43
- package/features/MailerService/MailerService.js.map +1 -1
- package/features/MailerService/feature.js +6 -7
- package/features/MailerService/feature.js.map +1 -1
- package/features/SaveSettings/SaveSettingsRepository.js +32 -46
- package/features/SaveSettings/SaveSettingsRepository.js.map +1 -1
- package/features/SaveSettings/SaveSettingsUseCase.d.ts +4 -4
- package/features/SaveSettings/SaveSettingsUseCase.js +44 -57
- package/features/SaveSettings/SaveSettingsUseCase.js.map +1 -1
- package/features/SaveSettings/abstractions.d.ts +1 -0
- package/features/SaveSettings/abstractions.js +5 -17
- package/features/SaveSettings/abstractions.js.map +1 -1
- package/features/SaveSettings/events.js +16 -11
- package/features/SaveSettings/events.js.map +1 -1
- package/features/SaveSettings/feature.js +7 -6
- package/features/SaveSettings/feature.js.map +1 -1
- package/features/SaveSettings/index.js +1 -3
- package/features/SaveSettings/validation.d.ts +2 -1
- package/features/SaveSettings/validation.js +12 -14
- package/features/SaveSettings/validation.js.map +1 -1
- package/features/SendMail/SendMailUseCase.d.ts +1 -1
- package/features/SendMail/SendMailUseCase.js +40 -47
- package/features/SendMail/SendMailUseCase.js.map +1 -1
- package/features/SendMail/abstractions.js +5 -8
- package/features/SendMail/abstractions.js.map +1 -1
- package/features/SendMail/events.js +23 -16
- package/features/SendMail/events.js.map +1 -1
- package/features/SendMail/feature.js +6 -5
- package/features/SendMail/feature.js.map +1 -1
- package/features/SendMail/index.js +1 -3
- package/features/SmtpTransport/SmtpConfig.js +21 -24
- package/features/SmtpTransport/SmtpConfig.js.map +1 -1
- package/features/SmtpTransport/SmtpMailTransport.d.ts +9 -9
- package/features/SmtpTransport/SmtpMailTransport.js +47 -61
- package/features/SmtpTransport/SmtpMailTransport.js.map +1 -1
- package/features/SmtpTransport/SmtpMailTransportFactory.d.ts +1 -0
- package/features/SmtpTransport/SmtpMailTransportFactory.js +13 -7
- package/features/SmtpTransport/SmtpMailTransportFactory.js.map +1 -1
- package/features/SmtpTransport/feature.js +6 -5
- package/features/SmtpTransport/feature.js.map +1 -1
- package/graphql/MailerSchemaFactory.d.ts +10 -0
- package/graphql/MailerSchemaFactory.js +120 -0
- package/graphql/MailerSchemaFactory.js.map +1 -0
- package/index.d.ts +1 -2
- package/index.js +1 -26
- package/package.json +21 -22
- package/types.d.ts +1 -0
- package/types.js +0 -3
- package/utils/isMailboxAddress.js +3 -10
- package/utils/isMailboxAddress.js.map +1 -1
- package/exports/api/mailer.js.map +0 -1
- package/features/CodeMailerSettings/CodeMailerSettingsImpl.js +0 -22
- package/features/CodeMailerSettings/CodeMailerSettingsImpl.js.map +0 -1
- package/features/GetSettings/index.js.map +0 -1
- package/features/MailerService/ActiveTransport.d.ts +0 -10
- package/features/MailerService/ActiveTransport.js +0 -20
- package/features/MailerService/ActiveTransport.js.map +0 -1
- package/features/SaveSettings/index.js.map +0 -1
- package/features/SendMail/index.js.map +0 -1
- package/graphql/settings.d.ts +0 -3
- package/graphql/settings.js +0 -127
- package/graphql/settings.js.map +0 -1
- package/index.js.map +0 -1
- package/types.js.map +0 -1
- /package/features/CodeMailerSettings/{CodeMailerSettingsImpl.d.ts → CodeMailerSettings.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"features/GetSettings/GetSettingsRepository.js","sources":["../../../src/features/GetSettings/GetSettingsRepository.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport { Encryption } from \"@webiny/api-core/features/encryption/index.js\";\nimport { KeyValueStore } from \"@webiny/api-core/features/keyValueStore/index.js\";\nimport { GetSettingsRepository, type ISettingsWithSource } from \"./abstractions.js\";\nimport { CodeMailerSettings } from \"~/domain/CodeMailerSettings/abstractions.js\";\nimport type { TransportSettings } from \"~/types.js\";\nimport { MAILER_TRANSPORT_SETTINGS } from \"~/constants.js\";\n\nclass GetSettingsRepositoryImpl implements GetSettingsRepository.Interface {\n constructor(\n private keyValueStore: KeyValueStore.Interface,\n private encryption: Encryption.Interface,\n private codeSettings: CodeMailerSettings.Interface\n ) {}\n\n async get(transportName: string): Promise<Result<ISettingsWithSource>> {\n // Code-defined settings win over the KV store.\n const codeSettingsValue = this.codeSettings.get(transportName);\n if (codeSettingsValue !== null) {\n return Result.ok({\n settings: codeSettingsValue,\n source: \"code\"\n });\n }\n\n const result = await this.keyValueStore.get<TransportSettings>(MAILER_TRANSPORT_SETTINGS);\n\n if (result.isFail()) {\n return Result.ok({ settings: null, source: null });\n }\n\n const settings = result.value;\n if (!settings) {\n return Result.ok({ settings: null, source: null });\n }\n\n // Decrypt password if present.\n const password = settings.password\n ? await this.encryption.decrypt(String(settings.password))\n : \"\";\n\n const port = Number(settings.port || 587);\n\n const transportSettings: TransportSettings = {\n host: String(settings.host || \"\"),\n port,\n secure: settings.secure ?? port === 465,\n user: String(settings.user || \"\"),\n password,\n from: String(settings.from || \"\"),\n replyTo: settings.replyTo ? String(settings.replyTo) : undefined\n };\n\n return Result.ok({ settings: transportSettings, source: \"storage\" });\n }\n}\n\nexport const GetSettingsRepositoryImplementation = GetSettingsRepository.createImplementation({\n implementation: GetSettingsRepositoryImpl,\n dependencies: [KeyValueStore, Encryption, CodeMailerSettings]\n});\n"],"names":["GetSettingsRepositoryImpl","keyValueStore","encryption","codeSettings","transportName","codeSettingsValue","Result","result","MAILER_TRANSPORT_SETTINGS","settings","password","String","port","Number","transportSettings","undefined","GetSettingsRepositoryImplementation","GetSettingsRepository","KeyValueStore","Encryption","CodeMailerSettings"],"mappings":";;;;;;AAQA,MAAMA;IACF,YACYC,aAAsC,EACtCC,UAAgC,EAChCC,YAA0C,CACpD;aAHUF,aAAa,GAAbA;aACAC,UAAU,GAAVA;aACAC,YAAY,GAAZA;IACT;IAEH,MAAM,IAAIC,aAAqB,EAAwC;QAEnE,MAAMC,oBAAoB,IAAI,CAAC,YAAY,CAAC,GAAG,CAACD;QAChD,IAAIC,AAAsB,SAAtBA,mBACA,OAAOC,OAAO,EAAE,CAAC;YACb,UAAUD;YACV,QAAQ;QACZ;QAGJ,MAAME,SAAS,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,CAAoBC;QAE/D,IAAID,OAAO,MAAM,IACb,OAAOD,OAAO,EAAE,CAAC;YAAE,UAAU;YAAM,QAAQ;QAAK;QAGpD,MAAMG,WAAWF,OAAO,KAAK;QAC7B,IAAI,CAACE,UACD,OAAOH,OAAO,EAAE,CAAC;YAAE,UAAU;YAAM,QAAQ;QAAK;QAIpD,MAAMI,WAAWD,SAAS,QAAQ,GAC5B,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAACE,OAAOF,SAAS,QAAQ,KACtD;QAEN,MAAMG,OAAOC,OAAOJ,SAAS,IAAI,IAAI;QAErC,MAAMK,oBAAuC;YACzC,MAAMH,OAAOF,SAAS,IAAI,IAAI;YAC9BG;YACA,QAAQH,SAAS,MAAM,IAAIG,AAAS,QAATA;YAC3B,MAAMD,OAAOF,SAAS,IAAI,IAAI;YAC9BC;YACA,MAAMC,OAAOF,SAAS,IAAI,IAAI;YAC9B,SAASA,SAAS,OAAO,GAAGE,OAAOF,SAAS,OAAO,IAAIM;QAC3D;QAEA,OAAOT,OAAO,EAAE,CAAC;YAAE,UAAUQ;YAAmB,QAAQ;QAAU;IACtE;AACJ;AAEO,MAAME,sCAAsCC,sBAAsB,oBAAoB,CAAC;IAC1F,gBAAgBjB;IAChB,cAAc;QAACkB;QAAeC;QAAYC;KAAmB;AACjE"}
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GetSettingsRepository, GetSettingsUseCase } from "./abstractions.js";
|
|
2
2
|
class GetSettingsUseCaseImpl {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
constructor(repository){
|
|
4
|
+
this.repository = repository;
|
|
5
|
+
}
|
|
6
|
+
execute(transportName) {
|
|
7
|
+
return this.repository.get(transportName);
|
|
8
|
+
}
|
|
9
9
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
const GetSettingsUseCaseImplementation = GetSettingsUseCase.createImplementation({
|
|
11
|
+
implementation: GetSettingsUseCaseImpl,
|
|
12
|
+
dependencies: [
|
|
13
|
+
GetSettingsRepository
|
|
14
|
+
]
|
|
13
15
|
});
|
|
16
|
+
export { GetSettingsUseCaseImplementation };
|
|
14
17
|
|
|
15
18
|
//# sourceMappingURL=GetSettingsUseCase.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"features/GetSettings/GetSettingsUseCase.js","sources":["../../../src/features/GetSettings/GetSettingsUseCase.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport {\n GetSettingsUseCase,\n GetSettingsRepository,\n type ISettingsWithSource\n} from \"./abstractions.js\";\n\nclass GetSettingsUseCaseImpl implements GetSettingsUseCase.Interface {\n constructor(private repository: GetSettingsRepository.Interface) {}\n\n execute(transportName: string): Promise<Result<ISettingsWithSource>> {\n return this.repository.get(transportName);\n }\n}\n\nexport const GetSettingsUseCaseImplementation = GetSettingsUseCase.createImplementation({\n implementation: GetSettingsUseCaseImpl,\n dependencies: [GetSettingsRepository]\n});\n"],"names":["GetSettingsUseCaseImpl","repository","transportName","GetSettingsUseCaseImplementation","GetSettingsUseCase","GetSettingsRepository"],"mappings":";AAOA,MAAMA;IACF,YAAoBC,UAA2C,CAAE;aAA7CA,UAAU,GAAVA;IAA8C;IAElE,QAAQC,aAAqB,EAAwC;QACjE,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAACA;IAC/B;AACJ;AAEO,MAAMC,mCAAmCC,mBAAmB,oBAAoB,CAAC;IACpF,gBAAgBJ;IAChB,cAAc;QAACK;KAAsB;AACzC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createAbstraction } from "@webiny/feature/api";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
const GetSettingsRepository = createAbstraction("GetSettingsRepository");
|
|
3
|
+
const GetSettingsUseCase = createAbstraction("GetSettingsUseCase");
|
|
4
|
+
export { GetSettingsRepository, GetSettingsUseCase };
|
|
4
5
|
|
|
5
6
|
//# sourceMappingURL=abstractions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"features/GetSettings/abstractions.js","sources":["../../../src/features/GetSettings/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport { Result } from \"@webiny/feature/api\";\nimport type { TransportSettings } from \"~/types.js\";\n\nexport type MailerSettingsSource = \"code\" | \"storage\" | null;\n\nexport interface ISettingsWithSource {\n settings: TransportSettings | null;\n source: MailerSettingsSource;\n}\n\nexport interface IGetSettingsRepository {\n get(transportName: string): Promise<Result<ISettingsWithSource>>;\n}\n\nexport const GetSettingsRepository =\n createAbstraction<IGetSettingsRepository>(\"GetSettingsRepository\");\n\nexport namespace GetSettingsRepository {\n export type Interface = IGetSettingsRepository;\n export type Return = Promise<Result<ISettingsWithSource>>;\n}\n\nexport interface IGetSettingsUseCase {\n execute(transportName: string): Promise<Result<ISettingsWithSource>>;\n}\n\nexport const GetSettingsUseCase = createAbstraction<IGetSettingsUseCase>(\"GetSettingsUseCase\");\n\nexport namespace GetSettingsUseCase {\n export type Interface = IGetSettingsUseCase;\n}\n"],"names":["GetSettingsRepository","createAbstraction","GetSettingsUseCase"],"mappings":";AAeO,MAAMA,wBACTC,kBAA0C;AAWvC,MAAMC,qBAAqBD,kBAAuC"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { createFeature } from "@webiny/feature/api";
|
|
2
2
|
import { GetSettingsRepositoryImplementation } from "./GetSettingsRepository.js";
|
|
3
3
|
import { GetSettingsUseCaseImplementation } from "./GetSettingsUseCase.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
const GetSettingsFeature = createFeature({
|
|
5
|
+
name: "GetSettings",
|
|
6
|
+
register (container) {
|
|
7
|
+
container.register(GetSettingsRepositoryImplementation).inSingletonScope();
|
|
8
|
+
container.register(GetSettingsUseCaseImplementation);
|
|
9
|
+
}
|
|
10
10
|
});
|
|
11
|
+
export { GetSettingsFeature };
|
|
11
12
|
|
|
12
13
|
//# sourceMappingURL=feature.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"features/GetSettings/feature.js","sources":["../../../src/features/GetSettings/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { GetSettingsRepositoryImplementation } from \"./GetSettingsRepository.js\";\nimport { GetSettingsUseCaseImplementation } from \"./GetSettingsUseCase.js\";\n\nexport const GetSettingsFeature = createFeature({\n name: \"GetSettings\",\n register(container) {\n container.register(GetSettingsRepositoryImplementation).inSingletonScope();\n container.register(GetSettingsUseCaseImplementation);\n }\n});\n"],"names":["GetSettingsFeature","createFeature","container","GetSettingsRepositoryImplementation","GetSettingsUseCaseImplementation"],"mappings":";;;AAIO,MAAMA,qBAAqBC,cAAc;IAC5C,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC,qCAAqC,gBAAgB;QACxED,UAAU,QAAQ,CAACE;IACvB;AACJ"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { MailerService as Abstraction } from "../../domain/MailerService/abstractions.js";
|
|
2
|
-
import {
|
|
2
|
+
import { MailTransportFactory } from "../../domain/MailTransport/abstractions.js";
|
|
3
3
|
import { GetSettingsRepository } from "../GetSettings/abstractions.js";
|
|
4
4
|
import type { TransportSendData } from "../../types.js";
|
|
5
5
|
declare class MailerServiceImpl implements Abstraction.Interface {
|
|
6
6
|
private getSettingsRepository;
|
|
7
|
-
private activeTransport;
|
|
8
7
|
private transportFactories;
|
|
9
|
-
constructor(getSettingsRepository: GetSettingsRepository.Interface,
|
|
8
|
+
constructor(getSettingsRepository: GetSettingsRepository.Interface, transportFactories: MailTransportFactory.Interface[]);
|
|
10
9
|
sendMail<T = any>(data: TransportSendData): Abstraction.Return<T>;
|
|
11
|
-
private
|
|
10
|
+
private resolveTransport;
|
|
12
11
|
}
|
|
13
12
|
export declare const MailerService: typeof MailerServiceImpl & {
|
|
14
13
|
__abstraction: import("@webiny/di").Abstraction<import("~/domain/MailerService/abstractions.js").IMailerService>;
|
|
@@ -1,53 +1,59 @@
|
|
|
1
1
|
import { Result } from "@webiny/feature/api";
|
|
2
|
-
import { MailerService
|
|
3
|
-
import { NoTransportAvailableError,
|
|
4
|
-
import {
|
|
2
|
+
import { MailerService } from "../../domain/MailerService/abstractions.js";
|
|
3
|
+
import { NoTransportAvailableError, TransportCreateError, TransportSendError } from "../../domain/MailerService/errors.js";
|
|
4
|
+
import { MailTransportFactory } from "../../domain/MailTransport/abstractions.js";
|
|
5
5
|
import { GetSettingsRepository } from "../GetSettings/abstractions.js";
|
|
6
6
|
class MailerServiceImpl {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
this.transportFactories = transportFactories;
|
|
11
|
-
}
|
|
12
|
-
async sendMail(data) {
|
|
13
|
-
const transportName = this.activeTransport.name();
|
|
14
|
-
if (!transportName) {
|
|
15
|
-
return Result.fail(new NoTransportAvailableError());
|
|
7
|
+
constructor(getSettingsRepository, transportFactories){
|
|
8
|
+
this.getSettingsRepository = getSettingsRepository;
|
|
9
|
+
this.transportFactories = transportFactories;
|
|
16
10
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
11
|
+
async sendMail(data) {
|
|
12
|
+
const { factory, transport } = await this.resolveTransport();
|
|
13
|
+
if (!factory || !transport) return Result.fail(new NoTransportAvailableError());
|
|
14
|
+
try {
|
|
15
|
+
const response = await transport.send(data);
|
|
16
|
+
if (response.error) return Result.fail(new TransportSendError(response.error));
|
|
17
|
+
return Result.ok(response);
|
|
18
|
+
} catch (error) {
|
|
19
|
+
return Result.fail(new TransportSendError(error));
|
|
20
|
+
}
|
|
23
21
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
async resolveTransport() {
|
|
23
|
+
const factories = [
|
|
24
|
+
...this.transportFactories
|
|
25
|
+
].reverse();
|
|
26
|
+
for (const factory of factories){
|
|
27
|
+
const result = await this.getSettingsRepository.get(factory.name);
|
|
28
|
+
const { settings } = result.value;
|
|
29
|
+
if (factory.canUse(settings)) try {
|
|
30
|
+
const transport = await factory.createTransport(settings);
|
|
31
|
+
return {
|
|
32
|
+
factory,
|
|
33
|
+
transport
|
|
34
|
+
};
|
|
35
|
+
} catch (error) {
|
|
36
|
+
throw new TransportCreateError(error);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
factory: null,
|
|
41
|
+
transport: null
|
|
42
|
+
};
|
|
27
43
|
}
|
|
28
|
-
try {
|
|
29
|
-
const response = await transport.send(data);
|
|
30
|
-
if (response.error) {
|
|
31
|
-
return Result.fail(new TransportSendError(response.error));
|
|
32
|
-
}
|
|
33
|
-
return Result.ok(response);
|
|
34
|
-
} catch (error) {
|
|
35
|
-
return Result.fail(new TransportSendError(error));
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
async getTransport(transportName, settings) {
|
|
39
|
-
const factory = this.transportFactories.find(f => f.name === transportName);
|
|
40
|
-
if (!factory) {
|
|
41
|
-
return null;
|
|
42
|
-
}
|
|
43
|
-
return factory.createTransport(settings);
|
|
44
|
-
}
|
|
45
44
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
const MailerService_MailerService = MailerService.createImplementation({
|
|
46
|
+
implementation: MailerServiceImpl,
|
|
47
|
+
dependencies: [
|
|
48
|
+
GetSettingsRepository,
|
|
49
|
+
[
|
|
50
|
+
MailTransportFactory,
|
|
51
|
+
{
|
|
52
|
+
multiple: true
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
]
|
|
51
56
|
});
|
|
57
|
+
export { MailerService_MailerService as MailerService };
|
|
52
58
|
|
|
53
59
|
//# sourceMappingURL=MailerService.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"features/MailerService/MailerService.js","sources":["../../../src/features/MailerService/MailerService.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport { MailerService as Abstraction } from \"~/domain/MailerService/abstractions.js\";\nimport {\n NoTransportAvailableError,\n TransportCreateError,\n TransportSendError\n} from \"~/domain/MailerService/errors.js\";\nimport { MailTransport, MailTransportFactory } from \"~/domain/MailTransport/abstractions.js\";\nimport { GetSettingsRepository } from \"../GetSettings/abstractions.js\";\nimport type { TransportSendData } from \"~/types.js\";\n\nclass MailerServiceImpl implements Abstraction.Interface {\n constructor(\n private getSettingsRepository: GetSettingsRepository.Interface,\n private transportFactories: MailTransportFactory.Interface[]\n ) {}\n\n async sendMail<T = any>(data: TransportSendData): Abstraction.Return<T> {\n const { factory, transport } = await this.resolveTransport();\n\n if (!factory || !transport) {\n return Result.fail(new NoTransportAvailableError());\n }\n\n try {\n const response = await transport.send(data);\n\n if (response.error) {\n return Result.fail(new TransportSendError(response.error));\n }\n\n return Result.ok(response);\n } catch (error) {\n return Result.fail(new TransportSendError(error));\n }\n }\n\n private async resolveTransport(): Promise<{\n factory: MailTransportFactory.Interface | null;\n transport: MailTransport.Interface | null;\n }> {\n const factories = [...this.transportFactories].reverse();\n\n for (const factory of factories) {\n const result = await this.getSettingsRepository.get(factory.name);\n const { settings } = result.value;\n\n if (!factory.canUse(settings)) {\n continue;\n }\n\n try {\n const transport = await factory.createTransport(settings!);\n return { factory, transport };\n } catch (error) {\n throw new TransportCreateError(error);\n }\n }\n\n return { factory: null, transport: null };\n }\n}\n\nexport const MailerService = Abstraction.createImplementation({\n implementation: MailerServiceImpl,\n dependencies: [GetSettingsRepository, [MailTransportFactory, { multiple: true }]]\n});\n"],"names":["MailerServiceImpl","getSettingsRepository","transportFactories","data","factory","transport","Result","NoTransportAvailableError","response","TransportSendError","error","factories","result","settings","TransportCreateError","MailerService","Abstraction","GetSettingsRepository","MailTransportFactory"],"mappings":";;;;;AAWA,MAAMA;IACF,YACYC,qBAAsD,EACtDC,kBAAoD,CAC9D;aAFUD,qBAAqB,GAArBA;aACAC,kBAAkB,GAAlBA;IACT;IAEH,MAAM,SAAkBC,IAAuB,EAAyB;QACpE,MAAM,EAAEC,OAAO,EAAEC,SAAS,EAAE,GAAG,MAAM,IAAI,CAAC,gBAAgB;QAE1D,IAAI,CAACD,WAAW,CAACC,WACb,OAAOC,OAAO,IAAI,CAAC,IAAIC;QAG3B,IAAI;YACA,MAAMC,WAAW,MAAMH,UAAU,IAAI,CAACF;YAEtC,IAAIK,SAAS,KAAK,EACd,OAAOF,OAAO,IAAI,CAAC,IAAIG,mBAAmBD,SAAS,KAAK;YAG5D,OAAOF,OAAO,EAAE,CAACE;QACrB,EAAE,OAAOE,OAAO;YACZ,OAAOJ,OAAO,IAAI,CAAC,IAAIG,mBAAmBC;QAC9C;IACJ;IAEA,MAAc,mBAGX;QACC,MAAMC,YAAY;eAAI,IAAI,CAAC,kBAAkB;SAAC,CAAC,OAAO;QAEtD,KAAK,MAAMP,WAAWO,UAAW;YAC7B,MAAMC,SAAS,MAAM,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAACR,QAAQ,IAAI;YAChE,MAAM,EAAES,QAAQ,EAAE,GAAGD,OAAO,KAAK;YAEjC,IAAKR,QAAQ,MAAM,CAACS,WAIpB,IAAI;gBACA,MAAMR,YAAY,MAAMD,QAAQ,eAAe,CAACS;gBAChD,OAAO;oBAAET;oBAASC;gBAAU;YAChC,EAAE,OAAOK,OAAO;gBACZ,MAAM,IAAII,qBAAqBJ;YACnC;QACJ;QAEA,OAAO;YAAE,SAAS;YAAM,WAAW;QAAK;IAC5C;AACJ;AAEO,MAAMK,8BAAgBC,cAAAA,oBAAgC,CAAC;IAC1D,gBAAgBhB;IAChB,cAAc;QAACiB;QAAuB;YAACC;YAAsB;gBAAE,UAAU;YAAK;SAAE;KAAC;AACrF"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { createFeature } from "@webiny/feature/api";
|
|
2
2
|
import { MailerService } from "./MailerService.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
container.register(MailerService).inSingletonScope();
|
|
9
|
-
}
|
|
3
|
+
const MailerServiceFeature = createFeature({
|
|
4
|
+
name: "Mailer/MailerService",
|
|
5
|
+
register (container) {
|
|
6
|
+
container.register(MailerService).inSingletonScope();
|
|
7
|
+
}
|
|
10
8
|
});
|
|
9
|
+
export { MailerServiceFeature };
|
|
11
10
|
|
|
12
11
|
//# sourceMappingURL=feature.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"features/MailerService/feature.js","sources":["../../../src/features/MailerService/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { MailerService } from \"./MailerService.js\";\n\nexport const MailerServiceFeature = createFeature({\n name: \"Mailer/MailerService\",\n register(container) {\n container.register(MailerService).inSingletonScope();\n }\n});\n"],"names":["MailerServiceFeature","createFeature","container","MailerService"],"mappings":";;AAGO,MAAMA,uBAAuBC,cAAc;IAC9C,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC,eAAe,gBAAgB;IACtD;AACJ"}
|
|
@@ -4,56 +4,42 @@ import { SaveSettingsRepository } from "./abstractions.js";
|
|
|
4
4
|
import { SettingsPersistenceError } from "../../domain/errors.js";
|
|
5
5
|
import { KeyValueStore } from "@webiny/api-core/features/keyValueStore/index.js";
|
|
6
6
|
import { MAILER_TRANSPORT_SETTINGS } from "../../constants.js";
|
|
7
|
-
const DEFAULT_PORT =
|
|
7
|
+
const DEFAULT_PORT = 587;
|
|
8
8
|
class SaveSettingsRepositoryImpl {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
async execute(input) {
|
|
14
|
-
// Check if settings exist
|
|
15
|
-
const existingResult = await this.keyValueStore.get(MAILER_TRANSPORT_SETTINGS);
|
|
16
|
-
const existingSettings = existingResult.isOk() ? existingResult.value : null;
|
|
17
|
-
const transportSettings = existingSettings ?? {};
|
|
18
|
-
|
|
19
|
-
// If updating and no password provided, keep the existing password
|
|
20
|
-
let passwordToStore = input.password || "";
|
|
21
|
-
if (!input.password && existingSettings) {
|
|
22
|
-
passwordToStore = this.encryption.decrypt(transportSettings.password || "");
|
|
9
|
+
constructor(keyValueStore, encryption){
|
|
10
|
+
this.keyValueStore = keyValueStore;
|
|
11
|
+
this.encryption = encryption;
|
|
23
12
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
13
|
+
async execute(input) {
|
|
14
|
+
const existingResult = await this.keyValueStore.get(MAILER_TRANSPORT_SETTINGS);
|
|
15
|
+
const existingSettings = existingResult.isOk() ? existingResult.value : null;
|
|
16
|
+
const transportSettings = existingSettings ?? {};
|
|
17
|
+
let passwordToStore = input.password || "";
|
|
18
|
+
if (!input.password && existingSettings) passwordToStore = await this.encryption.decrypt(transportSettings.password || "");
|
|
19
|
+
const encryptedPassword = await this.encryption.encrypt(passwordToStore);
|
|
20
|
+
const port = input.port ?? transportSettings.port ?? DEFAULT_PORT;
|
|
21
|
+
const data = {
|
|
22
|
+
host: input.host ?? transportSettings.host,
|
|
23
|
+
port,
|
|
24
|
+
secure: input.secure ?? transportSettings.secure ?? 465 === port,
|
|
25
|
+
user: input.user ?? transportSettings.user,
|
|
26
|
+
password: encryptedPassword,
|
|
27
|
+
from: input.from ?? transportSettings.from,
|
|
28
|
+
replyTo: input.replyTo ?? transportSettings.replyTo
|
|
29
|
+
};
|
|
30
|
+
const result = await this.keyValueStore.set(MAILER_TRANSPORT_SETTINGS, data);
|
|
31
|
+
if (result.isFail()) return Result.fail(new SettingsPersistenceError(result.error));
|
|
32
|
+
const { password: _password, ...savedSettings } = data;
|
|
33
|
+
return Result.ok(savedSettings);
|
|
42
34
|
}
|
|
43
|
-
|
|
44
|
-
// Return the stored state without the password. Callers that need the
|
|
45
|
-
// plaintext password go through GetSettingsRepository.get(transportName).
|
|
46
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
47
|
-
const {
|
|
48
|
-
password: _password,
|
|
49
|
-
...savedSettings
|
|
50
|
-
} = data;
|
|
51
|
-
return Result.ok(savedSettings);
|
|
52
|
-
}
|
|
53
35
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
36
|
+
const SaveSettingsRepositoryImplementation = SaveSettingsRepository.createImplementation({
|
|
37
|
+
implementation: SaveSettingsRepositoryImpl,
|
|
38
|
+
dependencies: [
|
|
39
|
+
KeyValueStore,
|
|
40
|
+
Encryption
|
|
41
|
+
]
|
|
57
42
|
});
|
|
43
|
+
export { SaveSettingsRepositoryImplementation };
|
|
58
44
|
|
|
59
45
|
//# sourceMappingURL=SaveSettingsRepository.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"features/SaveSettings/SaveSettingsRepository.js","sources":["../../../src/features/SaveSettings/SaveSettingsRepository.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport { Encryption } from \"@webiny/api-core/features/encryption/index.js\";\nimport { SaveSettingsRepository, type SaveSettingsInput } from \"./abstractions.js\";\nimport type { TransportSettings } from \"~/types.js\";\nimport { SettingsPersistenceError } from \"~/domain/errors.js\";\nimport { KeyValueStore } from \"@webiny/api-core/features/keyValueStore/index.js\";\nimport { MAILER_TRANSPORT_SETTINGS } from \"~/constants.js\";\n\nconst DEFAULT_PORT = 587;\n\nclass SaveSettingsRepositoryImpl implements SaveSettingsRepository.Interface {\n constructor(\n private keyValueStore: KeyValueStore.Interface,\n private encryption: Encryption.Interface\n ) {}\n\n async execute(input: SaveSettingsInput): SaveSettingsRepository.Return {\n // Check if settings exist\n const existingResult =\n await this.keyValueStore.get<TransportSettings>(MAILER_TRANSPORT_SETTINGS);\n const existingSettings = existingResult.isOk() ? existingResult.value : null;\n const transportSettings: Partial<TransportSettings> = existingSettings ?? {};\n\n // If updating and no password provided, keep the existing password\n let passwordToStore = input.password || \"\";\n if (!input.password && existingSettings) {\n passwordToStore = await this.encryption.decrypt(transportSettings.password || \"\");\n }\n\n // Encrypt password\n const encryptedPassword = await this.encryption.encrypt(passwordToStore);\n\n // Prepare data\n const port = input.port ?? transportSettings.port ?? DEFAULT_PORT;\n\n const data = {\n host: input.host ?? transportSettings.host,\n port,\n secure: input.secure ?? transportSettings.secure ?? port === 465,\n user: input.user ?? transportSettings.user,\n password: encryptedPassword,\n from: input.from ?? transportSettings.from,\n replyTo: input.replyTo ?? transportSettings.replyTo\n };\n\n // Save settings.\n const result = await this.keyValueStore.set(MAILER_TRANSPORT_SETTINGS, data);\n\n if (result.isFail()) {\n return Result.fail(new SettingsPersistenceError(result.error));\n }\n\n // Return the stored state without the password. Callers that need the\n // plaintext password go through GetSettingsRepository.get(transportName).\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { password: _password, ...savedSettings } = data as TransportSettings;\n return Result.ok(savedSettings);\n }\n}\n\nexport const SaveSettingsRepositoryImplementation = SaveSettingsRepository.createImplementation({\n implementation: SaveSettingsRepositoryImpl,\n dependencies: [KeyValueStore, Encryption]\n});\n"],"names":["DEFAULT_PORT","SaveSettingsRepositoryImpl","keyValueStore","encryption","input","existingResult","MAILER_TRANSPORT_SETTINGS","existingSettings","transportSettings","passwordToStore","encryptedPassword","port","data","result","Result","SettingsPersistenceError","_password","savedSettings","SaveSettingsRepositoryImplementation","SaveSettingsRepository","KeyValueStore","Encryption"],"mappings":";;;;;;AAQA,MAAMA,eAAe;AAErB,MAAMC;IACF,YACYC,aAAsC,EACtCC,UAAgC,CAC1C;aAFUD,aAAa,GAAbA;aACAC,UAAU,GAAVA;IACT;IAEH,MAAM,QAAQC,KAAwB,EAAiC;QAEnE,MAAMC,iBACF,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,CAAoBC;QACpD,MAAMC,mBAAmBF,eAAe,IAAI,KAAKA,eAAe,KAAK,GAAG;QACxE,MAAMG,oBAAgDD,oBAAoB,CAAC;QAG3E,IAAIE,kBAAkBL,MAAM,QAAQ,IAAI;QACxC,IAAI,CAACA,MAAM,QAAQ,IAAIG,kBACnBE,kBAAkB,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAACD,kBAAkB,QAAQ,IAAI;QAIlF,MAAME,oBAAoB,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAACD;QAGxD,MAAME,OAAOP,MAAM,IAAI,IAAII,kBAAkB,IAAI,IAAIR;QAErD,MAAMY,OAAO;YACT,MAAMR,MAAM,IAAI,IAAII,kBAAkB,IAAI;YAC1CG;YACA,QAAQP,MAAM,MAAM,IAAII,kBAAkB,MAAM,IAAIG,AAAS,QAATA;YACpD,MAAMP,MAAM,IAAI,IAAII,kBAAkB,IAAI;YAC1C,UAAUE;YACV,MAAMN,MAAM,IAAI,IAAII,kBAAkB,IAAI;YAC1C,SAASJ,MAAM,OAAO,IAAII,kBAAkB,OAAO;QACvD;QAGA,MAAMK,SAAS,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,CAACP,2BAA2BM;QAEvE,IAAIC,OAAO,MAAM,IACb,OAAOC,OAAO,IAAI,CAAC,IAAIC,yBAAyBF,OAAO,KAAK;QAMhE,MAAM,EAAE,UAAUG,SAAS,EAAE,GAAGC,eAAe,GAAGL;QAClD,OAAOE,OAAO,EAAE,CAACG;IACrB;AACJ;AAEO,MAAMC,uCAAuCC,uBAAuB,oBAAoB,CAAC;IAC5F,gBAAgBlB;IAChB,cAAc;QAACmB;QAAeC;KAAW;AAC7C"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { EventPublisher
|
|
1
|
+
import { EventPublisher } from "@webiny/api-core/features/eventPublisher/index.js";
|
|
2
2
|
import { SaveSettingsUseCase, SaveSettingsRepository, type SaveSettingsInput } from "./abstractions.js";
|
|
3
3
|
import { IdentityContext } from "@webiny/api-core/features/security/IdentityContext/index.js";
|
|
4
4
|
import { CodeMailerSettings } from "../../domain/CodeMailerSettings/abstractions.js";
|
|
5
|
-
import {
|
|
5
|
+
import { MailTransportFactory } from "../../domain/MailTransport/abstractions.js";
|
|
6
6
|
declare class SaveSettingsUseCaseImpl implements SaveSettingsUseCase.Interface {
|
|
7
7
|
private identityContext;
|
|
8
8
|
private eventPublisher;
|
|
9
9
|
private repository;
|
|
10
10
|
private codeSettings;
|
|
11
|
-
private
|
|
12
|
-
constructor(identityContext: IdentityContext.Interface, eventPublisher:
|
|
11
|
+
private transportFactories;
|
|
12
|
+
constructor(identityContext: IdentityContext.Interface, eventPublisher: EventPublisher.Interface, repository: SaveSettingsRepository.Interface, codeSettings: CodeMailerSettings.Interface, transportFactories: MailTransportFactory.Interface[]);
|
|
13
13
|
execute(input: SaveSettingsInput): SaveSettingsUseCase.Return;
|
|
14
14
|
}
|
|
15
15
|
export declare const SaveSettingsUseCaseImplementation: typeof SaveSettingsUseCaseImpl & {
|
|
@@ -1,69 +1,56 @@
|
|
|
1
1
|
import { Result } from "@webiny/feature/api";
|
|
2
2
|
import { EventPublisher } from "@webiny/api-core/features/eventPublisher/index.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { SaveSettingsRepository, SaveSettingsUseCase } from "./abstractions.js";
|
|
4
|
+
import { MailerSettingsAfterSaveEvent, MailerSettingsBeforeSaveEvent } from "./events.js";
|
|
5
5
|
import { saveValidation } from "./validation.js";
|
|
6
|
-
import {
|
|
6
|
+
import { SettingsLockedByCode, SettingsNotAuthorized, SettingsPersistenceError, SettingsValidationError } from "../../domain/errors.js";
|
|
7
7
|
import { IdentityContext } from "@webiny/api-core/features/security/IdentityContext/index.js";
|
|
8
8
|
import { CodeMailerSettings } from "../../domain/CodeMailerSettings/abstractions.js";
|
|
9
|
-
import {
|
|
9
|
+
import { MailTransportFactory } from "../../domain/MailTransport/abstractions.js";
|
|
10
10
|
class SaveSettingsUseCaseImpl {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
async execute(input) {
|
|
19
|
-
const permission = await this.identityContext.getPermission("mailer.settings");
|
|
20
|
-
if (!permission) {
|
|
21
|
-
return Result.fail(new SettingsNotAuthorized());
|
|
11
|
+
constructor(identityContext, eventPublisher, repository, codeSettings, transportFactories){
|
|
12
|
+
this.identityContext = identityContext;
|
|
13
|
+
this.eventPublisher = eventPublisher;
|
|
14
|
+
this.repository = repository;
|
|
15
|
+
this.codeSettings = codeSettings;
|
|
16
|
+
this.transportFactories = transportFactories;
|
|
22
17
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
18
|
+
async execute(input) {
|
|
19
|
+
const permission = await this.identityContext.getPermission("mailer.settings");
|
|
20
|
+
if (!permission) return Result.fail(new SettingsNotAuthorized());
|
|
21
|
+
const validationResult = saveValidation.safeParse(input);
|
|
22
|
+
if (!validationResult.success) return Result.fail(new SettingsValidationError(validationResult.error.issues));
|
|
23
|
+
const isLockedByCode = this.transportFactories.some((f)=>null !== this.codeSettings.get(f.name));
|
|
24
|
+
if (isLockedByCode) return Result.fail(new SettingsLockedByCode());
|
|
25
|
+
const { password: _beforePassword, ...inputForEvent } = input;
|
|
26
|
+
const beforeSaveEvent = new MailerSettingsBeforeSaveEvent({
|
|
27
|
+
input: inputForEvent
|
|
28
|
+
});
|
|
29
|
+
await this.eventPublisher.publish(beforeSaveEvent);
|
|
30
|
+
const result = await this.repository.execute(input);
|
|
31
|
+
if (result.isFail()) return Result.fail(new SettingsPersistenceError(result.error));
|
|
32
|
+
const afterSaveEvent = new MailerSettingsAfterSaveEvent({
|
|
33
|
+
settings: result.value
|
|
34
|
+
});
|
|
35
|
+
await this.eventPublisher.publish(afterSaveEvent);
|
|
36
|
+
return result;
|
|
34
37
|
}
|
|
35
|
-
|
|
36
|
-
// Publish before save event. Strip the password — subscribers (audit
|
|
37
|
-
// logs, telemetry) must never see the plaintext value from the input.
|
|
38
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
39
|
-
const {
|
|
40
|
-
password: _beforePassword,
|
|
41
|
-
...inputForEvent
|
|
42
|
-
} = input;
|
|
43
|
-
const beforeSaveEvent = new MailerSettingsBeforeSaveEvent({
|
|
44
|
-
input: inputForEvent
|
|
45
|
-
});
|
|
46
|
-
await this.eventPublisher.publish(beforeSaveEvent);
|
|
47
|
-
|
|
48
|
-
// Save settings.
|
|
49
|
-
const result = await this.repository.execute(input);
|
|
50
|
-
if (result.isFail()) {
|
|
51
|
-
return Result.fail(new SettingsPersistenceError(result.error));
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// Publish after save event. The repository return is already password-free
|
|
55
|
-
// (its type is Omit<TransportSettings, "password">), so no runtime strip
|
|
56
|
-
// is needed here.
|
|
57
|
-
const afterSaveEvent = new MailerSettingsAfterSaveEvent({
|
|
58
|
-
settings: result.value
|
|
59
|
-
});
|
|
60
|
-
await this.eventPublisher.publish(afterSaveEvent);
|
|
61
|
-
return result;
|
|
62
|
-
}
|
|
63
38
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
39
|
+
const SaveSettingsUseCaseImplementation = SaveSettingsUseCase.createImplementation({
|
|
40
|
+
implementation: SaveSettingsUseCaseImpl,
|
|
41
|
+
dependencies: [
|
|
42
|
+
IdentityContext,
|
|
43
|
+
EventPublisher,
|
|
44
|
+
SaveSettingsRepository,
|
|
45
|
+
CodeMailerSettings,
|
|
46
|
+
[
|
|
47
|
+
MailTransportFactory,
|
|
48
|
+
{
|
|
49
|
+
multiple: true
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
]
|
|
67
53
|
});
|
|
54
|
+
export { SaveSettingsUseCaseImplementation };
|
|
68
55
|
|
|
69
56
|
//# sourceMappingURL=SaveSettingsUseCase.js.map
|