@strapi/provider-email-sendgrid 4.14.3 → 4.14.4

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/dist/index.d.ts CHANGED
@@ -21,4 +21,4 @@ declare const _default: {
21
21
  send(options: SendOptions): Promise<void>;
22
22
  };
23
23
  };
24
- export = _default;
24
+ export default _default;
package/dist/index.js CHANGED
@@ -1,37 +1,36 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
2
+ const sendgrid = require("@sendgrid/mail");
3
+ const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
4
+ const sendgrid__default = /* @__PURE__ */ _interopDefault(sendgrid);
5
+ const index = {
6
+ init(providerOptions, settings) {
7
+ sendgrid__default.default.setApiKey(providerOptions.apiKey);
8
+ return {
9
+ send(options) {
10
+ return new Promise((resolve, reject) => {
11
+ const { from, to, cc, bcc, replyTo, subject, text, html, ...rest } = options;
12
+ const msg = {
13
+ from: from || settings.defaultFrom,
14
+ to,
15
+ cc,
16
+ bcc,
17
+ replyTo: replyTo || settings.defaultReplyTo,
18
+ subject,
19
+ text,
20
+ html,
21
+ ...rest
22
+ };
23
+ sendgrid__default.default.send(msg, false, (err) => {
24
+ if (err) {
25
+ reject(err);
26
+ } else {
27
+ resolve();
28
+ }
29
+ });
30
+ });
31
+ }
32
+ };
33
+ }
4
34
  };
5
- const mail_1 = __importDefault(require("@sendgrid/mail"));
6
- module.exports = {
7
- init(providerOptions, settings) {
8
- mail_1.default.setApiKey(providerOptions.apiKey);
9
- return {
10
- send(options) {
11
- return new Promise((resolve, reject) => {
12
- const { from, to, cc, bcc, replyTo, subject, text, html, ...rest } = options;
13
- const msg = {
14
- from: from || settings.defaultFrom,
15
- to,
16
- cc,
17
- bcc,
18
- replyTo: replyTo || settings.defaultReplyTo,
19
- subject,
20
- text,
21
- html,
22
- ...rest,
23
- };
24
- mail_1.default.send(msg, false, (err) => {
25
- if (err) {
26
- reject(err);
27
- }
28
- else {
29
- resolve();
30
- }
31
- });
32
- });
33
- },
34
- };
35
- },
36
- };
37
- //# sourceMappingURL=index.js.map
35
+ module.exports = index;
36
+ //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,0DAA4D;AAuB5D,iBAAS;IACP,IAAI,CAAC,eAAgC,EAAE,QAAkB;QACvD,cAAQ,CAAC,SAAS,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QAE3C,OAAO;YACL,IAAI,CAAC,OAAoB;gBACvB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;oBACrC,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,OAAO,CAAC;oBAE7E,MAAM,GAAG,GAAqB;wBAC5B,IAAI,EAAE,IAAI,IAAI,QAAQ,CAAC,WAAW;wBAClC,EAAE;wBACF,EAAE;wBACF,GAAG;wBACH,OAAO,EAAE,OAAO,IAAI,QAAQ,CAAC,cAAc;wBAC3C,OAAO;wBACP,IAAI;wBACJ,IAAI;wBACJ,GAAG,IAAI;qBACR,CAAC;oBAEF,cAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,CAAC,GAAG,EAAE,EAAE;wBAChC,IAAI,GAAG,EAAE;4BACP,MAAM,CAAC,GAAG,CAAC,CAAC;yBACb;6BAAM;4BACL,OAAO,EAAE,CAAC;yBACX;oBACH,CAAC,CAAC,CAAC;gBACL,CAAC,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC"}
1
+ {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import sendgrid, { MailDataRequired } from '@sendgrid/mail';\n\ninterface Settings {\n defaultFrom: string;\n defaultReplyTo: string;\n}\n\ninterface SendOptions {\n from?: string;\n to: string;\n cc: string;\n bcc: string;\n replyTo?: string;\n subject: string;\n text: string;\n html: string;\n [key: string]: unknown;\n}\n\ninterface ProviderOptions {\n apiKey: string;\n}\n\nexport default {\n init(providerOptions: ProviderOptions, settings: Settings) {\n sendgrid.setApiKey(providerOptions.apiKey);\n\n return {\n send(options: SendOptions): Promise<void> {\n return new Promise((resolve, reject) => {\n const { from, to, cc, bcc, replyTo, subject, text, html, ...rest } = options;\n\n const msg: MailDataRequired = {\n from: from || settings.defaultFrom,\n to,\n cc,\n bcc,\n replyTo: replyTo || settings.defaultReplyTo,\n subject,\n text,\n html,\n ...rest,\n };\n\n sendgrid.send(msg, false, (err) => {\n if (err) {\n reject(err);\n } else {\n resolve();\n }\n });\n });\n },\n };\n },\n};\n"],"names":["sendgrid"],"mappings":";;;;AAuBA,MAAe,QAAA;AAAA,EACb,KAAK,iBAAkC,UAAoB;AAChDA,sBAAAA,QAAA,UAAU,gBAAgB,MAAM;AAElC,WAAA;AAAA,MACL,KAAK,SAAqC;AACxC,eAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AAChC,gBAAA,EAAE,MAAM,IAAI,IAAI,KAAK,SAAS,SAAS,MAAM,MAAM,GAAG,KAAA,IAAS;AAErE,gBAAM,MAAwB;AAAA,YAC5B,MAAM,QAAQ,SAAS;AAAA,YACvB;AAAA,YACA;AAAA,YACA;AAAA,YACA,SAAS,WAAW,SAAS;AAAA,YAC7B;AAAA,YACA;AAAA,YACA;AAAA,YACA,GAAG;AAAA,UAAA;AAGLA,4BAAAA,QAAS,KAAK,KAAK,OAAO,CAAC,QAAQ;AACjC,gBAAI,KAAK;AACP,qBAAO,GAAG;AAAA,YAAA,OACL;AACG;YACV;AAAA,UAAA,CACD;AAAA,QAAA,CACF;AAAA,MACH;AAAA,IAAA;AAAA,EAEJ;AACF;;"}
package/dist/index.mjs ADDED
@@ -0,0 +1,35 @@
1
+ import sendgrid from "@sendgrid/mail";
2
+ const index = {
3
+ init(providerOptions, settings) {
4
+ sendgrid.setApiKey(providerOptions.apiKey);
5
+ return {
6
+ send(options) {
7
+ return new Promise((resolve, reject) => {
8
+ const { from, to, cc, bcc, replyTo, subject, text, html, ...rest } = options;
9
+ const msg = {
10
+ from: from || settings.defaultFrom,
11
+ to,
12
+ cc,
13
+ bcc,
14
+ replyTo: replyTo || settings.defaultReplyTo,
15
+ subject,
16
+ text,
17
+ html,
18
+ ...rest
19
+ };
20
+ sendgrid.send(msg, false, (err) => {
21
+ if (err) {
22
+ reject(err);
23
+ } else {
24
+ resolve();
25
+ }
26
+ });
27
+ });
28
+ }
29
+ };
30
+ }
31
+ };
32
+ export {
33
+ index as default
34
+ };
35
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":["../src/index.ts"],"sourcesContent":["import sendgrid, { MailDataRequired } from '@sendgrid/mail';\n\ninterface Settings {\n defaultFrom: string;\n defaultReplyTo: string;\n}\n\ninterface SendOptions {\n from?: string;\n to: string;\n cc: string;\n bcc: string;\n replyTo?: string;\n subject: string;\n text: string;\n html: string;\n [key: string]: unknown;\n}\n\ninterface ProviderOptions {\n apiKey: string;\n}\n\nexport default {\n init(providerOptions: ProviderOptions, settings: Settings) {\n sendgrid.setApiKey(providerOptions.apiKey);\n\n return {\n send(options: SendOptions): Promise<void> {\n return new Promise((resolve, reject) => {\n const { from, to, cc, bcc, replyTo, subject, text, html, ...rest } = options;\n\n const msg: MailDataRequired = {\n from: from || settings.defaultFrom,\n to,\n cc,\n bcc,\n replyTo: replyTo || settings.defaultReplyTo,\n subject,\n text,\n html,\n ...rest,\n };\n\n sendgrid.send(msg, false, (err) => {\n if (err) {\n reject(err);\n } else {\n resolve();\n }\n });\n });\n },\n };\n },\n};\n"],"names":[],"mappings":";AAuBA,MAAe,QAAA;AAAA,EACb,KAAK,iBAAkC,UAAoB;AAChD,aAAA,UAAU,gBAAgB,MAAM;AAElC,WAAA;AAAA,MACL,KAAK,SAAqC;AACxC,eAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AAChC,gBAAA,EAAE,MAAM,IAAI,IAAI,KAAK,SAAS,SAAS,MAAM,MAAM,GAAG,KAAA,IAAS;AAErE,gBAAM,MAAwB;AAAA,YAC5B,MAAM,QAAQ,SAAS;AAAA,YACvB;AAAA,YACA;AAAA,YACA;AAAA,YACA,SAAS,WAAW,SAAS;AAAA,YAC7B;AAAA,YACA;AAAA,YACA;AAAA,YACA,GAAG;AAAA,UAAA;AAGL,mBAAS,KAAK,KAAK,OAAO,CAAC,QAAQ;AACjC,gBAAI,KAAK;AACP,qBAAO,GAAG;AAAA,YAAA,OACL;AACG;YACV;AAAA,UAAA,CACD;AAAA,QAAA,CACF;AAAA,MACH;AAAA,IAAA;AAAA,EAEJ;AACF;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strapi/provider-email-sendgrid",
3
- "version": "4.14.3",
3
+ "version": "4.14.4",
4
4
  "description": "Sendgrid provider for strapi email",
5
5
  "keywords": [
6
6
  "email",
@@ -29,29 +29,31 @@
29
29
  }
30
30
  ],
31
31
  "main": "./dist/index.js",
32
+ "module": "./dist/index.mjs",
33
+ "source": "./src/index.ts",
32
34
  "types": "./dist/index.d.ts",
33
35
  "files": [
34
36
  "./dist"
35
37
  ],
36
38
  "scripts": {
37
- "build": "run -T tsc",
38
- "build:ts": "run -T tsc",
39
- "watch": "run -T tsc -w --preserveWatchOutput",
39
+ "build": "pack-up build",
40
40
  "clean": "run -T rimraf ./dist",
41
+ "lint": "run -T eslint .",
41
42
  "prepublishOnly": "yarn clean && yarn build",
42
- "lint": "run -T eslint ."
43
+ "watch": "pack-up watch"
43
44
  },
44
45
  "dependencies": {
45
46
  "@sendgrid/mail": "7.7.0",
46
- "@strapi/utils": "4.14.3"
47
+ "@strapi/utils": "4.14.4"
47
48
  },
48
49
  "devDependencies": {
49
- "eslint-config-custom": "4.14.3",
50
- "tsconfig": "4.14.3"
50
+ "@strapi/pack-up": "4.14.4",
51
+ "eslint-config-custom": "4.14.4",
52
+ "tsconfig": "4.14.4"
51
53
  },
52
54
  "engines": {
53
55
  "node": ">=16.0.0 <=20.x.x",
54
56
  "npm": ">=6.0.0"
55
57
  },
56
- "gitHead": "f509e0b15d77e2475bdc1ada1b26dd0ba2b1dbca"
58
+ "gitHead": "fbd6e3e3014b1c5eee1d7bb8d65e273318662656"
57
59
  }