@storecraft/mailer-providers-http 1.0.1 → 1.0.2

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
@@ -2,7 +2,7 @@
2
2
 
3
3
  <div style="text-align:center">
4
4
  <img src='https://storecraft.app/storecraft-color.svg'
5
- width='90%'' />
5
+ width='90%' />
6
6
  </div><hr/><br/>
7
7
 
8
8
  Supports wellknown http-based `serverless` friendly `email` providers,
@@ -23,9 +23,9 @@ npm i @storecraft/mailer-providers-http
23
23
  ### Sendgrid
24
24
 
25
25
  ```js
26
- import { MailerSendGrid } from '@storecraft/mailer-providers-http/sendgrid';
26
+ import { SendGrid } from '@storecraft/mailer-providers-http/sendgrid';
27
27
 
28
- const mailer = new MailerSendGrid(
28
+ const mailer = new SendGrid(
29
29
  {
30
30
  apikey: process.env.SEND_GRID_SECRET
31
31
  }
@@ -44,9 +44,9 @@ let { success, native_response } = await mailer.email({
44
44
 
45
45
  ### Resend
46
46
  ```js
47
- import { MailerResend } from '@storecraft/mailer-providers-http/resend';
47
+ import { Resend } from '@storecraft/mailer-providers-http/resend';
48
48
 
49
- const mailer = new MailerResend(
49
+ const mailer = new Resend(
50
50
  {
51
51
  apikey: process.env.RESEND_API_KEY
52
52
  }
@@ -66,9 +66,9 @@ let { success, native_response } = await mailer.email({
66
66
  ### Mailchimp
67
67
 
68
68
  ```js
69
- import { MailerMailChimp } from '@storecraft/mailer-providers-http/mailchimp';
69
+ import { MailChimp } from '@storecraft/mailer-providers-http/mailchimp';
70
70
 
71
- const mailer = new MailerMailChimp(
71
+ const mailer = new MailChimp(
72
72
  {
73
73
  apikey: process.env.MAILCHIMP_API_KEY
74
74
  }
@@ -88,9 +88,9 @@ let { success, native_response } = await mailer.email({
88
88
  ### Mailgun
89
89
 
90
90
  ```js
91
- import { MailerMailgun } from '@storecraft/mailer-providers-http/mailgun';
91
+ import { Mailgun } from '@storecraft/mailer-providers-http/mailgun';
92
92
 
93
- const mailer = new MailerMailgun(
93
+ const mailer = new Mailgun(
94
94
  {
95
95
  apikey: process.env.MAILGUN_API_KEY
96
96
  }
@@ -4,9 +4,9 @@
4
4
  ## Howto
5
5
 
6
6
  ```js
7
- import { MailerMailChimp } from '@storecraft/mailer-mailchimp-http';
7
+ import { MailChimp } from '@storecraft/mailer-mailchimp-http';
8
8
 
9
- const mailer = new MailerMailChimp(
9
+ const mailer = new MailChimp(
10
10
  {
11
11
  apikey: process.env.MAILCHIMP_API_KEY
12
12
  }
@@ -2,12 +2,12 @@ import { convert_to_base64 } from "./adapter.utils.js";
2
2
 
3
3
  /**
4
4
  * @typedef {import("./types.public.d.ts").Config} Config
5
- * @typedef {import('@storecraft/core/v-mailer').mailer<Config>} mailer
5
+ * @typedef {import('@storecraft/core/mailer').mailer<Config>} mailer
6
6
  * @implements {mailer}
7
7
  *
8
8
  * mailer with mail-chimp / mandrill http api
9
9
  */
10
- export class MailerMailChimp {
10
+ export class MailChimp {
11
11
 
12
12
  /** @type {Config} */ #_config;
13
13
 
@@ -1,7 +1,7 @@
1
- import { base64 } from '@storecraft/core/v-crypto'
1
+ import { base64 } from '@storecraft/core/crypto'
2
2
 
3
3
  /**
4
- * @param {import('@storecraft/core/v-mailer').MailObject["attachments"][0]["content"]} c
4
+ * @param {import('@storecraft/core/mailer').MailObject["attachments"][0]["content"]} c
5
5
  */
6
6
  export const convert_to_base64 = async (c) => {
7
7
  if(c instanceof ArrayBuffer)
@@ -1,9 +1,9 @@
1
1
  import 'dotenv/config';
2
2
  import { test } from 'uvu';
3
3
  import * as assert from 'uvu/assert';
4
- import { MailerMailChimp } from '../index.js';
4
+ import { MailChimp } from '../adapter.js';
5
5
 
6
- const mailer = new MailerMailChimp(
6
+ const mailer = new MailChimp(
7
7
  {
8
8
  apikey: process.env.MAILCHIMP_API_KEY
9
9
  }
@@ -1,4 +1,4 @@
1
- export { MailerMailChimp } from './adapter.js';
1
+ export { MailChimp } from './adapter.js';
2
2
 
3
3
  /**
4
4
  * @description `Mailchimp` config
package/mailgun/README.md CHANGED
@@ -4,9 +4,9 @@
4
4
  ## Howto
5
5
 
6
6
  ```js
7
- import { MailerMailChimp } from '@storecraft/mailer-mailgun-http';
7
+ import { Mailgun } from '@storecraft/mailer-mailgun-http';
8
8
 
9
- const mailer = new MailerMailgun(
9
+ const mailer = new Mailgun(
10
10
  {
11
11
  apikey: process.env.MAILGUN_API_KEY
12
12
  }
@@ -1,14 +1,14 @@
1
- import { base64 } from "@storecraft/core/v-crypto";
1
+ import { base64 } from "@storecraft/core/crypto";
2
2
  import { address_to_friendly_name, convert_attachment_to_blob } from "./adapter.utils.js";
3
3
 
4
4
  /**
5
5
  * @typedef {import("./types.public.d.ts").Config} Config
6
- * @typedef {import('@storecraft/core/v-mailer').mailer<Config>} mailer
6
+ * @typedef {import('@storecraft/core/mailer').mailer<Config>} mailer
7
7
  * @implements {mailer}
8
8
  *
9
- * mailer with mailgun http api
9
+ * @description mailer with mailgun http api
10
10
  */
11
- export class MailerMailgun {
11
+ export class Mailgun {
12
12
 
13
13
  /** @type {Config} */ #_config;
14
14
 
@@ -1,7 +1,7 @@
1
1
 
2
2
  /**
3
3
  *
4
- * @param {import('@storecraft/core/v-mailer').MailObject["attachments"][0]["content"]} c
4
+ * @param {import('@storecraft/core/mailer').MailObject["attachments"][0]["content"]} c
5
5
  */
6
6
  export const convert_attachment_to_blob = async c => {
7
7
  if(c instanceof ArrayBuffer)
@@ -27,7 +27,7 @@ export const convert_attachment_to_blob = async c => {
27
27
 
28
28
  /**
29
29
  *
30
- * @param {import('@storecraft/core/v-mailer').MailAddress} a
30
+ * @param {import('@storecraft/core/mailer').MailAddress} a
31
31
  */
32
32
  export const address_to_friendly_name = a => {
33
33
  return a.name ? `${a.name} <${a.address}>` : a.address;
@@ -1,9 +1,9 @@
1
1
  import 'dotenv/config';
2
2
  import { test } from 'uvu';
3
3
  import * as assert from 'uvu/assert';
4
- import { MailerMailgun } from '../index.js';
4
+ import { Mailgun } from '../adapter.js';
5
5
 
6
- const mailer = new MailerMailgun(
6
+ const mailer = new Mailgun(
7
7
  {
8
8
  apikey: process.env.MAILGUN_API_KEY,
9
9
  domain_name: process.env.YOUR_DOMAIN_NAME
@@ -1,4 +1,4 @@
1
- export { MailerMailgun } from './adapter.js';
1
+ export { Mailgun } from './adapter.js';
2
2
 
3
3
  /**
4
4
  * @description `mailgun` config
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storecraft/mailer-providers-http",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
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)",
@@ -8,7 +8,7 @@
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "https://github.com/store-craft/storecraft.git",
11
- "directory": "packages/mailer-providers-http"
11
+ "directory": "packages/mailers/mailer-providers-http"
12
12
  },
13
13
  "keywords": [
14
14
  "commerce",
package/resend/README.md CHANGED
@@ -4,9 +4,9 @@
4
4
  ## Howto
5
5
 
6
6
  ```js
7
- import { MailerResend } from '@storecraft/mailer-resend-http';
7
+ import { Resend } from '@storecraft/mailer-resend-http';
8
8
 
9
- const mailer = new MailerResend(
9
+ const mailer = new Resend(
10
10
  {
11
11
  apikey: process.env.RESEND_API_KEY
12
12
  }
package/resend/adapter.js CHANGED
@@ -2,12 +2,12 @@ import { address_to_friendly_name, convert_to_base64 } from "./adapter.utils.js"
2
2
 
3
3
  /**
4
4
  * @typedef {import("./types.public.d.ts").Config} Config
5
- * @typedef {import('@storecraft/core/v-mailer').mailer<Config>} mailer
5
+ * @typedef {import('@storecraft/core/mailer').mailer<Config>} mailer
6
6
  * @implements {mailer}
7
7
  *
8
- * mailer with Resend rest api
8
+ * @description mailer with Resend rest api
9
9
  */
10
- export class MailerResend {
10
+ export class Resend {
11
11
 
12
12
  /** @type {Config} */ #_config;
13
13
 
@@ -1,8 +1,8 @@
1
- import { base64 } from '@storecraft/core/v-crypto'
1
+ import { base64 } from '@storecraft/core/crypto'
2
2
 
3
3
  /**
4
4
  *
5
- * @param {import('@storecraft/core/v-mailer').MailObject["attachments"][0]["content"]} c
5
+ * @param {import('@storecraft/core/mailer').MailObject["attachments"][0]["content"]} c
6
6
  */
7
7
  export const convert_to_base64 = async (c) => {
8
8
  if(c instanceof ArrayBuffer)
@@ -28,7 +28,7 @@ export const convert_to_base64 = async (c) => {
28
28
 
29
29
  /**
30
30
  *
31
- * @param {import('@storecraft/core/v-mailer').MailAddress} a
31
+ * @param {import('@storecraft/core/mailer').MailAddress} a
32
32
  */
33
33
  export const address_to_friendly_name = a => {
34
34
  return a.name ? `${a.name} <${a.address}>` : a.address;
@@ -1,9 +1,9 @@
1
1
  import 'dotenv/config';
2
2
  import { test } from 'uvu';
3
3
  import * as assert from 'uvu/assert';
4
- import { MailerResend } from '../index.js';
4
+ import { Resend } from '../adapter.js';
5
5
 
6
- const mailer = new MailerResend(
6
+ const mailer = new Resend(
7
7
  {
8
8
  apikey: process.env.RESEND_API_KEY
9
9
  }
@@ -1,4 +1,4 @@
1
- export { MailerResend } from './adapter.js';
1
+ export { Resend } from './adapter.js';
2
2
 
3
3
  /**
4
4
  * @description `Resend` config
@@ -4,9 +4,9 @@
4
4
  ## Howto
5
5
 
6
6
  ```js
7
- import { MailerSendGrid } from '@storecraft/mailer-sendgrid-http';
7
+ import { SendGrid } from '@storecraft/mailer-sendgrid-http';
8
8
 
9
- const mailer = new MailerSendGrid(
9
+ const mailer = new SendGrid(
10
10
  {
11
11
  apikey: process.env.SEND_GRID_SECRET
12
12
  }
@@ -2,12 +2,12 @@ import { convert_to_base64 } from "./adapter.utils.js";
2
2
 
3
3
  /**
4
4
  * @typedef {import("./types.public.d.ts").Config} Config
5
- * @typedef {import('@storecraft/core/v-mailer').mailer<Config>} mailer
5
+ * @typedef {import('@storecraft/core/mailer').mailer<Config>} mailer
6
6
  * @implements {mailer}
7
7
  *
8
- * mailer with sendgrid http api
8
+ * @description mailer with sendgrid http api
9
9
  */
10
- export class MailerSendGrid {
10
+ export class SendGrid {
11
11
 
12
12
  /** @type {Config} */ #_config;
13
13
 
@@ -1,8 +1,8 @@
1
- import { base64 } from '@storecraft/core/v-crypto'
1
+ import { base64 } from '@storecraft/core/crypto'
2
2
 
3
3
  /**
4
4
  *
5
- * @param {import('@storecraft/core/v-mailer').MailObject["attachments"][0]["content"]} c
5
+ * @param {import('@storecraft/core/mailer').MailObject["attachments"][0]["content"]} c
6
6
  */
7
7
  export const convert_to_base64 = async (c) => {
8
8
  if(c instanceof ArrayBuffer)
@@ -1,9 +1,9 @@
1
1
  import 'dotenv/config';
2
2
  import { test } from 'uvu';
3
3
  import * as assert from 'uvu/assert';
4
- import { MailerSendGrid } from '../index.js';
4
+ import { SendGrid } from '../adapter.js';
5
5
 
6
- const mailer = new MailerSendGrid(
6
+ const mailer = new SendGrid(
7
7
  {
8
8
  apikey: process.env.SEND_GRID_SECRET
9
9
  }
@@ -1,4 +1,4 @@
1
- export { MailerSendGrid } from './adapter.js';
1
+ export { SendGrid } from './adapter.js';
2
2
 
3
3
  /**
4
4
  * @description `sendgrid` config
package/tsconfig.json CHANGED
@@ -3,6 +3,7 @@
3
3
  "compilerOptions": {
4
4
  "noEmit": true,
5
5
  "allowJs": true,
6
+ "maxNodeModuleJsDepth": 10,
6
7
  "checkJs": true,
7
8
  "target": "ESNext",
8
9
  "resolveJsonModule": true,