@strapi/provider-email-sendgrid 5.49.0 → 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 CHANGED
@@ -15,6 +15,7 @@ interface SendOptions {
15
15
  }
16
16
  interface ProviderOptions {
17
17
  apiKey: string;
18
+ region?: 'eu' | 'global';
18
19
  }
19
20
  declare const _default: {
20
21
  init(providerOptions: ProviderOptions, settings: Settings): {
@@ -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;CAChB;;0BAGuB,eAAe,YAAY,QAAQ;sBAIvC,WAAW,GAAG,QAAQ,IAAI,CAAC;;;AAL/C,wBAgCE"}
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
@@ -9,6 +9,9 @@ var sendgrid__default = /*#__PURE__*/_interopDefault(sendgrid);
9
9
  var index = {
10
10
  init (providerOptions, settings) {
11
11
  sendgrid__default.default.setApiKey(providerOptions.apiKey);
12
+ if (providerOptions.region) {
13
+ sendgrid__default.default.client.setDataResidency(providerOptions.region);
14
+ }
12
15
  return {
13
16
  send (options) {
14
17
  return new Promise((resolve, reject)=>{
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":";;;;;;;;AAuBA,YAAe;IACbA,IAAAA,CAAAA,CAAKC,eAAgC,EAAEC,QAAkB,EAAA;QACvDC,yBAAAA,CAASC,SAAS,CAACH,eAAAA,CAAgBI,MAAM,CAAA;QAEzC,OAAO;AACLC,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,IAAQT,SAASmB,WAAW;AAClCT,wBAAAA,EAAAA;AACAC,wBAAAA,EAAAA;AACAC,wBAAAA,GAAAA;wBACAC,OAAAA,EAASA,OAAAA,IAAWb,SAASoB,cAAc;AAC3CN,wBAAAA,OAAAA;AACAC,wBAAAA,IAAAA;AACAC,wBAAAA,IAAAA;AACA,wBAAA,GAAGC;AACL,qBAAA;AAEAhB,oBAAAA,yBAAAA,CAASG,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;;;;"}
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)=>{
@@ -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":";;AAuBA,YAAe;IACbA,IAAAA,CAAAA,CAAKC,eAAgC,EAAEC,QAAkB,EAAA;QACvDC,QAAAA,CAASC,SAAS,CAACH,eAAAA,CAAgBI,MAAM,CAAA;QAEzC,OAAO;AACLC,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,IAAQT,SAASmB,WAAW;AAClCT,wBAAAA,EAAAA;AACAC,wBAAAA,EAAAA;AACAC,wBAAAA,GAAAA;wBACAC,OAAAA,EAASA,OAAAA,IAAWb,SAASoB,cAAc;AAC3CN,wBAAAA,OAAAA;AACAC,wBAAAA,IAAAA;AACAC,wBAAAA,IAAAA;AACA,wBAAA,GAAGC;AACL,qBAAA;AAEAhB,oBAAAA,QAAAA,CAASG,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;;;;"}
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.49.0",
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.0"
49
+ "@strapi/utils": "5.50.0"
50
50
  },
51
51
  "devDependencies": {
52
- "eslint-config-custom": "5.49.0",
53
- "tsconfig": "5.49.0"
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",