@webiny/api-mailer 5.30.0 → 5.31.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/context.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { ContextPlugin } from "@webiny/handler";
1
+ import { ContextPlugin } from "@webiny/api";
2
2
  import { MailerConfig, MailerContext } from "./types";
3
3
  export declare const createMailerContext: (config?: MailerConfig) => ContextPlugin<MailerContext>;
package/context.js CHANGED
@@ -5,12 +5,12 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.createMailerContext = void 0;
7
7
 
8
- var _handler = require("@webiny/handler");
8
+ var _api = require("@webiny/api");
9
9
 
10
10
  var _mailer = require("./crud/mailer.crud");
11
11
 
12
12
  const createMailerContext = config => {
13
- return new _handler.ContextPlugin(async context => {
13
+ return new _api.ContextPlugin(async context => {
14
14
  context.mailer = (0, _mailer.createMailerCrud)(config);
15
15
  });
16
16
  };
package/context.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["createMailerContext","config","ContextPlugin","context","mailer","createMailerCrud"],"sources":["context.ts"],"sourcesContent":["import { ContextPlugin } from \"@webiny/handler\";\nimport { MailerConfig, MailerContext } from \"./types\";\nimport { createMailerCrud } from \"~/crud/mailer.crud\";\n\nexport const createMailerContext = (config?: MailerConfig) => {\n return new ContextPlugin<MailerContext>(async context => {\n context.mailer = createMailerCrud(config);\n });\n};\n"],"mappings":";;;;;;;AAAA;;AAEA;;AAEO,MAAMA,mBAAmB,GAAIC,MAAD,IAA2B;EAC1D,OAAO,IAAIC,sBAAJ,CAAiC,MAAMC,OAAN,IAAiB;IACrDA,OAAO,CAACC,MAAR,GAAiB,IAAAC,wBAAA,EAAiBJ,MAAjB,CAAjB;EACH,CAFM,CAAP;AAGH,CAJM"}
1
+ {"version":3,"names":["createMailerContext","config","ContextPlugin","context","mailer","createMailerCrud"],"sources":["context.ts"],"sourcesContent":["import { ContextPlugin } from \"@webiny/api\";\nimport { MailerConfig, MailerContext } from \"./types\";\nimport { createMailerCrud } from \"~/crud/mailer.crud\";\n\nexport const createMailerContext = (config?: MailerConfig) => {\n return new ContextPlugin<MailerContext>(async context => {\n context.mailer = createMailerCrud(config);\n });\n};\n"],"mappings":";;;;;;;AAAA;;AAEA;;AAEO,MAAMA,mBAAmB,GAAIC,MAAD,IAA2B;EAC1D,OAAO,IAAIC,kBAAJ,CAAiC,MAAMC,OAAN,IAAiB;IACrDA,OAAO,CAACC,MAAR,GAAiB,IAAAC,wBAAA,EAAiBJ,MAAjB,CAAjB;EACH,CAFM,CAAP;AAGH,CAJM"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/api-mailer",
3
- "version": "5.30.0",
3
+ "version": "5.31.0-beta.0",
4
4
  "main": "index.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,11 +14,11 @@
14
14
  "description": "The API to send e-mails.",
15
15
  "license": "MIT",
16
16
  "dependencies": {
17
- "@babel/runtime": "7.18.6",
18
- "@webiny/error": "5.30.0",
19
- "@webiny/handler": "5.30.0",
20
- "@webiny/plugins": "5.30.0",
21
- "@webiny/pubsub": "5.30.0",
17
+ "@babel/runtime": "7.18.9",
18
+ "@webiny/api": "5.31.0-beta.0",
19
+ "@webiny/error": "5.31.0-beta.0",
20
+ "@webiny/plugins": "5.31.0-beta.0",
21
+ "@webiny/pubsub": "5.31.0-beta.0",
22
22
  "joi": "17.6.0",
23
23
  "nodemailer": "6.7.7"
24
24
  },
@@ -28,9 +28,9 @@
28
28
  "@babel/preset-env": "^7.16.4",
29
29
  "@babel/preset-typescript": "^7.16.0",
30
30
  "@types/nodemailer": "^6.4.4",
31
- "@webiny/cli": "^5.30.0",
32
- "@webiny/project-utils": "^5.30.0",
33
- "jest": "^26.6.3",
31
+ "@webiny/cli": "^5.31.0-beta.0",
32
+ "@webiny/project-utils": "^5.31.0-beta.0",
33
+ "jest": "^28.1.0",
34
34
  "rimraf": "^3.0.2",
35
35
  "ttypescript": "^1.5.12",
36
36
  "typescript": "4.7.4"
@@ -43,5 +43,5 @@
43
43
  "build": "yarn webiny run build",
44
44
  "watch": "yarn webiny run watch"
45
45
  },
46
- "gitHead": "3cadc5d26e565586b28772afbc18ae554ce7b782"
46
+ "gitHead": "dea7c56325ff140ef0e2d761f3e65708d46d401e"
47
47
  }
package/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Context } from "@webiny/handler/types";
1
+ import { Context } from "@webiny/api/types";
2
2
  import { Topic } from "@webiny/pubsub/types";
3
3
  export interface MailerContextObjectSendParams {
4
4
  data: MailerSendData;
package/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import { Context } from \"@webiny/handler/types\";\nimport { Topic } from \"@webiny/pubsub/types\";\n\nexport interface MailerContextObjectSendParams {\n data: MailerSendData;\n}\n\nexport type MailerSetterParams = Mailer | (() => Promise<Mailer>);\n\nexport interface MailerSetter {\n (mailer: MailerSetterParams): void;\n}\n\nexport interface MailerContextObject {\n onBeforeSend: Topic<OnBeforeMailerSendParams>;\n onAfterSend: Topic<OnAfterMailerSendParams>;\n onError: Topic<OnErrorMailerParams>;\n setMailer: MailerSetter;\n getMailer: <T extends Mailer = Mailer>() => Promise<T>;\n send: <T>(params: MailerContextObjectSendParams) => Promise<MailerSendResponse<T>>;\n}\nexport interface MailerContext extends Context {\n mailer: MailerContextObject;\n}\n\nexport interface MailerConfig<T extends Mailer = Mailer> {\n mailer?: T;\n}\n\nexport interface OnBeforeMailerSendParams {\n data: MailerSendData;\n}\nexport interface OnAfterMailerSendParams {\n data: MailerSendData;\n}\nexport interface OnErrorMailerParams {\n error: Error;\n data: MailerSendData;\n}\n\n/**\n * Interface to implement the actual mailer.\n */\nexport interface MailerSendResponse<T = any> {\n result: T | null;\n error: {\n message: string;\n code: string;\n data: {\n [key: string]: any;\n };\n } | null;\n}\n\nexport interface MailerSendData {\n to: string[];\n from: string;\n subject: string;\n text: string;\n html?: string;\n replyTo?: string;\n cc?: string[];\n bcc?: string[];\n}\nexport interface Mailer<T = any> {\n send: (params: MailerSendData) => Promise<MailerSendResponse<T>>;\n}\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import { Context } from \"@webiny/api/types\";\nimport { Topic } from \"@webiny/pubsub/types\";\n\nexport interface MailerContextObjectSendParams {\n data: MailerSendData;\n}\n\nexport type MailerSetterParams = Mailer | (() => Promise<Mailer>);\n\nexport interface MailerSetter {\n (mailer: MailerSetterParams): void;\n}\n\nexport interface MailerContextObject {\n onBeforeSend: Topic<OnBeforeMailerSendParams>;\n onAfterSend: Topic<OnAfterMailerSendParams>;\n onError: Topic<OnErrorMailerParams>;\n setMailer: MailerSetter;\n getMailer: <T extends Mailer = Mailer>() => Promise<T>;\n send: <T>(params: MailerContextObjectSendParams) => Promise<MailerSendResponse<T>>;\n}\nexport interface MailerContext extends Context {\n mailer: MailerContextObject;\n}\n\nexport interface MailerConfig<T extends Mailer = Mailer> {\n mailer?: T;\n}\n\nexport interface OnBeforeMailerSendParams {\n data: MailerSendData;\n}\nexport interface OnAfterMailerSendParams {\n data: MailerSendData;\n}\nexport interface OnErrorMailerParams {\n error: Error;\n data: MailerSendData;\n}\n\n/**\n * Interface to implement the actual mailer.\n */\nexport interface MailerSendResponse<T = any> {\n result: T | null;\n error: {\n message: string;\n code: string;\n data: {\n [key: string]: any;\n };\n } | null;\n}\n\nexport interface MailerSendData {\n to: string[];\n from: string;\n subject: string;\n text: string;\n html?: string;\n replyTo?: string;\n cc?: string[];\n bcc?: string[];\n}\nexport interface Mailer<T = any> {\n send: (params: MailerSendData) => Promise<MailerSendResponse<T>>;\n}\n"],"mappings":""}