@webiny/api-mailer 6.6.0-alpha.11 → 6.6.0-alpha.13

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 (102) hide show
  1. package/MailerFeature.js +8 -10
  2. package/MailerFeature.js.map +1 -1
  3. package/constants.d.ts +1 -1
  4. package/constants.js +2 -2
  5. package/constants.js.map +1 -1
  6. package/domain/MailTransport/abstractions.d.ts +7 -4
  7. package/domain/MailTransport/abstractions.js.map +1 -1
  8. package/domain/MailerService/abstractions.d.ts +2 -0
  9. package/domain/MailerService/abstractions.js.map +1 -1
  10. package/domain/TransportSettings/abstractions.d.ts +47 -0
  11. package/domain/TransportSettings/abstractions.js +5 -0
  12. package/domain/TransportSettings/abstractions.js.map +1 -0
  13. package/domain/TransportSettings/findDefinition.d.ts +6 -0
  14. package/domain/TransportSettings/findDefinition.js +13 -0
  15. package/domain/TransportSettings/findDefinition.js.map +1 -0
  16. package/domain/errors.d.ts +15 -1
  17. package/domain/errors.js +27 -3
  18. package/domain/errors.js.map +1 -1
  19. package/exports/api/mailer.d.ts +3 -1
  20. package/exports/api/mailer.js +3 -1
  21. package/features/GetSettings/GetSettingsRepository.d.ts +5 -4
  22. package/features/GetSettings/GetSettingsRepository.js +23 -27
  23. package/features/GetSettings/GetSettingsRepository.js.map +1 -1
  24. package/features/GetSettings/GetSettingsUseCase.d.ts +11 -3
  25. package/features/GetSettings/GetSettingsUseCase.js +29 -4
  26. package/features/GetSettings/GetSettingsUseCase.js.map +1 -1
  27. package/features/GetSettings/abstractions.d.ts +14 -6
  28. package/features/GetSettings/abstractions.js.map +1 -1
  29. package/features/GetSettings/feature.js +1 -1
  30. package/features/GetSettings/feature.js.map +1 -1
  31. package/features/GetSettings/index.d.ts +1 -0
  32. package/features/IsMailerConfigured/IsMailerConfiguredUseCase.d.ts +11 -0
  33. package/features/IsMailerConfigured/IsMailerConfiguredUseCase.js +19 -0
  34. package/features/IsMailerConfigured/IsMailerConfiguredUseCase.js.map +1 -0
  35. package/features/IsMailerConfigured/abstractions.d.ts +18 -0
  36. package/features/IsMailerConfigured/abstractions.js +5 -0
  37. package/features/IsMailerConfigured/abstractions.js.map +1 -0
  38. package/features/{CodeMailerSettings → IsMailerConfigured}/feature.d.ts +1 -1
  39. package/features/IsMailerConfigured/feature.js +11 -0
  40. package/features/IsMailerConfigured/feature.js.map +1 -0
  41. package/features/IsMailerConfigured/index.d.ts +1 -0
  42. package/features/IsMailerConfigured/index.js +1 -0
  43. package/features/MailerService/MailerService.d.ts +3 -4
  44. package/features/MailerService/MailerService.js +13 -19
  45. package/features/MailerService/MailerService.js.map +1 -1
  46. package/features/SaveSettings/SaveSettingsRepository.d.ts +3 -2
  47. package/features/SaveSettings/SaveSettingsRepository.js +44 -22
  48. package/features/SaveSettings/SaveSettingsRepository.js.map +1 -1
  49. package/features/SaveSettings/SaveSettingsUseCase.d.ts +5 -7
  50. package/features/SaveSettings/SaveSettingsUseCase.js +27 -25
  51. package/features/SaveSettings/SaveSettingsUseCase.js.map +1 -1
  52. package/features/SaveSettings/abstractions.d.ts +12 -20
  53. package/features/SaveSettings/abstractions.js.map +1 -1
  54. package/features/SaveSettings/feature.js +1 -1
  55. package/features/SaveSettings/feature.js.map +1 -1
  56. package/features/SaveSettings/index.d.ts +1 -0
  57. package/features/SendTestMail/SendTestMailUseCase.d.ts +13 -0
  58. package/features/SendTestMail/SendTestMailUseCase.js +40 -0
  59. package/features/SendTestMail/SendTestMailUseCase.js.map +1 -0
  60. package/features/SendTestMail/abstractions.d.ts +32 -0
  61. package/features/SendTestMail/abstractions.js +5 -0
  62. package/features/SendTestMail/abstractions.js.map +1 -0
  63. package/features/{SmtpTransport → SendTestMail}/feature.d.ts +1 -1
  64. package/features/SendTestMail/feature.js +11 -0
  65. package/features/SendTestMail/feature.js.map +1 -0
  66. package/graphql/MailerSchemaFactory.js +52 -38
  67. package/graphql/MailerSchemaFactory.js.map +1 -1
  68. package/index.d.ts +10 -0
  69. package/index.js +7 -0
  70. package/package.json +13 -15
  71. package/types.d.ts +0 -9
  72. package/domain/CodeMailerSettings/abstractions.d.ts +0 -8
  73. package/domain/CodeMailerSettings/abstractions.js +0 -5
  74. package/domain/CodeMailerSettings/abstractions.js.map +0 -1
  75. package/features/CodeMailerSettings/CodeMailerSettings.d.ts +0 -12
  76. package/features/CodeMailerSettings/CodeMailerSettings.js +0 -23
  77. package/features/CodeMailerSettings/CodeMailerSettings.js.map +0 -1
  78. package/features/CodeMailerSettings/feature.js +0 -11
  79. package/features/CodeMailerSettings/feature.js.map +0 -1
  80. package/features/DummyTransport/DummyMailTransport.d.ts +0 -9
  81. package/features/DummyTransport/DummyMailTransport.js +0 -14
  82. package/features/DummyTransport/DummyMailTransport.js.map +0 -1
  83. package/features/DummyTransport/DummyMailTransportFactory.d.ts +0 -10
  84. package/features/DummyTransport/DummyMailTransportFactory.js +0 -20
  85. package/features/DummyTransport/DummyMailTransportFactory.js.map +0 -1
  86. package/features/DummyTransport/feature.d.ts +0 -4
  87. package/features/DummyTransport/feature.js +0 -11
  88. package/features/DummyTransport/feature.js.map +0 -1
  89. package/features/SaveSettings/validation.d.ts +0 -10
  90. package/features/SaveSettings/validation.js +0 -21
  91. package/features/SaveSettings/validation.js.map +0 -1
  92. package/features/SmtpTransport/SmtpConfig.d.ts +0 -6
  93. package/features/SmtpTransport/SmtpConfig.js +0 -26
  94. package/features/SmtpTransport/SmtpConfig.js.map +0 -1
  95. package/features/SmtpTransport/SmtpMailTransport.d.ts +0 -77
  96. package/features/SmtpTransport/SmtpMailTransport.js +0 -54
  97. package/features/SmtpTransport/SmtpMailTransport.js.map +0 -1
  98. package/features/SmtpTransport/SmtpMailTransportFactory.d.ts +0 -11
  99. package/features/SmtpTransport/SmtpMailTransportFactory.js +0 -21
  100. package/features/SmtpTransport/SmtpMailTransportFactory.js.map +0 -1
  101. package/features/SmtpTransport/feature.js +0 -11
  102. package/features/SmtpTransport/feature.js.map +0 -1
@@ -1,21 +0,0 @@
1
- import zod from "zod";
2
- import { isMailboxAddress } from "../../utils/isMailboxAddress.js";
3
- const validation_password = zod.string().describe("Password");
4
- const mailboxAddress = zod.string().refine(isMailboxAddress, {
5
- message: "Invalid email address."
6
- });
7
- const common = {
8
- from: mailboxAddress.describe("Mail from"),
9
- port: zod.number().optional().nullish().describe("Port"),
10
- replyTo: zod.preprocess((value)=>"" === value ? null : value, mailboxAddress.optional().nullish()).describe("Mail reply-to"),
11
- host: zod.string().describe("Hostname"),
12
- user: zod.string().describe("User")
13
- };
14
- const saveValidation = zod.object({
15
- ...common,
16
- secure: zod.boolean().optional().describe("Use TLS/SSL"),
17
- password: validation_password.nullish().optional().transform((value)=>void 0 === value ? null : value)
18
- });
19
- export { saveValidation };
20
-
21
- //# sourceMappingURL=validation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"features/SaveSettings/validation.js","sources":["../../../src/features/SaveSettings/validation.ts"],"sourcesContent":["import zod from \"zod\";\nimport { isMailboxAddress } from \"~/utils/isMailboxAddress.js\";\n\nconst password = zod.string().describe(\"Password\");\n\nconst mailboxAddress = zod.string().refine(isMailboxAddress, { message: \"Invalid email address.\" });\n\nconst common = {\n from: mailboxAddress.describe(\"Mail from\"),\n port: zod.number().optional().nullish().describe(\"Port\"),\n replyTo: zod\n .preprocess(\n // We need to set empty strings to `null` before address validation kicks in.\n value => (value === \"\" ? null : value),\n mailboxAddress.optional().nullish()\n )\n .describe(\"Mail reply-to\"),\n host: zod.string().describe(\"Hostname\"),\n user: zod.string().describe(\"User\")\n};\n\nexport const saveValidation = zod.object({\n ...common,\n secure: zod.boolean().optional().describe(\"Use TLS/SSL\"),\n password: password\n .nullish()\n .optional()\n .transform(value => {\n return value === undefined ? null : value;\n })\n});\n"],"names":["password","zod","mailboxAddress","isMailboxAddress","common","value","saveValidation","undefined"],"mappings":";;AAGA,MAAMA,sBAAWC,IAAI,MAAM,GAAG,QAAQ,CAAC;AAEvC,MAAMC,iBAAiBD,IAAI,MAAM,GAAG,MAAM,CAACE,kBAAkB;IAAE,SAAS;AAAyB;AAEjG,MAAMC,SAAS;IACX,MAAMF,eAAe,QAAQ,CAAC;IAC9B,MAAMD,IAAI,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;IACjD,SAASA,IAAAA,UACM,CAEPI,CAAAA,QAAUA,AAAU,OAAVA,QAAe,OAAOA,OAChCH,eAAe,QAAQ,GAAG,OAAO,IAEpC,QAAQ,CAAC;IACd,MAAMD,IAAI,MAAM,GAAG,QAAQ,CAAC;IAC5B,MAAMA,IAAI,MAAM,GAAG,QAAQ,CAAC;AAChC;AAEO,MAAMK,iBAAiBL,IAAI,MAAM,CAAC;IACrC,GAAGG,MAAM;IACT,QAAQH,IAAI,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAC1C,UAAUD,oBACL,OAAO,GACP,QAAQ,GACR,SAAS,CAACK,CAAAA,QACAA,AAAUE,WAAVF,QAAsB,OAAOA;AAEhD"}
@@ -1,6 +0,0 @@
1
- import type { TransportSettings } from "../../types.js";
2
- import type SMTPTransport from "nodemailer/lib/smtp-transport";
3
- export type SmtpTransportConfig = SMTPTransport.Options;
4
- export declare class SmtpConfig {
5
- static fromTransportSettings(settings: TransportSettings): SmtpTransportConfig;
6
- }
@@ -1,26 +0,0 @@
1
- const configDefaults = {
2
- socketTimeout: 15000,
3
- connectionTimeout: 15000,
4
- greetingTimeout: 15000
5
- };
6
- class SmtpConfig {
7
- static fromTransportSettings(settings) {
8
- const baseConfig = {
9
- host: settings.host,
10
- port: settings.port,
11
- secure: settings.secure,
12
- auth: {
13
- user: settings.user,
14
- pass: settings.password
15
- }
16
- };
17
- return Object.keys(configDefaults).reduce((config, key)=>{
18
- const configKey = key;
19
- if (void 0 === config[configKey] || null === config[configKey]) config[configKey] = configDefaults[configKey];
20
- return config;
21
- }, baseConfig);
22
- }
23
- }
24
- export { SmtpConfig };
25
-
26
- //# sourceMappingURL=SmtpConfig.js.map
@@ -1 +0,0 @@
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 secure: settings.secure,\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,QAAQA,SAAS,MAAM;YACvB,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"}
@@ -1,77 +0,0 @@
1
- import type SMTPTransport from "nodemailer/lib/smtp-transport";
2
- import { MailTransport } from "../../domain/MailTransport/abstractions.js";
3
- export declare class SmtpMailTransport implements MailTransport.Interface {
4
- private readonly defaultFrom?;
5
- readonly name = "Mailer/SmtpTransport";
6
- private readonly transporter;
7
- constructor(config: SMTPTransport.Options, defaultFrom?: string | undefined);
8
- send(params: MailTransport.SendParams): Promise<{
9
- result: string;
10
- error: null;
11
- } | {
12
- result: null;
13
- error: {
14
- message: string;
15
- code: string;
16
- data: {
17
- [key: string]: any;
18
- ehlo?: string[] | undefined;
19
- rejectedErrors?: import("nodemailer").NodemailerError[] | undefined;
20
- envelopeTime: number;
21
- messageTime: number;
22
- messageSize: number;
23
- serverMessageId?: string | undefined;
24
- envelope: import("nodemailer/lib/mime-node").MimeNodeEnvelope;
25
- messageId: string;
26
- accepted: string[];
27
- rejected: string[];
28
- response: string;
29
- pending?: string[] | undefined;
30
- message?: any;
31
- };
32
- };
33
- } | {
34
- result: null;
35
- error: {
36
- message: any;
37
- code: any;
38
- data: {
39
- to?: string[];
40
- cc?: string[];
41
- bcc: string[];
42
- from?: string;
43
- subject: string;
44
- text?: string;
45
- html?: string;
46
- replyTo?: string;
47
- command: any;
48
- response: any;
49
- responseCode: any;
50
- } | {
51
- to?: string[];
52
- cc: string[];
53
- bcc?: string[];
54
- from?: string;
55
- subject: string;
56
- text?: string;
57
- html?: string;
58
- replyTo?: string;
59
- command: any;
60
- response: any;
61
- responseCode: any;
62
- } | {
63
- to: string[];
64
- cc?: string[];
65
- bcc?: string[];
66
- from?: string;
67
- subject: string;
68
- text?: string;
69
- html?: string;
70
- replyTo?: string;
71
- command: any;
72
- response: any;
73
- responseCode: any;
74
- };
75
- };
76
- }>;
77
- }
@@ -1,54 +0,0 @@
1
- import nodemailer from "nodemailer";
2
- class SmtpMailTransport {
3
- constructor(config, defaultFrom){
4
- this.defaultFrom = defaultFrom;
5
- this.name = "Mailer/SmtpTransport";
6
- this.transporter = nodemailer.createTransport(config);
7
- }
8
- async send(params) {
9
- const { replyTo, text, html, to, bcc, cc, from, subject } = params;
10
- try {
11
- const result = await this.transporter.sendMail({
12
- replyTo,
13
- bcc,
14
- cc,
15
- from: from || this.defaultFrom || void 0,
16
- text,
17
- html,
18
- to,
19
- subject
20
- });
21
- if (result.messageId) return {
22
- result: result.response,
23
- error: null
24
- };
25
- return {
26
- result: null,
27
- error: {
28
- message: "nodemailer.sendMail does not have a messageId in the result. Something went wrong...",
29
- code: "MAILER_ERROR",
30
- data: {
31
- ...result
32
- }
33
- }
34
- };
35
- } catch (ex) {
36
- return {
37
- result: null,
38
- error: {
39
- message: ex.message,
40
- code: ex.code,
41
- data: {
42
- ...params,
43
- command: ex.command,
44
- response: ex.response,
45
- responseCode: ex.responseCode
46
- }
47
- }
48
- };
49
- }
50
- }
51
- }
52
- export { SmtpMailTransport };
53
-
54
- //# sourceMappingURL=SmtpMailTransport.js.map
@@ -1 +0,0 @@
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(\n config: SMTPTransport.Options,\n private readonly defaultFrom?: string\n ) {\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 // An explicit sender wins; otherwise the configured settings sender (R201).\n // An empty default counts as none, so a missing settings `from` changes nothing.\n from: from || this.defaultFrom || undefined,\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","defaultFrom","nodemailer","params","replyTo","text","html","to","bcc","cc","from","subject","result","undefined","ex"],"mappings":";AAKO,MAAMA;IAIT,YACIC,MAA6B,EACZC,WAAoB,CACvC;aADmBA,WAAW,GAAXA;aALL,IAAI,GAAG;QAOnB,IAAI,CAAC,WAAW,GAAGC,WAAW,eAAe,CAACF;IAClD;IAEA,MAAM,KAAKG,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;gBAGA,MAAMC,QAAQ,IAAI,CAAC,WAAW,IAAIG;gBAClCR;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,OAAOE,IAAS;YAKd,OAAO;gBACH,QAAQ;gBACR,OAAO;oBACH,SAASA,GAAG,OAAO;oBACnB,MAAMA,GAAG,IAAI;oBACb,MAAM;wBACF,GAAGX,MAAM;wBACT,SAASW,GAAG,OAAO;wBACnB,UAAUA,GAAG,QAAQ;wBACrB,cAAcA,GAAG,YAAY;oBACjC;gBACJ;YACJ;QACJ;IACJ;AACJ"}
@@ -1,11 +0,0 @@
1
- import { MailTransportFactory } from "../../domain/MailTransport/abstractions.js";
2
- import type { TransportSettings } from "../../types.js";
3
- declare class SmtpMailTransportFactoryImpl implements MailTransportFactory.Interface {
4
- readonly name = "Mailer/SmtpTransport";
5
- canUse(settings: TransportSettings | null): boolean;
6
- createTransport(settings: TransportSettings): MailTransportFactory.Return;
7
- }
8
- export declare const SmtpMailTransportFactory: typeof SmtpMailTransportFactoryImpl & {
9
- __abstraction: import("@webiny/di").Abstraction<import("~/domain/MailTransport/abstractions.js").IMailTransportFactory>;
10
- };
11
- export {};
@@ -1,21 +0,0 @@
1
- import { MailTransportFactory } from "../../domain/MailTransport/abstractions.js";
2
- import { SmtpMailTransport } from "./SmtpMailTransport.js";
3
- import { SmtpConfig } from "./SmtpConfig.js";
4
- class SmtpMailTransportFactoryImpl {
5
- canUse(settings) {
6
- return null !== settings;
7
- }
8
- async createTransport(settings) {
9
- return new SmtpMailTransport(SmtpConfig.fromTransportSettings(settings), settings.from);
10
- }
11
- constructor(){
12
- this.name = "Mailer/SmtpTransport";
13
- }
14
- }
15
- const SmtpMailTransportFactory = MailTransportFactory.createImplementation({
16
- implementation: SmtpMailTransportFactoryImpl,
17
- dependencies: []
18
- });
19
- export { SmtpMailTransportFactory };
20
-
21
- //# sourceMappingURL=SmtpMailTransportFactory.js.map
@@ -1 +0,0 @@
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 canUse(settings: TransportSettings | null): boolean {\n return settings !== null;\n }\n\n async createTransport(settings: TransportSettings): MailTransportFactory.Return {\n return new SmtpMailTransport(SmtpConfig.fromTransportSettings(settings), settings.from);\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,OAAOC,QAAkC,EAAW;QAChD,OAAOA,AAAa,SAAbA;IACX;IAEA,MAAM,gBAAgBA,QAA2B,EAA+B;QAC5E,OAAO,IAAIC,kBAAkBC,WAAW,qBAAqB,CAACF,WAAWA,SAAS,IAAI;IAC1F;;aARgB,IAAI,GAAG;;AAS3B;AAEO,MAAMG,2BAA2BC,qBAAqB,oBAAoB,CAAC;IAC9E,gBAAgBL;IAChB,cAAc,EAAE;AACpB"}
@@ -1,11 +0,0 @@
1
- import { createFeature } from "@webiny/feature/api";
2
- import { SmtpMailTransportFactory } from "./SmtpMailTransportFactory.js";
3
- const SmtpTransportFeature = createFeature({
4
- name: "SmtpTransport",
5
- register (container) {
6
- container.register(SmtpMailTransportFactory).inSingletonScope();
7
- }
8
- });
9
- export { SmtpTransportFeature };
10
-
11
- //# sourceMappingURL=feature.js.map
@@ -1 +0,0 @@
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"}