@igniter-js/mail 0.1.11 → 0.1.13
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/AGENTS.md +418 -302
- package/dist/adapters/index.d.mts +1 -229
- package/dist/adapters/index.d.ts +1 -229
- package/dist/index-CbiH0sth.d.mts +286 -0
- package/dist/index-CbiH0sth.d.ts +286 -0
- package/dist/index.d.mts +5 -12
- package/dist/index.d.ts +5 -12
- package/dist/index.js +36 -22
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +32 -23
- package/dist/index.mjs.map +1 -1
- package/dist/telemetry/index.d.mts +74 -8
- package/dist/telemetry/index.d.ts +74 -8
- package/dist/telemetry/index.js.map +1 -1
- package/dist/telemetry/index.mjs.map +1 -1
- package/package.json +4 -4
- package/dist/adapter-BhnIsrlh.d.mts +0 -60
- package/dist/adapter-BhnIsrlh.d.ts +0 -60
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@igniter-js/mail",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"description": "Type-safe email library for Igniter.js with React Email templates and multiple provider adapters",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -15,19 +15,19 @@
|
|
|
15
15
|
".": {
|
|
16
16
|
"types": "./dist/index.d.ts",
|
|
17
17
|
"browser": "./dist/shim.js",
|
|
18
|
-
"import": "./dist/index.
|
|
18
|
+
"import": "./dist/index.mjs",
|
|
19
19
|
"require": "./dist/index.js"
|
|
20
20
|
},
|
|
21
21
|
"./telemetry": {
|
|
22
22
|
"types": "./dist/telemetry/index.d.ts",
|
|
23
23
|
"browser": "./dist/shim.js",
|
|
24
|
-
"import": "./dist/telemetry/index.
|
|
24
|
+
"import": "./dist/telemetry/index.mjs",
|
|
25
25
|
"require": "./dist/telemetry/index.js"
|
|
26
26
|
},
|
|
27
27
|
"./adapters": {
|
|
28
28
|
"types": "./dist/adapters/index.d.ts",
|
|
29
29
|
"browser": "./dist/shim.js",
|
|
30
|
-
"import": "./dist/adapters/index.
|
|
30
|
+
"import": "./dist/adapters/index.mjs",
|
|
31
31
|
"require": "./dist/adapters/index.js"
|
|
32
32
|
}
|
|
33
33
|
},
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Parameters used by a mail adapter to send an email.
|
|
3
|
-
*
|
|
4
|
-
* @example
|
|
5
|
-
* ```ts
|
|
6
|
-
* await adapter.send({
|
|
7
|
-
* to: 'user@example.com',
|
|
8
|
-
* subject: 'Welcome',
|
|
9
|
-
* html: '<p>Hello</p>',
|
|
10
|
-
* text: 'Hello',
|
|
11
|
-
* })
|
|
12
|
-
* ```
|
|
13
|
-
*/
|
|
14
|
-
interface IgniterMailAdapterSendParams {
|
|
15
|
-
/** Recipient email address. */
|
|
16
|
-
to: string;
|
|
17
|
-
/** Email subject. */
|
|
18
|
-
subject: string;
|
|
19
|
-
/** HTML body. */
|
|
20
|
-
html: string;
|
|
21
|
-
/** Plain-text body. */
|
|
22
|
-
text: string;
|
|
23
|
-
/** Optional provider-level scheduled send date. */
|
|
24
|
-
scheduledAt?: Date;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Credentials required by mail adapters.
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* ```ts
|
|
31
|
-
* const credentials = { secret: process.env.RESEND_API_KEY, from: 'no-reply@acme.com' }
|
|
32
|
-
* ```
|
|
33
|
-
*/
|
|
34
|
-
interface IgniterMailAdapterCredentials {
|
|
35
|
-
/** Provider secret, token, or connection URL. */
|
|
36
|
-
secret?: string;
|
|
37
|
-
/** Default FROM address used by the provider. */
|
|
38
|
-
from?: string;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Adapter interface used by {@link IgniterMail}.
|
|
42
|
-
*
|
|
43
|
-
* Adapters will eventually be imported from `@igniter-js/mail/adapters`.
|
|
44
|
-
*/
|
|
45
|
-
interface IgniterMailAdapter {
|
|
46
|
-
/**
|
|
47
|
-
* Sends an email using the underlying provider.
|
|
48
|
-
*
|
|
49
|
-
* @param params - Normalized send parameters.
|
|
50
|
-
* @returns A promise that resolves when the provider accepts the email.
|
|
51
|
-
* @throws IgniterMailError When configuration is invalid or provider call fails.
|
|
52
|
-
* @example
|
|
53
|
-
* ```ts
|
|
54
|
-
* await adapter.send({ to: 'a@b.com', subject: 'Hi', html: '<p>x</p>', text: 'x' })
|
|
55
|
-
* ```
|
|
56
|
-
*/
|
|
57
|
-
send: (params: IgniterMailAdapterSendParams) => Promise<void>;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export type { IgniterMailAdapter as I, IgniterMailAdapterSendParams as a, IgniterMailAdapterCredentials as b };
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Parameters used by a mail adapter to send an email.
|
|
3
|
-
*
|
|
4
|
-
* @example
|
|
5
|
-
* ```ts
|
|
6
|
-
* await adapter.send({
|
|
7
|
-
* to: 'user@example.com',
|
|
8
|
-
* subject: 'Welcome',
|
|
9
|
-
* html: '<p>Hello</p>',
|
|
10
|
-
* text: 'Hello',
|
|
11
|
-
* })
|
|
12
|
-
* ```
|
|
13
|
-
*/
|
|
14
|
-
interface IgniterMailAdapterSendParams {
|
|
15
|
-
/** Recipient email address. */
|
|
16
|
-
to: string;
|
|
17
|
-
/** Email subject. */
|
|
18
|
-
subject: string;
|
|
19
|
-
/** HTML body. */
|
|
20
|
-
html: string;
|
|
21
|
-
/** Plain-text body. */
|
|
22
|
-
text: string;
|
|
23
|
-
/** Optional provider-level scheduled send date. */
|
|
24
|
-
scheduledAt?: Date;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Credentials required by mail adapters.
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* ```ts
|
|
31
|
-
* const credentials = { secret: process.env.RESEND_API_KEY, from: 'no-reply@acme.com' }
|
|
32
|
-
* ```
|
|
33
|
-
*/
|
|
34
|
-
interface IgniterMailAdapterCredentials {
|
|
35
|
-
/** Provider secret, token, or connection URL. */
|
|
36
|
-
secret?: string;
|
|
37
|
-
/** Default FROM address used by the provider. */
|
|
38
|
-
from?: string;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Adapter interface used by {@link IgniterMail}.
|
|
42
|
-
*
|
|
43
|
-
* Adapters will eventually be imported from `@igniter-js/mail/adapters`.
|
|
44
|
-
*/
|
|
45
|
-
interface IgniterMailAdapter {
|
|
46
|
-
/**
|
|
47
|
-
* Sends an email using the underlying provider.
|
|
48
|
-
*
|
|
49
|
-
* @param params - Normalized send parameters.
|
|
50
|
-
* @returns A promise that resolves when the provider accepts the email.
|
|
51
|
-
* @throws IgniterMailError When configuration is invalid or provider call fails.
|
|
52
|
-
* @example
|
|
53
|
-
* ```ts
|
|
54
|
-
* await adapter.send({ to: 'a@b.com', subject: 'Hi', html: '<p>x</p>', text: 'x' })
|
|
55
|
-
* ```
|
|
56
|
-
*/
|
|
57
|
-
send: (params: IgniterMailAdapterSendParams) => Promise<void>;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export type { IgniterMailAdapter as I, IgniterMailAdapterSendParams as a, IgniterMailAdapterCredentials as b };
|