@stacksjs/email 0.75.519 → 0.75.522
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/drivers/log.d.ts +0 -1
- package/dist/drivers/mailgun.d.ts +8 -0
- package/dist/drivers/mailtrap.d.ts +5 -0
- package/dist/drivers/sendgrid.d.ts +6 -0
- package/dist/drivers/ses.d.ts +5 -0
- package/dist/drivers/smtp.d.ts +3 -0
- package/dist/email.d.ts +6 -0
- package/dist/inbound-parser.d.ts +0 -2
- package/dist/mailable.d.ts +1 -0
- package/dist/sdk/index.d.ts +15 -3
- package/package.json +13 -13
package/dist/drivers/log.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { BaseEmailDriver } from './base';
|
|
2
2
|
import type { EmailMessage, EmailResult } from '@stacksjs/types';
|
|
3
3
|
import type { TemplateOptions } from '../template';
|
|
4
|
-
declare const captured: CapturedEmail[];
|
|
5
4
|
/**
|
|
6
5
|
* Local-only email driver that never opens a network socket. Renders
|
|
7
6
|
* the message to disk so devs can inspect it (and tests can read it),
|
|
@@ -3,6 +3,14 @@ import type { EmailMessage, EmailResult } from '@stacksjs/types';
|
|
|
3
3
|
import type { TemplateOptions } from '../template';
|
|
4
4
|
export declare class MailgunDriver extends BaseEmailDriver {
|
|
5
5
|
name: string;
|
|
6
|
+
private apiKey;
|
|
7
|
+
private domain;
|
|
8
|
+
private endpoint;
|
|
9
|
+
private getConfig;
|
|
6
10
|
send(message: EmailMessage, options?: TemplateOptions): Promise<EmailResult>;
|
|
11
|
+
private formatMailgunAddress;
|
|
12
|
+
private formatMailgunAddresses;
|
|
13
|
+
private arrayBufferToBase64;
|
|
14
|
+
private sendWithRetry;
|
|
7
15
|
}
|
|
8
16
|
export default MailgunDriver;
|
|
@@ -23,6 +23,11 @@ export declare const MAILTRAP_SENDING_URL: 'https://send.api.mailtrap.io/api/sen
|
|
|
23
23
|
export declare const MAILTRAP_SANDBOX_URL: 'https://sandbox.api.mailtrap.io/api/send';
|
|
24
24
|
export declare class MailtrapDriver extends BaseEmailDriver {
|
|
25
25
|
name: string;
|
|
26
|
+
private getConfig;
|
|
26
27
|
send(message: EmailMessage, options?: TemplateOptions): Promise<EmailResult>;
|
|
28
|
+
private formatMailtrapAddresses;
|
|
29
|
+
private firstMailtrapAddress;
|
|
30
|
+
private arrayBufferToBase64;
|
|
31
|
+
private sendWithRetry;
|
|
27
32
|
}
|
|
28
33
|
export default MailtrapDriver;
|
|
@@ -3,6 +3,12 @@ import type { EmailMessage, EmailResult } from '@stacksjs/types';
|
|
|
3
3
|
import type { TemplateOptions } from '../template';
|
|
4
4
|
export declare class SendGridDriver extends BaseEmailDriver {
|
|
5
5
|
name: string;
|
|
6
|
+
private apiKey;
|
|
7
|
+
private getApiKey;
|
|
6
8
|
send(message: EmailMessage, options?: TemplateOptions): Promise<EmailResult>;
|
|
9
|
+
private formatSendGridAddresses;
|
|
10
|
+
private firstSendGridAddress;
|
|
11
|
+
private arrayBufferToBase64;
|
|
12
|
+
private sendWithRetry;
|
|
7
13
|
}
|
|
8
14
|
export default SendGridDriver;
|
package/dist/drivers/ses.d.ts
CHANGED
|
@@ -3,6 +3,11 @@ import type { EmailMessage, EmailResult } from '@stacksjs/types';
|
|
|
3
3
|
import type { TemplateOptions } from '../template';
|
|
4
4
|
export declare class SESDriver extends BaseEmailDriver {
|
|
5
5
|
name: string;
|
|
6
|
+
private client;
|
|
7
|
+
private clientPromise;
|
|
8
|
+
private getClient;
|
|
6
9
|
send(message: EmailMessage, options?: TemplateOptions): Promise<EmailResult>;
|
|
10
|
+
private formatSourceAddress;
|
|
11
|
+
private enrichSesError;
|
|
7
12
|
}
|
|
8
13
|
export default SESDriver;
|
package/dist/drivers/smtp.d.ts
CHANGED
|
@@ -7,8 +7,11 @@ import type { TemplateOptions } from '../template';
|
|
|
7
7
|
* Supports STARTTLS (port 587) and direct TLS (port 465)
|
|
8
8
|
*/
|
|
9
9
|
export declare class SMTPDriver extends BaseEmailDriver {
|
|
10
|
+
private static SMTP_TIMEOUT;
|
|
10
11
|
name: string;
|
|
12
|
+
private getConfig;
|
|
11
13
|
send(message: EmailMessage, options?: TemplateOptions): Promise<EmailResult>;
|
|
14
|
+
private sendViaSMTP;
|
|
12
15
|
protected formatAddresses(addresses: string | string[] | EmailAddress[] | undefined): string[];
|
|
13
16
|
}
|
|
14
17
|
export default SMTPDriver;
|
package/dist/email.d.ts
CHANGED
|
@@ -31,10 +31,14 @@ export declare class Email {
|
|
|
31
31
|
onError?: (error: Error) => Promise<EmailHandlerResult>;
|
|
32
32
|
onSuccess?: () => void;
|
|
33
33
|
constructor(options: Message);
|
|
34
|
+
private renderTemplate;
|
|
34
35
|
send(to?: string | string[]): Promise<EmailHandlerResult>;
|
|
35
36
|
}
|
|
36
37
|
export declare class Mail {
|
|
38
|
+
private drivers;
|
|
39
|
+
private defaultDriver;
|
|
37
40
|
constructor(options?: MailConfig);
|
|
41
|
+
private registerDefaultDrivers;
|
|
38
42
|
send(message: EmailMessage): Promise<EmailResult>;
|
|
39
43
|
sendOrFail(message: EmailMessage): Promise<EmailSent>;
|
|
40
44
|
use(driver: string): Mail;
|
|
@@ -43,4 +47,6 @@ export declare class Mail {
|
|
|
43
47
|
queue(message: EmailMessage): Promise<void>;
|
|
44
48
|
later(delaySeconds: number, message: EmailMessage): Promise<void>;
|
|
45
49
|
queueOn(queueName: string, message: EmailMessage): Promise<void>;
|
|
50
|
+
private dispatchOrFallback;
|
|
46
51
|
}
|
|
52
|
+
export {};
|
package/dist/inbound-parser.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { inboundMailboxRecipient } from './inbox-mailbox';
|
|
2
|
-
import type { Address, Mailbox } from '@stacksjs/mail/mime';
|
|
3
|
-
declare function mailbox(address: Address | undefined): Mailbox | undefined;
|
|
4
2
|
export declare function inboundAttachmentName(filename: string | null | undefined, index: number): string;
|
|
5
3
|
export declare function inboundAttachmentStorageName(filename: string, index: number): string;
|
|
6
4
|
export declare function inboundMessageStorageId(messageId: string): string;
|
package/dist/mailable.d.ts
CHANGED
package/dist/sdk/index.d.ts
CHANGED
|
@@ -2,10 +2,10 @@ import { type InboxAttachment } from './inbox-attachments';
|
|
|
2
2
|
// Export singleton instance
|
|
3
3
|
export declare const emailSDK: EmailSDK;
|
|
4
4
|
// Export convenience functions
|
|
5
|
-
export declare const sendEmail: (message: EmailMessage) =>
|
|
5
|
+
export declare const sendEmail: (message: EmailMessage) => unknown;
|
|
6
6
|
export declare const getInbox: (mailbox: string, options?: { limit?: number; offset?: number }) => unknown;
|
|
7
|
-
export declare const getInboxStats: (mailbox: string) =>
|
|
8
|
-
export declare const getUnreadCount: (mailbox: string) =>
|
|
7
|
+
export declare const getInboxStats: (mailbox: string) => unknown;
|
|
8
|
+
export declare const getUnreadCount: (mailbox: string) => unknown;
|
|
9
9
|
export declare const searchEmails: (mailbox: string, options: EmailSearchOptions) => unknown;
|
|
10
10
|
export declare const deleteEmail: (mailbox: string, messageId: string) => unknown;
|
|
11
11
|
export declare interface EmailAddress {
|
|
@@ -73,6 +73,10 @@ export type EmailStorageClient = Pick<import('@stacksjs/ts-cloud').S3Client,
|
|
|
73
73
|
* Email SDK class for Stacks applications
|
|
74
74
|
*/
|
|
75
75
|
export declare class EmailSDK {
|
|
76
|
+
private bucket;
|
|
77
|
+
private region;
|
|
78
|
+
private domain;
|
|
79
|
+
private storageFactory;
|
|
76
80
|
constructor(options?: EmailSDKOptions);
|
|
77
81
|
send(message: EmailMessage): Promise<SendResult>;
|
|
78
82
|
sendTemplate(options: {
|
|
@@ -100,8 +104,16 @@ export declare class EmailSDK {
|
|
|
100
104
|
} | null>;
|
|
101
105
|
search(mailbox: string, options: EmailSearchOptions): Promise<InboxEmail[]>;
|
|
102
106
|
delete(mailbox: string, messageId: string): Promise<boolean>;
|
|
107
|
+
private listAttachments;
|
|
108
|
+
private listStoredAttachments;
|
|
109
|
+
private listStoredObjectKeys;
|
|
103
110
|
markAsRead(mailbox: string, messageId: string): Promise<boolean>;
|
|
104
111
|
markAsUnread(mailbox: string, messageId: string): Promise<boolean>;
|
|
112
|
+
private updateEmailStatus;
|
|
113
|
+
private storage;
|
|
114
|
+
private normalizeAddress;
|
|
115
|
+
private normalizeAddresses;
|
|
116
|
+
private renderTemplate;
|
|
105
117
|
}
|
|
106
118
|
export * from './inbox-attachments';
|
|
107
119
|
export default EmailSDK;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@stacksjs/email",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "0.75.
|
|
5
|
+
"version": "0.75.522",
|
|
6
6
|
"description": "The Stacks Email integration. Painlessly create & manage your inboxes, templates, and send emails.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"contributors": [
|
|
@@ -61,26 +61,26 @@
|
|
|
61
61
|
"prepublishOnly": "bun run build"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@stacksjs/config": "0.75.
|
|
65
|
-
"@stacksjs/database": "0.75.
|
|
66
|
-
"@stacksjs/events": "0.75.
|
|
67
|
-
"@stacksjs/logging": "0.75.
|
|
64
|
+
"@stacksjs/config": "0.75.522",
|
|
65
|
+
"@stacksjs/database": "0.75.522",
|
|
66
|
+
"@stacksjs/events": "0.75.522",
|
|
67
|
+
"@stacksjs/logging": "0.75.522",
|
|
68
68
|
"@stacksjs/mail": "^0.3.11",
|
|
69
|
-
"@stacksjs/path": "0.75.
|
|
70
|
-
"@stacksjs/storage": "0.75.
|
|
71
|
-
"@stacksjs/strings": "0.75.
|
|
69
|
+
"@stacksjs/path": "0.75.522",
|
|
70
|
+
"@stacksjs/storage": "0.75.522",
|
|
71
|
+
"@stacksjs/strings": "0.75.522",
|
|
72
72
|
"@stacksjs/stx": "0.2.807",
|
|
73
73
|
"@stacksjs/ts-cloud": "^0.16.109",
|
|
74
|
-
"@stacksjs/utils": "0.75.
|
|
74
|
+
"@stacksjs/utils": "0.75.522"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
|
-
"@stacksjs/cli": "0.75.
|
|
78
|
-
"@stacksjs/error-handling": "0.75.
|
|
79
|
-
"@stacksjs/types": "0.75.
|
|
77
|
+
"@stacksjs/cli": "0.75.522",
|
|
78
|
+
"@stacksjs/error-handling": "0.75.522",
|
|
79
|
+
"@stacksjs/types": "0.75.522",
|
|
80
80
|
"better-dx": "^0.2.24"
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {
|
|
83
|
-
"@stacksjs/queue": "0.75.
|
|
83
|
+
"@stacksjs/queue": "0.75.522"
|
|
84
84
|
},
|
|
85
85
|
"peerDependenciesMeta": {
|
|
86
86
|
"@stacksjs/queue": {
|