@webiny/api-mailer 0.0.0-unstable.6f45466a1d → 0.0.0-unstable.7be00a75a9
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/constants.js +2 -1
- package/constants.js.map +1 -1
- package/domain/CodeMailerSettings/abstractions.d.ts +8 -0
- package/domain/CodeMailerSettings/abstractions.js +5 -0
- package/domain/CodeMailerSettings/abstractions.js.map +1 -0
- package/domain/MailTransport/abstractions.d.ts +8 -0
- package/domain/MailTransport/abstractions.js +4 -2
- package/domain/MailTransport/abstractions.js.map +1 -1
- package/domain/MailerService/abstractions.js +2 -1
- package/domain/MailerService/abstractions.js.map +1 -1
- package/domain/MailerService/errors.js +22 -24
- package/domain/MailerService/errors.js.map +1 -1
- package/domain/errors.d.ts +8 -4
- package/domain/errors.js +41 -37
- package/domain/errors.js.map +1 -1
- package/exports/api/mailer.d.ts +4 -0
- package/exports/api/mailer.js +4 -0
- package/features/CodeMailerSettings/CodeMailerSettingsImpl.d.ts +12 -0
- package/features/CodeMailerSettings/CodeMailerSettingsImpl.js +23 -0
- package/features/CodeMailerSettings/CodeMailerSettingsImpl.js.map +1 -0
- package/features/CodeMailerSettings/feature.d.ts +4 -0
- package/features/CodeMailerSettings/feature.js +11 -0
- package/features/CodeMailerSettings/feature.js.map +1 -0
- 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 +10 -6
- package/features/DummyTransport/DummyMailTransportFactory.js.map +1 -1
- package/features/DummyTransport/feature.d.ts +4 -1
- package/features/DummyTransport/feature.js +6 -5
- package/features/DummyTransport/feature.js.map +1 -1
- package/features/GetSettings/GetSettingsRepository.d.ts +6 -5
- package/features/GetSettings/GetSettingsRepository.js +44 -29
- package/features/GetSettings/GetSettingsRepository.js.map +1 -1
- package/features/GetSettings/GetSettingsUseCase.d.ts +3 -4
- package/features/GetSettings/GetSettingsUseCase.js +13 -10
- package/features/GetSettings/GetSettingsUseCase.js.map +1 -1
- package/features/GetSettings/abstractions.d.ts +11 -5
- package/features/GetSettings/abstractions.js +3 -2
- package/features/GetSettings/abstractions.js.map +1 -1
- package/features/GetSettings/feature.d.ts +4 -1
- package/features/GetSettings/feature.js +7 -6
- package/features/GetSettings/feature.js.map +1 -1
- package/features/GetSettings/index.d.ts +1 -1
- package/features/GetSettings/index.js +1 -3
- package/features/MailerService/ActiveTransport.d.ts +10 -0
- package/features/MailerService/ActiveTransport.js +24 -0
- package/features/MailerService/ActiveTransport.js.map +1 -0
- package/features/MailerService/MailerService.d.ts +3 -2
- package/features/MailerService/MailerService.js +39 -42
- package/features/MailerService/MailerService.js.map +1 -1
- package/features/MailerService/feature.d.ts +4 -1
- package/features/MailerService/feature.js +8 -5
- package/features/MailerService/feature.js.map +1 -1
- package/features/SaveSettings/SaveSettingsRepository.d.ts +1 -1
- package/features/SaveSettings/SaveSettingsRepository.js +30 -44
- package/features/SaveSettings/SaveSettingsRepository.js.map +1 -1
- package/features/SaveSettings/SaveSettingsUseCase.d.ts +6 -2
- package/features/SaveSettings/SaveSettingsUseCase.js +41 -41
- package/features/SaveSettings/SaveSettingsUseCase.js.map +1 -1
- package/features/SaveSettings/abstractions.d.ts +20 -12
- package/features/SaveSettings/abstractions.js +5 -8
- package/features/SaveSettings/abstractions.js.map +1 -1
- package/features/SaveSettings/events.d.ts +3 -3
- package/features/SaveSettings/events.js +17 -12
- package/features/SaveSettings/events.js.map +1 -1
- package/features/SaveSettings/feature.d.ts +4 -1
- package/features/SaveSettings/feature.js +7 -6
- package/features/SaveSettings/feature.js.map +1 -1
- package/features/SaveSettings/index.d.ts +1 -1
- package/features/SaveSettings/index.js +1 -3
- package/features/SaveSettings/validation.d.ts +3 -17
- package/features/SaveSettings/validation.js +14 -13
- package/features/SaveSettings/validation.js.map +1 -1
- package/features/SendMail/SendMailUseCase.d.ts +1 -1
- package/features/SendMail/SendMailUseCase.js +44 -48
- package/features/SendMail/SendMailUseCase.js.map +1 -1
- package/features/SendMail/abstractions.d.ts +7 -7
- package/features/SendMail/abstractions.js +5 -8
- package/features/SendMail/abstractions.js.map +1 -1
- package/features/SendMail/events.d.ts +4 -4
- package/features/SendMail/events.js +24 -17
- package/features/SendMail/events.js.map +1 -1
- package/features/SendMail/feature.d.ts +4 -1
- package/features/SendMail/feature.js +6 -5
- package/features/SendMail/feature.js.map +1 -1
- package/features/SendMail/index.d.ts +1 -0
- package/features/SendMail/index.js +1 -0
- package/features/SmtpTransport/SmtpConfig.js +20 -24
- package/features/SmtpTransport/SmtpConfig.js.map +1 -1
- package/features/SmtpTransport/SmtpMailTransport.d.ts +51 -1
- package/features/SmtpTransport/SmtpMailTransport.js +47 -55
- package/features/SmtpTransport/SmtpMailTransport.js.map +1 -1
- package/features/SmtpTransport/SmtpMailTransportFactory.d.ts +1 -0
- package/features/SmtpTransport/SmtpMailTransportFactory.js +10 -6
- package/features/SmtpTransport/SmtpMailTransportFactory.js.map +1 -1
- package/features/SmtpTransport/feature.d.ts +4 -1
- package/features/SmtpTransport/feature.js +6 -5
- package/features/SmtpTransport/feature.js.map +1 -1
- package/graphql/settings.js +58 -66
- package/graphql/settings.js.map +1 -1
- package/index.js +12 -16
- package/index.js.map +1 -1
- package/package.json +29 -32
- package/types.js +0 -3
- package/utils/isMailboxAddress.d.ts +6 -0
- package/utils/isMailboxAddress.js +5 -0
- package/utils/isMailboxAddress.js.map +1 -0
- package/domain/Encryption/abstractions.d.ts +0 -8
- package/domain/Encryption/abstractions.js +0 -4
- package/domain/Encryption/abstractions.js.map +0 -1
- package/features/Encryption/PasswordEncryption.d.ts +0 -9
- package/features/Encryption/PasswordEncryption.js +0 -23
- package/features/Encryption/PasswordEncryption.js.map +0 -1
- package/features/Encryption/feature.d.ts +0 -1
- package/features/Encryption/feature.js +0 -10
- package/features/Encryption/feature.js.map +0 -1
- package/features/Encryption/utils/password.d.ts +0 -7
- package/features/Encryption/utils/password.js +0 -56
- package/features/Encryption/utils/password.js.map +0 -1
- package/features/Encryption/utils/secret.d.ts +0 -1
- package/features/Encryption/utils/secret.js +0 -11
- package/features/Encryption/utils/secret.js.map +0 -1
- package/features/GetSettings/index.js.map +0 -1
- package/features/MailerService/TransportFactory.d.ts +0 -2
- package/features/MailerService/TransportFactory.js +0 -31
- package/features/MailerService/TransportFactory.js.map +0 -1
- package/features/SaveSettings/index.js.map +0 -1
- package/types.js.map +0 -1
|
@@ -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 transportSettings: TransportSettings = {\n host: String(settings.host || \"\"),\n port: Number(settings.port || 25),\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","transportSettings","Number","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,oBAAuC;YACzC,MAAMD,OAAOF,SAAS,IAAI,IAAI;YAC9B,MAAMI,OAAOJ,SAAS,IAAI,IAAI;YAC9B,MAAME,OAAOF,SAAS,IAAI,IAAI;YAC9BC;YACA,MAAMC,OAAOF,SAAS,IAAI,IAAI;YAC9B,SAASA,SAAS,OAAO,GAAGE,OAAOF,SAAS,OAAO,IAAIK;QAC3D;QAEA,OAAOR,OAAO,EAAE,CAAC;YAAE,UAAUM;YAAmB,QAAQ;QAAU;IACtE;AACJ;AAEO,MAAMG,sCAAsCC,sBAAsB,oBAAoB,CAAC;IAC1F,gBAAgBhB;IAChB,cAAc;QAACiB;QAAeC;QAAYC;KAAmB;AACjE"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { Result } from "@webiny/feature/api";
|
|
2
|
-
import { GetSettingsUseCase, GetSettingsRepository } from "./abstractions.js";
|
|
3
|
-
import type { TransportSettings } from "../../types.js";
|
|
2
|
+
import { GetSettingsUseCase, GetSettingsRepository, type ISettingsWithSource } from "./abstractions.js";
|
|
4
3
|
declare class GetSettingsUseCaseImpl implements GetSettingsUseCase.Interface {
|
|
5
4
|
private repository;
|
|
6
5
|
constructor(repository: GetSettingsRepository.Interface);
|
|
7
|
-
execute(): Promise<Result<
|
|
6
|
+
execute(transportName: string): Promise<Result<ISettingsWithSource>>;
|
|
8
7
|
}
|
|
9
8
|
export declare const GetSettingsUseCaseImplementation: typeof GetSettingsUseCaseImpl & {
|
|
10
|
-
__abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").
|
|
9
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IGetSettingsUseCase>;
|
|
11
10
|
};
|
|
12
11
|
export {};
|
|
@@ -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,16 +1,22 @@
|
|
|
1
1
|
import { Result } from "@webiny/feature/api";
|
|
2
2
|
import type { TransportSettings } from "../../types.js";
|
|
3
|
+
export type MailerSettingsSource = "code" | "storage" | null;
|
|
4
|
+
export interface ISettingsWithSource {
|
|
5
|
+
settings: TransportSettings | null;
|
|
6
|
+
source: MailerSettingsSource;
|
|
7
|
+
}
|
|
3
8
|
export interface IGetSettingsRepository {
|
|
4
|
-
get(): Promise<Result<
|
|
9
|
+
get(transportName: string): Promise<Result<ISettingsWithSource>>;
|
|
5
10
|
}
|
|
6
11
|
export declare const GetSettingsRepository: import("@webiny/di").Abstraction<IGetSettingsRepository>;
|
|
7
12
|
export declare namespace GetSettingsRepository {
|
|
8
13
|
type Interface = IGetSettingsRepository;
|
|
14
|
+
type Return = Promise<Result<ISettingsWithSource>>;
|
|
9
15
|
}
|
|
10
|
-
export interface
|
|
11
|
-
execute(): Promise<Result<
|
|
16
|
+
export interface IGetSettingsUseCase {
|
|
17
|
+
execute(transportName: string): Promise<Result<ISettingsWithSource>>;
|
|
12
18
|
}
|
|
13
|
-
export declare const GetSettingsUseCase: import("@webiny/di").Abstraction<
|
|
19
|
+
export declare const GetSettingsUseCase: import("@webiny/di").Abstraction<IGetSettingsUseCase>;
|
|
14
20
|
export declare namespace GetSettingsUseCase {
|
|
15
|
-
type Interface =
|
|
21
|
+
type Interface = IGetSettingsUseCase;
|
|
16
22
|
}
|
|
@@ -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 +1 @@
|
|
|
1
|
-
export { GetSettingsUseCase } from "./abstractions.js";
|
|
1
|
+
export { GetSettingsUseCase, GetSettingsRepository } from "./abstractions.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ActiveTransport as ActiveTransportAbstraction, MailTransportFactory } from "../../domain/MailTransport/abstractions.js";
|
|
2
|
+
declare class ActiveTransportImpl implements ActiveTransportAbstraction.Interface {
|
|
3
|
+
private transportFactories;
|
|
4
|
+
constructor(transportFactories: MailTransportFactory.Interface[]);
|
|
5
|
+
name(): string | null;
|
|
6
|
+
}
|
|
7
|
+
export declare const ActiveTransport: typeof ActiveTransportImpl & {
|
|
8
|
+
__abstraction: import("@webiny/di").Abstraction<import("~/domain/MailTransport/abstractions.js").IActiveTransport>;
|
|
9
|
+
};
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ActiveTransport, MailTransportFactory } from "../../domain/MailTransport/abstractions.js";
|
|
2
|
+
class ActiveTransportImpl {
|
|
3
|
+
constructor(transportFactories){
|
|
4
|
+
this.transportFactories = transportFactories;
|
|
5
|
+
}
|
|
6
|
+
name() {
|
|
7
|
+
if (0 === this.transportFactories.length) return null;
|
|
8
|
+
return this.transportFactories[this.transportFactories.length - 1].name;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
const ActiveTransport_ActiveTransport = ActiveTransport.createImplementation({
|
|
12
|
+
implementation: ActiveTransportImpl,
|
|
13
|
+
dependencies: [
|
|
14
|
+
[
|
|
15
|
+
MailTransportFactory,
|
|
16
|
+
{
|
|
17
|
+
multiple: true
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
]
|
|
21
|
+
});
|
|
22
|
+
export { ActiveTransport_ActiveTransport as ActiveTransport };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=ActiveTransport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/MailerService/ActiveTransport.js","sources":["../../../src/features/MailerService/ActiveTransport.ts"],"sourcesContent":["import {\n ActiveTransport as ActiveTransportAbstraction,\n MailTransportFactory\n} from \"~/domain/MailTransport/abstractions.js\";\n\nclass ActiveTransportImpl implements ActiveTransportAbstraction.Interface {\n constructor(private transportFactories: MailTransportFactory.Interface[]) {}\n\n name(): string | null {\n if (this.transportFactories.length === 0) {\n return null;\n }\n return this.transportFactories[this.transportFactories.length - 1].name;\n }\n}\n\nexport const ActiveTransport = ActiveTransportAbstraction.createImplementation({\n implementation: ActiveTransportImpl,\n dependencies: [[MailTransportFactory, { multiple: true }]]\n});\n"],"names":["ActiveTransportImpl","transportFactories","ActiveTransport","ActiveTransportAbstraction","MailTransportFactory"],"mappings":";AAKA,MAAMA;IACF,YAAoBC,kBAAoD,CAAE;aAAtDA,kBAAkB,GAAlBA;IAAuD;IAE3E,OAAsB;QAClB,IAAI,AAAmC,MAAnC,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAC9B,OAAO;QAEX,OAAO,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,kBAAkB,CAAC,MAAM,GAAG,EAAE,CAAC,IAAI;IAC3E;AACJ;AAEO,MAAMC,kCAAkBC,gBAAAA,oBAA+C,CAAC;IAC3E,gBAAgBH;IAChB,cAAc;QAAC;YAACI;YAAsB;gBAAE,UAAU;YAAK;SAAE;KAAC;AAC9D"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { MailerService as Abstraction } from "../../domain/MailerService/abstractions.js";
|
|
2
|
-
import { MailTransportFactory } from "../../domain/MailTransport/abstractions.js";
|
|
2
|
+
import { ActiveTransport, 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;
|
|
7
8
|
private transportFactories;
|
|
8
|
-
constructor(getSettingsRepository: GetSettingsRepository.Interface, transportFactories: MailTransportFactory.Interface[]);
|
|
9
|
+
constructor(getSettingsRepository: GetSettingsRepository.Interface, activeTransport: ActiveTransport.Interface, transportFactories: MailTransportFactory.Interface[]);
|
|
9
10
|
sendMail<T = any>(data: TransportSendData): Abstraction.Return<T>;
|
|
10
11
|
private getTransport;
|
|
11
12
|
}
|
|
@@ -1,52 +1,49 @@
|
|
|
1
1
|
import { Result } from "@webiny/feature/api";
|
|
2
|
-
import { MailerService
|
|
3
|
-
import {
|
|
4
|
-
import { MailTransportFactory } from "../../domain/MailTransport/abstractions.js";
|
|
2
|
+
import { MailerService } from "../../domain/MailerService/abstractions.js";
|
|
3
|
+
import { NoSettingsConfiguredError, NoTransportAvailableError, TransportSendError } from "../../domain/MailerService/errors.js";
|
|
4
|
+
import { ActiveTransport, MailTransportFactory } from "../../domain/MailTransport/abstractions.js";
|
|
5
5
|
import { GetSettingsRepository } from "../GetSettings/abstractions.js";
|
|
6
|
-
import { getDefaultSettingsFromEnv } from "./TransportFactory.js";
|
|
7
6
|
class MailerServiceImpl {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
async sendMail(data) {
|
|
13
|
-
// Get settings from repository or environment variables
|
|
14
|
-
const result = await this.getSettingsRepository.get();
|
|
15
|
-
const settings = result.value ?? getDefaultSettingsFromEnv();
|
|
16
|
-
if (!settings) {
|
|
17
|
-
return Result.fail(new NoSettingsConfiguredError());
|
|
7
|
+
constructor(getSettingsRepository, activeTransport, transportFactories){
|
|
8
|
+
this.getSettingsRepository = getSettingsRepository;
|
|
9
|
+
this.activeTransport = activeTransport;
|
|
10
|
+
this.transportFactories = transportFactories;
|
|
18
11
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return Result.fail(new TransportSendError(error));
|
|
12
|
+
async sendMail(data) {
|
|
13
|
+
const transportName = this.activeTransport.name();
|
|
14
|
+
if (!transportName) return Result.fail(new NoTransportAvailableError());
|
|
15
|
+
const result = await this.getSettingsRepository.get(transportName);
|
|
16
|
+
const { settings } = result.value;
|
|
17
|
+
if (!settings) return Result.fail(new NoSettingsConfiguredError());
|
|
18
|
+
const transport = await this.getTransport(transportName, settings);
|
|
19
|
+
if (!transport) return Result.fail(new NoTransportAvailableError());
|
|
20
|
+
try {
|
|
21
|
+
const response = await transport.send(data);
|
|
22
|
+
if (response.error) return Result.fail(new TransportSendError(response.error));
|
|
23
|
+
return Result.ok(response);
|
|
24
|
+
} catch (error) {
|
|
25
|
+
return Result.fail(new TransportSendError(error));
|
|
26
|
+
}
|
|
35
27
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
28
|
+
async getTransport(transportName, settings) {
|
|
29
|
+
const factory = this.transportFactories.find((f)=>f.name === transportName);
|
|
30
|
+
if (!factory) return null;
|
|
31
|
+
return factory.createTransport(settings);
|
|
40
32
|
}
|
|
41
|
-
const factory = this.transportFactories[this.transportFactories.length - 1];
|
|
42
|
-
return factory.createTransport(settings);
|
|
43
|
-
}
|
|
44
33
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
34
|
+
const MailerService_MailerService = MailerService.createImplementation({
|
|
35
|
+
implementation: MailerServiceImpl,
|
|
36
|
+
dependencies: [
|
|
37
|
+
GetSettingsRepository,
|
|
38
|
+
ActiveTransport,
|
|
39
|
+
[
|
|
40
|
+
MailTransportFactory,
|
|
41
|
+
{
|
|
42
|
+
multiple: true
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
]
|
|
50
46
|
});
|
|
47
|
+
export { MailerService_MailerService as MailerService };
|
|
51
48
|
|
|
52
49
|
//# 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 NoSettingsConfiguredError,\n TransportSendError\n} from \"~/domain/MailerService/errors.js\";\nimport {\n ActiveTransport,\n MailTransport,\n MailTransportFactory\n} from \"~/domain/MailTransport/abstractions.js\";\nimport { GetSettingsRepository } from \"../GetSettings/abstractions.js\";\nimport type { TransportSettings, TransportSendData } from \"~/types.js\";\n\nclass MailerServiceImpl implements Abstraction.Interface {\n constructor(\n private getSettingsRepository: GetSettingsRepository.Interface,\n private activeTransport: ActiveTransport.Interface,\n private transportFactories: MailTransportFactory.Interface[]\n ) {}\n\n async sendMail<T = any>(data: TransportSendData): Abstraction.Return<T> {\n const transportName = this.activeTransport.name();\n\n if (!transportName) {\n return Result.fail(new NoTransportAvailableError());\n }\n\n const result = await this.getSettingsRepository.get(transportName);\n const { settings } = result.value;\n\n if (!settings) {\n return Result.fail(new NoSettingsConfiguredError());\n }\n\n const transport = await this.getTransport(transportName, settings);\n\n if (!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 getTransport(\n transportName: string,\n settings: TransportSettings\n ): Promise<MailTransport.Interface | null> {\n const factory = this.transportFactories.find(f => f.name === transportName);\n if (!factory) {\n return null;\n }\n return factory.createTransport(settings);\n }\n}\n\nexport const MailerService = Abstraction.createImplementation({\n implementation: MailerServiceImpl,\n dependencies: [\n GetSettingsRepository,\n ActiveTransport,\n [MailTransportFactory, { multiple: true }]\n ]\n});\n"],"names":["MailerServiceImpl","getSettingsRepository","activeTransport","transportFactories","data","transportName","Result","NoTransportAvailableError","result","settings","NoSettingsConfiguredError","transport","response","TransportSendError","error","factory","f","MailerService","Abstraction","GetSettingsRepository","ActiveTransport","MailTransportFactory"],"mappings":";;;;;AAeA,MAAMA;IACF,YACYC,qBAAsD,EACtDC,eAA0C,EAC1CC,kBAAoD,CAC9D;aAHUF,qBAAqB,GAArBA;aACAC,eAAe,GAAfA;aACAC,kBAAkB,GAAlBA;IACT;IAEH,MAAM,SAAkBC,IAAuB,EAAyB;QACpE,MAAMC,gBAAgB,IAAI,CAAC,eAAe,CAAC,IAAI;QAE/C,IAAI,CAACA,eACD,OAAOC,OAAO,IAAI,CAAC,IAAIC;QAG3B,MAAMC,SAAS,MAAM,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAACH;QACpD,MAAM,EAAEI,QAAQ,EAAE,GAAGD,OAAO,KAAK;QAEjC,IAAI,CAACC,UACD,OAAOH,OAAO,IAAI,CAAC,IAAII;QAG3B,MAAMC,YAAY,MAAM,IAAI,CAAC,YAAY,CAACN,eAAeI;QAEzD,IAAI,CAACE,WACD,OAAOL,OAAO,IAAI,CAAC,IAAIC;QAG3B,IAAI;YACA,MAAMK,WAAW,MAAMD,UAAU,IAAI,CAACP;YAEtC,IAAIQ,SAAS,KAAK,EACd,OAAON,OAAO,IAAI,CAAC,IAAIO,mBAAmBD,SAAS,KAAK;YAG5D,OAAON,OAAO,EAAE,CAACM;QACrB,EAAE,OAAOE,OAAO;YACZ,OAAOR,OAAO,IAAI,CAAC,IAAIO,mBAAmBC;QAC9C;IACJ;IAEA,MAAc,aACVT,aAAqB,EACrBI,QAA2B,EACY;QACvC,MAAMM,UAAU,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAACC,CAAAA,IAAKA,EAAE,IAAI,KAAKX;QAC7D,IAAI,CAACU,SACD,OAAO;QAEX,OAAOA,QAAQ,eAAe,CAACN;IACnC;AACJ;AAEO,MAAMQ,8BAAgBC,cAAAA,oBAAgC,CAAC;IAC1D,gBAAgBlB;IAChB,cAAc;QACVmB;QACAC;QACA;YAACC;YAAsB;gBAAE,UAAU;YAAK;SAAE;KAC7C;AACL"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { createFeature } from "@webiny/feature/api";
|
|
2
2
|
import { MailerService } from "./MailerService.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
import { ActiveTransport } from "./ActiveTransport.js";
|
|
4
|
+
const MailerServiceFeature = createFeature({
|
|
5
|
+
name: "Mailer/MailerService",
|
|
6
|
+
register (container) {
|
|
7
|
+
container.register(ActiveTransport).inSingletonScope();
|
|
8
|
+
container.register(MailerService).inSingletonScope();
|
|
9
|
+
}
|
|
8
10
|
});
|
|
11
|
+
export { MailerServiceFeature };
|
|
9
12
|
|
|
10
13
|
//# 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\";\nimport { ActiveTransport } from \"./ActiveTransport.js\";\n\nexport const MailerServiceFeature = createFeature({\n name: \"Mailer/MailerService\",\n register(container) {\n container.register(ActiveTransport).inSingletonScope();\n container.register(MailerService).inSingletonScope();\n }\n});\n"],"names":["MailerServiceFeature","createFeature","container","ActiveTransport","MailerService"],"mappings":";;;AAIO,MAAMA,uBAAuBC,cAAc;IAC9C,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC,iBAAiB,gBAAgB;QACpDD,UAAU,QAAQ,CAACE,eAAe,gBAAgB;IACtD;AACJ"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Encryption } from "
|
|
1
|
+
import { Encryption } from "@webiny/api-core/features/encryption/index.js";
|
|
2
2
|
import { SaveSettingsRepository, type SaveSettingsInput } from "./abstractions.js";
|
|
3
3
|
import { KeyValueStore } from "@webiny/api-core/features/keyValueStore/index.js";
|
|
4
4
|
declare class SaveSettingsRepositoryImpl implements SaveSettingsRepository.Interface {
|
|
@@ -1,57 +1,43 @@
|
|
|
1
1
|
import { Result } from "@webiny/feature/api";
|
|
2
|
-
import { Encryption } from "
|
|
2
|
+
import { Encryption } from "@webiny/api-core/features/encryption/index.js";
|
|
3
3
|
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
7
|
const DEFAULT_PORT = 25;
|
|
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 = await 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 data = {
|
|
21
|
+
host: input.host ?? transportSettings.host,
|
|
22
|
+
port: input.port ?? transportSettings.port ?? DEFAULT_PORT,
|
|
23
|
+
user: input.user ?? transportSettings.user,
|
|
24
|
+
password: encryptedPassword,
|
|
25
|
+
from: input.from ?? transportSettings.from,
|
|
26
|
+
replyTo: input.replyTo ?? transportSettings.replyTo
|
|
27
|
+
};
|
|
28
|
+
const result = await this.keyValueStore.set(MAILER_TRANSPORT_SETTINGS, data);
|
|
29
|
+
if (result.isFail()) return Result.fail(new SettingsPersistenceError(result.error));
|
|
30
|
+
const { password: _password, ...savedSettings } = data;
|
|
31
|
+
return Result.ok(savedSettings);
|
|
42
32
|
}
|
|
43
|
-
|
|
44
|
-
// Return without encrypted password
|
|
45
|
-
const returnSettings = {
|
|
46
|
-
...data,
|
|
47
|
-
password: "" // Don't return password
|
|
48
|
-
};
|
|
49
|
-
return Result.ok(returnSettings);
|
|
50
|
-
}
|
|
51
33
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
34
|
+
const SaveSettingsRepositoryImplementation = SaveSettingsRepository.createImplementation({
|
|
35
|
+
implementation: SaveSettingsRepositoryImpl,
|
|
36
|
+
dependencies: [
|
|
37
|
+
KeyValueStore,
|
|
38
|
+
Encryption
|
|
39
|
+
]
|
|
55
40
|
});
|
|
41
|
+
export { SaveSettingsRepositoryImplementation };
|
|
56
42
|
|
|
57
43
|
//# 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 = 25;\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 data = {\n host: input.host ?? transportSettings.host,\n port: input.port ?? transportSettings.port ?? DEFAULT_PORT,\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","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,OAAO;YACT,MAAMP,MAAM,IAAI,IAAII,kBAAkB,IAAI;YAC1C,MAAMJ,MAAM,IAAI,IAAII,kBAAkB,IAAI,IAAIR;YAC9C,MAAMI,MAAM,IAAI,IAAII,kBAAkB,IAAI;YAC1C,UAAUE;YACV,MAAMN,MAAM,IAAI,IAAII,kBAAkB,IAAI;YAC1C,SAASJ,MAAM,OAAO,IAAII,kBAAkB,OAAO;QACvD;QAGA,MAAMI,SAAS,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,CAACN,2BAA2BK;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,gBAAgBjB;IAChB,cAAc;QAACkB;QAAeC;KAAW;AAC7C"}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import { EventPublisher as EventPublisherAbstraction } from "@webiny/api-core/features/
|
|
1
|
+
import { EventPublisher as EventPublisherAbstraction } 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
|
+
import { CodeMailerSettings } from "../../domain/CodeMailerSettings/abstractions.js";
|
|
5
|
+
import { ActiveTransport } from "../../domain/MailTransport/abstractions.js";
|
|
4
6
|
declare class SaveSettingsUseCaseImpl implements SaveSettingsUseCase.Interface {
|
|
5
7
|
private identityContext;
|
|
6
8
|
private eventPublisher;
|
|
7
9
|
private repository;
|
|
8
|
-
|
|
10
|
+
private codeSettings;
|
|
11
|
+
private activeTransport;
|
|
12
|
+
constructor(identityContext: IdentityContext.Interface, eventPublisher: EventPublisherAbstraction.Interface, repository: SaveSettingsRepository.Interface, codeSettings: CodeMailerSettings.Interface, activeTransport: ActiveTransport.Interface);
|
|
9
13
|
execute(input: SaveSettingsInput): SaveSettingsUseCase.Return;
|
|
10
14
|
}
|
|
11
15
|
export declare const SaveSettingsUseCaseImplementation: typeof SaveSettingsUseCaseImpl & {
|