@strapi/provider-email-sendgrid 5.48.1 → 5.50.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.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,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,UAAU,eAAe;IACvB,MAAM,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,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,UAAU,eAAe;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,IAAI,GAAG,QAAQ,CAAC;CAC1B;;0BAGuB,eAAe,YAAY,QAAQ;sBAQvC,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;;;AAT/C,wBAoCE"}
|
package/dist/index.js
CHANGED
|
@@ -2,9 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
var sendgrid = require('@sendgrid/mail');
|
|
4
4
|
|
|
5
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
6
|
+
|
|
7
|
+
var sendgrid__default = /*#__PURE__*/_interopDefault(sendgrid);
|
|
8
|
+
|
|
5
9
|
var index = {
|
|
6
10
|
init (providerOptions, settings) {
|
|
7
|
-
|
|
11
|
+
sendgrid__default.default.setApiKey(providerOptions.apiKey);
|
|
12
|
+
if (providerOptions.region) {
|
|
13
|
+
sendgrid__default.default.client.setDataResidency(providerOptions.region);
|
|
14
|
+
}
|
|
8
15
|
return {
|
|
9
16
|
send (options) {
|
|
10
17
|
return new Promise((resolve, reject)=>{
|
|
@@ -20,7 +27,7 @@ var index = {
|
|
|
20
27
|
html,
|
|
21
28
|
...rest
|
|
22
29
|
};
|
|
23
|
-
|
|
30
|
+
sendgrid__default.default.send(msg, false, (err)=>{
|
|
24
31
|
if (err) {
|
|
25
32
|
reject(err);
|
|
26
33
|
} else {
|
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":["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":"
|
|
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 region?: 'eu' | 'global';\n}\n\nexport default {\n init(providerOptions: ProviderOptions, settings: Settings) {\n sendgrid.setApiKey(providerOptions.apiKey);\n\n if (providerOptions.region) {\n (sendgrid as any).client.setDataResidency(providerOptions.region);\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: 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","region","client","setDataResidency","send","options","Promise","resolve","reject","from","to","cc","bcc","replyTo","subject","text","html","rest","msg","defaultFrom","defaultReplyTo","err"],"mappings":";;;;;;;;AAwBA,YAAe;IACbA,IAAAA,CAAAA,CAAKC,eAAgC,EAAEC,QAAkB,EAAA;QACvDC,yBAAAA,CAASC,SAAS,CAACH,eAAAA,CAAgBI,MAAM,CAAA;QAEzC,IAAIJ,eAAAA,CAAgBK,MAAM,EAAE;AACzBH,YAAAA,yBAAAA,CAAiBI,MAAM,CAACC,gBAAgB,CAACP,gBAAgBK,MAAM,CAAA;AAClE,QAAA;QAEA,OAAO;AACLG,YAAAA,IAAAA,CAAAA,CAAKC,OAAoB,EAAA;gBACvB,OAAO,IAAIC,OAAAA,CAAQ,CAACC,OAAAA,EAASC,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,GAAAA,GAAwB;wBAC5BT,IAAAA,EAAMA,IAAAA,IAAQZ,SAASsB,WAAW;AAClCT,wBAAAA,EAAAA;AACAC,wBAAAA,EAAAA;AACAC,wBAAAA,GAAAA;wBACAC,OAAAA,EAASA,OAAAA,IAAWhB,SAASuB,cAAc;AAC3CN,wBAAAA,OAAAA;AACAC,wBAAAA,IAAAA;AACAC,wBAAAA,IAAAA;AACA,wBAAA,GAAGC;AACL,qBAAA;AAEAnB,oBAAAA,yBAAAA,CAASM,IAAI,CAACc,GAAAA,EAAK,KAAA,EAAO,CAACG,GAAAA,GAAAA;AACzB,wBAAA,IAAIA,GAAAA,EAAK;4BACPb,MAAAA,CAAOa,GAAAA,CAAAA;wBACT,CAAA,MAAO;AACLd,4BAAAA,OAAAA,EAAAA;AACF,wBAAA;AACF,oBAAA,CAAA,CAAA;AACF,gBAAA,CAAA,CAAA;AACF,YAAA;AACF,SAAA;AACF,IAAA;AACF,CAAA;;;;"}
|
package/dist/index.mjs
CHANGED
|
@@ -3,6 +3,9 @@ import sendgrid from '@sendgrid/mail';
|
|
|
3
3
|
var index = {
|
|
4
4
|
init (providerOptions, settings) {
|
|
5
5
|
sendgrid.setApiKey(providerOptions.apiKey);
|
|
6
|
+
if (providerOptions.region) {
|
|
7
|
+
sendgrid.client.setDataResidency(providerOptions.region);
|
|
8
|
+
}
|
|
6
9
|
return {
|
|
7
10
|
send (options) {
|
|
8
11
|
return new Promise((resolve, reject)=>{
|
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":["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":";;
|
|
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 region?: 'eu' | 'global';\n}\n\nexport default {\n init(providerOptions: ProviderOptions, settings: Settings) {\n sendgrid.setApiKey(providerOptions.apiKey);\n\n if (providerOptions.region) {\n (sendgrid as any).client.setDataResidency(providerOptions.region);\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: 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","region","client","setDataResidency","send","options","Promise","resolve","reject","from","to","cc","bcc","replyTo","subject","text","html","rest","msg","defaultFrom","defaultReplyTo","err"],"mappings":";;AAwBA,YAAe;IACbA,IAAAA,CAAAA,CAAKC,eAAgC,EAAEC,QAAkB,EAAA;QACvDC,QAAAA,CAASC,SAAS,CAACH,eAAAA,CAAgBI,MAAM,CAAA;QAEzC,IAAIJ,eAAAA,CAAgBK,MAAM,EAAE;AACzBH,YAAAA,QAAAA,CAAiBI,MAAM,CAACC,gBAAgB,CAACP,gBAAgBK,MAAM,CAAA;AAClE,QAAA;QAEA,OAAO;AACLG,YAAAA,IAAAA,CAAAA,CAAKC,OAAoB,EAAA;gBACvB,OAAO,IAAIC,OAAAA,CAAQ,CAACC,OAAAA,EAASC,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,GAAAA,GAAwB;wBAC5BT,IAAAA,EAAMA,IAAAA,IAAQZ,SAASsB,WAAW;AAClCT,wBAAAA,EAAAA;AACAC,wBAAAA,EAAAA;AACAC,wBAAAA,GAAAA;wBACAC,OAAAA,EAASA,OAAAA,IAAWhB,SAASuB,cAAc;AAC3CN,wBAAAA,OAAAA;AACAC,wBAAAA,IAAAA;AACAC,wBAAAA,IAAAA;AACA,wBAAA,GAAGC;AACL,qBAAA;AAEAnB,oBAAAA,QAAAA,CAASM,IAAI,CAACc,GAAAA,EAAK,KAAA,EAAO,CAACG,GAAAA,GAAAA;AACzB,wBAAA,IAAIA,GAAAA,EAAK;4BACPb,MAAAA,CAAOa,GAAAA,CAAAA;wBACT,CAAA,MAAO;AACLd,4BAAAA,OAAAA,EAAAA;AACF,wBAAA;AACF,oBAAA,CAAA,CAAA;AACF,gBAAA,CAAA,CAAA;AACF,YAAA;AACF,SAAA;AACF,IAAA;AACF,CAAA;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/provider-email-sendgrid",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.50.0",
|
|
4
4
|
"description": "Sendgrid provider for strapi email",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"email",
|
|
@@ -46,11 +46,11 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@sendgrid/mail": "8.1.3",
|
|
49
|
-
"@strapi/utils": "5.
|
|
49
|
+
"@strapi/utils": "5.50.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"eslint-config-custom": "5.
|
|
53
|
-
"tsconfig": "5.
|
|
52
|
+
"eslint-config-custom": "5.50.0",
|
|
53
|
+
"tsconfig": "5.50.0"
|
|
54
54
|
},
|
|
55
55
|
"engines": {
|
|
56
56
|
"node": ">=20.0.0 <=26.x.x",
|