@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.
Files changed (129) hide show
  1. package/constants.js +2 -1
  2. package/constants.js.map +1 -1
  3. package/domain/CodeMailerSettings/abstractions.d.ts +8 -0
  4. package/domain/CodeMailerSettings/abstractions.js +5 -0
  5. package/domain/CodeMailerSettings/abstractions.js.map +1 -0
  6. package/domain/MailTransport/abstractions.d.ts +8 -0
  7. package/domain/MailTransport/abstractions.js +4 -2
  8. package/domain/MailTransport/abstractions.js.map +1 -1
  9. package/domain/MailerService/abstractions.js +2 -1
  10. package/domain/MailerService/abstractions.js.map +1 -1
  11. package/domain/MailerService/errors.js +22 -24
  12. package/domain/MailerService/errors.js.map +1 -1
  13. package/domain/errors.d.ts +8 -4
  14. package/domain/errors.js +41 -37
  15. package/domain/errors.js.map +1 -1
  16. package/exports/api/mailer.d.ts +4 -0
  17. package/exports/api/mailer.js +4 -0
  18. package/features/CodeMailerSettings/CodeMailerSettingsImpl.d.ts +12 -0
  19. package/features/CodeMailerSettings/CodeMailerSettingsImpl.js +23 -0
  20. package/features/CodeMailerSettings/CodeMailerSettingsImpl.js.map +1 -0
  21. package/features/CodeMailerSettings/feature.d.ts +4 -0
  22. package/features/CodeMailerSettings/feature.js +11 -0
  23. package/features/CodeMailerSettings/feature.js.map +1 -0
  24. package/features/DummyTransport/DummyMailTransport.js +11 -9
  25. package/features/DummyTransport/DummyMailTransport.js.map +1 -1
  26. package/features/DummyTransport/DummyMailTransportFactory.d.ts +1 -0
  27. package/features/DummyTransport/DummyMailTransportFactory.js +10 -6
  28. package/features/DummyTransport/DummyMailTransportFactory.js.map +1 -1
  29. package/features/DummyTransport/feature.d.ts +4 -1
  30. package/features/DummyTransport/feature.js +6 -5
  31. package/features/DummyTransport/feature.js.map +1 -1
  32. package/features/GetSettings/GetSettingsRepository.d.ts +6 -5
  33. package/features/GetSettings/GetSettingsRepository.js +44 -29
  34. package/features/GetSettings/GetSettingsRepository.js.map +1 -1
  35. package/features/GetSettings/GetSettingsUseCase.d.ts +3 -4
  36. package/features/GetSettings/GetSettingsUseCase.js +13 -10
  37. package/features/GetSettings/GetSettingsUseCase.js.map +1 -1
  38. package/features/GetSettings/abstractions.d.ts +11 -5
  39. package/features/GetSettings/abstractions.js +3 -2
  40. package/features/GetSettings/abstractions.js.map +1 -1
  41. package/features/GetSettings/feature.d.ts +4 -1
  42. package/features/GetSettings/feature.js +7 -6
  43. package/features/GetSettings/feature.js.map +1 -1
  44. package/features/GetSettings/index.d.ts +1 -1
  45. package/features/GetSettings/index.js +1 -3
  46. package/features/MailerService/ActiveTransport.d.ts +10 -0
  47. package/features/MailerService/ActiveTransport.js +24 -0
  48. package/features/MailerService/ActiveTransport.js.map +1 -0
  49. package/features/MailerService/MailerService.d.ts +3 -2
  50. package/features/MailerService/MailerService.js +39 -42
  51. package/features/MailerService/MailerService.js.map +1 -1
  52. package/features/MailerService/feature.d.ts +4 -1
  53. package/features/MailerService/feature.js +8 -5
  54. package/features/MailerService/feature.js.map +1 -1
  55. package/features/SaveSettings/SaveSettingsRepository.d.ts +1 -1
  56. package/features/SaveSettings/SaveSettingsRepository.js +30 -44
  57. package/features/SaveSettings/SaveSettingsRepository.js.map +1 -1
  58. package/features/SaveSettings/SaveSettingsUseCase.d.ts +6 -2
  59. package/features/SaveSettings/SaveSettingsUseCase.js +41 -41
  60. package/features/SaveSettings/SaveSettingsUseCase.js.map +1 -1
  61. package/features/SaveSettings/abstractions.d.ts +20 -12
  62. package/features/SaveSettings/abstractions.js +5 -8
  63. package/features/SaveSettings/abstractions.js.map +1 -1
  64. package/features/SaveSettings/events.d.ts +3 -3
  65. package/features/SaveSettings/events.js +17 -12
  66. package/features/SaveSettings/events.js.map +1 -1
  67. package/features/SaveSettings/feature.d.ts +4 -1
  68. package/features/SaveSettings/feature.js +7 -6
  69. package/features/SaveSettings/feature.js.map +1 -1
  70. package/features/SaveSettings/index.d.ts +1 -1
  71. package/features/SaveSettings/index.js +1 -3
  72. package/features/SaveSettings/validation.d.ts +3 -17
  73. package/features/SaveSettings/validation.js +14 -13
  74. package/features/SaveSettings/validation.js.map +1 -1
  75. package/features/SendMail/SendMailUseCase.d.ts +1 -1
  76. package/features/SendMail/SendMailUseCase.js +44 -48
  77. package/features/SendMail/SendMailUseCase.js.map +1 -1
  78. package/features/SendMail/abstractions.d.ts +7 -7
  79. package/features/SendMail/abstractions.js +5 -8
  80. package/features/SendMail/abstractions.js.map +1 -1
  81. package/features/SendMail/events.d.ts +4 -4
  82. package/features/SendMail/events.js +24 -17
  83. package/features/SendMail/events.js.map +1 -1
  84. package/features/SendMail/feature.d.ts +4 -1
  85. package/features/SendMail/feature.js +6 -5
  86. package/features/SendMail/feature.js.map +1 -1
  87. package/features/SendMail/index.d.ts +1 -0
  88. package/features/SendMail/index.js +1 -0
  89. package/features/SmtpTransport/SmtpConfig.js +20 -24
  90. package/features/SmtpTransport/SmtpConfig.js.map +1 -1
  91. package/features/SmtpTransport/SmtpMailTransport.d.ts +51 -1
  92. package/features/SmtpTransport/SmtpMailTransport.js +47 -55
  93. package/features/SmtpTransport/SmtpMailTransport.js.map +1 -1
  94. package/features/SmtpTransport/SmtpMailTransportFactory.d.ts +1 -0
  95. package/features/SmtpTransport/SmtpMailTransportFactory.js +10 -6
  96. package/features/SmtpTransport/SmtpMailTransportFactory.js.map +1 -1
  97. package/features/SmtpTransport/feature.d.ts +4 -1
  98. package/features/SmtpTransport/feature.js +6 -5
  99. package/features/SmtpTransport/feature.js.map +1 -1
  100. package/graphql/settings.js +58 -66
  101. package/graphql/settings.js.map +1 -1
  102. package/index.js +12 -16
  103. package/index.js.map +1 -1
  104. package/package.json +29 -32
  105. package/types.js +0 -3
  106. package/utils/isMailboxAddress.d.ts +6 -0
  107. package/utils/isMailboxAddress.js +5 -0
  108. package/utils/isMailboxAddress.js.map +1 -0
  109. package/domain/Encryption/abstractions.d.ts +0 -8
  110. package/domain/Encryption/abstractions.js +0 -4
  111. package/domain/Encryption/abstractions.js.map +0 -1
  112. package/features/Encryption/PasswordEncryption.d.ts +0 -9
  113. package/features/Encryption/PasswordEncryption.js +0 -23
  114. package/features/Encryption/PasswordEncryption.js.map +0 -1
  115. package/features/Encryption/feature.d.ts +0 -1
  116. package/features/Encryption/feature.js +0 -10
  117. package/features/Encryption/feature.js.map +0 -1
  118. package/features/Encryption/utils/password.d.ts +0 -7
  119. package/features/Encryption/utils/password.js +0 -56
  120. package/features/Encryption/utils/password.js.map +0 -1
  121. package/features/Encryption/utils/secret.d.ts +0 -1
  122. package/features/Encryption/utils/secret.js +0 -11
  123. package/features/Encryption/utils/secret.js.map +0 -1
  124. package/features/GetSettings/index.js.map +0 -1
  125. package/features/MailerService/TransportFactory.d.ts +0 -2
  126. package/features/MailerService/TransportFactory.js +0 -31
  127. package/features/MailerService/TransportFactory.js.map +0 -1
  128. package/features/SaveSettings/index.js.map +0 -1
  129. package/types.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { Result } from "@webiny/feature/api";
2
- import type { DomainEvent, IEventHandler } from "@webiny/api-core/features/EventPublisher";
2
+ import type { DomainEvent, IEventHandler } from "@webiny/api-core/features/eventPublisher/index.js";
3
3
  import type { TransportSendData, TransportSendResponse } from "../../types.js";
4
4
  import type { MailerService } from "../../domain/MailerService/abstractions.js";
5
5
  import { MailValidationError } from "../../domain/errors.js";
@@ -27,18 +27,18 @@ export interface MailSendErrorPayload {
27
27
  data: TransportSendData;
28
28
  error: Error;
29
29
  }
30
- export declare const MailBeforeSendHandler: import("@webiny/di").Abstraction<IEventHandler<DomainEvent<MailBeforeSendPayload>>>;
31
- export declare namespace MailBeforeSendHandler {
30
+ export declare const MailBeforeSendEventHandler: import("@webiny/di").Abstraction<IEventHandler<DomainEvent<MailBeforeSendPayload>>>;
31
+ export declare namespace MailBeforeSendEventHandler {
32
32
  type Interface = IEventHandler<DomainEvent<MailBeforeSendPayload>>;
33
33
  type Event = DomainEvent<MailBeforeSendPayload>;
34
34
  }
35
- export declare const MailAfterSendHandler: import("@webiny/di").Abstraction<IEventHandler<DomainEvent<MailAfterSendPayload>>>;
36
- export declare namespace MailAfterSendHandler {
35
+ export declare const MailAfterSendEventHandler: import("@webiny/di").Abstraction<IEventHandler<DomainEvent<MailAfterSendPayload>>>;
36
+ export declare namespace MailAfterSendEventHandler {
37
37
  type Interface = IEventHandler<DomainEvent<MailAfterSendPayload>>;
38
38
  type Event = DomainEvent<MailAfterSendPayload>;
39
39
  }
40
- export declare const MailSendErrorHandler: import("@webiny/di").Abstraction<IEventHandler<DomainEvent<MailSendErrorPayload>>>;
41
- export declare namespace MailSendErrorHandler {
40
+ export declare const MailSendErrorEventHandler: import("@webiny/di").Abstraction<IEventHandler<DomainEvent<MailSendErrorPayload>>>;
41
+ export declare namespace MailSendErrorEventHandler {
42
42
  type Interface = IEventHandler<DomainEvent<MailSendErrorPayload>>;
43
43
  type Event = DomainEvent<MailSendErrorPayload>;
44
44
  }
@@ -1,11 +1,8 @@
1
1
  import { createAbstraction } from "@webiny/feature/api";
2
- export const SendMailUseCase = createAbstraction("SendMail");
3
-
4
- // Domain Events
5
-
6
- // Event Handler Abstractions
7
- export const MailBeforeSendHandler = createAbstraction("MailBeforeSendHandler");
8
- export const MailAfterSendHandler = createAbstraction("MailAfterSendHandler");
9
- export const MailSendErrorHandler = createAbstraction("MailSendErrorHandler");
2
+ const SendMailUseCase = createAbstraction("SendMail");
3
+ const MailBeforeSendEventHandler = createAbstraction("MailBeforeSendEventHandler");
4
+ const MailAfterSendEventHandler = createAbstraction("MailAfterSendEventHandler");
5
+ const MailSendErrorEventHandler = createAbstraction("MailSendErrorEventHandler");
6
+ export { MailAfterSendEventHandler, MailBeforeSendEventHandler, MailSendErrorEventHandler, SendMailUseCase };
10
7
 
11
8
  //# sourceMappingURL=abstractions.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createAbstraction","SendMailUseCase","MailBeforeSendHandler","MailAfterSendHandler","MailSendErrorHandler"],"sources":["abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport { Result } from \"@webiny/feature/api\";\nimport type { DomainEvent, IEventHandler } from \"@webiny/api-core/features/EventPublisher\";\nimport type { TransportSendData, TransportSendResponse } from \"~/types.js\";\nimport type { MailerService } from \"~/domain/MailerService/abstractions.js\";\nimport { MailValidationError } from \"~/domain/errors.js\";\n\nexport interface ISendMailErrors {\n validation: MailValidationError;\n mailService: MailerService.Error;\n}\n\ntype SendMailErrors = ISendMailErrors[keyof ISendMailErrors];\n\nexport interface ISendMailUseCase {\n execute(data: TransportSendData): Promise<Result<TransportSendResponse, SendMailErrors>>;\n}\n\nexport const SendMailUseCase = createAbstraction<ISendMailUseCase>(\"SendMail\");\n\nexport namespace SendMailUseCase {\n export type Interface = ISendMailUseCase;\n export type Error = SendMailErrors;\n}\n\n// Domain Events\nexport interface MailBeforeSendPayload {\n data: TransportSendData;\n}\n\nexport interface MailAfterSendPayload {\n data: TransportSendData;\n response: TransportSendResponse;\n}\n\nexport interface MailSendErrorPayload {\n data: TransportSendData;\n error: Error;\n}\n\n// Event Handler Abstractions\nexport const MailBeforeSendHandler =\n createAbstraction<IEventHandler<DomainEvent<MailBeforeSendPayload>>>(\"MailBeforeSendHandler\");\n\nexport namespace MailBeforeSendHandler {\n export type Interface = IEventHandler<DomainEvent<MailBeforeSendPayload>>;\n export type Event = DomainEvent<MailBeforeSendPayload>;\n}\n\nexport const MailAfterSendHandler =\n createAbstraction<IEventHandler<DomainEvent<MailAfterSendPayload>>>(\"MailAfterSendHandler\");\n\nexport namespace MailAfterSendHandler {\n export type Interface = IEventHandler<DomainEvent<MailAfterSendPayload>>;\n export type Event = DomainEvent<MailAfterSendPayload>;\n}\n\nexport const MailSendErrorHandler =\n createAbstraction<IEventHandler<DomainEvent<MailSendErrorPayload>>>(\"MailSendErrorHandler\");\n\nexport namespace MailSendErrorHandler {\n export type Interface = IEventHandler<DomainEvent<MailSendErrorPayload>>;\n export type Event = DomainEvent<MailSendErrorPayload>;\n}\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,qBAAqB;AAkBvD,OAAO,MAAMC,eAAe,GAAGD,iBAAiB,CAAmB,UAAU,CAAC;;AAO9E;;AAeA;AACA,OAAO,MAAME,qBAAqB,GAC9BF,iBAAiB,CAAoD,uBAAuB,CAAC;AAOjG,OAAO,MAAMG,oBAAoB,GAC7BH,iBAAiB,CAAmD,sBAAsB,CAAC;AAO/F,OAAO,MAAMI,oBAAoB,GAC7BJ,iBAAiB,CAAmD,sBAAsB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"features/SendMail/abstractions.js","sources":["../../../src/features/SendMail/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport { Result } from \"@webiny/feature/api\";\nimport type { DomainEvent, IEventHandler } from \"@webiny/api-core/features/eventPublisher/index.js\";\nimport type { TransportSendData, TransportSendResponse } from \"~/types.js\";\nimport type { MailerService } from \"~/domain/MailerService/abstractions.js\";\nimport { MailValidationError } from \"~/domain/errors.js\";\n\nexport interface ISendMailErrors {\n validation: MailValidationError;\n mailService: MailerService.Error;\n}\n\ntype SendMailErrors = ISendMailErrors[keyof ISendMailErrors];\n\nexport interface ISendMailUseCase {\n execute(data: TransportSendData): Promise<Result<TransportSendResponse, SendMailErrors>>;\n}\n\nexport const SendMailUseCase = createAbstraction<ISendMailUseCase>(\"SendMail\");\n\nexport namespace SendMailUseCase {\n export type Interface = ISendMailUseCase;\n export type Error = SendMailErrors;\n}\n\n// Domain Events\nexport interface MailBeforeSendPayload {\n data: TransportSendData;\n}\n\nexport interface MailAfterSendPayload {\n data: TransportSendData;\n response: TransportSendResponse;\n}\n\nexport interface MailSendErrorPayload {\n data: TransportSendData;\n error: Error;\n}\n\n// Event Handler Abstractions\nexport const MailBeforeSendEventHandler = createAbstraction<\n IEventHandler<DomainEvent<MailBeforeSendPayload>>\n>(\"MailBeforeSendEventHandler\");\n\nexport namespace MailBeforeSendEventHandler {\n export type Interface = IEventHandler<DomainEvent<MailBeforeSendPayload>>;\n export type Event = DomainEvent<MailBeforeSendPayload>;\n}\n\nexport const MailAfterSendEventHandler = createAbstraction<\n IEventHandler<DomainEvent<MailAfterSendPayload>>\n>(\"MailAfterSendEventHandler\");\n\nexport namespace MailAfterSendEventHandler {\n export type Interface = IEventHandler<DomainEvent<MailAfterSendPayload>>;\n export type Event = DomainEvent<MailAfterSendPayload>;\n}\n\nexport const MailSendErrorEventHandler = createAbstraction<\n IEventHandler<DomainEvent<MailSendErrorPayload>>\n>(\"MailSendErrorEventHandler\");\n\nexport namespace MailSendErrorEventHandler {\n export type Interface = IEventHandler<DomainEvent<MailSendErrorPayload>>;\n export type Event = DomainEvent<MailSendErrorPayload>;\n}\n"],"names":["SendMailUseCase","createAbstraction","MailBeforeSendEventHandler","MailAfterSendEventHandler","MailSendErrorEventHandler"],"mappings":";AAkBO,MAAMA,kBAAkBC,kBAAoC;AAuB5D,MAAMC,6BAA6BD,kBAExC;AAOK,MAAME,4BAA4BF,kBAEvC;AAOK,MAAMG,4BAA4BH,kBAEvC"}
@@ -1,14 +1,14 @@
1
- import { DomainEvent } from "@webiny/api-core/features/EventPublisher";
1
+ import { DomainEvent } from "@webiny/api-core/features/eventPublisher/index.js";
2
2
  import type { MailBeforeSendPayload, MailAfterSendPayload, MailSendErrorPayload } from "./abstractions.js";
3
3
  export declare class MailBeforeSendEvent extends DomainEvent<MailBeforeSendPayload> {
4
4
  eventType: "mailer.mail.beforeSend";
5
- getHandlerAbstraction(): import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<DomainEvent<MailBeforeSendPayload>>>;
5
+ getHandlerAbstraction(): import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher/abstractions.js").IEventHandler<DomainEvent<MailBeforeSendPayload>>>;
6
6
  }
7
7
  export declare class MailAfterSendEvent extends DomainEvent<MailAfterSendPayload> {
8
8
  eventType: "mailer.mail.afterSend";
9
- getHandlerAbstraction(): import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<DomainEvent<MailAfterSendPayload>>>;
9
+ getHandlerAbstraction(): import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher/abstractions.js").IEventHandler<DomainEvent<MailAfterSendPayload>>>;
10
10
  }
11
11
  export declare class MailSendErrorEvent extends DomainEvent<MailSendErrorPayload> {
12
12
  eventType: "mailer.mail.sendError";
13
- getHandlerAbstraction(): import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<DomainEvent<MailSendErrorPayload>>>;
13
+ getHandlerAbstraction(): import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher/abstractions.js").IEventHandler<DomainEvent<MailSendErrorPayload>>>;
14
14
  }
@@ -1,22 +1,29 @@
1
- import { DomainEvent } from "@webiny/api-core/features/EventPublisher";
2
- import { MailBeforeSendHandler, MailAfterSendHandler, MailSendErrorHandler } from "./abstractions.js";
3
- export class MailBeforeSendEvent extends DomainEvent {
4
- eventType = "mailer.mail.beforeSend";
5
- getHandlerAbstraction() {
6
- return MailBeforeSendHandler;
7
- }
1
+ import { DomainEvent } from "@webiny/api-core/features/eventPublisher/index.js";
2
+ import { MailAfterSendEventHandler, MailBeforeSendEventHandler, MailSendErrorEventHandler } from "./abstractions.js";
3
+ class MailBeforeSendEvent extends DomainEvent {
4
+ getHandlerAbstraction() {
5
+ return MailBeforeSendEventHandler;
6
+ }
7
+ constructor(...args){
8
+ super(...args), this.eventType = "mailer.mail.beforeSend";
9
+ }
8
10
  }
9
- export class MailAfterSendEvent extends DomainEvent {
10
- eventType = "mailer.mail.afterSend";
11
- getHandlerAbstraction() {
12
- return MailAfterSendHandler;
13
- }
11
+ class MailAfterSendEvent extends DomainEvent {
12
+ getHandlerAbstraction() {
13
+ return MailAfterSendEventHandler;
14
+ }
15
+ constructor(...args){
16
+ super(...args), this.eventType = "mailer.mail.afterSend";
17
+ }
14
18
  }
15
- export class MailSendErrorEvent extends DomainEvent {
16
- eventType = "mailer.mail.sendError";
17
- getHandlerAbstraction() {
18
- return MailSendErrorHandler;
19
- }
19
+ class MailSendErrorEvent extends DomainEvent {
20
+ getHandlerAbstraction() {
21
+ return MailSendErrorEventHandler;
22
+ }
23
+ constructor(...args){
24
+ super(...args), this.eventType = "mailer.mail.sendError";
25
+ }
20
26
  }
27
+ export { MailAfterSendEvent, MailBeforeSendEvent, MailSendErrorEvent };
21
28
 
22
29
  //# sourceMappingURL=events.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["DomainEvent","MailBeforeSendHandler","MailAfterSendHandler","MailSendErrorHandler","MailBeforeSendEvent","eventType","getHandlerAbstraction","MailAfterSendEvent","MailSendErrorEvent"],"sources":["events.ts"],"sourcesContent":["import { DomainEvent } from \"@webiny/api-core/features/EventPublisher\";\nimport {\n MailBeforeSendHandler,\n MailAfterSendHandler,\n MailSendErrorHandler\n} from \"./abstractions.js\";\nimport type {\n MailBeforeSendPayload,\n MailAfterSendPayload,\n MailSendErrorPayload\n} from \"./abstractions.js\";\n\nexport class MailBeforeSendEvent extends DomainEvent<MailBeforeSendPayload> {\n eventType = \"mailer.mail.beforeSend\" as const;\n\n getHandlerAbstraction() {\n return MailBeforeSendHandler;\n }\n}\n\nexport class MailAfterSendEvent extends DomainEvent<MailAfterSendPayload> {\n eventType = \"mailer.mail.afterSend\" as const;\n\n getHandlerAbstraction() {\n return MailAfterSendHandler;\n }\n}\n\nexport class MailSendErrorEvent extends DomainEvent<MailSendErrorPayload> {\n eventType = \"mailer.mail.sendError\" as const;\n\n getHandlerAbstraction() {\n return MailSendErrorHandler;\n }\n}\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,0CAA0C;AACtE,SACIC,qBAAqB,EACrBC,oBAAoB,EACpBC,oBAAoB;AAQxB,OAAO,MAAMC,mBAAmB,SAASJ,WAAW,CAAwB;EACxEK,SAAS,GAAG,wBAAwB;EAEpCC,qBAAqBA,CAAA,EAAG;IACpB,OAAOL,qBAAqB;EAChC;AACJ;AAEA,OAAO,MAAMM,kBAAkB,SAASP,WAAW,CAAuB;EACtEK,SAAS,GAAG,uBAAuB;EAEnCC,qBAAqBA,CAAA,EAAG;IACpB,OAAOJ,oBAAoB;EAC/B;AACJ;AAEA,OAAO,MAAMM,kBAAkB,SAASR,WAAW,CAAuB;EACtEK,SAAS,GAAG,uBAAuB;EAEnCC,qBAAqBA,CAAA,EAAG;IACpB,OAAOH,oBAAoB;EAC/B;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"features/SendMail/events.js","sources":["../../../src/features/SendMail/events.ts"],"sourcesContent":["import { DomainEvent } from \"@webiny/api-core/features/eventPublisher/index.js\";\nimport {\n MailBeforeSendEventHandler,\n MailAfterSendEventHandler,\n MailSendErrorEventHandler\n} from \"./abstractions.js\";\nimport type {\n MailBeforeSendPayload,\n MailAfterSendPayload,\n MailSendErrorPayload\n} from \"./abstractions.js\";\n\nexport class MailBeforeSendEvent extends DomainEvent<MailBeforeSendPayload> {\n eventType = \"mailer.mail.beforeSend\" as const;\n\n getHandlerAbstraction() {\n return MailBeforeSendEventHandler;\n }\n}\n\nexport class MailAfterSendEvent extends DomainEvent<MailAfterSendPayload> {\n eventType = \"mailer.mail.afterSend\" as const;\n\n getHandlerAbstraction() {\n return MailAfterSendEventHandler;\n }\n}\n\nexport class MailSendErrorEvent extends DomainEvent<MailSendErrorPayload> {\n eventType = \"mailer.mail.sendError\" as const;\n\n getHandlerAbstraction() {\n return MailSendErrorEventHandler;\n }\n}\n"],"names":["MailBeforeSendEvent","DomainEvent","MailBeforeSendEventHandler","MailAfterSendEvent","MailAfterSendEventHandler","MailSendErrorEvent","MailSendErrorEventHandler"],"mappings":";;AAYO,MAAMA,4BAA4BC;IAGrC,wBAAwB;QACpB,OAAOC;IACX;;QALG,qBACH,SAAS,GAAG;;AAKhB;AAEO,MAAMC,2BAA2BF;IAGpC,wBAAwB;QACpB,OAAOG;IACX;;QALG,qBACH,SAAS,GAAG;;AAKhB;AAEO,MAAMC,2BAA2BJ;IAGpC,wBAAwB;QACpB,OAAOK;IACX;;QALG,qBACH,SAAS,GAAG;;AAKhB"}
@@ -1 +1,4 @@
1
- export declare const SendMailFeature: import("@webiny/feature/api/createFeature.js").FeatureDefinition<unknown>;
1
+ export declare const SendMailFeature: {
2
+ name: string;
3
+ register(container: import("@webiny/di").Container): void;
4
+ };
@@ -1,10 +1,11 @@
1
1
  import { createFeature } from "@webiny/feature/api";
2
2
  import { SendMailUseCaseImplementation } from "./SendMailUseCase.js";
3
- export const SendMailFeature = createFeature({
4
- name: "SendMail",
5
- register(container) {
6
- container.register(SendMailUseCaseImplementation);
7
- }
3
+ const SendMailFeature = createFeature({
4
+ name: "SendMail",
5
+ register (container) {
6
+ container.register(SendMailUseCaseImplementation);
7
+ }
8
8
  });
9
+ export { SendMailFeature };
9
10
 
10
11
  //# sourceMappingURL=feature.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createFeature","SendMailUseCaseImplementation","SendMailFeature","name","register","container"],"sources":["feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { SendMailUseCaseImplementation } from \"./SendMailUseCase.js\";\n\nexport const SendMailFeature = createFeature({\n name: \"SendMail\",\n register(container) {\n container.register(SendMailUseCaseImplementation);\n }\n});\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,qBAAqB;AACnD,SAASC,6BAA6B;AAEtC,OAAO,MAAMC,eAAe,GAAGF,aAAa,CAAC;EACzCG,IAAI,EAAE,UAAU;EAChBC,QAAQA,CAACC,SAAS,EAAE;IAChBA,SAAS,CAACD,QAAQ,CAACH,6BAA6B,CAAC;EACrD;AACJ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"features/SendMail/feature.js","sources":["../../../src/features/SendMail/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { SendMailUseCaseImplementation } from \"./SendMailUseCase.js\";\n\nexport const SendMailFeature = createFeature({\n name: \"SendMail\",\n register(container) {\n container.register(SendMailUseCaseImplementation);\n }\n});\n"],"names":["SendMailFeature","createFeature","container","SendMailUseCaseImplementation"],"mappings":";;AAGO,MAAMA,kBAAkBC,cAAc;IACzC,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;IACvB;AACJ"}
@@ -0,0 +1 @@
1
+ export { SendMailUseCase, MailAfterSendEventHandler, MailBeforeSendEventHandler, MailSendErrorEventHandler } from "./abstractions.js";
@@ -0,0 +1 @@
1
+ export { MailAfterSendEventHandler, MailBeforeSendEventHandler, MailSendErrorEventHandler, SendMailUseCase } from "./abstractions.js";
@@ -1,29 +1,25 @@
1
1
  const configDefaults = {
2
- socketTimeout: 15000,
3
- connectionTimeout: 15000,
4
- greetingTimeout: 15000
2
+ socketTimeout: 15000,
3
+ connectionTimeout: 15000,
4
+ greetingTimeout: 15000
5
5
  };
6
- export class SmtpConfig {
7
- static fromTransportSettings(settings) {
8
- const baseConfig = {
9
- host: settings.host,
10
- port: settings.port,
11
- auth: {
12
- user: settings.user,
13
- pass: settings.password
14
- }
15
- };
16
-
17
- // Apply defaults
18
- return Object.keys(configDefaults).reduce((config, key) => {
19
- const configKey = key;
20
- if (config[configKey] === undefined || config[configKey] === null) {
21
- // @ts-expect-error
22
- config[configKey] = configDefaults[configKey];
23
- }
24
- return config;
25
- }, baseConfig);
26
- }
6
+ class SmtpConfig {
7
+ static fromTransportSettings(settings) {
8
+ const baseConfig = {
9
+ host: settings.host,
10
+ port: settings.port,
11
+ auth: {
12
+ user: settings.user,
13
+ pass: settings.password
14
+ }
15
+ };
16
+ return Object.keys(configDefaults).reduce((config, key)=>{
17
+ const configKey = key;
18
+ if (void 0 === config[configKey] || null === config[configKey]) config[configKey] = configDefaults[configKey];
19
+ return config;
20
+ }, baseConfig);
21
+ }
27
22
  }
23
+ export { SmtpConfig };
28
24
 
29
25
  //# sourceMappingURL=SmtpConfig.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["configDefaults","socketTimeout","connectionTimeout","greetingTimeout","SmtpConfig","fromTransportSettings","settings","baseConfig","host","port","auth","user","pass","password","Object","keys","reduce","config","key","configKey","undefined"],"sources":["SmtpConfig.ts"],"sourcesContent":["import type { TransportSettings } from \"~/types.js\";\nimport type SMTPTransport from \"nodemailer/lib/smtp-transport\";\n\nexport type SmtpTransportConfig = SMTPTransport.Options;\n\nconst configDefaults: Partial<SmtpTransportConfig> = {\n socketTimeout: 15000,\n connectionTimeout: 15000,\n greetingTimeout: 15000\n};\n\nexport class SmtpConfig {\n static fromTransportSettings(settings: TransportSettings): SmtpTransportConfig {\n const baseConfig: SmtpTransportConfig = {\n host: settings.host,\n port: settings.port,\n auth: {\n user: settings.user,\n pass: settings.password\n }\n };\n\n // Apply defaults\n return Object.keys(configDefaults).reduce<SmtpTransportConfig>((config, key) => {\n const configKey = key as keyof SmtpTransportConfig;\n if (config[configKey] === undefined || config[configKey] === null) {\n // @ts-expect-error\n config[configKey] = configDefaults[configKey];\n }\n return config;\n }, baseConfig);\n }\n}\n"],"mappings":"AAKA,MAAMA,cAA4C,GAAG;EACjDC,aAAa,EAAE,KAAK;EACpBC,iBAAiB,EAAE,KAAK;EACxBC,eAAe,EAAE;AACrB,CAAC;AAED,OAAO,MAAMC,UAAU,CAAC;EACpB,OAAOC,qBAAqBA,CAACC,QAA2B,EAAuB;IAC3E,MAAMC,UAA+B,GAAG;MACpCC,IAAI,EAAEF,QAAQ,CAACE,IAAI;MACnBC,IAAI,EAAEH,QAAQ,CAACG,IAAI;MACnBC,IAAI,EAAE;QACFC,IAAI,EAAEL,QAAQ,CAACK,IAAI;QACnBC,IAAI,EAAEN,QAAQ,CAACO;MACnB;IACJ,CAAC;;IAED;IACA,OAAOC,MAAM,CAACC,IAAI,CAACf,cAAc,CAAC,CAACgB,MAAM,CAAsB,CAACC,MAAM,EAAEC,GAAG,KAAK;MAC5E,MAAMC,SAAS,GAAGD,GAAgC;MAClD,IAAID,MAAM,CAACE,SAAS,CAAC,KAAKC,SAAS,IAAIH,MAAM,CAACE,SAAS,CAAC,KAAK,IAAI,EAAE;QAC/D;QACAF,MAAM,CAACE,SAAS,CAAC,GAAGnB,cAAc,CAACmB,SAAS,CAAC;MACjD;MACA,OAAOF,MAAM;IACjB,CAAC,EAAEV,UAAU,CAAC;EAClB;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"features/SmtpTransport/SmtpConfig.js","sources":["../../../src/features/SmtpTransport/SmtpConfig.ts"],"sourcesContent":["import type { TransportSettings } from \"~/types.js\";\nimport type SMTPTransport from \"nodemailer/lib/smtp-transport\";\n\nexport type SmtpTransportConfig = SMTPTransport.Options;\n\nconst configDefaults: Partial<SmtpTransportConfig> = {\n socketTimeout: 15000,\n connectionTimeout: 15000,\n greetingTimeout: 15000\n};\n\nexport class SmtpConfig {\n static fromTransportSettings(settings: TransportSettings): SmtpTransportConfig {\n const baseConfig: SmtpTransportConfig = {\n host: settings.host,\n port: settings.port,\n auth: {\n user: settings.user,\n pass: settings.password\n }\n };\n\n // Apply defaults\n return Object.keys(configDefaults).reduce<SmtpTransportConfig>((config, key) => {\n const configKey = key as keyof SmtpTransportConfig;\n if (config[configKey] === undefined || config[configKey] === null) {\n // @ts-expect-error\n config[configKey] = configDefaults[configKey];\n }\n return config;\n }, baseConfig);\n }\n}\n"],"names":["configDefaults","SmtpConfig","settings","baseConfig","Object","config","key","configKey","undefined"],"mappings":"AAKA,MAAMA,iBAA+C;IACjD,eAAe;IACf,mBAAmB;IACnB,iBAAiB;AACrB;AAEO,MAAMC;IACT,OAAO,sBAAsBC,QAA2B,EAAuB;QAC3E,MAAMC,aAAkC;YACpC,MAAMD,SAAS,IAAI;YACnB,MAAMA,SAAS,IAAI;YACnB,MAAM;gBACF,MAAMA,SAAS,IAAI;gBACnB,MAAMA,SAAS,QAAQ;YAC3B;QACJ;QAGA,OAAOE,OAAO,IAAI,CAACJ,gBAAgB,MAAM,CAAsB,CAACK,QAAQC;YACpE,MAAMC,YAAYD;YAClB,IAAID,AAAsBG,WAAtBH,MAAM,CAACE,UAAU,IAAkBF,AAAsB,SAAtBA,MAAM,CAACE,UAAU,EAEpDF,MAAM,CAACE,UAAU,GAAGP,cAAc,CAACO,UAAU;YAEjD,OAAOF;QACX,GAAGF;IACP;AACJ"}
@@ -7,12 +7,62 @@ export declare class SmtpMailTransport implements MailTransport.Interface {
7
7
  send(params: MailTransport.SendParams): Promise<{
8
8
  result: string;
9
9
  error: null;
10
+ } | {
11
+ result: null;
12
+ error: {
13
+ message: string;
14
+ code: string;
15
+ data: {
16
+ envelope: import("nodemailer/lib/mime-node").Envelope;
17
+ messageId: string;
18
+ accepted: Array<string | import("nodemailer/lib/mailer").Address>;
19
+ rejected: Array<string | import("nodemailer/lib/mailer").Address>;
20
+ pending: Array<string | import("nodemailer/lib/mailer").Address>;
21
+ response: string;
22
+ };
23
+ };
10
24
  } | {
11
25
  result: null;
12
26
  error: {
13
27
  message: any;
14
28
  code: any;
15
- data: any;
29
+ data: {
30
+ command: any;
31
+ response: any;
32
+ responseCode: any;
33
+ to: string[];
34
+ cc?: string[];
35
+ bcc?: string[];
36
+ from?: string;
37
+ subject: string;
38
+ text?: string;
39
+ html?: string;
40
+ replyTo?: string;
41
+ } | {
42
+ command: any;
43
+ response: any;
44
+ responseCode: any;
45
+ to?: string[];
46
+ cc: string[];
47
+ bcc?: string[];
48
+ from?: string;
49
+ subject: string;
50
+ text?: string;
51
+ html?: string;
52
+ replyTo?: string;
53
+ } | {
54
+ command: any;
55
+ response: any;
56
+ responseCode: any;
57
+ to?: string[];
58
+ cc?: string[];
59
+ bcc: string[];
60
+ from?: string;
61
+ subject: string;
62
+ text?: string;
63
+ html?: string;
64
+ replyTo?: string;
65
+ };
16
66
  };
17
67
  }>;
18
68
  }
@@ -1,61 +1,53 @@
1
1
  import nodemailer from "nodemailer";
2
- export class SmtpMailTransport {
3
- name = "Mailer/SmtpTransport";
4
- constructor(config) {
5
- this.transporter = nodemailer.createTransport(config);
6
- }
7
- async send(params) {
8
- const {
9
- replyTo,
10
- text,
11
- html,
12
- to,
13
- bcc,
14
- cc,
15
- from,
16
- subject
17
- } = params;
18
- try {
19
- const result = await this.transporter.sendMail({
20
- replyTo,
21
- bcc,
22
- cc,
23
- from,
24
- text,
25
- html,
26
- to,
27
- subject
28
- });
29
- if (result.messageId) {
30
- return {
31
- result: result.response,
32
- error: null
33
- };
34
- }
35
- return {
36
- result: null,
37
- error: {
38
- message: "nodemailer.sendMail does not have a messageId in the result. Something went wrong...",
39
- code: "MAILER_ERROR",
40
- data: {
41
- ...result
42
- }
43
- }
44
- };
45
- } catch (ex) {
46
- return {
47
- result: null,
48
- error: {
49
- message: ex.message,
50
- code: ex.code,
51
- data: {
52
- ...params,
53
- ...ex.data
54
- }
2
+ class SmtpMailTransport {
3
+ constructor(config){
4
+ this.name = "Mailer/SmtpTransport";
5
+ this.transporter = nodemailer.createTransport(config);
6
+ }
7
+ async send(params) {
8
+ const { replyTo, text, html, to, bcc, cc, from, subject } = params;
9
+ try {
10
+ const result = await this.transporter.sendMail({
11
+ replyTo,
12
+ bcc,
13
+ cc,
14
+ from,
15
+ text,
16
+ html,
17
+ to,
18
+ subject
19
+ });
20
+ if (result.messageId) return {
21
+ result: result.response,
22
+ error: null
23
+ };
24
+ return {
25
+ result: null,
26
+ error: {
27
+ message: "nodemailer.sendMail does not have a messageId in the result. Something went wrong...",
28
+ code: "MAILER_ERROR",
29
+ data: {
30
+ ...result
31
+ }
32
+ }
33
+ };
34
+ } catch (ex) {
35
+ return {
36
+ result: null,
37
+ error: {
38
+ message: ex.message,
39
+ code: ex.code,
40
+ data: {
41
+ ...params,
42
+ command: ex.command,
43
+ response: ex.response,
44
+ responseCode: ex.responseCode
45
+ }
46
+ }
47
+ };
55
48
  }
56
- };
57
49
  }
58
- }
59
50
  }
51
+ export { SmtpMailTransport };
60
52
 
61
53
  //# sourceMappingURL=SmtpMailTransport.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["nodemailer","SmtpMailTransport","name","constructor","config","transporter","createTransport","send","params","replyTo","text","html","to","bcc","cc","from","subject","result","sendMail","messageId","response","error","message","code","data","ex"],"sources":["SmtpMailTransport.ts"],"sourcesContent":["import type { Transporter } from \"nodemailer\";\nimport nodemailer from \"nodemailer\";\nimport type SMTPTransport from \"nodemailer/lib/smtp-transport\";\nimport { MailTransport } from \"~/domain/MailTransport/abstractions.js\";\n\nexport class SmtpMailTransport implements MailTransport.Interface {\n public readonly name = \"Mailer/SmtpTransport\";\n private readonly transporter: Transporter<SMTPTransport.SentMessageInfo>;\n\n constructor(config: SMTPTransport.Options) {\n this.transporter = nodemailer.createTransport(config);\n }\n\n async send(params: MailTransport.SendParams) {\n const { replyTo, text, html, to, bcc, cc, from, subject } = params;\n\n try {\n const result = await this.transporter.sendMail({\n replyTo,\n bcc,\n cc,\n from,\n text,\n html,\n to,\n subject\n });\n\n if (result.messageId) {\n return {\n result: result.response,\n error: null\n };\n }\n\n return {\n result: null,\n error: {\n message:\n \"nodemailer.sendMail does not have a messageId in the result. Something went wrong...\",\n code: \"MAILER_ERROR\",\n data: {\n ...result\n }\n }\n };\n } catch (ex: any) {\n return {\n result: null,\n error: {\n message: ex.message,\n code: ex.code,\n data: {\n ...params,\n ...ex.data\n }\n }\n };\n }\n }\n}\n"],"mappings":"AACA,OAAOA,UAAU,MAAM,YAAY;AAInC,OAAO,MAAMC,iBAAiB,CAAoC;EAC9CC,IAAI,GAAG,sBAAsB;EAG7CC,WAAWA,CAACC,MAA6B,EAAE;IACvC,IAAI,CAACC,WAAW,GAAGL,UAAU,CAACM,eAAe,CAACF,MAAM,CAAC;EACzD;EAEA,MAAMG,IAAIA,CAACC,MAAgC,EAAE;IACzC,MAAM;MAAEC,OAAO;MAAEC,IAAI;MAAEC,IAAI;MAAEC,EAAE;MAAEC,GAAG;MAAEC,EAAE;MAAEC,IAAI;MAAEC;IAAQ,CAAC,GAAGR,MAAM;IAElE,IAAI;MACA,MAAMS,MAAM,GAAG,MAAM,IAAI,CAACZ,WAAW,CAACa,QAAQ,CAAC;QAC3CT,OAAO;QACPI,GAAG;QACHC,EAAE;QACFC,IAAI;QACJL,IAAI;QACJC,IAAI;QACJC,EAAE;QACFI;MACJ,CAAC,CAAC;MAEF,IAAIC,MAAM,CAACE,SAAS,EAAE;QAClB,OAAO;UACHF,MAAM,EAAEA,MAAM,CAACG,QAAQ;UACvBC,KAAK,EAAE;QACX,CAAC;MACL;MAEA,OAAO;QACHJ,MAAM,EAAE,IAAI;QACZI,KAAK,EAAE;UACHC,OAAO,EACH,sFAAsF;UAC1FC,IAAI,EAAE,cAAc;UACpBC,IAAI,EAAE;YACF,GAAGP;UACP;QACJ;MACJ,CAAC;IACL,CAAC,CAAC,OAAOQ,EAAO,EAAE;MACd,OAAO;QACHR,MAAM,EAAE,IAAI;QACZI,KAAK,EAAE;UACHC,OAAO,EAAEG,EAAE,CAACH,OAAO;UACnBC,IAAI,EAAEE,EAAE,CAACF,IAAI;UACbC,IAAI,EAAE;YACF,GAAGhB,MAAM;YACT,GAAGiB,EAAE,CAACD;UACV;QACJ;MACJ,CAAC;IACL;EACJ;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"features/SmtpTransport/SmtpMailTransport.js","sources":["../../../src/features/SmtpTransport/SmtpMailTransport.ts"],"sourcesContent":["import type { Transporter } from \"nodemailer\";\nimport nodemailer from \"nodemailer\";\nimport type SMTPTransport from \"nodemailer/lib/smtp-transport\";\nimport { MailTransport } from \"~/domain/MailTransport/abstractions.js\";\n\nexport class SmtpMailTransport implements MailTransport.Interface {\n public readonly name = \"Mailer/SmtpTransport\";\n private readonly transporter: Transporter<SMTPTransport.SentMessageInfo>;\n\n constructor(config: SMTPTransport.Options) {\n this.transporter = nodemailer.createTransport(config);\n }\n\n async send(params: MailTransport.SendParams) {\n const { replyTo, text, html, to, bcc, cc, from, subject } = params;\n\n try {\n const result = await this.transporter.sendMail({\n replyTo,\n bcc,\n cc,\n from,\n text,\n html,\n to,\n subject\n });\n\n if (result.messageId) {\n return {\n result: result.response,\n error: null\n };\n }\n\n return {\n result: null,\n error: {\n message:\n \"nodemailer.sendMail does not have a messageId in the result. Something went wrong...\",\n code: \"MAILER_ERROR\",\n data: {\n ...result\n }\n }\n };\n } catch (ex: any) {\n // Allow-list specific nodemailer/SMTP error fields. Spreading `ex`\n // or `ex.data` blindly would risk surfacing the transporter's auth\n // config (or anything else a future nodemailer version stamps onto\n // its errors) in error responses.\n return {\n result: null,\n error: {\n message: ex.message,\n code: ex.code,\n data: {\n ...params,\n command: ex.command,\n response: ex.response,\n responseCode: ex.responseCode\n }\n }\n };\n }\n }\n}\n"],"names":["SmtpMailTransport","config","nodemailer","params","replyTo","text","html","to","bcc","cc","from","subject","result","ex"],"mappings":";AAKO,MAAMA;IAIT,YAAYC,MAA6B,CAAE;aAH3B,IAAI,GAAG;QAInB,IAAI,CAAC,WAAW,GAAGC,WAAW,eAAe,CAACD;IAClD;IAEA,MAAM,KAAKE,MAAgC,EAAE;QACzC,MAAM,EAAEC,OAAO,EAAEC,IAAI,EAAEC,IAAI,EAAEC,EAAE,EAAEC,GAAG,EAAEC,EAAE,EAAEC,IAAI,EAAEC,OAAO,EAAE,GAAGR;QAE5D,IAAI;YACA,MAAMS,SAAS,MAAM,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC;gBAC3CR;gBACAI;gBACAC;gBACAC;gBACAL;gBACAC;gBACAC;gBACAI;YACJ;YAEA,IAAIC,OAAO,SAAS,EAChB,OAAO;gBACH,QAAQA,OAAO,QAAQ;gBACvB,OAAO;YACX;YAGJ,OAAO;gBACH,QAAQ;gBACR,OAAO;oBACH,SACI;oBACJ,MAAM;oBACN,MAAM;wBACF,GAAGA,MAAM;oBACb;gBACJ;YACJ;QACJ,EAAE,OAAOC,IAAS;YAKd,OAAO;gBACH,QAAQ;gBACR,OAAO;oBACH,SAASA,GAAG,OAAO;oBACnB,MAAMA,GAAG,IAAI;oBACb,MAAM;wBACF,GAAGV,MAAM;wBACT,SAASU,GAAG,OAAO;wBACnB,UAAUA,GAAG,QAAQ;wBACrB,cAAcA,GAAG,YAAY;oBACjC;gBACJ;YACJ;QACJ;IACJ;AACJ"}
@@ -1,6 +1,7 @@
1
1
  import { MailTransportFactory } from "../../domain/MailTransport/abstractions.js";
2
2
  import type { TransportSettings } from "../../types.js";
3
3
  declare class SmtpMailTransportFactoryImpl implements MailTransportFactory.Interface {
4
+ readonly name = "Mailer/SmtpTransport";
4
5
  createTransport(settings: TransportSettings): MailTransportFactory.Return;
5
6
  }
6
7
  export declare const SmtpMailTransportFactory: typeof SmtpMailTransportFactoryImpl & {
@@ -2,13 +2,17 @@ import { MailTransportFactory } from "../../domain/MailTransport/abstractions.js
2
2
  import { SmtpMailTransport } from "./SmtpMailTransport.js";
3
3
  import { SmtpConfig } from "./SmtpConfig.js";
4
4
  class SmtpMailTransportFactoryImpl {
5
- async createTransport(settings) {
6
- return new SmtpMailTransport(SmtpConfig.fromTransportSettings(settings));
7
- }
5
+ async createTransport(settings) {
6
+ return new SmtpMailTransport(SmtpConfig.fromTransportSettings(settings));
7
+ }
8
+ constructor(){
9
+ this.name = "Mailer/SmtpTransport";
10
+ }
8
11
  }
9
- export const SmtpMailTransportFactory = MailTransportFactory.createImplementation({
10
- implementation: SmtpMailTransportFactoryImpl,
11
- dependencies: []
12
+ const SmtpMailTransportFactory = MailTransportFactory.createImplementation({
13
+ implementation: SmtpMailTransportFactoryImpl,
14
+ dependencies: []
12
15
  });
16
+ export { SmtpMailTransportFactory };
13
17
 
14
18
  //# sourceMappingURL=SmtpMailTransportFactory.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["MailTransportFactory","SmtpMailTransport","SmtpConfig","SmtpMailTransportFactoryImpl","createTransport","settings","fromTransportSettings","SmtpMailTransportFactory","createImplementation","implementation","dependencies"],"sources":["SmtpMailTransportFactory.ts"],"sourcesContent":["import { MailTransportFactory } from \"~/domain/MailTransport/abstractions.js\";\nimport type { TransportSettings } from \"~/types.js\";\nimport { SmtpMailTransport } from \"~/features/SmtpTransport/SmtpMailTransport.js\";\nimport { SmtpConfig } from \"~/features/SmtpTransport/SmtpConfig.js\";\n\nclass SmtpMailTransportFactoryImpl implements MailTransportFactory.Interface {\n async createTransport(settings: TransportSettings): MailTransportFactory.Return {\n return new SmtpMailTransport(SmtpConfig.fromTransportSettings(settings));\n }\n}\n\nexport const SmtpMailTransportFactory = MailTransportFactory.createImplementation({\n implementation: SmtpMailTransportFactoryImpl,\n dependencies: []\n});\n"],"mappings":"AAAA,SAASA,oBAAoB;AAE7B,SAASC,iBAAiB;AAC1B,SAASC,UAAU;AAEnB,MAAMC,4BAA4B,CAA2C;EACzE,MAAMC,eAAeA,CAACC,QAA2B,EAA+B;IAC5E,OAAO,IAAIJ,iBAAiB,CAACC,UAAU,CAACI,qBAAqB,CAACD,QAAQ,CAAC,CAAC;EAC5E;AACJ;AAEA,OAAO,MAAME,wBAAwB,GAAGP,oBAAoB,CAACQ,oBAAoB,CAAC;EAC9EC,cAAc,EAAEN,4BAA4B;EAC5CO,YAAY,EAAE;AAClB,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"features/SmtpTransport/SmtpMailTransportFactory.js","sources":["../../../src/features/SmtpTransport/SmtpMailTransportFactory.ts"],"sourcesContent":["import { MailTransportFactory } from \"~/domain/MailTransport/abstractions.js\";\nimport type { TransportSettings } from \"~/types.js\";\nimport { SmtpMailTransport } from \"~/features/SmtpTransport/SmtpMailTransport.js\";\nimport { SmtpConfig } from \"~/features/SmtpTransport/SmtpConfig.js\";\n\nclass SmtpMailTransportFactoryImpl implements MailTransportFactory.Interface {\n public readonly name = \"Mailer/SmtpTransport\";\n\n async createTransport(settings: TransportSettings): MailTransportFactory.Return {\n return new SmtpMailTransport(SmtpConfig.fromTransportSettings(settings));\n }\n}\n\nexport const SmtpMailTransportFactory = MailTransportFactory.createImplementation({\n implementation: SmtpMailTransportFactoryImpl,\n dependencies: []\n});\n"],"names":["SmtpMailTransportFactoryImpl","settings","SmtpMailTransport","SmtpConfig","SmtpMailTransportFactory","MailTransportFactory"],"mappings":";;;AAKA,MAAMA;IAGF,MAAM,gBAAgBC,QAA2B,EAA+B;QAC5E,OAAO,IAAIC,kBAAkBC,WAAW,qBAAqB,CAACF;IAClE;;aAJgB,IAAI,GAAG;;AAK3B;AAEO,MAAMG,2BAA2BC,qBAAqB,oBAAoB,CAAC;IAC9E,gBAAgBL;IAChB,cAAc,EAAE;AACpB"}
@@ -1 +1,4 @@
1
- export declare const SmtpTransportFeature: import("@webiny/feature/api/createFeature.js").FeatureDefinition<unknown>;
1
+ export declare const SmtpTransportFeature: {
2
+ name: string;
3
+ register(container: import("@webiny/di").Container): void;
4
+ };
@@ -1,10 +1,11 @@
1
1
  import { createFeature } from "@webiny/feature/api";
2
2
  import { SmtpMailTransportFactory } from "./SmtpMailTransportFactory.js";
3
- export const SmtpTransportFeature = createFeature({
4
- name: "SmtpTransport",
5
- register(container) {
6
- container.register(SmtpMailTransportFactory).inSingletonScope();
7
- }
3
+ const SmtpTransportFeature = createFeature({
4
+ name: "SmtpTransport",
5
+ register (container) {
6
+ container.register(SmtpMailTransportFactory).inSingletonScope();
7
+ }
8
8
  });
9
+ export { SmtpTransportFeature };
9
10
 
10
11
  //# sourceMappingURL=feature.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createFeature","SmtpMailTransportFactory","SmtpTransportFeature","name","register","container","inSingletonScope"],"sources":["feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { SmtpMailTransportFactory } from \"./SmtpMailTransportFactory.js\";\n\nexport const SmtpTransportFeature = createFeature({\n name: \"SmtpTransport\",\n register(container) {\n container.register(SmtpMailTransportFactory).inSingletonScope();\n }\n});\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,qBAAqB;AACnD,SAASC,wBAAwB;AAEjC,OAAO,MAAMC,oBAAoB,GAAGF,aAAa,CAAC;EAC9CG,IAAI,EAAE,eAAe;EACrBC,QAAQA,CAACC,SAAS,EAAE;IAChBA,SAAS,CAACD,QAAQ,CAACH,wBAAwB,CAAC,CAACK,gBAAgB,CAAC,CAAC;EACnE;AACJ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"features/SmtpTransport/feature.js","sources":["../../../src/features/SmtpTransport/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { SmtpMailTransportFactory } from \"./SmtpMailTransportFactory.js\";\n\nexport const SmtpTransportFeature = createFeature({\n name: \"SmtpTransport\",\n register(container) {\n container.register(SmtpMailTransportFactory).inSingletonScope();\n }\n});\n"],"names":["SmtpTransportFeature","createFeature","container","SmtpMailTransportFactory"],"mappings":";;AAGO,MAAMA,uBAAuBC,cAAc;IAC9C,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC,0BAA0B,gBAAgB;IACjE;AACJ"}