@stacksjs/email 0.66.0 → 0.68.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.
@@ -0,0 +1,3 @@
1
+ export declare const email: typeof notification.email;
2
+
3
+ export default email;
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export * from "./drivers";
2
- export * from "./email.ts";
3
- export * from "./types";
1
+ export * from './drivers'
2
+ export * from './email.ts'
3
+ export * from './types'
package/dist/index.js CHANGED
@@ -1,5 +1,2 @@
1
1
  // @bun
2
2
  var e={};export{e as ses};
3
-
4
- //# debugId=4B79F4B86ADEBC6B64756E2164756E21
5
- //# sourceMappingURL=index.js.map
@@ -1,6 +1,7 @@
1
- import type { I18n } from "vue-email";
2
- export interface RenderOptions {
3
- props?: Record<string, unknown>;
4
- i18n?: I18n;
1
+ import type { I18n } from 'vue-email';
2
+
3
+ export declare interface RenderOptions {
4
+ props?: Record<string, unknown>
5
+ i18n?: I18n
5
6
  }
6
- export declare function template(path: string, options?: RenderOptions): Promise<string>;
7
+ export declare function template(path: string, options?: RenderOptions): Promise<string>;
package/dist/types.d.ts CHANGED
@@ -1,33 +1,37 @@
1
- export interface Message {
2
- name: string;
3
- subject: string;
4
- to: string;
5
- from?: {
6
- name: string;
7
- address: string;
8
- };
9
- template: string;
10
- handle?: () => Promise<{ message: string }>;
11
- onError?: (error: Error) => Promise<{ message: string }>;
12
- onSuccess?: () => void;
1
+ export declare interface Message {
2
+ name: string
3
+ subject: string
4
+ to: string
5
+ from?: {
6
+ name: string
7
+ address: string
8
+ }
9
+ template: string
10
+ handle?: () => Promise<{ message: string }>
11
+ onError?: (error: Error) => Promise<{ message: string }>
12
+ onSuccess?: () => void
13
13
  }
14
- export interface SendEmailParams {
15
- Source: string;
16
- Destination: { ToAddresses: string[] };
17
- Message: {
18
- Body: { Html: {
19
- Charset: "UTF-8";
20
- Data: string;
21
- } };
22
- Subject: {
23
- Charset: "UTF-8";
24
- Data: string;
25
- };
26
- };
27
- }
28
- export interface EmailParams {
29
- to: string;
30
- from: string;
31
- subject: string;
32
- html: string;
14
+ export declare interface SendEmailParams {
15
+ Source: string
16
+ Destination: {
17
+ ToAddresses: string[]
18
+ }
19
+ Message: {
20
+ Body: {
21
+ Html: {
22
+ Charset: 'UTF-8'
23
+ Data: string
24
+ }
25
+ }
26
+ Subject: {
27
+ Charset: 'UTF-8'
28
+ Data: string
29
+ }
30
+ }
33
31
  }
32
+ export declare interface EmailParams {
33
+ to: string
34
+ from: string
35
+ subject: string
36
+ html: string
37
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/email",
3
3
  "type": "module",
4
- "version": "0.66.0",
4
+ "version": "0.68.0",
5
5
  "description": "The Stacks Email integration. Painlessly create & manage your inboxes, templates, and send emails.",
6
6
  "author": "Chris Breuer",
7
7
  "contributors": ["Chris Breuer <chris@stacksjs.org>"],
@@ -19,17 +19,15 @@
19
19
  "keywords": ["email", "ses", "aws", "stacks", "emailjs", "mailgun"],
20
20
  "exports": {
21
21
  ".": {
22
- "bun": "./src/index.ts",
23
22
  "import": "./dist/index.js"
24
23
  },
25
24
  "./*": {
26
- "bun": "./src/*",
27
25
  "import": "./dist/*"
28
26
  }
29
27
  },
30
28
  "module": "dist/index.js",
31
29
  "types": "dist/index.d.ts",
32
- "files": ["README.md", "dist", "src"],
30
+ "files": ["README.md", "dist"],
33
31
  "scripts": {
34
32
  "build": "bun build.ts",
35
33
  "build:inbound": "bun build-inbound.ts",
@@ -37,14 +35,14 @@
37
35
  "prepublishOnly": "bun run build"
38
36
  },
39
37
  "dependencies": {
40
- "@stacksjs/cli": "0.65.1",
41
- "@stacksjs/config": "0.65.1",
42
- "@stacksjs/error-handling": "0.65.1",
43
- "@stacksjs/types": "0.65.1",
38
+ "@stacksjs/cli": "0.67.0",
39
+ "@stacksjs/config": "0.67.0",
40
+ "@stacksjs/error-handling": "0.67.0",
41
+ "@stacksjs/types": "0.67.0",
44
42
  "aws-sdk": "^2.1691.0",
45
43
  "vue-email": "^0.8.11"
46
44
  },
47
45
  "devDependencies": {
48
- "@stacksjs/development": "0.65.1"
46
+ "@stacksjs/development": "0.67.0"
49
47
  }
50
48
  }
@@ -1 +0,0 @@
1
- export * as ses from "./ses";
File without changes
File without changes
File without changes
package/dist/email.d.ts DELETED
File without changes
package/dist/index.js.map DELETED
@@ -1,9 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": [],
4
- "sourcesContent": [
5
- ],
6
- "mappings": "",
7
- "debugId": "4B79F4B86ADEBC6B64756E2164756E21",
8
- "names": []
9
- }
package/dist/send.d.ts DELETED
File without changes
File without changes
File without changes
File without changes
@@ -1,3 +0,0 @@
1
- import { notification } from "@stacksjs/config";
2
- export declare const email: typeof notification.email;
3
- export default email;
@@ -1,3 +0,0 @@
1
- // export * as mailgun from './mailgun'
2
- // export * as nodemailer from './nodemailer'
3
- export * as ses from './ses'
@@ -1,21 +0,0 @@
1
- // import { MailgunEmailProvider } from '@novu/mailgun'
2
- // import type { EmailOptions } from '@stacksjs/types'
3
- // import type { ResultAsync } from '@stacksjs/error-handling'
4
- // import { notification } from '@stacksjs/config'
5
- // import { send as sendEmail } from '../send'
6
- //
7
- // const env = notification.email
8
- // const service = notification.email?.drivers.mailgun
9
- //
10
- // const provider = new MailgunEmailProvider({
11
- // apiKey: service?.key || '',
12
- // domain: service?.domain || '',
13
- // username: service?.username || '',
14
- // from: env?.from.address || '',
15
- // })
16
- //
17
- // async function send(options: EmailOptions, css?: string): Promise<ResultAsync<any, Error>> {
18
- // return sendEmail(options, provider, 'Mailgun', css)
19
- // }
20
- //
21
- // export { send as Send, send }
@@ -1,23 +0,0 @@
1
- // import { NodemailerProvider } from '@novu/nodemailer'
2
- // import type { EmailOptions } from '@stacksjs/types'
3
- // import type { ResultAsync } from '@stacksjs/error-handling'
4
- // import { notification } from '@stacksjs/config'
5
- // import { send as sendEmail } from '../send'
6
- //
7
- // const env = notification.email
8
- // const service = notification.email?.drivers.nodemailer
9
- //
10
- // const provider = new NodemailerProvider({
11
- // from: env?.from.address || '',
12
- // host: service?.host || '',
13
- // user: service?.user,
14
- // password: service?.password,
15
- // port: service?.port || 587,
16
- // secure: service?.secure,
17
- // })
18
- //
19
- // async function send(options: EmailOptions, css?: string): Promise<ResultAsync<any, Error>> {
20
- // return sendEmail(options, provider, 'Nodemailer', css)
21
- // }
22
- //
23
- // export { send as Send, send }
@@ -1,23 +0,0 @@
1
- // import { SESEmailProvider } from '@novu/ses'
2
- // import type { EmailOptions } from '@stacksjs/types'
3
- // import { notification } from '@stacksjs/config'
4
- // import type { ResultAsync } from '@stacksjs/error-handling'
5
- // import { send as sendEmail } from '../send'
6
-
7
- // const email = notification.email
8
- // const env = email?.drivers?.ses
9
-
10
- // // const provider = new SESEmailProvider({
11
- // const provider = new SESEmailProvider({
12
- // region: env?.region || 'us-east-1',
13
- // accessKeyId: env?.key || '',
14
- // secretAccessKey: env?.secret || '',
15
- // senderName: email?.from.name || 'Stacks',
16
- // from: email?.from.address || '',
17
- // })
18
-
19
- // async function send(options: EmailOptions, css?: string): Promise<ResultAsync<any, Error>> {
20
- // return sendEmail(options, provider, 'Ses', css)
21
- // }
22
-
23
- // export { send as Send, send }
package/src/email.ts DELETED
@@ -1,80 +0,0 @@
1
- // import { SES } from '@aws-sdk/client-ses'
2
- // import { log } from '@stacksjs/logging'
3
- // import type { RenderOptions } from './template'
4
- // import { template } from './template'
5
- // import type { Message, SendEmailParams } from './types'
6
-
7
- // export class Email {
8
- // private client: SES
9
-
10
- // constructor(private message: Message) {
11
- // this.client = new SES({ region: 'us-east-1' })
12
- // this.message = message
13
- // }
14
-
15
- // public async send(options?: RenderOptions): Promise<{ message: string }> {
16
- // log.info('Sending email...')
17
- // const path = this.message.template
18
-
19
- // try {
20
- // const templ = await template(path, options)
21
-
22
- // const params: SendEmailParams = {
23
- // Source: this.message.from?.address || '',
24
-
25
- // Destination: {
26
- // ToAddresses: [this.message.to],
27
- // },
28
-
29
- // Message: {
30
- // Body: {
31
- // Html: {
32
- // Charset: 'UTF-8',
33
- // Data: templ.html,
34
- // },
35
- // },
36
-
37
- // Subject: {
38
- // Charset: 'UTF-8',
39
- // Data: this.message.subject,
40
- // },
41
- // },
42
- // }
43
-
44
- // await this.client.sendEmail(params)
45
-
46
- // let returnMsg: { message: string } = { message: 'Email sent' }
47
-
48
- // if (this.message.handle) returnMsg = await this.message.handle()
49
-
50
- // await this.onSuccess()
51
-
52
- // return returnMsg
53
- // } catch (error) {
54
- // return this.onError(error as Error)
55
- // }
56
- // }
57
-
58
- // public async onError(error: Error) {
59
- // log.error(error)
60
-
61
- // if (!this.message.onError) return
62
-
63
- // return await this.message.onError(error)
64
- // }
65
-
66
- // // public onSuccess() {
67
- // // try {
68
- // // if (!this.message.onSuccess) return
69
-
70
- // // this.message.onSuccess()
71
- // // } catch (error) {
72
- // // return this.onError(error as Error)
73
- // // }
74
- // // }
75
- // }
76
-
77
- // export type { Message }
78
-
79
- // // export const email = (options: Message) => new Email(options)
80
- // export default Email
package/src/index.ts DELETED
@@ -1,3 +0,0 @@
1
- export * from './drivers'
2
- export * from './email.ts'
3
- export * from './types'
package/src/send.ts DELETED
@@ -1,38 +0,0 @@
1
- // import { italic } from '@stacksjs/cli'
2
- // import { ResultAsync } from '@stacksjs/error-handling'
3
- // import type { EmailOptions } from '@stacksjs/types'
4
-
5
- // // import { stringify } from 'json5'
6
-
7
- // export async function send(
8
- // options: EmailOptions,
9
- // provider: any,
10
- // providerName: string,
11
- // ): Promise<ResultAsync<any, Error>> {
12
- // // const template = `
13
- // // <extends src="./src/notifications/src/utils/template.html">
14
- // // <block name="template">
15
- // // ${options.html}
16
- // // </block>
17
- // // </extends>`
18
-
19
- // // await Maizzle.render(
20
- // // template,
21
- // // {
22
- // // tailwind: {
23
- // // // config: stringify(config),
24
- // // css,
25
- // // maizzle: maizzleConfig,
26
- // // },
27
- // // },
28
- // // )
29
- // // .then(({ html }: any) => {
30
- // // options.html = html
31
- // // })
32
- // // .catch((error: any) => log.error(`Failed to render email template using provider: ${italic(providerName)}.`, error))
33
-
34
- // return ResultAsync.fromPromise(
35
- // provider.sendMessage(options),
36
- // () => new Error(`Failed to send message using provider: ${italic(providerName)}`),
37
- // )
38
- // }