@strapi/provider-email-sendmail 0.0.0-next.dff425769af4d4d006725a10c395f59637403653 → 0.0.0-next.e09d30edcbd16960a838997778a31d50e9c60bc4

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,24 @@
1
+ import { Options } from 'sendmail';
2
+ interface Settings {
3
+ defaultFrom: string;
4
+ defaultReplyTo: string;
5
+ }
6
+ interface SendOptions {
7
+ from?: string;
8
+ to: string;
9
+ cc: string;
10
+ bcc: string;
11
+ replyTo?: string;
12
+ subject: string;
13
+ text: string;
14
+ html: string;
15
+ [key: string]: unknown;
16
+ }
17
+ type ProviderOptions = Options;
18
+ declare const _default: {
19
+ init(providerOptions: ProviderOptions, settings: Settings): {
20
+ send(options: SendOptions): Promise<void>;
21
+ };
22
+ };
23
+ export default _default;
24
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAwB,EAAE,OAAO,EAAa,MAAM,UAAU,CAAC;AAE/D,UAAU,QAAQ;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,UAAU,WAAW;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,KAAK,eAAe,GAAG,OAAO,CAAC;;0BAGP,eAAe,YAAY,QAAQ;sBAOvC,WAAW,GAAG,QAAQ,IAAI,CAAC;;;AAR/C,wBAmCE"}
package/dist/index.js ADDED
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ const sendmailFactory = require("sendmail");
3
+ const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
4
+ const sendmailFactory__default = /* @__PURE__ */ _interopDefault(sendmailFactory);
5
+ const index = {
6
+ init(providerOptions, settings) {
7
+ const sendmail = sendmailFactory__default.default({
8
+ silent: true,
9
+ ...providerOptions
10
+ });
11
+ return {
12
+ send(options) {
13
+ return new Promise((resolve, reject) => {
14
+ const { from, to, cc, bcc, replyTo, subject, text, html, ...rest } = options;
15
+ const msg = {
16
+ from: from || settings.defaultFrom,
17
+ to,
18
+ cc,
19
+ bcc,
20
+ replyTo: replyTo || settings.defaultReplyTo,
21
+ subject,
22
+ text,
23
+ html,
24
+ ...rest
25
+ };
26
+ sendmail(msg, (err) => {
27
+ if (err) {
28
+ reject(err);
29
+ } else {
30
+ resolve();
31
+ }
32
+ });
33
+ });
34
+ }
35
+ };
36
+ }
37
+ };
38
+ module.exports = index;
39
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import sendmailFactory, { Options, MailInput } from 'sendmail';\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\ntype ProviderOptions = Options;\n\nexport default {\n init(providerOptions: ProviderOptions, settings: Settings) {\n const sendmail = sendmailFactory({\n silent: true,\n ...providerOptions,\n });\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: MailInput = {\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 sendmail(msg, (err) => {\n if (err) {\n reject(err);\n } else {\n resolve();\n }\n });\n });\n },\n };\n },\n};\n"],"names":["sendmailFactory"],"mappings":";;;;AAqBA,MAAe,QAAA;AAAA,EACb,KAAK,iBAAkC,UAAoB;AACzD,UAAM,WAAWA,yBAAAA,QAAgB;AAAA,MAC/B,QAAQ;AAAA,MACR,GAAG;AAAA,IAAA,CACJ;AAEM,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,MAAiB;AAAA,YACrB,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;AAGI,mBAAA,KAAK,CAAC,QAAQ;AACrB,gBAAI,KAAK;AACP,qBAAO,GAAG;AAAA,YAAA,OACL;AACG;YACV;AAAA,UAAA,CACD;AAAA,QAAA,CACF;AAAA,MACH;AAAA,IAAA;AAAA,EAEJ;AACF;;"}
@@ -1,19 +1,14 @@
1
- 'use strict';
2
-
3
- const sendmailFactory = require('sendmail');
4
- const { removeUndefined } = require('@strapi/utils');
5
-
6
- module.exports = {
7
- init(providerOptions = {}, settings = {}) {
1
+ import sendmailFactory from "sendmail";
2
+ const index = {
3
+ init(providerOptions, settings) {
8
4
  const sendmail = sendmailFactory({
9
5
  silent: true,
10
- ...providerOptions,
6
+ ...providerOptions
11
7
  });
12
8
  return {
13
9
  send(options) {
14
10
  return new Promise((resolve, reject) => {
15
11
  const { from, to, cc, bcc, replyTo, subject, text, html, ...rest } = options;
16
-
17
12
  const msg = {
18
13
  from: from || settings.defaultFrom,
19
14
  to,
@@ -23,10 +18,9 @@ module.exports = {
23
18
  subject,
24
19
  text,
25
20
  html,
26
- ...rest,
21
+ ...rest
27
22
  };
28
-
29
- sendmail(removeUndefined(msg), (err) => {
23
+ sendmail(msg, (err) => {
30
24
  if (err) {
31
25
  reject(err);
32
26
  } else {
@@ -34,7 +28,11 @@ module.exports = {
34
28
  }
35
29
  });
36
30
  });
37
- },
31
+ }
38
32
  };
39
- },
33
+ }
40
34
  };
35
+ export {
36
+ index as default
37
+ };
38
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":["../src/index.ts"],"sourcesContent":["import sendmailFactory, { Options, MailInput } from 'sendmail';\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\ntype ProviderOptions = Options;\n\nexport default {\n init(providerOptions: ProviderOptions, settings: Settings) {\n const sendmail = sendmailFactory({\n silent: true,\n ...providerOptions,\n });\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: MailInput = {\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 sendmail(msg, (err) => {\n if (err) {\n reject(err);\n } else {\n resolve();\n }\n });\n });\n },\n };\n },\n};\n"],"names":[],"mappings":";AAqBA,MAAe,QAAA;AAAA,EACb,KAAK,iBAAkC,UAAoB;AACzD,UAAM,WAAW,gBAAgB;AAAA,MAC/B,QAAQ;AAAA,MACR,GAAG;AAAA,IAAA,CACJ;AAEM,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,MAAiB;AAAA,YACrB,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;AAGI,mBAAA,KAAK,CAAC,QAAQ;AACrB,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-sendmail",
3
- "version": "0.0.0-next.dff425769af4d4d006725a10c395f59637403653",
3
+ "version": "0.0.0-next.e09d30edcbd16960a838997778a31d50e9c60bc4",
4
4
  "description": "Sendmail provider for strapi email",
5
5
  "keywords": [
6
6
  "email",
@@ -27,20 +27,32 @@
27
27
  "url": "https://strapi.io"
28
28
  }
29
29
  ],
30
- "main": "./lib",
31
- "directories": {
32
- "lib": "./lib"
33
- },
30
+ "main": "./dist/index.js",
31
+ "module": "./dist/index.mjs",
32
+ "source": "./src/index.ts",
33
+ "types": "./dist/index.d.ts",
34
+ "files": [
35
+ "./dist"
36
+ ],
34
37
  "scripts": {
35
- "lint": "run -T eslint ."
38
+ "build": "pack-up build",
39
+ "clean": "run -T rimraf ./dist",
40
+ "lint": "run -T eslint .",
41
+ "watch": "pack-up watch"
36
42
  },
37
43
  "dependencies": {
38
- "@strapi/utils": "0.0.0-next.dff425769af4d4d006725a10c395f59637403653",
44
+ "@strapi/utils": "0.0.0-next.e09d30edcbd16960a838997778a31d50e9c60bc4",
39
45
  "sendmail": "^1.6.1"
40
46
  },
47
+ "devDependencies": {
48
+ "@strapi/pack-up": "0.0.0-next.e09d30edcbd16960a838997778a31d50e9c60bc4",
49
+ "@types/sendmail": "1.4.4",
50
+ "eslint-config-custom": "0.0.0-next.e09d30edcbd16960a838997778a31d50e9c60bc4",
51
+ "tsconfig": "0.0.0-next.e09d30edcbd16960a838997778a31d50e9c60bc4"
52
+ },
41
53
  "engines": {
42
- "node": ">=14.19.1 <=18.x.x",
54
+ "node": ">=18.0.0 <=20.x.x",
43
55
  "npm": ">=6.0.0"
44
56
  },
45
- "gitHead": "dff425769af4d4d006725a10c395f59637403653"
57
+ "gitHead": "e09d30edcbd16960a838997778a31d50e9c60bc4"
46
58
  }
package/.eslintignore DELETED
@@ -1,2 +0,0 @@
1
- node_modules/
2
- .eslintrc.js
package/.eslintrc.js DELETED
@@ -1,4 +0,0 @@
1
- module.exports = {
2
- root: true,
3
- extends: ['custom/back'],
4
- };