@strapi/provider-email-sendgrid 5.9.0 → 5.10.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/dist/index.js +33 -32
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +32 -32
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -7
package/dist/index.js
CHANGED
|
@@ -1,36 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var sendgrid = require('@sendgrid/mail');
|
|
4
|
+
|
|
5
|
+
var index = {
|
|
6
|
+
init (providerOptions, settings) {
|
|
7
|
+
sendgrid.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.send(msg, false, (err)=>{
|
|
24
|
+
if (err) {
|
|
25
|
+
reject(err);
|
|
26
|
+
} else {
|
|
27
|
+
resolve();
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
});
|
|
28
31
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
}
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
34
|
};
|
|
35
|
+
|
|
35
36
|
module.exports = index;
|
|
36
37
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,
|
|
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":["init","providerOptions","settings","sendgrid","setApiKey","apiKey","send","options","Promise","resolve","reject","from","to","cc","bcc","replyTo","subject","text","html","rest","msg","defaultFrom","defaultReplyTo","err"],"mappings":";;;;AAuBA,YAAe;IACbA,IAAKC,CAAAA,CAAAA,eAAgC,EAAEC,QAAkB,EAAA;QACvDC,QAASC,CAAAA,SAAS,CAACH,eAAAA,CAAgBI,MAAM,CAAA;QAEzC,OAAO;AACLC,YAAAA,IAAAA,CAAAA,CAAKC,OAAoB,EAAA;gBACvB,OAAO,IAAIC,OAAQ,CAAA,CAACC,OAASC,EAAAA,MAAAA,GAAAA;AAC3B,oBAAA,MAAM,EAAEC,IAAI,EAAEC,EAAE,EAAEC,EAAE,EAAEC,GAAG,EAAEC,OAAO,EAAEC,OAAO,EAAEC,IAAI,EAAEC,IAAI,EAAE,GAAGC,MAAM,GAAGZ,OAAAA;AAErE,oBAAA,MAAMa,GAAwB,GAAA;wBAC5BT,IAAMA,EAAAA,IAAAA,IAAQT,SAASmB,WAAW;AAClCT,wBAAAA,EAAAA;AACAC,wBAAAA,EAAAA;AACAC,wBAAAA,GAAAA;wBACAC,OAASA,EAAAA,OAAAA,IAAWb,SAASoB,cAAc;AAC3CN,wBAAAA,OAAAA;AACAC,wBAAAA,IAAAA;AACAC,wBAAAA,IAAAA;AACA,wBAAA,GAAGC;AACL,qBAAA;AAEAhB,oBAAAA,QAAAA,CAASG,IAAI,CAACc,GAAK,EAAA,KAAA,EAAO,CAACG,GAAAA,GAAAA;AACzB,wBAAA,IAAIA,GAAK,EAAA;4BACPb,MAAOa,CAAAA,GAAAA,CAAAA;yBACF,MAAA;AACLd,4BAAAA,OAAAA,EAAAA;AACF;AACF,qBAAA,CAAA;AACF,iBAAA,CAAA;AACF;AACF,SAAA;AACF;AACF,CAAE;;;;"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import sendgrid from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
import sendgrid from '@sendgrid/mail';
|
|
2
|
+
|
|
3
|
+
var index = {
|
|
4
|
+
init (providerOptions, settings) {
|
|
5
|
+
sendgrid.setApiKey(providerOptions.apiKey);
|
|
6
|
+
return {
|
|
7
|
+
send (options) {
|
|
8
|
+
return new Promise((resolve, reject)=>{
|
|
9
|
+
const { from, to, cc, bcc, replyTo, subject, text, html, ...rest } = options;
|
|
10
|
+
const msg = {
|
|
11
|
+
from: from || settings.defaultFrom,
|
|
12
|
+
to,
|
|
13
|
+
cc,
|
|
14
|
+
bcc,
|
|
15
|
+
replyTo: replyTo || settings.defaultReplyTo,
|
|
16
|
+
subject,
|
|
17
|
+
text,
|
|
18
|
+
html,
|
|
19
|
+
...rest
|
|
20
|
+
};
|
|
21
|
+
sendgrid.send(msg, false, (err)=>{
|
|
22
|
+
if (err) {
|
|
23
|
+
reject(err);
|
|
24
|
+
} else {
|
|
25
|
+
resolve();
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
});
|
|
25
29
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
export {
|
|
33
|
-
index as default
|
|
30
|
+
};
|
|
31
|
+
}
|
|
34
32
|
};
|
|
33
|
+
|
|
34
|
+
export { index as default };
|
|
35
35
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +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":"
|
|
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":["init","providerOptions","settings","sendgrid","setApiKey","apiKey","send","options","Promise","resolve","reject","from","to","cc","bcc","replyTo","subject","text","html","rest","msg","defaultFrom","defaultReplyTo","err"],"mappings":";;AAuBA,YAAe;IACbA,IAAKC,CAAAA,CAAAA,eAAgC,EAAEC,QAAkB,EAAA;QACvDC,QAASC,CAAAA,SAAS,CAACH,eAAAA,CAAgBI,MAAM,CAAA;QAEzC,OAAO;AACLC,YAAAA,IAAAA,CAAAA,CAAKC,OAAoB,EAAA;gBACvB,OAAO,IAAIC,OAAQ,CAAA,CAACC,OAASC,EAAAA,MAAAA,GAAAA;AAC3B,oBAAA,MAAM,EAAEC,IAAI,EAAEC,EAAE,EAAEC,EAAE,EAAEC,GAAG,EAAEC,OAAO,EAAEC,OAAO,EAAEC,IAAI,EAAEC,IAAI,EAAE,GAAGC,MAAM,GAAGZ,OAAAA;AAErE,oBAAA,MAAMa,GAAwB,GAAA;wBAC5BT,IAAMA,EAAAA,IAAAA,IAAQT,SAASmB,WAAW;AAClCT,wBAAAA,EAAAA;AACAC,wBAAAA,EAAAA;AACAC,wBAAAA,GAAAA;wBACAC,OAASA,EAAAA,OAAAA,IAAWb,SAASoB,cAAc;AAC3CN,wBAAAA,OAAAA;AACAC,wBAAAA,IAAAA;AACAC,wBAAAA,IAAAA;AACA,wBAAA,GAAGC;AACL,qBAAA;AAEAhB,oBAAAA,QAAAA,CAASG,IAAI,CAACc,GAAK,EAAA,KAAA,EAAO,CAACG,GAAAA,GAAAA;AACzB,wBAAA,IAAIA,GAAK,EAAA;4BACPb,MAAOa,CAAAA,GAAAA,CAAAA;yBACF,MAAA;AACLd,4BAAAA,OAAAA,EAAAA;AACF;AACF,qBAAA,CAAA;AACF,iBAAA,CAAA;AACF;AACF,SAAA;AACF;AACF,CAAE;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/provider-email-sendgrid",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.10.0",
|
|
4
4
|
"description": "Sendgrid provider for strapi email",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"email",
|
|
@@ -36,19 +36,20 @@
|
|
|
36
36
|
"dist/"
|
|
37
37
|
],
|
|
38
38
|
"scripts": {
|
|
39
|
-
"build": "
|
|
39
|
+
"build": "run -T npm-run-all clean --parallel build:code build:types",
|
|
40
|
+
"build:code": "run -T rollup -c",
|
|
41
|
+
"build:types": "run -T tsc -p tsconfig.build.json --emitDeclarationOnly",
|
|
40
42
|
"clean": "run -T rimraf ./dist",
|
|
41
43
|
"lint": "run -T eslint .",
|
|
42
|
-
"watch": "
|
|
44
|
+
"watch": "run -T rollup -c -w"
|
|
43
45
|
},
|
|
44
46
|
"dependencies": {
|
|
45
47
|
"@sendgrid/mail": "8.1.3",
|
|
46
|
-
"@strapi/utils": "5.
|
|
48
|
+
"@strapi/utils": "5.10.0"
|
|
47
49
|
},
|
|
48
50
|
"devDependencies": {
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"tsconfig": "5.9.0"
|
|
51
|
+
"eslint-config-custom": "5.10.0",
|
|
52
|
+
"tsconfig": "5.10.0"
|
|
52
53
|
},
|
|
53
54
|
"engines": {
|
|
54
55
|
"node": ">=18.0.0 <=22.x.x",
|