@webiny/api-mailer 0.0.0-unstable.a4f3e4ea8b → 0.0.0-unstable.a85ef555b2

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.
@@ -0,0 +1,4 @@
1
+ export declare const MailerFeature: {
2
+ name: string;
3
+ register(container: import("@webiny/di").Container): void;
4
+ };
@@ -0,0 +1,25 @@
1
+ import { createFeature } from "@webiny/feature/api";
2
+ import { CodeMailerSettingsFeature } from "./features/CodeMailerSettings/feature.js";
3
+ import { DummyTransportFeature } from "./features/DummyTransport/feature.js";
4
+ import { SmtpTransportFeature } from "./features/SmtpTransport/feature.js";
5
+ import { GetSettingsFeature } from "./features/GetSettings/feature.js";
6
+ import { SaveSettingsFeature } from "./features/SaveSettings/feature.js";
7
+ import { MailerServiceFeature } from "./features/MailerService/feature.js";
8
+ import { SendMailFeature } from "./features/SendMail/feature.js";
9
+ import { MailerSchemaFactory } from "./graphql/MailerSchemaFactory.js";
10
+ const MailerFeature = createFeature({
11
+ name: "Mailer",
12
+ register (container) {
13
+ CodeMailerSettingsFeature.register(container);
14
+ DummyTransportFeature.register(container);
15
+ SmtpTransportFeature.register(container);
16
+ GetSettingsFeature.register(container);
17
+ SaveSettingsFeature.register(container);
18
+ MailerServiceFeature.register(container);
19
+ SendMailFeature.register(container);
20
+ container.register(MailerSchemaFactory);
21
+ }
22
+ });
23
+ export { MailerFeature };
24
+
25
+ //# sourceMappingURL=MailerFeature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MailerFeature.js","sources":["../src/MailerFeature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { CodeMailerSettingsFeature } from \"~/features/CodeMailerSettings/feature.js\";\nimport { DummyTransportFeature } from \"~/features/DummyTransport/feature.js\";\nimport { SmtpTransportFeature } from \"~/features/SmtpTransport/feature.js\";\nimport { GetSettingsFeature } from \"~/features/GetSettings/feature.js\";\nimport { SaveSettingsFeature } from \"~/features/SaveSettings/feature.js\";\nimport { MailerServiceFeature } from \"~/features/MailerService/feature.js\";\nimport { SendMailFeature } from \"~/features/SendMail/feature.js\";\nimport { MailerSchemaFactory } from \"~/graphql/MailerSchemaFactory.js\";\n\nexport const MailerFeature = createFeature({\n name: \"Mailer\",\n register(container) {\n CodeMailerSettingsFeature.register(container);\n DummyTransportFeature.register(container);\n SmtpTransportFeature.register(container);\n GetSettingsFeature.register(container);\n SaveSettingsFeature.register(container);\n MailerServiceFeature.register(container);\n SendMailFeature.register(container);\n container.register(MailerSchemaFactory);\n }\n});\n"],"names":["MailerFeature","createFeature","container","CodeMailerSettingsFeature","DummyTransportFeature","SmtpTransportFeature","GetSettingsFeature","SaveSettingsFeature","MailerServiceFeature","SendMailFeature","MailerSchemaFactory"],"mappings":";;;;;;;;;AAUO,MAAMA,gBAAgBC,cAAc;IACvC,MAAM;IACN,UAASC,SAAS;QACdC,0BAA0B,QAAQ,CAACD;QACnCE,sBAAsB,QAAQ,CAACF;QAC/BG,qBAAqB,QAAQ,CAACH;QAC9BI,mBAAmB,QAAQ,CAACJ;QAC5BK,oBAAoB,QAAQ,CAACL;QAC7BM,qBAAqB,QAAQ,CAACN;QAC9BO,gBAAgB,QAAQ,CAACP;QACzBA,UAAU,QAAQ,CAACQ;IACvB;AACJ"}
@@ -12,12 +12,12 @@ class CodeMailerSettingsImpl {
12
12
  return value ?? null;
13
13
  }
14
14
  }
15
- const CodeMailerSettingsImpl_CodeMailerSettings = CodeMailerSettings.createImplementation({
15
+ const CodeMailerSettings_CodeMailerSettings = CodeMailerSettings.createImplementation({
16
16
  implementation: CodeMailerSettingsImpl,
17
17
  dependencies: [
18
18
  BuildParams
19
19
  ]
20
20
  });
21
- export { CodeMailerSettingsImpl_CodeMailerSettings as CodeMailerSettings };
21
+ export { CodeMailerSettings_CodeMailerSettings as CodeMailerSettings };
22
22
 
23
- //# sourceMappingURL=CodeMailerSettingsImpl.js.map
23
+ //# sourceMappingURL=CodeMailerSettings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/CodeMailerSettings/CodeMailerSettings.js","sources":["../../../src/features/CodeMailerSettings/CodeMailerSettings.ts"],"sourcesContent":["import { BuildParams } from \"@webiny/api-core/features/buildParams/index.js\";\nimport { CodeMailerSettings as Abstraction } from \"~/domain/CodeMailerSettings/abstractions.js\";\nimport type { TransportSettings } from \"~/types.js\";\n\nconst SMTP_TRANSPORT_NAME = \"Mailer/SmtpTransport\";\nconst SMTP_BUILD_PARAM_KEY = \"Mailer.SmtpSettings\";\n\nclass CodeMailerSettingsImpl implements Abstraction.Interface {\n constructor(private buildParams: BuildParams.Interface) {}\n\n get(transportName: string): TransportSettings | null {\n if (transportName !== SMTP_TRANSPORT_NAME) {\n return null;\n }\n const value = this.buildParams.get<TransportSettings>(SMTP_BUILD_PARAM_KEY);\n return value ?? null;\n }\n}\n\nexport const CodeMailerSettings = Abstraction.createImplementation({\n implementation: CodeMailerSettingsImpl,\n dependencies: [BuildParams]\n});\n"],"names":["SMTP_TRANSPORT_NAME","SMTP_BUILD_PARAM_KEY","CodeMailerSettingsImpl","buildParams","transportName","value","CodeMailerSettings","Abstraction","BuildParams"],"mappings":";;AAIA,MAAMA,sBAAsB;AAC5B,MAAMC,uBAAuB;AAE7B,MAAMC;IACF,YAAoBC,WAAkC,CAAE;aAApCA,WAAW,GAAXA;IAAqC;IAEzD,IAAIC,aAAqB,EAA4B;QACjD,IAAIA,kBAAkBJ,qBAClB,OAAO;QAEX,MAAMK,QAAQ,IAAI,CAAC,WAAW,CAAC,GAAG,CAAoBJ;QACtD,OAAOI,SAAS;IACpB;AACJ;AAEO,MAAMC,wCAAqBC,mBAAAA,oBAAgC,CAAC;IAC/D,gBAAgBL;IAChB,cAAc;QAACM;KAAY;AAC/B"}
@@ -1,5 +1,5 @@
1
1
  import { createFeature } from "@webiny/feature/api";
2
- import { CodeMailerSettings } from "./CodeMailerSettingsImpl.js";
2
+ import { CodeMailerSettings } from "./CodeMailerSettings.js";
3
3
  const CodeMailerSettingsFeature = createFeature({
4
4
  name: "Mailer/CodeMailerSettings",
5
5
  register (container) {
@@ -1 +1 @@
1
- {"version":3,"file":"features/CodeMailerSettings/feature.js","sources":["../../../src/features/CodeMailerSettings/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { CodeMailerSettings } from \"./CodeMailerSettingsImpl.js\";\n\nexport const CodeMailerSettingsFeature = createFeature({\n name: \"Mailer/CodeMailerSettings\",\n register(container) {\n container.register(CodeMailerSettings).inSingletonScope();\n }\n});\n"],"names":["CodeMailerSettingsFeature","createFeature","container","CodeMailerSettings"],"mappings":";;AAGO,MAAMA,4BAA4BC,cAAc;IACnD,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC,oBAAoB,gBAAgB;IAC3D;AACJ"}
1
+ {"version":3,"file":"features/CodeMailerSettings/feature.js","sources":["../../../src/features/CodeMailerSettings/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { CodeMailerSettings } from \"./CodeMailerSettings.js\";\n\nexport const CodeMailerSettingsFeature = createFeature({\n name: \"Mailer/CodeMailerSettings\",\n register(container) {\n container.register(CodeMailerSettings).inSingletonScope();\n }\n});\n"],"names":["CodeMailerSettingsFeature","createFeature","container","CodeMailerSettings"],"mappings":";;AAGO,MAAMA,4BAA4BC,cAAc;IACnD,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC,oBAAoB,gBAAgB;IAC3D;AACJ"}
@@ -1,9 +1,10 @@
1
1
  import type SMTPTransport from "nodemailer/lib/smtp-transport";
2
2
  import { MailTransport } from "../../domain/MailTransport/abstractions.js";
3
3
  export declare class SmtpMailTransport implements MailTransport.Interface {
4
+ private readonly defaultFrom?;
4
5
  readonly name = "Mailer/SmtpTransport";
5
6
  private readonly transporter;
6
- constructor(config: SMTPTransport.Options);
7
+ constructor(config: SMTPTransport.Options, defaultFrom?: string | undefined);
7
8
  send(params: MailTransport.SendParams): Promise<{
8
9
  result: string;
9
10
  error: null;
@@ -1,6 +1,7 @@
1
1
  import nodemailer from "nodemailer";
2
2
  class SmtpMailTransport {
3
- constructor(config){
3
+ constructor(config, defaultFrom){
4
+ this.defaultFrom = defaultFrom;
4
5
  this.name = "Mailer/SmtpTransport";
5
6
  this.transporter = nodemailer.createTransport(config);
6
7
  }
@@ -11,7 +12,7 @@ class SmtpMailTransport {
11
12
  replyTo,
12
13
  bcc,
13
14
  cc,
14
- from,
15
+ from: from || this.defaultFrom || void 0,
15
16
  text,
16
17
  html,
17
18
  to,
@@ -1 +1 @@
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
+ {"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"}
@@ -6,7 +6,7 @@ class SmtpMailTransportFactoryImpl {
6
6
  return null !== settings;
7
7
  }
8
8
  async createTransport(settings) {
9
- return new SmtpMailTransport(SmtpConfig.fromTransportSettings(settings));
9
+ return new SmtpMailTransport(SmtpConfig.fromTransportSettings(settings), settings.from);
10
10
  }
11
11
  constructor(){
12
12
  this.name = "Mailer/SmtpTransport";
@@ -1 +1 @@
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));\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;IAClE;;aARgB,IAAI,GAAG;;AAS3B;AAEO,MAAMG,2BAA2BC,qBAAqB,oBAAoB,CAAC;IAC9E,gBAAgBL;IAChB,cAAc,EAAE;AACpB"}
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"}
@@ -0,0 +1,10 @@
1
+ import { GraphQLSchemaFactory } from "@webiny/api-graphql/graphql/abstractions.js";
2
+ import type { IGraphQLSchemaBuilder } from "@webiny/api-graphql/features/GraphQLSchemaBuilder/abstractions.js";
3
+ declare class MailerSchemaFactoryImpl implements GraphQLSchemaFactory.Interface {
4
+ getSchemaKey: () => string;
5
+ execute(builder: IGraphQLSchemaBuilder): Promise<IGraphQLSchemaBuilder>;
6
+ }
7
+ export declare const MailerSchemaFactory: typeof MailerSchemaFactoryImpl & {
8
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-graphql/graphql/abstractions.public").IGraphQLSchemaFactory>;
9
+ };
10
+ export {};
@@ -1,8 +1,9 @@
1
- import { ErrorResponse, GraphQLSchemaPlugin } from "@webiny/handler-graphql";
1
+ import { GraphQLSchemaFactory } from "@webiny/api-graphql/graphql/abstractions.js";
2
+ import { staticSchemaKey } from "@webiny/api-graphql/graphql/staticSchemaKey.js";
3
+ import { ErrorResponse } from "@webiny/api-graphql/responses.js";
2
4
  import { GetSettingsUseCase } from "../features/GetSettings/abstractions.js";
3
5
  import { SaveSettingsUseCase } from "../features/SaveSettings/abstractions.js";
4
6
  const SMTP_TRANSPORT_NAME = "Mailer/SmtpTransport";
5
- const emptyResolver = ()=>({});
6
7
  const toPublicSettings = (settings, source)=>{
7
8
  if (!settings) return null;
8
9
  const { password: _password, ...publicSettings } = settings;
@@ -11,8 +12,9 @@ const toPublicSettings = (settings, source)=>{
11
12
  source
12
13
  };
13
14
  };
14
- const createSettingsGraphQL = ()=>new GraphQLSchemaPlugin({
15
- typeDefs: `
15
+ class MailerSchemaFactoryImpl {
16
+ async execute(builder) {
17
+ builder.addTypeDefs(`
16
18
  type MailerTransportSettingsError {
17
19
  message: String!
18
20
  code: String
@@ -58,15 +60,22 @@ const createSettingsGraphQL = ()=>new GraphQLSchemaPlugin({
58
60
  extend type Mutation {
59
61
  mailer: MailerMutation
60
62
  }
61
- `,
62
- resolvers: {
63
- Query: {
64
- mailer: emptyResolver
65
- },
66
- MailerQuery: {
67
- getSettings: async (_, __, context)=>{
63
+ `);
64
+ builder.addResolver({
65
+ path: "Query.mailer",
66
+ resolver: ()=>async ()=>({})
67
+ });
68
+ builder.addResolver({
69
+ path: "Mutation.mailer",
70
+ resolver: ()=>async ()=>({})
71
+ });
72
+ builder.addResolver({
73
+ path: "MailerQuery.getSettings",
74
+ dependencies: [
75
+ GetSettingsUseCase
76
+ ],
77
+ resolver: (getSettings)=>async ()=>{
68
78
  try {
69
- const getSettings = context.container.resolve(GetSettingsUseCase);
70
79
  const result = await getSettings.execute(SMTP_TRANSPORT_NAME);
71
80
  if (result.isFail()) return new ErrorResponse(result.error);
72
81
  const { settings, source } = result.value;
@@ -78,14 +87,14 @@ const createSettingsGraphQL = ()=>new GraphQLSchemaPlugin({
78
87
  return new ErrorResponse(ex);
79
88
  }
80
89
  }
81
- },
82
- Mutation: {
83
- mailer: emptyResolver
84
- },
85
- MailerMutation: {
86
- saveSettings: async (_, args, context)=>{
90
+ });
91
+ builder.addResolver({
92
+ path: "MailerMutation.saveSettings",
93
+ dependencies: [
94
+ SaveSettingsUseCase
95
+ ],
96
+ resolver: (saveSettings)=>async ({ args })=>{
87
97
  try {
88
- const saveSettings = context.container.resolve(SaveSettingsUseCase);
89
98
  const result = await saveSettings.execute(args.data);
90
99
  if (result.isFail()) return new ErrorResponse(result.error);
91
100
  return {
@@ -96,9 +105,17 @@ const createSettingsGraphQL = ()=>new GraphQLSchemaPlugin({
96
105
  return new ErrorResponse(ex);
97
106
  }
98
107
  }
99
- }
100
- }
101
- });
102
- export { createSettingsGraphQL };
108
+ });
109
+ return builder;
110
+ }
111
+ constructor(){
112
+ this.getSchemaKey = staticSchemaKey("api-mailer/MailerSchemaFactoryImpl");
113
+ }
114
+ }
115
+ const MailerSchemaFactory = GraphQLSchemaFactory.createImplementation({
116
+ implementation: MailerSchemaFactoryImpl,
117
+ dependencies: []
118
+ });
119
+ export { MailerSchemaFactory };
103
120
 
104
- //# sourceMappingURL=settings.js.map
121
+ //# sourceMappingURL=MailerSchemaFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graphql/MailerSchemaFactory.js","sources":["../../src/graphql/MailerSchemaFactory.ts"],"sourcesContent":["import { GraphQLSchemaFactory } from \"@webiny/api-graphql/graphql/abstractions.js\";\nimport { staticSchemaKey } from \"@webiny/api-graphql/graphql/staticSchemaKey.js\";\nimport type { IGraphQLSchemaBuilder } from \"@webiny/api-graphql/features/GraphQLSchemaBuilder/abstractions.js\";\nimport { ErrorResponse } from \"@webiny/api-graphql/responses.js\";\nimport { GetSettingsUseCase } from \"~/features/GetSettings/abstractions.js\";\nimport { SaveSettingsUseCase } from \"~/features/SaveSettings/abstractions.js\";\nimport type { MailerSettingsSource } from \"~/features/GetSettings/abstractions.js\";\nimport type { SaveSettingsInput } from \"~/features/SaveSettings/abstractions.js\";\nimport type { TransportSettings } from \"~/types.js\";\n\nconst SMTP_TRANSPORT_NAME = \"Mailer/SmtpTransport\";\n\n// Strip `password` before the settings leave the server and tack on `source`\n// so the admin UI can branch on code-vs-storage. Accepts both the full\n// `TransportSettings` (from getSettings) and the already-stripped\n// `Omit<TransportSettings, \"password\">` (from saveSettings) — defense in depth\n// even when the input type carries no password to begin with.\nconst toPublicSettings = (\n settings: TransportSettings | Omit<TransportSettings, \"password\"> | null,\n source: MailerSettingsSource\n): (Omit<TransportSettings, \"password\"> & { source: MailerSettingsSource }) | null => {\n if (!settings) {\n return null;\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { password: _password, ...publicSettings } = settings as TransportSettings;\n return { ...publicSettings, source };\n};\n\nclass MailerSchemaFactoryImpl implements GraphQLSchemaFactory.Interface {\n public getSchemaKey = staticSchemaKey(\"api-mailer/MailerSchemaFactoryImpl\");\n\n async execute(builder: IGraphQLSchemaBuilder): Promise<IGraphQLSchemaBuilder> {\n builder.addTypeDefs(`\n type MailerTransportSettingsError {\n message: String!\n code: String\n data: JSON\n }\n\n type MailerTransportSettings {\n host: String\n port: Number\n secure: Boolean\n user: String\n from: String\n replyTo: String\n source: String\n }\n\n type MailerTransportSettingsResponse {\n data: MailerTransportSettings\n error: MailerTransportSettingsError\n }\n\n type MailerQuery {\n getSettings: MailerTransportSettingsResponse!\n }\n\n input MailerTransportSettingsInput {\n host: String!\n port: Number\n secure: Boolean\n user: String!\n password: String\n from: String!\n replyTo: String\n }\n\n type MailerMutation {\n saveSettings(data: MailerTransportSettingsInput!): MailerTransportSettingsResponse!\n }\n\n extend type Query {\n mailer: MailerQuery\n }\n extend type Mutation {\n mailer: MailerMutation\n }\n `);\n\n builder.addResolver({\n path: \"Query.mailer\",\n resolver: () => async () => ({})\n });\n\n builder.addResolver({\n path: \"Mutation.mailer\",\n resolver: () => async () => ({})\n });\n\n builder.addResolver({\n path: \"MailerQuery.getSettings\",\n dependencies: [GetSettingsUseCase],\n resolver: (getSettings: GetSettingsUseCase.Interface) => async () => {\n try {\n const result = await getSettings.execute(SMTP_TRANSPORT_NAME);\n\n if (result.isFail()) {\n return new ErrorResponse(result.error);\n }\n\n const { settings, source } = result.value;\n\n return {\n data: toPublicSettings(settings, source),\n error: null\n };\n } catch (ex) {\n return new ErrorResponse(ex);\n }\n }\n });\n\n builder.addResolver<{ data: SaveSettingsInput }>({\n path: \"MailerMutation.saveSettings\",\n dependencies: [SaveSettingsUseCase],\n resolver:\n (saveSettings: SaveSettingsUseCase.Interface) =>\n async ({ args }) => {\n try {\n const result = await saveSettings.execute(args.data);\n\n if (result.isFail()) {\n return new ErrorResponse(result.error);\n }\n\n return {\n data: toPublicSettings(result.value, \"storage\"),\n error: null\n };\n } catch (ex) {\n return new ErrorResponse(ex);\n }\n }\n });\n\n return builder;\n }\n}\n\nexport const MailerSchemaFactory = GraphQLSchemaFactory.createImplementation({\n implementation: MailerSchemaFactoryImpl,\n dependencies: []\n});\n"],"names":["SMTP_TRANSPORT_NAME","toPublicSettings","settings","source","_password","publicSettings","MailerSchemaFactoryImpl","builder","GetSettingsUseCase","getSettings","result","ErrorResponse","ex","SaveSettingsUseCase","saveSettings","args","staticSchemaKey","MailerSchemaFactory","GraphQLSchemaFactory"],"mappings":";;;;;AAUA,MAAMA,sBAAsB;AAO5B,MAAMC,mBAAmB,CACrBC,UACAC;IAEA,IAAI,CAACD,UACD,OAAO;IAGX,MAAM,EAAE,UAAUE,SAAS,EAAE,GAAGC,gBAAgB,GAAGH;IACnD,OAAO;QAAE,GAAGG,cAAc;QAAEF;IAAO;AACvC;AAEA,MAAMG;IAGF,MAAM,QAAQC,OAA8B,EAAkC;QAC1EA,QAAQ,WAAW,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA8CrB,CAAC;QAEDA,QAAQ,WAAW,CAAC;YAChB,MAAM;YACN,UAAU,IAAM,UAAa,EAAC;QAClC;QAEAA,QAAQ,WAAW,CAAC;YAChB,MAAM;YACN,UAAU,IAAM,UAAa,EAAC;QAClC;QAEAA,QAAQ,WAAW,CAAC;YAChB,MAAM;YACN,cAAc;gBAACC;aAAmB;YAClC,UAAU,CAACC,cAA8C;oBACrD,IAAI;wBACA,MAAMC,SAAS,MAAMD,YAAY,OAAO,CAACT;wBAEzC,IAAIU,OAAO,MAAM,IACb,OAAO,IAAIC,cAAcD,OAAO,KAAK;wBAGzC,MAAM,EAAER,QAAQ,EAAEC,MAAM,EAAE,GAAGO,OAAO,KAAK;wBAEzC,OAAO;4BACH,MAAMT,iBAAiBC,UAAUC;4BACjC,OAAO;wBACX;oBACJ,EAAE,OAAOS,IAAI;wBACT,OAAO,IAAID,cAAcC;oBAC7B;gBACJ;QACJ;QAEAL,QAAQ,WAAW,CAA8B;YAC7C,MAAM;YACN,cAAc;gBAACM;aAAoB;YACnC,UACI,CAACC,eACD,OAAO,EAAEC,IAAI,EAAE;oBACX,IAAI;wBACA,MAAML,SAAS,MAAMI,aAAa,OAAO,CAACC,KAAK,IAAI;wBAEnD,IAAIL,OAAO,MAAM,IACb,OAAO,IAAIC,cAAcD,OAAO,KAAK;wBAGzC,OAAO;4BACH,MAAMT,iBAAiBS,OAAO,KAAK,EAAE;4BACrC,OAAO;wBACX;oBACJ,EAAE,OAAOE,IAAI;wBACT,OAAO,IAAID,cAAcC;oBAC7B;gBACJ;QACR;QAEA,OAAOL;IACX;;aA5GO,YAAY,GAAGS,gBAAgB;;AA6G1C;AAEO,MAAMC,sBAAsBC,qBAAqB,oBAAoB,CAAC;IACzE,gBAAgBZ;IAChB,cAAc,EAAE;AACpB"}
package/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
+ export { MailerFeature } from "./MailerFeature.js";
1
2
  export { MailerService } from "./domain/MailerService/abstractions.js";
2
3
  export type { IMailerService, IMailerServiceErrors } from "./domain/MailerService/abstractions.js";
3
- export declare const createMailerContext: () => import("@webiny/handler").RegisterExtensionPlugin<import("@webiny/handler/types.js").Context>;
4
- export declare const createMailerGraphQL: () => import("@webiny/handler-graphql/index.js").GraphQLSchemaPlugin<import("@webiny/api/types.js").Context>;
package/index.js CHANGED
@@ -1,23 +1,2 @@
1
- import { CodeMailerSettingsFeature } from "./features/CodeMailerSettings/feature.js";
2
- import { GetSettingsFeature } from "./features/GetSettings/feature.js";
3
- import { SaveSettingsFeature } from "./features/SaveSettings/feature.js";
4
- import { DummyTransportFeature } from "./features/DummyTransport/feature.js";
5
- import { SmtpTransportFeature } from "./features/SmtpTransport/feature.js";
6
- import { MailerServiceFeature } from "./features/MailerService/feature.js";
7
- import { SendMailFeature } from "./features/SendMail/feature.js";
8
- import { createSettingsGraphQL } from "./graphql/settings.js";
9
- import { createRegisterExtensionPlugin } from "@webiny/handler";
10
- const createMailerContext = ()=>createRegisterExtensionPlugin((context)=>{
11
- CodeMailerSettingsFeature.register(context.container);
12
- DummyTransportFeature.register(context.container);
13
- SmtpTransportFeature.register(context.container);
14
- GetSettingsFeature.register(context.container);
15
- SaveSettingsFeature.register(context.container);
16
- MailerServiceFeature.register(context.container);
17
- SendMailFeature.register(context.container);
18
- });
19
- const createMailerGraphQL = ()=>createSettingsGraphQL();
1
+ export { MailerFeature } from "./MailerFeature.js";
20
2
  export { MailerService } from "./domain/MailerService/abstractions.js";
21
- export { createMailerContext, createMailerGraphQL };
22
-
23
- //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/api-mailer",
3
- "version": "0.0.0-unstable.a4f3e4ea8b",
3
+ "version": "0.0.0-unstable.a85ef555b2",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./index.js",
@@ -18,27 +18,26 @@
18
18
  "description": "The API to send e-mails.",
19
19
  "license": "MIT",
20
20
  "dependencies": {
21
- "@webiny/api": "0.0.0-unstable.a4f3e4ea8b",
22
- "@webiny/api-headless-cms": "0.0.0-unstable.a4f3e4ea8b",
23
- "@webiny/feature": "0.0.0-unstable.a4f3e4ea8b",
24
- "@webiny/handler-graphql": "0.0.0-unstable.a4f3e4ea8b",
25
- "@webiny/plugins": "0.0.0-unstable.a4f3e4ea8b",
21
+ "@webiny/api-graphql": "0.0.0-unstable.a85ef555b2",
22
+ "@webiny/feature": "0.0.0-unstable.a85ef555b2",
23
+ "@webiny/plugins": "0.0.0-unstable.a85ef555b2",
26
24
  "email-addresses": "5.0.0",
27
- "nodemailer": "9.0.3",
25
+ "nodemailer": "9.0.5",
28
26
  "zod": "4.4.3"
29
27
  },
30
28
  "devDependencies": {
31
29
  "@types/nodemailer": "8.0.1",
32
- "@webiny/api-core": "0.0.0-unstable.a4f3e4ea8b",
33
- "@webiny/build-tools": "0.0.0-unstable.a4f3e4ea8b",
34
- "@webiny/handler": "0.0.0-unstable.a4f3e4ea8b",
35
- "@webiny/handler-aws": "0.0.0-unstable.a4f3e4ea8b",
36
- "@webiny/handler-db": "0.0.0-unstable.a4f3e4ea8b",
37
- "@webiny/project-utils": "0.0.0-unstable.a4f3e4ea8b",
30
+ "@webiny/api": "0.0.0-unstable.a85ef555b2",
31
+ "@webiny/api-core": "0.0.0-unstable.a85ef555b2",
32
+ "@webiny/build-tools": "0.0.0-unstable.a85ef555b2",
33
+ "@webiny/db-dynamodb": "0.0.0-unstable.a85ef555b2",
34
+ "@webiny/di": "2.0.0",
35
+ "@webiny/event-handler-core": "0.0.0-unstable.a85ef555b2",
36
+ "@webiny/handler": "0.0.0-unstable.a85ef555b2",
38
37
  "graphql": "16.14.2",
39
38
  "rimraf": "6.1.3",
40
39
  "typescript": "7.0.2",
41
- "vitest": "4.1.10"
40
+ "vitest": "4.1.11"
42
41
  },
43
42
  "publishConfig": {
44
43
  "access": "public"
@@ -1 +0,0 @@
1
- {"version":3,"file":"features/CodeMailerSettings/CodeMailerSettingsImpl.js","sources":["../../../src/features/CodeMailerSettings/CodeMailerSettingsImpl.ts"],"sourcesContent":["import { BuildParams } from \"@webiny/api-core/features/buildParams/index.js\";\nimport { CodeMailerSettings as Abstraction } from \"~/domain/CodeMailerSettings/abstractions.js\";\nimport type { TransportSettings } from \"~/types.js\";\n\nconst SMTP_TRANSPORT_NAME = \"Mailer/SmtpTransport\";\nconst SMTP_BUILD_PARAM_KEY = \"Mailer.SmtpSettings\";\n\nclass CodeMailerSettingsImpl implements Abstraction.Interface {\n constructor(private buildParams: BuildParams.Interface) {}\n\n get(transportName: string): TransportSettings | null {\n if (transportName !== SMTP_TRANSPORT_NAME) {\n return null;\n }\n const value = this.buildParams.get<TransportSettings>(SMTP_BUILD_PARAM_KEY);\n return value ?? null;\n }\n}\n\nexport const CodeMailerSettings = Abstraction.createImplementation({\n implementation: CodeMailerSettingsImpl,\n dependencies: [BuildParams]\n});\n"],"names":["SMTP_TRANSPORT_NAME","SMTP_BUILD_PARAM_KEY","CodeMailerSettingsImpl","buildParams","transportName","value","CodeMailerSettings","Abstraction","BuildParams"],"mappings":";;AAIA,MAAMA,sBAAsB;AAC5B,MAAMC,uBAAuB;AAE7B,MAAMC;IACF,YAAoBC,WAAkC,CAAE;aAApCA,WAAW,GAAXA;IAAqC;IAEzD,IAAIC,aAAqB,EAA4B;QACjD,IAAIA,kBAAkBJ,qBAClB,OAAO;QAEX,MAAMK,QAAQ,IAAI,CAAC,WAAW,CAAC,GAAG,CAAoBJ;QACtD,OAAOI,SAAS;IACpB;AACJ;AAEO,MAAMC,4CAAqBC,mBAAAA,oBAAgC,CAAC;IAC/D,gBAAgBL;IAChB,cAAc;QAACM;KAAY;AAC/B"}
@@ -1,3 +0,0 @@
1
- import { GraphQLSchemaPlugin } from "@webiny/handler-graphql";
2
- import type { Context } from "@webiny/api/types.js";
3
- export declare const createSettingsGraphQL: () => GraphQLSchemaPlugin<Context>;
@@ -1 +0,0 @@
1
- {"version":3,"file":"graphql/settings.js","sources":["../../src/graphql/settings.ts"],"sourcesContent":["import { ErrorResponse, GraphQLSchemaPlugin } from \"@webiny/handler-graphql\";\nimport { GetSettingsUseCase } from \"~/features/GetSettings/abstractions.js\";\nimport { SaveSettingsUseCase } from \"~/features/SaveSettings/abstractions.js\";\nimport type { MailerSettingsSource } from \"~/features/GetSettings/abstractions.js\";\nimport type { Context } from \"@webiny/api/types.js\";\nimport type { TransportSettings } from \"~/types.js\";\n\nconst SMTP_TRANSPORT_NAME = \"Mailer/SmtpTransport\";\n\nconst emptyResolver = () => ({});\n\n// Strip `password` before the settings leave the server and tack on `source`\n// so the admin UI can branch on code-vs-storage. Accepts both the full\n// `TransportSettings` (from getSettings) and the already-stripped\n// `Omit<TransportSettings, \"password\">` (from saveSettings) — defense in depth\n// even when the input type carries no password to begin with.\nconst toPublicSettings = (\n settings: TransportSettings | Omit<TransportSettings, \"password\"> | null,\n source: MailerSettingsSource\n): (Omit<TransportSettings, \"password\"> & { source: MailerSettingsSource }) | null => {\n if (!settings) {\n return null;\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { password: _password, ...publicSettings } = settings as TransportSettings;\n return { ...publicSettings, source };\n};\n\nexport const createSettingsGraphQL = () => {\n return new GraphQLSchemaPlugin<Context>({\n typeDefs: `\n type MailerTransportSettingsError {\n message: String!\n code: String\n data: JSON\n }\n\n type MailerTransportSettings {\n host: String\n port: Number\n secure: Boolean\n user: String\n from: String\n replyTo: String\n source: String\n }\n\n type MailerTransportSettingsResponse {\n data: MailerTransportSettings\n error: MailerTransportSettingsError\n }\n\n type MailerQuery {\n getSettings: MailerTransportSettingsResponse!\n }\n\n input MailerTransportSettingsInput {\n host: String!\n port: Number\n secure: Boolean\n user: String!\n password: String\n from: String!\n replyTo: String\n }\n\n type MailerMutation {\n saveSettings(data: MailerTransportSettingsInput!): MailerTransportSettingsResponse!\n }\n\n extend type Query {\n mailer: MailerQuery\n }\n extend type Mutation {\n mailer: MailerMutation\n }\n `,\n resolvers: {\n Query: {\n mailer: emptyResolver\n },\n MailerQuery: {\n getSettings: async (_, __, context) => {\n try {\n const getSettings = context.container.resolve(GetSettingsUseCase);\n const result = await getSettings.execute(SMTP_TRANSPORT_NAME);\n\n if (result.isFail()) {\n return new ErrorResponse(result.error);\n }\n\n const { settings, source } = result.value;\n\n return {\n data: toPublicSettings(settings, source),\n error: null\n };\n } catch (ex) {\n return new ErrorResponse(ex);\n }\n }\n },\n Mutation: {\n mailer: emptyResolver\n },\n MailerMutation: {\n saveSettings: async (_, args: any, context) => {\n try {\n const saveSettings = context.container.resolve(SaveSettingsUseCase);\n const result = await saveSettings.execute(args.data);\n\n if (result.isFail()) {\n return new ErrorResponse(result.error);\n }\n\n return {\n data: toPublicSettings(result.value, \"storage\"),\n error: null\n };\n } catch (ex) {\n return new ErrorResponse(ex);\n }\n }\n }\n }\n });\n};\n"],"names":["SMTP_TRANSPORT_NAME","emptyResolver","toPublicSettings","settings","source","_password","publicSettings","createSettingsGraphQL","GraphQLSchemaPlugin","_","__","context","getSettings","GetSettingsUseCase","result","ErrorResponse","ex","args","saveSettings","SaveSettingsUseCase"],"mappings":";;;AAOA,MAAMA,sBAAsB;AAE5B,MAAMC,gBAAgB,IAAO,EAAC;AAO9B,MAAMC,mBAAmB,CACrBC,UACAC;IAEA,IAAI,CAACD,UACD,OAAO;IAGX,MAAM,EAAE,UAAUE,SAAS,EAAE,GAAGC,gBAAgB,GAAGH;IACnD,OAAO;QAAE,GAAGG,cAAc;QAAEF;IAAO;AACvC;AAEO,MAAMG,wBAAwB,IAC1B,IAAIC,oBAA6B;QACpC,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA8CX,CAAC;QACD,WAAW;YACP,OAAO;gBACH,QAAQP;YACZ;YACA,aAAa;gBACT,aAAa,OAAOQ,GAAGC,IAAIC;oBACvB,IAAI;wBACA,MAAMC,cAAcD,QAAQ,SAAS,CAAC,OAAO,CAACE;wBAC9C,MAAMC,SAAS,MAAMF,YAAY,OAAO,CAACZ;wBAEzC,IAAIc,OAAO,MAAM,IACb,OAAO,IAAIC,cAAcD,OAAO,KAAK;wBAGzC,MAAM,EAAEX,QAAQ,EAAEC,MAAM,EAAE,GAAGU,OAAO,KAAK;wBAEzC,OAAO;4BACH,MAAMZ,iBAAiBC,UAAUC;4BACjC,OAAO;wBACX;oBACJ,EAAE,OAAOY,IAAI;wBACT,OAAO,IAAID,cAAcC;oBAC7B;gBACJ;YACJ;YACA,UAAU;gBACN,QAAQf;YACZ;YACA,gBAAgB;gBACZ,cAAc,OAAOQ,GAAGQ,MAAWN;oBAC/B,IAAI;wBACA,MAAMO,eAAeP,QAAQ,SAAS,CAAC,OAAO,CAACQ;wBAC/C,MAAML,SAAS,MAAMI,aAAa,OAAO,CAACD,KAAK,IAAI;wBAEnD,IAAIH,OAAO,MAAM,IACb,OAAO,IAAIC,cAAcD,OAAO,KAAK;wBAGzC,OAAO;4BACH,MAAMZ,iBAAiBY,OAAO,KAAK,EAAE;4BACrC,OAAO;wBACX;oBACJ,EAAE,OAAOE,IAAI;wBACT,OAAO,IAAID,cAAcC;oBAC7B;gBACJ;YACJ;QACJ;IACJ"}
package/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { CodeMailerSettingsFeature } from \"~/features/CodeMailerSettings/feature.js\";\nimport { GetSettingsFeature } from \"~/features/GetSettings/feature.js\";\nimport { SaveSettingsFeature } from \"~/features/SaveSettings/feature.js\";\nimport { DummyTransportFeature } from \"~/features/DummyTransport/feature.js\";\nimport { SmtpTransportFeature } from \"~/features/SmtpTransport/feature.js\";\nimport { MailerServiceFeature } from \"~/features/MailerService/feature.js\";\nimport { SendMailFeature } from \"~/features/SendMail/feature.js\";\nimport { createSettingsGraphQL } from \"~/graphql/settings.js\";\nimport { createRegisterExtensionPlugin } from \"@webiny/handler\";\n\nexport { MailerService } from \"./domain/MailerService/abstractions.js\";\nexport type { IMailerService, IMailerServiceErrors } from \"./domain/MailerService/abstractions.js\";\n\nexport const createMailerContext = () => {\n return createRegisterExtensionPlugin(context => {\n // Register all features.\n CodeMailerSettingsFeature.register(context.container);\n DummyTransportFeature.register(context.container);\n SmtpTransportFeature.register(context.container);\n GetSettingsFeature.register(context.container);\n SaveSettingsFeature.register(context.container);\n MailerServiceFeature.register(context.container);\n SendMailFeature.register(context.container);\n });\n};\n\nexport const createMailerGraphQL = () => {\n return createSettingsGraphQL();\n};\n"],"names":["createMailerContext","createRegisterExtensionPlugin","context","CodeMailerSettingsFeature","DummyTransportFeature","SmtpTransportFeature","GetSettingsFeature","SaveSettingsFeature","MailerServiceFeature","SendMailFeature","createMailerGraphQL","createSettingsGraphQL"],"mappings":";;;;;;;;;AAaO,MAAMA,sBAAsB,IACxBC,8BAA8BC,CAAAA;QAEjCC,0BAA0B,QAAQ,CAACD,QAAQ,SAAS;QACpDE,sBAAsB,QAAQ,CAACF,QAAQ,SAAS;QAChDG,qBAAqB,QAAQ,CAACH,QAAQ,SAAS;QAC/CI,mBAAmB,QAAQ,CAACJ,QAAQ,SAAS;QAC7CK,oBAAoB,QAAQ,CAACL,QAAQ,SAAS;QAC9CM,qBAAqB,QAAQ,CAACN,QAAQ,SAAS;QAC/CO,gBAAgB,QAAQ,CAACP,QAAQ,SAAS;IAC9C;AAGG,MAAMQ,sBAAsB,IACxBC"}