@boostkit/mail 0.0.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 BoostKit
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,54 @@
1
+ # @boostkit/mail
2
+
3
+ Mail facade, mailable abstraction, and provider factory with log and SMTP driver support.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pnpm add @boostkit/mail
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```ts
14
+ // bootstrap/providers.ts
15
+ import { mail } from '@boostkit/mail'
16
+ import configs from '../config/index.js'
17
+
18
+ export default [
19
+ mail(configs.mail),
20
+ ]
21
+
22
+ import { Mail, Mailable } from '@boostkit/mail'
23
+ class WelcomeMail extends Mailable {
24
+ build() { return this.subject('Welcome').text('Hello') }
25
+ }
26
+ await Mail.to('user@example.com').send(new WelcomeMail())
27
+ ```
28
+
29
+ ## API Reference
30
+
31
+ - `MailMessage`
32
+ - `Mailable`
33
+ - `SendOptions`
34
+ - `MailAdapter`, `MailAdapterProvider`
35
+ - `MailRegistry`
36
+ - `MailPendingSend`
37
+ - `Mail`
38
+ - `MailConnectionConfig`, `MailConfig`
39
+ - `mail(config)`
40
+
41
+ ## Configuration
42
+
43
+ - `MailConfig`
44
+ - `default`
45
+ - `from`
46
+ - `mailers`
47
+ - `MailConnectionConfig`
48
+ - `driver`
49
+ - additional driver-specific keys
50
+
51
+ ## Notes
52
+
53
+ - Built-in driver: `log`.
54
+ - Plugin driver supported by factory: `smtp` (via `@boostkit/mail-nodemailer`).
@@ -0,0 +1,90 @@
1
+ import { ServiceProvider, type Application } from '@boostkit/core';
2
+ export interface MailMessage {
3
+ subject: string;
4
+ html?: string;
5
+ text?: string;
6
+ }
7
+ export declare abstract class Mailable {
8
+ private _subject;
9
+ private _html?;
10
+ private _text?;
11
+ /** Set the email subject */
12
+ protected subject(subject: string): this;
13
+ /** Set the HTML body */
14
+ protected html(html: string): this;
15
+ /** Set the plain-text body */
16
+ protected text(text: string): this;
17
+ /** Build the mailable — called before sending. Override to set subject/html/text. */
18
+ abstract build(): this | Promise<this>;
19
+ /** Called by the adapter — builds then returns the compiled message */
20
+ compile(): Promise<MailMessage>;
21
+ }
22
+ export interface SendOptions {
23
+ to: string[];
24
+ from: {
25
+ address: string;
26
+ name?: string;
27
+ };
28
+ cc?: string[];
29
+ bcc?: string[];
30
+ }
31
+ export interface MailAdapter {
32
+ send(mailable: Mailable, options: SendOptions): Promise<void>;
33
+ }
34
+ export interface MailAdapterProvider {
35
+ create(): MailAdapter;
36
+ }
37
+ export declare class MailRegistry {
38
+ private static adapter;
39
+ private static _from;
40
+ static set(adapter: MailAdapter): void;
41
+ static get(): MailAdapter | null;
42
+ static setFrom(from: {
43
+ address: string;
44
+ name?: string;
45
+ }): void;
46
+ static getFrom(): {
47
+ address: string;
48
+ name?: string;
49
+ };
50
+ }
51
+ export declare class MailPendingSend {
52
+ private readonly _to;
53
+ private _cc;
54
+ private _bcc;
55
+ constructor(_to: string[]);
56
+ cc(...addresses: string[]): this;
57
+ bcc(...addresses: string[]): this;
58
+ send(mailable: Mailable): Promise<void>;
59
+ }
60
+ export declare class Mail {
61
+ static to(...addresses: string[]): MailPendingSend;
62
+ }
63
+ export interface MailConnectionConfig {
64
+ driver: string;
65
+ [key: string]: unknown;
66
+ }
67
+ export interface MailConfig {
68
+ /** The default mailer connection name */
69
+ default: string;
70
+ /** From address used on all outgoing mail */
71
+ from: {
72
+ address: string;
73
+ name?: string;
74
+ };
75
+ /** Named mailer connections */
76
+ mailers: Record<string, MailConnectionConfig>;
77
+ }
78
+ /**
79
+ * Returns a MailServiceProvider class configured for the given mail config.
80
+ *
81
+ * Built-in drivers: log (prints to console — great for dev)
82
+ * Plugin drivers: smtp (@boostkit/mail-nodemailer), resend, mailgun …
83
+ *
84
+ * Usage in bootstrap/providers.ts:
85
+ * import { mail } from '@boostkit/mail'
86
+ * import configs from '../config/index.js'
87
+ * export default [..., mail(configs.mail), ...]
88
+ */
89
+ export declare function mail(config: MailConfig): new (app: Application) => ServiceProvider;
90
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAKlE,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAI,MAAM,CAAA;IACf,IAAI,CAAC,EAAI,MAAM,CAAA;CAChB;AAID,8BAAsB,QAAQ;IAC5B,OAAO,CAAC,QAAQ,CAAK;IACrB,OAAO,CAAC,KAAK,CAAC,CAAQ;IACtB,OAAO,CAAC,KAAK,CAAC,CAAQ;IAEtB,4BAA4B;IAC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;CACrD;AAID,qBAAa,eAAe;IAId,OAAO,CAAC,QAAQ,CAAC,GAAG;IAHhC,OAAO,CAAC,GAAG,CAAgB;IAC3B,OAAO,CAAC,IAAI,CAAe;gBAEE,GAAG,EAAE,MAAM,EAAE;IAE1C,EAAE,CAAC,GAAG,SAAS,EAAE,MAAM,EAAE,GAAI,IAAI;IACjC,GAAG,CAAC,GAAG,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI;IAE3B,IAAI,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;CAM9C;AAID,qBAAa,IAAI;IACf,MAAM,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,MAAM,EAAE,GAAG,eAAe;CAGnD;AAID,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAA;IACd,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB;AAED,MAAM,WAAW,UAAU;IACzB,yCAAyC;IACzC,OAAO,EAAE,MAAM,CAAA;IACf,6CAA6C;IAC7C,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IACxC,+BAA+B;IAC/B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAA;CAC9C;AAsBD;;;;;;;;;;GAUG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE,UAAU,GAAG,KAAK,GAAG,EAAE,WAAW,KAAK,eAAe,CAgClF"}
package/dist/index.js ADDED
@@ -0,0 +1,116 @@
1
+ import { ServiceProvider } from '@boostkit/core';
2
+ import { resolveOptionalPeer } from '@boostkit/core';
3
+ // ─── Mailable ──────────────────────────────────────────────
4
+ export class Mailable {
5
+ _subject = '';
6
+ _html;
7
+ _text;
8
+ /** Set the email subject */
9
+ subject(subject) { this._subject = subject; return this; }
10
+ /** Set the HTML body */
11
+ html(html) { this._html = html; return this; }
12
+ /** Set the plain-text body */
13
+ text(text) { this._text = text; return this; }
14
+ /** Called by the adapter — builds then returns the compiled message */
15
+ async compile() {
16
+ await this.build();
17
+ const msg = { subject: this._subject };
18
+ if (this._html !== undefined)
19
+ msg.html = this._html;
20
+ if (this._text !== undefined)
21
+ msg.text = this._text;
22
+ return msg;
23
+ }
24
+ }
25
+ // ─── Mail Registry ─────────────────────────────────────────
26
+ export class MailRegistry {
27
+ static adapter = null;
28
+ static _from = { address: 'noreply@example.com' };
29
+ static set(adapter) { this.adapter = adapter; }
30
+ static get() { return this.adapter; }
31
+ static setFrom(from) { this._from = { ...from }; }
32
+ static getFrom() { return { ...this._from }; }
33
+ }
34
+ // ─── Pending Send (fluent builder) ─────────────────────────
35
+ export class MailPendingSend {
36
+ _to;
37
+ _cc = [];
38
+ _bcc = [];
39
+ constructor(_to) {
40
+ this._to = _to;
41
+ }
42
+ cc(...addresses) { this._cc = addresses; return this; }
43
+ bcc(...addresses) { this._bcc = addresses; return this; }
44
+ async send(mailable) {
45
+ const adapter = MailRegistry.get();
46
+ if (!adapter)
47
+ throw new Error('[BoostKit Mail] No mail adapter registered. Add mail() to providers.');
48
+ const from = MailRegistry.getFrom();
49
+ await adapter.send(mailable, { to: this._to, from, cc: this._cc, bcc: this._bcc });
50
+ }
51
+ }
52
+ // ─── Mail Facade ───────────────────────────────────────────
53
+ export class Mail {
54
+ static to(...addresses) {
55
+ return new MailPendingSend(addresses);
56
+ }
57
+ }
58
+ // ─── Built-in Log Adapter ──────────────────────────────────
59
+ class LogAdapter {
60
+ from;
61
+ constructor(from) {
62
+ this.from = from;
63
+ }
64
+ async send(mailable, options) {
65
+ const msg = await mailable.compile();
66
+ const line = '─'.repeat(50);
67
+ console.log(`\n[BoostKit Mail] ${line}`);
68
+ console.log(`[BoostKit Mail] To: ${options.to.join(', ')}`);
69
+ console.log(`[BoostKit Mail] From: ${options.from.name ? `${options.from.name} <${options.from.address}>` : options.from.address}`);
70
+ console.log(`[BoostKit Mail] Subject: ${msg.subject}`);
71
+ if (msg.html)
72
+ console.log(`[BoostKit Mail] HTML: ${msg.html.replace(/<[^>]+>/g, '').trim().slice(0, 120)}`);
73
+ if (msg.text)
74
+ console.log(`[BoostKit Mail] Text: ${msg.text.trim().slice(0, 120)}`);
75
+ console.log(`[BoostKit Mail] ${line}\n`);
76
+ }
77
+ }
78
+ // ─── Service Provider Factory ──────────────────────────────
79
+ /**
80
+ * Returns a MailServiceProvider class configured for the given mail config.
81
+ *
82
+ * Built-in drivers: log (prints to console — great for dev)
83
+ * Plugin drivers: smtp (@boostkit/mail-nodemailer), resend, mailgun …
84
+ *
85
+ * Usage in bootstrap/providers.ts:
86
+ * import { mail } from '@boostkit/mail'
87
+ * import configs from '../config/index.js'
88
+ * export default [..., mail(configs.mail), ...]
89
+ */
90
+ export function mail(config) {
91
+ class MailServiceProvider extends ServiceProvider {
92
+ register() { }
93
+ async boot() {
94
+ const mailerName = config.default;
95
+ const mailerConfig = config.mailers[mailerName] ?? { driver: 'log' };
96
+ const driver = mailerConfig['driver'];
97
+ MailRegistry.setFrom(config.from);
98
+ let adapter;
99
+ if (driver === 'log') {
100
+ adapter = new LogAdapter(config.from);
101
+ }
102
+ else if (driver === 'smtp') {
103
+ const { nodemailer } = await resolveOptionalPeer('@boostkit/mail-nodemailer');
104
+ adapter = nodemailer(mailerConfig, config.from).create();
105
+ }
106
+ else {
107
+ throw new Error(`[BoostKit Mail] Unknown driver "${driver}". Available: log, smtp`);
108
+ }
109
+ MailRegistry.set(adapter);
110
+ this.app.instance('mail', adapter);
111
+ console.log(`[MailServiceProvider] booted — driver: ${driver}`);
112
+ }
113
+ }
114
+ return MailServiceProvider;
115
+ }
116
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAoB,MAAM,gBAAgB,CAAA;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAUp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C,IAAI;YACR,MAAM,UAAU,GAAK,MAAM,CAAC,OAAO,CAAA;YACnC,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAA;YACpE,MAAM,MAAM,GAAS,YAAY,CAAC,QAAQ,CAAW,CAAA;YAErD,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;YAEjC,IAAI,OAAoB,CAAA;YAExB,IAAI,MAAM,KAAK,KAAK,EAAE,CAAC;gBACrB,OAAO,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;YACvC,CAAC;iBAAM,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;gBAC7B,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,mBAAmB,CAAM,2BAA2B,CAAC,CAAA;gBAClF,OAAO,GAAI,UAAiE,CAC1E,YAAY,EAAE,MAAM,CAAC,IAAI,CAC1B,CAAC,MAAM,EAAE,CAAA;YACZ,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,KAAK,CAAC,mCAAmC,MAAM,yBAAyB,CAAC,CAAA;YACrF,CAAC;YAED,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;YACzB,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;YAElC,OAAO,CAAC,GAAG,CAAC,0CAA0C,MAAM,EAAE,CAAC,CAAA;QACjE,CAAC;KACF;IAED,OAAO,mBAAmB,CAAA;AAC5B,CAAC"}
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "@boostkit/mail",
3
+ "version": "0.0.1",
4
+ "license": "MIT",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/boostkitjs/boostkit",
8
+ "directory": "packages/mail"
9
+ },
10
+ "type": "module",
11
+ "files": [
12
+ "dist"
13
+ ],
14
+ "main": "./dist/index.js",
15
+ "types": "./dist/index.d.ts",
16
+ "exports": {
17
+ ".": {
18
+ "import": "./dist/index.js",
19
+ "types": "./dist/index.d.ts"
20
+ }
21
+ },
22
+ "dependencies": {
23
+ "@boostkit/core": "0.0.1"
24
+ },
25
+ "devDependencies": {
26
+ "@types/node": "^20.0.0",
27
+ "typescript": "^5.4.0",
28
+ "tsx": "^4.0.0"
29
+ },
30
+ "scripts": {
31
+ "build": "tsc",
32
+ "dev": "tsc --watch",
33
+ "typecheck": "tsc --noEmit",
34
+ "clean": "rm -rf dist",
35
+ "test": "tsc -p tsconfig.test.json && node --test dist-test/index.test.js; rm -rf dist-test"
36
+ }
37
+ }