@visulima/email 1.0.0-alpha.16 → 1.0.0-alpha.18

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.
Files changed (138) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/LICENSE.md +303 -483
  3. package/dist/crypto/index.d.ts +147 -4
  4. package/dist/index.d.ts +785 -9
  5. package/dist/packem_shared/provider.d-DcfYeGJJ.d.ts +28 -0
  6. package/dist/packem_shared/types.d-CNnnk-Ya.d.ts +102 -0
  7. package/dist/packem_shared/types.d-nyR1ty1Q.d.ts +9 -0
  8. package/dist/packem_shared/types.d-wwpgA3to.d.ts +204 -0
  9. package/dist/providers/ahasend/index.d.ts +36 -3
  10. package/dist/providers/aws-ses/index.d.ts +47 -3
  11. package/dist/providers/azure/index.d.ts +52 -3
  12. package/dist/providers/brevo/index.d.ts +65 -3
  13. package/dist/providers/failover/index.d.ts +27 -3
  14. package/dist/providers/http/index.d.ts +35 -3
  15. package/dist/providers/infobip/index.d.ts +56 -3
  16. package/dist/providers/mailcrab/index.d.ts +32 -3
  17. package/dist/providers/mailersend/index.d.ts +51 -3
  18. package/dist/providers/mailgun/index.d.ts +73 -3
  19. package/dist/providers/mailjet/index.d.ts +72 -3
  20. package/dist/providers/mailomat/index.d.ts +40 -3
  21. package/dist/providers/mailpace/index.d.ts +52 -3
  22. package/dist/providers/mailtrap/index.d.ts +44 -3
  23. package/dist/providers/mandrill/index.d.ts +87 -3
  24. package/dist/providers/mock/index.d.ts +59 -3
  25. package/dist/providers/nodemailer/index.d.ts +38 -3
  26. package/dist/providers/opentelemetry/index.d.ts +529 -3
  27. package/dist/providers/plunk/index.d.ts +38 -3
  28. package/dist/providers/postal/index.d.ts +48 -3
  29. package/dist/providers/postmark/index.d.ts +60 -3
  30. package/dist/providers/resend/index.d.ts +51 -3
  31. package/dist/providers/roundrobin/index.d.ts +27 -3
  32. package/dist/providers/scaleway/index.d.ts +44 -3
  33. package/dist/providers/sendgrid/index.d.ts +84 -3
  34. package/dist/providers/smtp/index.d.ts +71 -3
  35. package/dist/providers/sweego/index.d.ts +40 -3
  36. package/dist/providers/zeptomail/index.d.ts +37 -3
  37. package/dist/template-engines/handlebars.d.ts +23 -22
  38. package/dist/template-engines/html-to-text.d.ts +24 -24
  39. package/dist/template-engines/mjml.d.ts +10 -10
  40. package/dist/template-engines/react-email.d.ts +9 -9
  41. package/dist/template-engines/vue-email.d.ts +9 -9
  42. package/dist/utils/cache.d.ts +49 -48
  43. package/dist/utils/format-email-address.d.ts +8 -7
  44. package/dist/utils/normalize-email-aliases.d.ts +20 -20
  45. package/dist/utils/parse-address.d.ts +18 -17
  46. package/dist/utils/validation/check-mx-records.d.ts +36 -35
  47. package/dist/utils/validation/disposable-email-domains.d.ts +1 -13
  48. package/dist/utils/validation/role-accounts.d.ts +18 -18
  49. package/dist/utils/validation/validate-email.d.ts +5 -5
  50. package/dist/utils/validation/verify-email.d.ts +45 -42
  51. package/dist/utils/validation/verify-smtp.d.ts +35 -34
  52. package/package.json +37 -37
  53. package/dist/attachment-helpers.d.ts +0 -64
  54. package/dist/crypto/dkim-signer.d.ts +0 -48
  55. package/dist/crypto/smime-encrypter.d.ts +0 -53
  56. package/dist/crypto/smime-signer.d.ts +0 -48
  57. package/dist/crypto/types.d.ts +0 -101
  58. package/dist/draft-mail-message.d.ts +0 -13
  59. package/dist/errors/email-error.d.ts +0 -17
  60. package/dist/errors/required-option-error.d.ts +0 -10
  61. package/dist/mail-message.d.ts +0 -425
  62. package/dist/mail.d.ts +0 -206
  63. package/dist/providers/ahasend/provider.d.ts +0 -7
  64. package/dist/providers/ahasend/types.d.ts +0 -28
  65. package/dist/providers/aws-ses/provider.d.ts +0 -8
  66. package/dist/providers/aws-ses/types.d.ts +0 -38
  67. package/dist/providers/azure/provider.d.ts +0 -7
  68. package/dist/providers/azure/types.d.ts +0 -44
  69. package/dist/providers/brevo/provider.d.ts +0 -7
  70. package/dist/providers/brevo/types.d.ts +0 -57
  71. package/dist/providers/failover/provider.d.ts +0 -7
  72. package/dist/providers/failover/types.d.ts +0 -19
  73. package/dist/providers/http/provider.d.ts +0 -7
  74. package/dist/providers/http/types.d.ts +0 -27
  75. package/dist/providers/infobip/provider.d.ts +0 -7
  76. package/dist/providers/infobip/types.d.ts +0 -48
  77. package/dist/providers/mailcrab/provider.d.ts +0 -9
  78. package/dist/providers/mailcrab/types.d.ts +0 -22
  79. package/dist/providers/mailersend/provider.d.ts +0 -7
  80. package/dist/providers/mailersend/types.d.ts +0 -43
  81. package/dist/providers/mailgun/provider.d.ts +0 -7
  82. package/dist/providers/mailgun/types.d.ts +0 -65
  83. package/dist/providers/mailjet/provider.d.ts +0 -7
  84. package/dist/providers/mailjet/types.d.ts +0 -64
  85. package/dist/providers/mailomat/provider.d.ts +0 -7
  86. package/dist/providers/mailomat/types.d.ts +0 -32
  87. package/dist/providers/mailpace/provider.d.ts +0 -7
  88. package/dist/providers/mailpace/types.d.ts +0 -44
  89. package/dist/providers/mailtrap/provider.d.ts +0 -7
  90. package/dist/providers/mailtrap/types.d.ts +0 -36
  91. package/dist/providers/mandrill/provider.d.ts +0 -7
  92. package/dist/providers/mandrill/types.d.ts +0 -79
  93. package/dist/providers/mock/provider.d.ts +0 -8
  94. package/dist/providers/mock/types.d.ts +0 -50
  95. package/dist/providers/nodemailer/provider.d.ts +0 -7
  96. package/dist/providers/nodemailer/types.d.ts +0 -30
  97. package/dist/providers/opentelemetry/provider.d.ts +0 -7
  98. package/dist/providers/opentelemetry/types.d.ts +0 -31
  99. package/dist/providers/plunk/provider.d.ts +0 -7
  100. package/dist/providers/plunk/types.d.ts +0 -30
  101. package/dist/providers/postal/provider.d.ts +0 -7
  102. package/dist/providers/postal/types.d.ts +0 -40
  103. package/dist/providers/postmark/provider.d.ts +0 -7
  104. package/dist/providers/postmark/types.d.ts +0 -52
  105. package/dist/providers/provider.d.ts +0 -27
  106. package/dist/providers/resend/provider.d.ts +0 -7
  107. package/dist/providers/resend/types.d.ts +0 -43
  108. package/dist/providers/roundrobin/provider.d.ts +0 -7
  109. package/dist/providers/roundrobin/types.d.ts +0 -19
  110. package/dist/providers/scaleway/provider.d.ts +0 -7
  111. package/dist/providers/scaleway/types.d.ts +0 -36
  112. package/dist/providers/sendgrid/provider.d.ts +0 -7
  113. package/dist/providers/sendgrid/types.d.ts +0 -76
  114. package/dist/providers/smtp/provider.d.ts +0 -7
  115. package/dist/providers/smtp/types.d.ts +0 -63
  116. package/dist/providers/sweego/provider.d.ts +0 -7
  117. package/dist/providers/sweego/types.d.ts +0 -32
  118. package/dist/providers/utils/address-formatter.d.ts +0 -139
  119. package/dist/providers/utils/attachment-processor.d.ts +0 -58
  120. package/dist/providers/utils/index.d.ts +0 -4
  121. package/dist/providers/utils/payload-builder.d.ts +0 -78
  122. package/dist/providers/utils/provider-base.d.ts +0 -69
  123. package/dist/providers/zeptomail/provider.d.ts +0 -7
  124. package/dist/providers/zeptomail/types.d.ts +0 -29
  125. package/dist/template-engines/types.d.ts +0 -8
  126. package/dist/types.d.ts +0 -203
  127. package/dist/utils/build-mime-message.d.ts +0 -8
  128. package/dist/utils/create-logger.d.ts +0 -16
  129. package/dist/utils/format-email-addresses.d.ts +0 -8
  130. package/dist/utils/generate-boundary.d.ts +0 -7
  131. package/dist/utils/generate-message-id.d.ts +0 -6
  132. package/dist/utils/headers-to-record.d.ts +0 -9
  133. package/dist/utils/is-port-available.d.ts +0 -9
  134. package/dist/utils/make-request.d.ts +0 -18
  135. package/dist/utils/retry.d.ts +0 -10
  136. package/dist/utils/sanitize-header.d.ts +0 -14
  137. package/dist/utils/to-base64.d.ts +0 -8
  138. package/dist/utils/validation/validate-email-options.d.ts +0 -8
@@ -0,0 +1,28 @@
1
+ import { E as EmailOptions, F as FeatureFlags, R as Result, M as MaybePromise, a as EmailResult } from "./types.d-wwpgA3to.js";
2
+ /**
3
+ * Standard provider interface for email services.
4
+ */
5
+ interface Provider<OptionsT = unknown, InstanceT = unknown, EmailOptionsT extends EmailOptions = EmailOptions> {
6
+ endpoint?: string;
7
+ features?: FeatureFlags;
8
+ getEmail?: (id: string) => MaybePromise<Result>;
9
+ getInstance?: () => InstanceT;
10
+ initialize: (options?: Record<string, unknown>) => MaybePromise<void>;
11
+ isAvailable: () => MaybePromise<boolean>;
12
+ name?: string;
13
+ options?: OptionsT;
14
+ sendEmail: (options: EmailOptionsT) => MaybePromise<Result<EmailResult>>;
15
+ shutdown?: () => MaybePromise<void>;
16
+ validateCredentials?: () => MaybePromise<boolean>;
17
+ }
18
+ /**
19
+ * Type for provider factory function.
20
+ */
21
+ type ProviderFactory<OptionsT = unknown, InstanceT = unknown, EmailOptionsT extends EmailOptions = EmailOptions> = (options?: OptionsT) => Provider<OptionsT, InstanceT, EmailOptionsT>;
22
+ /**
23
+ * Helper function to define an email provider.
24
+ * @param factory The provider factory function.
25
+ * @returns The same factory function (for type inference).
26
+ */
27
+ declare const defineProvider: <OptionsT = unknown, InstanceT = unknown, EmailOptionsT extends EmailOptions = EmailOptions>(factory: ProviderFactory<OptionsT, InstanceT, EmailOptionsT>) => ProviderFactory<OptionsT, InstanceT, EmailOptionsT>;
28
+ export { ProviderFactory as P, Provider as a, defineProvider as d };
@@ -0,0 +1,102 @@
1
+ import { E as EmailOptions } from "./types.d-wwpgA3to.js";
2
+ /**
3
+ * Options for DKIM signing
4
+ */
5
+ interface DkimOptions {
6
+ /**
7
+ * Body canonicalization algorithm ('simple' or 'relaxed')
8
+ * Default: 'simple'
9
+ */
10
+ bodyCanon?: "relaxed" | "simple";
11
+ /**
12
+ * Domain name used for DKIM signing
13
+ */
14
+ domainName: string;
15
+ /**
16
+ * Header canonicalization algorithm ('simple' or 'relaxed')
17
+ * Default: 'simple'
18
+ */
19
+ headerCanon?: "relaxed" | "simple";
20
+ /**
21
+ * List of header names to ignore when signing
22
+ */
23
+ headersToIgnore?: string[];
24
+ /**
25
+ * Key selector used for DNS lookup
26
+ */
27
+ keySelector: string;
28
+ /**
29
+ * Passphrase for the private key (if encrypted)
30
+ */
31
+ passphrase?: string;
32
+ /**
33
+ * Private key for signing (PEM format)
34
+ * Can be a string with the key content or a path prefixed with 'file://'
35
+ */
36
+ privateKey: string;
37
+ }
38
+ /**
39
+ * Options for S/MIME signing
40
+ */
41
+ interface SmimeSignOptions {
42
+ /**
43
+ * Path to the certificate file (PEM format)
44
+ */
45
+ certificate: string;
46
+ /**
47
+ * Path to intermediate certificates (optional)
48
+ */
49
+ intermediateCerts?: string[];
50
+ /**
51
+ * Signing options flags
52
+ * Reserved for future use
53
+ */
54
+ options?: number;
55
+ /**
56
+ * Passphrase for the private key (if encrypted)
57
+ */
58
+ passphrase?: string;
59
+ /**
60
+ * Path to the private key file (PEM format)
61
+ */
62
+ privateKey: string;
63
+ }
64
+ /**
65
+ * Options for S/MIME encryption
66
+ */
67
+ interface SmimeEncryptOptions {
68
+ /**
69
+ * Encryption algorithm (cipher)
70
+ * Supported: 'aes-256-cbc', 'aes-192-cbc', 'aes-128-cbc'
71
+ * Default: 'aes-256-cbc'
72
+ */
73
+ algorithm?: string;
74
+ /**
75
+ * Certificate(s) for encryption
76
+ * Can be a single certificate path or a map of email -> certificate path
77
+ */
78
+ certificates: string | Record<string, string>;
79
+ }
80
+ /**
81
+ * Interface for email signers
82
+ */
83
+ interface EmailSigner {
84
+ /**
85
+ * Sign an email message
86
+ * @param email The email options to sign
87
+ * @returns The signed email options (may include additional headers or modified content)
88
+ */
89
+ sign: (email: EmailOptions) => Promise<EmailOptions>;
90
+ }
91
+ /**
92
+ * Interface for email encrypters
93
+ */
94
+ interface EmailEncrypter {
95
+ /**
96
+ * Encrypt an email message
97
+ * @param email The email options to encrypt
98
+ * @returns The encrypted email options (content will be encrypted)
99
+ */
100
+ encrypt: (email: EmailOptions) => Promise<EmailOptions>;
101
+ }
102
+ export { DkimOptions as D, EmailSigner as E, SmimeEncryptOptions as S, EmailEncrypter as a, SmimeSignOptions as b };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Template render function type.
3
+ * @param template Template content (string, React component, etc.).
4
+ * @param data Data/variables to pass to the template.
5
+ * @param options Options specific to the template engine.
6
+ * @returns Rendered HTML string.
7
+ */
8
+ type TemplateRenderer = (template: unknown, data?: Record<string, unknown>, options?: Record<string, unknown>) => string | Promise<string>;
9
+ export { TemplateRenderer as T };
@@ -0,0 +1,204 @@
1
+ import { Buffer } from 'node:buffer';
2
+ /**
3
+ * Utility type for values that can be promises
4
+ */
5
+ type MaybePromise<T> = T | Promise<T>;
6
+ /**
7
+ * Feature flags indicating what capabilities a provider supports
8
+ */
9
+ interface FeatureFlags {
10
+ attachments?: boolean;
11
+ batchSending?: boolean;
12
+ customHeaders?: boolean;
13
+ html?: boolean;
14
+ replyTo?: boolean;
15
+ scheduling?: boolean;
16
+ tagging?: boolean;
17
+ templates?: boolean;
18
+ tracking?: boolean;
19
+ }
20
+ /**
21
+ * Base configuration for all providers
22
+ */
23
+ interface BaseConfig {
24
+ debug?: boolean;
25
+ logger?: Console;
26
+ retries?: number;
27
+ timeout?: number;
28
+ }
29
+ /**
30
+ * Email address with optional name
31
+ */
32
+ interface EmailAddress {
33
+ email: string;
34
+ name?: string;
35
+ }
36
+ /**
37
+ * Email attachment
38
+ */
39
+ interface Attachment {
40
+ /**
41
+ * Content-ID for inline attachments (used in HTML with cid:)
42
+ */
43
+ cid?: string;
44
+ /**
45
+ * Attachment content (string, Buffer, or Promise&lt;Uint8Array> for async loading)
46
+ * Required if path, href, or raw are not provided
47
+ */
48
+ content?: string | Buffer | Promise<Uint8Array>;
49
+ /**
50
+ * Content disposition: 'attachment' (default) or 'inline'
51
+ */
52
+ contentDisposition?: "attachment" | "inline";
53
+ /**
54
+ * MIME type of the attachment
55
+ */
56
+ contentType?: string;
57
+ /**
58
+ * Content transfer encoding (e.g., 'base64', '7bit', 'quoted-printable')
59
+ */
60
+ encoding?: string;
61
+ /**
62
+ * Filename for the attachment
63
+ */
64
+ filename: string;
65
+ /**
66
+ * Custom headers for this attachment
67
+ */
68
+ headers?: Record<string, string>;
69
+ /**
70
+ * URL to fetch attachment from
71
+ * Alternative to content or path
72
+ */
73
+ href?: string;
74
+ /**
75
+ * HTTP headers to use when fetching from href
76
+ */
77
+ httpHeaders?: Record<string, string>;
78
+ /**
79
+ * File path to read attachment from
80
+ * Alternative to content
81
+ */
82
+ path?: string;
83
+ /**
84
+ * Raw attachment data (alternative to content)
85
+ * Can be used for pre-encoded content
86
+ */
87
+ raw?: string | Buffer;
88
+ }
89
+ /**
90
+ * Email tag for categorization
91
+ */
92
+ interface EmailTag {
93
+ name: string;
94
+ value: string;
95
+ }
96
+ /**
97
+ * Priority levels for email messages
98
+ */
99
+ type Priority = "high" | "normal" | "low";
100
+ /**
101
+ * Represents the headers of an email message.
102
+ * This type is a supertype of the standard `Headers` class, which is used to manage HTTP headers.
103
+ * Note that this type does not include methods for modifying the headers,
104
+ * such as `append`, `delete`, or `set`. It is intended to be used for
105
+ * read-only access to the headers of an email message.
106
+ */
107
+ type ImmutableHeaders = Omit<Headers, "append" | "delete" | "set">;
108
+ /**
109
+ * Email headers can be either a plain object or an ImmutableHeaders instance
110
+ */
111
+ type EmailHeaders = Record<string, string> | ImmutableHeaders;
112
+ /**
113
+ * Options for calendar event attachments
114
+ */
115
+ interface CalendarEventOptions {
116
+ /**
117
+ * Alternative text for the calendar event
118
+ */
119
+ alternativeText?: string;
120
+ /**
121
+ * Method for the calendar event (e.g., 'REQUEST', 'CANCEL', 'REPLY')
122
+ */
123
+ method?: string;
124
+ }
125
+ /**
126
+ * Common email options that all providers support
127
+ */
128
+ interface EmailOptions {
129
+ attachments?: Attachment[];
130
+ bcc?: EmailAddress | EmailAddress[];
131
+ cc?: EmailAddress | EmailAddress[];
132
+ from: EmailAddress;
133
+ headers?: EmailHeaders;
134
+ html?: string;
135
+ icalEvent?: CalendarEventOptions & {
136
+ content?: string;
137
+ href?: string;
138
+ path?: string;
139
+ };
140
+ priority?: Priority;
141
+ replyTo?: EmailAddress;
142
+ subject: string;
143
+ tags?: string[];
144
+ text?: string;
145
+ to: EmailAddress | EmailAddress[];
146
+ }
147
+ /**
148
+ * Result of sending an email
149
+ */
150
+ interface EmailResult {
151
+ messageId: string;
152
+ provider?: string;
153
+ response?: unknown;
154
+ sent: boolean;
155
+ timestamp: Date;
156
+ }
157
+ /**
158
+ * Receipt type for email sending results
159
+ * Uses discriminated union for type safety
160
+ */
161
+ type Receipt = {
162
+ /**
163
+ * The unique identifier for the message that was sent
164
+ */
165
+ readonly messageId: string;
166
+ /**
167
+ * Optional provider name
168
+ */
169
+ readonly provider?: string;
170
+ /**
171
+ * Optional response data from provider
172
+ */
173
+ readonly response?: unknown;
174
+ /**
175
+ * Indicates that the email was sent successfully
176
+ */
177
+ readonly successful: true;
178
+ /**
179
+ * Timestamp when email was sent
180
+ */
181
+ readonly timestamp: Date;
182
+ } | {
183
+ /**
184
+ * An array of error messages that occurred during the sending process
185
+ */
186
+ readonly errorMessages: ReadonlyArray<string>;
187
+ /**
188
+ * Optional provider name
189
+ */
190
+ readonly provider?: string;
191
+ /**
192
+ * Indicates that the email failed to send
193
+ */
194
+ readonly successful: false;
195
+ };
196
+ /**
197
+ * Generic result type
198
+ */
199
+ interface Result<T = unknown> {
200
+ data?: T;
201
+ error?: Error | unknown;
202
+ success: boolean;
203
+ }
204
+ export { Attachment as A, BaseConfig as B, CalendarEventOptions as C, EmailOptions as E, FeatureFlags as F, ImmutableHeaders as I, MaybePromise as M, Priority as P, Result as R, EmailResult as a, EmailAddress as b, EmailTag as c, Receipt as d, EmailHeaders as e };
@@ -1,3 +1,36 @@
1
- export type { Provider, ProviderFactory } from "../provider.d.ts";
2
- export { default as ahaSendProvider } from "./providers/ahasend/provider.d.ts";
3
- export type { AhaSendConfig, AhaSendEmailOptions } from "./types.d.ts";
1
+ import { P as ProviderFactory } from "../../packem_shared/provider.d-DcfYeGJJ.js";
2
+ export { type a as Provider } from "../../packem_shared/provider.d-DcfYeGJJ.js";
3
+ import { B as BaseConfig, E as EmailOptions } from "../../packem_shared/types.d-wwpgA3to.js";
4
+ import 'node:buffer';
5
+ /**
6
+ * AhaSend configuration
7
+ */
8
+ interface AhaSendConfig extends BaseConfig {
9
+ /**
10
+ * AhaSend API key
11
+ */
12
+ apiKey: string;
13
+ /**
14
+ * AhaSend API endpoint
15
+ * Defaults to: https://api.ahasend.com
16
+ */
17
+ endpoint?: string;
18
+ }
19
+ /**
20
+ * AhaSend-specific email options
21
+ */
22
+ interface AhaSendEmailOptions extends EmailOptions {
23
+ /**
24
+ * AhaSend template ID for template-based emails
25
+ */
26
+ templateId?: string;
27
+ /**
28
+ * Template variables for AhaSend templates
29
+ */
30
+ templateVariables?: Record<string, unknown>;
31
+ }
32
+ /**
33
+ * AhaSend Provider for sending emails through AhaSend API
34
+ */
35
+ declare const ahaSendProvider: ProviderFactory<AhaSendConfig>;
36
+ export { type AhaSendConfig, type AhaSendEmailOptions, type ProviderFactory, ahaSendProvider };
@@ -1,3 +1,47 @@
1
- export type { Provider, ProviderFactory } from "../provider.d.ts";
2
- export { default as awsSesProvider } from "./providers/aws-ses/provider.d.ts";
3
- export type { AwsSesConfig, AwsSesEmailOptions } from "./types.d.ts";
1
+ import { P as ProviderFactory } from "../../packem_shared/provider.d-DcfYeGJJ.js";
2
+ export { type a as Provider } from "../../packem_shared/provider.d-DcfYeGJJ.js";
3
+ import { B as BaseConfig, E as EmailOptions } from "../../packem_shared/types.d-wwpgA3to.js";
4
+ import 'node:buffer';
5
+ /**
6
+ * AWS SES configuration
7
+ */
8
+ interface AwsSesConfig extends BaseConfig {
9
+ accessKeyId: string;
10
+ apiVersion?: string;
11
+ endpoint?: string;
12
+ maxAttempts?: number;
13
+ region: string;
14
+ secretAccessKey: string;
15
+ sessionToken?: string;
16
+ }
17
+ /**
18
+ * AWS SES-specific email options
19
+ */
20
+ interface AwsSesEmailOptions extends EmailOptions {
21
+ /**
22
+ * Configuration set name
23
+ */
24
+ configurationSetName?: string;
25
+ /**
26
+ * Message tags as key-value pairs
27
+ */
28
+ messageTags?: Record<string, string>;
29
+ /**
30
+ * Return path email address
31
+ */
32
+ returnPath?: string;
33
+ /**
34
+ * Return path ARN
35
+ */
36
+ returnPathArn?: string;
37
+ /**
38
+ * Source ARN for sending authorization
39
+ */
40
+ sourceArn?: string;
41
+ }
42
+ /**
43
+ * AWS SES Email Provider Implementation - Zero dependency version
44
+ * Uses native Node.js APIs instead of AWS SDK
45
+ */
46
+ declare const awsSesProvider: ProviderFactory<AwsSesConfig>;
47
+ export { type AwsSesConfig, type AwsSesEmailOptions, type ProviderFactory, awsSesProvider };
@@ -1,3 +1,52 @@
1
- export type { Provider, ProviderFactory } from "../provider.d.ts";
2
- export { default as azureProvider } from "./providers/azure/provider.d.ts";
3
- export type { AzureConfig, AzureEmailOptions } from "./types.d.ts";
1
+ import { P as ProviderFactory } from "../../packem_shared/provider.d-DcfYeGJJ.js";
2
+ export { type a as Provider } from "../../packem_shared/provider.d-DcfYeGJJ.js";
3
+ import { B as BaseConfig, E as EmailOptions } from "../../packem_shared/types.d-wwpgA3to.js";
4
+ import 'node:buffer';
5
+ /**
6
+ * Azure Communication Services configuration
7
+ */
8
+ interface AzureConfig extends BaseConfig {
9
+ /**
10
+ * Azure AD access token (for OAuth2 authentication)
11
+ */
12
+ accessToken?: string;
13
+ /**
14
+ * Azure Communication Services connection string or access token
15
+ */
16
+ connectionString?: string;
17
+ /**
18
+ * Azure Communication Services endpoint
19
+ * Defaults to: https://{region}.communication.azure.com
20
+ */
21
+ endpoint?: string;
22
+ /**
23
+ * Azure region (e.g., "eastus", "westus")
24
+ */
25
+ region: string;
26
+ }
27
+ /**
28
+ * Azure-specific email options
29
+ */
30
+ interface AzureEmailOptions extends EmailOptions {
31
+ /**
32
+ * Custom headers
33
+ */
34
+ headers?: Record<string, string>;
35
+ /**
36
+ * Importance level (normal, high)
37
+ */
38
+ importance?: "normal" | "high";
39
+ /**
40
+ * Azure template ID for template-based emails
41
+ */
42
+ templateId?: string;
43
+ /**
44
+ * Template variables for Azure templates
45
+ */
46
+ templateVariables?: Record<string, unknown>;
47
+ }
48
+ /**
49
+ * Azure Communication Services Provider for sending emails through Azure API
50
+ */
51
+ declare const azureProvider: ProviderFactory<AzureConfig, unknown, AzureEmailOptions>;
52
+ export { type AzureConfig, type AzureEmailOptions, type ProviderFactory, azureProvider };
@@ -1,3 +1,65 @@
1
- export type { Provider, ProviderFactory } from "../provider.d.ts";
2
- export { default as brevoProvider } from "./providers/brevo/provider.d.ts";
3
- export type { BrevoConfig, BrevoEmailOptions } from "./types.d.ts";
1
+ import { P as ProviderFactory } from "../../packem_shared/provider.d-DcfYeGJJ.js";
2
+ export { type a as Provider } from "../../packem_shared/provider.d-DcfYeGJJ.js";
3
+ import { B as BaseConfig, E as EmailOptions, b as EmailAddress } from "../../packem_shared/types.d-wwpgA3to.js";
4
+ import 'node:buffer';
5
+ /**
6
+ * Brevo configuration
7
+ */
8
+ interface BrevoConfig extends BaseConfig {
9
+ /**
10
+ * Brevo API key
11
+ */
12
+ apiKey: string;
13
+ /**
14
+ * Brevo API endpoint
15
+ * Defaults to: https://api.brevo.com/v3
16
+ */
17
+ endpoint?: string;
18
+ /**
19
+ * Enable hard validation for replyTo addresses.
20
+ * If true, arrays will be rejected. If false, the first address from an array will be used.
21
+ * Defaults to: false
22
+ */
23
+ hardValidation?: boolean;
24
+ }
25
+ /**
26
+ * Brevo-specific email options
27
+ */
28
+ interface BrevoEmailOptions extends Omit<EmailOptions, "replyTo"> {
29
+ /**
30
+ * Batch ID for batch sending
31
+ */
32
+ batchId?: string;
33
+ /**
34
+ * Headers (custom headers)
35
+ */
36
+ headers?: Record<string, string>;
37
+ /**
38
+ * Reply-to email address (can override base replyTo).
39
+ * Only one address is allowed. If an array is provided and hardValidation is false, the first address will be used.
40
+ */
41
+ replyTo?: EmailAddress | EmailAddress[];
42
+ /**
43
+ * Scheduled date/time
44
+ * - If string: ISO 8601 format (e.g., "2025-01-15T10:00:00Z")
45
+ * - If number: Unix timestamp in seconds (not milliseconds)
46
+ */
47
+ scheduledAt?: string | number;
48
+ /**
49
+ * Tags for categorization
50
+ */
51
+ tags?: string[];
52
+ /**
53
+ * Brevo template ID for template-based emails
54
+ */
55
+ templateId?: number;
56
+ /**
57
+ * Template parameters for Brevo templates
58
+ */
59
+ templateParams?: Record<string, unknown>;
60
+ }
61
+ /**
62
+ * Brevo Provider for sending emails through Brevo API
63
+ */
64
+ declare const brevoProvider: ProviderFactory<BrevoConfig, unknown, BrevoEmailOptions>;
65
+ export { type BrevoConfig, type BrevoEmailOptions, type ProviderFactory, brevoProvider };
@@ -1,3 +1,27 @@
1
- export type { Provider, ProviderFactory } from "../provider.d.ts";
2
- export { default as failoverProvider } from "./providers/failover/provider.d.ts";
3
- export type { FailoverConfig, FailoverEmailOptions } from "./types.d.ts";
1
+ import { P as ProviderFactory } from "../../packem_shared/provider.d-DcfYeGJJ.js";
2
+ export { type a as Provider } from "../../packem_shared/provider.d-DcfYeGJJ.js";
3
+ import { B as BaseConfig, E as EmailOptions } from "../../packem_shared/types.d-wwpgA3to.js";
4
+ import 'node:buffer';
5
+ /**
6
+ * Failover configuration
7
+ */
8
+ interface FailoverConfig extends BaseConfig {
9
+ /**
10
+ * Array of provider instances or provider factories to use in failover order
11
+ * Can be Provider instances or ProviderFactory functions
12
+ */
13
+ mailers: unknown[];
14
+ /**
15
+ * Time in milliseconds to wait before trying the next provider (default: 60)
16
+ */
17
+ retryAfter?: number;
18
+ }
19
+ /**
20
+ * Failover-specific email options
21
+ */
22
+ type FailoverEmailOptions = EmailOptions;
23
+ /**
24
+ * Failover Provider for sending emails with automatic failover to backup providers.
25
+ */
26
+ declare const provider: ProviderFactory<FailoverConfig>;
27
+ export { type FailoverConfig, type FailoverEmailOptions, type ProviderFactory, provider as failoverProvider };
@@ -1,3 +1,35 @@
1
- export type { Provider, ProviderFactory } from "../provider.d.ts";
2
- export { default as httpProvider } from "./providers/http/provider.d.ts";
3
- export type { HttpEmailConfig, HttpEmailOptions } from "./types.d.ts";
1
+ import { P as ProviderFactory } from "../../packem_shared/provider.d-DcfYeGJJ.js";
2
+ export { type a as Provider } from "../../packem_shared/provider.d-DcfYeGJJ.js";
3
+ import { E as EmailOptions } from "../../packem_shared/types.d-wwpgA3to.js";
4
+ import 'node:buffer';
5
+ /**
6
+ * HTTP email configuration
7
+ */
8
+ interface HttpEmailConfig {
9
+ apiKey?: string;
10
+ endpoint: string;
11
+ headers?: Record<string, string>;
12
+ method?: "GET" | "POST" | "PUT";
13
+ }
14
+ /**
15
+ * HTTP-specific email options
16
+ */
17
+ interface HttpEmailOptions extends EmailOptions {
18
+ /**
19
+ * Custom parameters to include in the request payload
20
+ */
21
+ customParams?: Record<string, unknown>;
22
+ /**
23
+ * Override the endpoint for this specific email
24
+ */
25
+ endpointOverride?: string;
26
+ /**
27
+ * Override the HTTP method for this specific email
28
+ */
29
+ methodOverride?: "GET" | "POST" | "PUT";
30
+ }
31
+ /**
32
+ * HTTP Email Provider for sending emails via HTTP API.
33
+ */
34
+ declare const httpProvider: ProviderFactory<HttpEmailConfig>;
35
+ export { type HttpEmailConfig, type HttpEmailOptions, type ProviderFactory, httpProvider };
@@ -1,3 +1,56 @@
1
- export type { Provider, ProviderFactory } from "../provider.d.ts";
2
- export { default as infobipProvider } from "./providers/infobip/provider.d.ts";
3
- export type { InfobipConfig, InfobipEmailOptions } from "./types.d.ts";
1
+ import { P as ProviderFactory } from "../../packem_shared/provider.d-DcfYeGJJ.js";
2
+ export { type a as Provider } from "../../packem_shared/provider.d-DcfYeGJJ.js";
3
+ import { B as BaseConfig, E as EmailOptions } from "../../packem_shared/types.d-wwpgA3to.js";
4
+ import 'node:buffer';
5
+ /**
6
+ * Infobip configuration
7
+ */
8
+ interface InfobipConfig extends BaseConfig {
9
+ /**
10
+ * Infobip API key
11
+ */
12
+ apiKey: string;
13
+ /**
14
+ * Infobip base URL (e.g., "https://api.infobip.com")
15
+ */
16
+ baseUrl?: string;
17
+ /**
18
+ * Infobip API endpoint
19
+ * Defaults to: https://{baseUrl}/email/3/send
20
+ */
21
+ endpoint?: string;
22
+ }
23
+ /**
24
+ * Infobip-specific email options
25
+ */
26
+ interface InfobipEmailOptions extends EmailOptions {
27
+ /**
28
+ * Intermediate report (for delivery status updates)
29
+ */
30
+ intermediateReport?: boolean;
31
+ /**
32
+ * Notify URL (for delivery notifications)
33
+ */
34
+ notifyUrl?: string;
35
+ /**
36
+ * Send at (Unix timestamp in milliseconds)
37
+ */
38
+ sendAt?: number;
39
+ /**
40
+ * Infobip template ID for template-based emails
41
+ */
42
+ templateId?: number;
43
+ /**
44
+ * Template variables for Infobip templates
45
+ */
46
+ templateVariables?: Record<string, unknown>;
47
+ /**
48
+ * Tracking URL (for click tracking)
49
+ */
50
+ trackingUrl?: string;
51
+ }
52
+ /**
53
+ * Infobip Provider for sending emails through Infobip API
54
+ */
55
+ declare const infobipProvider: ProviderFactory<InfobipConfig>;
56
+ export { type InfobipConfig, type InfobipEmailOptions, type ProviderFactory, infobipProvider };