@storecraft/mailer-providers-http 1.0.16 → 1.2.5

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/README.md CHANGED
@@ -34,9 +34,7 @@ const app = new App(config)
34
34
  apikey: process.env.SEND_GRID_SECRET
35
35
  }
36
36
  )
37
- );
38
-
39
- await app.init();
37
+ ).init();
40
38
  ```
41
39
 
42
40
  Storecraft will search the following `env` variables
@@ -68,9 +66,7 @@ const app = new App(config)
68
66
  apikey: process.env.RESEND_API_KEY
69
67
  }
70
68
  )
71
- );
72
-
73
- await app.init();
69
+ ).init();
74
70
  ```
75
71
 
76
72
  Storecraft will search the following `env` variables
@@ -103,9 +99,8 @@ const app = new App(config)
103
99
  apikey: process.env.MAILCHIMP_API_KEY
104
100
  }
105
101
  )
106
- );
102
+ ).init();
107
103
 
108
- await app.init();
109
104
  ```
110
105
  Storecraft will search the following `env` variables
111
106
 
@@ -138,9 +133,7 @@ const app = new App(config)
138
133
  apikey: process.env.MAILGUN_API_KEY
139
134
  }
140
135
  )
141
- );
142
-
143
- await app.init();
136
+ ).init();
144
137
  ```
145
138
 
146
139
  Storecraft will search the following `env` variables
@@ -18,7 +18,7 @@ import { convert_to_base64 } from "./adapter.utils.js";
18
18
  export class MailChimp {
19
19
 
20
20
  /** @satisfies {ENV<Config>} */
21
- static EnvConfig = /** @type{const} */ ({
21
+ static EnvConfig = /** @type {const} */ ({
22
22
  apikey: 'MAILCHIMP_API_KEY'
23
23
  });
24
24
 
@@ -36,7 +36,8 @@ export class MailChimp {
36
36
 
37
37
  /** @type {mailer<Config>["onInit"]} */
38
38
  onInit = (app) => {
39
- this.config.apikey ??= app.platform.env[MailChimp.EnvConfig.apikey];
39
+ this.config.apikey ??=
40
+ app.env[MailChimp.EnvConfig.apikey];
40
41
  };
41
42
 
42
43
  /**
@@ -17,7 +17,7 @@ import { address_to_friendly_name, convert_attachment_to_blob } from "./adapter.
17
17
  export class Mailgun {
18
18
 
19
19
  /** @satisfies {ENV<Config>} */
20
- static EnvConfig = /** @type{const} */ ({
20
+ static EnvConfig = /** @type {const} */ ({
21
21
  apikey: 'MAILGUN_API_KEY'
22
22
  });
23
23
 
@@ -35,7 +35,8 @@ export class Mailgun {
35
35
 
36
36
  /** @type {mailer<Config>["onInit"]} */
37
37
  onInit = (app) => {
38
- this.config.apikey ??= app.platform.env[Mailgun.EnvConfig.apikey];
38
+ this.config.apikey ??=
39
+ app.env[Mailgun.EnvConfig.apikey];
39
40
  };
40
41
 
41
42
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storecraft/mailer-providers-http",
3
- "version": "1.0.16",
3
+ "version": "1.2.5",
4
4
  "description": "Official Serverless Friendly e-mail adapters for storecraft",
5
5
  "license": "MIT",
6
6
  "author": "Tomer Shalev (https://github.com/store-craft)",
@@ -21,8 +21,7 @@
21
21
  "types": "./types.public.d.ts",
22
22
  "scripts": {
23
23
  "mailer-providers-http:test": "uvu -c",
24
- "test": "npm run mailer-providers-http:test",
25
- "prepublishOnly": "npm version patch --force"
24
+ "test": "npm run mailer-providers-http:test"
26
25
  },
27
26
  "exports": {
28
27
  ".": {
package/resend/adapter.js CHANGED
@@ -15,7 +15,7 @@ import { address_to_friendly_name, convert_to_base64 } from "./adapter.utils.js"
15
15
  export class Resend {
16
16
 
17
17
  /** @satisfies {ENV<Config>} */
18
- static EnvConfig = /** @type{const} */ ({
18
+ static EnvConfig = /** @type {const} */ ({
19
19
  apikey: 'RESEND_API_KEY'
20
20
  });
21
21
 
@@ -34,7 +34,8 @@ export class Resend {
34
34
 
35
35
  /** @type {mailer<Config>["onInit"]} */
36
36
  onInit = (app) => {
37
- this.config.apikey ??= app.platform.env[Resend.EnvConfig.apikey];
37
+ this.config.apikey ??=
38
+ app.env[Resend.EnvConfig.apikey];
38
39
  };
39
40
 
40
41
  /**
@@ -14,7 +14,7 @@ import { convert_to_base64 } from "./adapter.utils.js";
14
14
  export class SendGrid {
15
15
 
16
16
  /** @satisfies {ENV<Config>} */
17
- static EnvConfig = /** @type{const} */ ({
17
+ static EnvConfig = /** @type {const} */ ({
18
18
  apikey: 'SENDGRID_API_KEY'
19
19
  });
20
20
 
@@ -32,7 +32,8 @@ export class SendGrid {
32
32
 
33
33
  /** @type {mailer<Config>["onInit"]} */
34
34
  onInit = (app) => {
35
- this.config.apikey ??= app.platform.env[SendGrid.EnvConfig.apikey];
35
+ this.config.apikey ??=
36
+ app.env[SendGrid.EnvConfig.apikey];
36
37
  };
37
38
 
38
39
  /**