@beignet/provider-mail-resend 0.0.34 → 0.0.35
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/CHANGELOG.md +6 -0
- package/README.md +4 -0
- package/dist/index.d.ts +10 -17
- package/dist/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +17 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @beignet/provider-mail-resend
|
|
2
2
|
|
|
3
|
+
## 0.0.35
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 7d0c795: Expose stable named provider types while keeping private config schemas out of package declarations and preserving validated config and contributed-port inference. Drizzle's Postgres and MySQL config schema constants are now internal; use the exported config interfaces for validated shapes.
|
|
8
|
+
|
|
3
9
|
## 0.0.34
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -9,6 +9,10 @@ Resend-backed mail provider for Beignet.
|
|
|
9
9
|
The provider installs the app-facing `ctx.ports.mailer` port and exposes
|
|
10
10
|
`ctx.ports.resend.client` only as an escape hatch for Resend-specific features.
|
|
11
11
|
|
|
12
|
+
`createResendMailProvider(...)` returns the stable `ResendMailProvider` type.
|
|
13
|
+
`ResendMailConfig` describes its validated config; the Zod schema remains
|
|
14
|
+
internal.
|
|
15
|
+
|
|
12
16
|
## Install
|
|
13
17
|
|
|
14
18
|
```bash
|
package/dist/index.d.ts
CHANGED
|
@@ -4,17 +4,15 @@
|
|
|
4
4
|
* Resend-backed mail provider for Beignet.
|
|
5
5
|
*/
|
|
6
6
|
import { type MailAddress, type MailerPort } from "@beignet/core/mail";
|
|
7
|
-
import { type ProviderInstrumentationTarget } from "@beignet/core/providers";
|
|
7
|
+
import { type AnyProviderConfigSchema, type ProviderInstrumentationTarget, type ServiceProvider } from "@beignet/core/providers";
|
|
8
8
|
import { Resend } from "resend";
|
|
9
|
-
import { z } from "zod";
|
|
10
|
-
declare const ResendMailConfigSchema: z.ZodObject<{
|
|
11
|
-
API_KEY: z.ZodString;
|
|
12
|
-
FROM: z.ZodString;
|
|
13
|
-
}, z.core.$strip>;
|
|
14
9
|
/**
|
|
15
10
|
* Resend provider config loaded from `RESEND_API_KEY` and `RESEND_FROM`.
|
|
16
11
|
*/
|
|
17
|
-
export
|
|
12
|
+
export interface ResendMailConfig {
|
|
13
|
+
API_KEY: string;
|
|
14
|
+
FROM: string;
|
|
15
|
+
}
|
|
18
16
|
/**
|
|
19
17
|
* Escape hatch for apps that need the raw Resend client.
|
|
20
18
|
*/
|
|
@@ -37,6 +35,10 @@ export interface ResendMailProviderPorts {
|
|
|
37
35
|
*/
|
|
38
36
|
resend: ResendMailEscapeHatch;
|
|
39
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Resend mail lifecycle provider with stable contributed-port typing.
|
|
40
|
+
*/
|
|
41
|
+
export type ResendMailProvider = ServiceProvider<unknown, AnyProviderConfigSchema<ResendMailConfig>, Pick<ResendMailProviderPorts, keyof ResendMailProviderPorts>>;
|
|
40
42
|
/**
|
|
41
43
|
* Options for creating a Resend-backed mailer directly.
|
|
42
44
|
*/
|
|
@@ -80,14 +82,5 @@ export interface CreateResendMailProviderOptions {
|
|
|
80
82
|
*
|
|
81
83
|
* Options override the corresponding `RESEND_*` env values.
|
|
82
84
|
*/
|
|
83
|
-
export declare function createResendMailProvider(options?: CreateResendMailProviderOptions):
|
|
84
|
-
API_KEY: z.ZodString;
|
|
85
|
-
FROM: z.ZodString;
|
|
86
|
-
}, z.core.$strip>, {
|
|
87
|
-
mailer: MailerPort;
|
|
88
|
-
resend: {
|
|
89
|
-
client: Resend;
|
|
90
|
-
};
|
|
91
|
-
}, unknown, void>;
|
|
92
|
-
export {};
|
|
85
|
+
export declare function createResendMailProvider(options?: CreateResendMailProviderOptions): ResendMailProvider;
|
|
93
86
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAGL,KAAK,WAAW,EAEhB,KAAK,UAAU,EAIhB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAGL,KAAK,WAAW,EAEhB,KAAK,UAAU,EAIhB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,KAAK,uBAAuB,EAG5B,KAAK,6BAA6B,EAClC,KAAK,eAAe,EACrB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAA2B,MAAM,EAAE,MAAM,QAAQ,CAAC;AAQzD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,MAAM,EAAE,UAAU,CAAC;IACnB;;OAEG;IACH,MAAM,EAAE,qBAAqB,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,eAAe,CAC9C,OAAO,EACP,uBAAuB,CAAC,gBAAgB,CAAC,EACzC,IAAI,CAAC,uBAAuB,EAAE,MAAM,uBAAuB,CAAC,CAC7D,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,IAAI,EAAE,WAAW,CAAC;IAClB;;OAEG;IACH,eAAe,CAAC,EAAE,6BAA6B,CAAC;CACjD;AA2DD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EACN,IAAI,EACJ,eAAe,EAAE,qBAAqB,GACvC,EAAE,yBAAyB,GAAG,UAAU,CAwFxC;AAED;;GAEG;AACH,MAAM,WAAW,+BAA+B;IAC9C;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,GAAE,+BAAoC,GAC5C,kBAAkB,CA0CpB"}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -15,9 +15,11 @@ import {
|
|
|
15
15
|
type SendMailResult,
|
|
16
16
|
} from "@beignet/core/mail";
|
|
17
17
|
import {
|
|
18
|
+
type AnyProviderConfigSchema,
|
|
18
19
|
createProvider,
|
|
19
20
|
createProviderInstrumentation,
|
|
20
21
|
type ProviderInstrumentationTarget,
|
|
22
|
+
type ServiceProvider,
|
|
21
23
|
} from "@beignet/core/providers";
|
|
22
24
|
import { type CreateEmailOptions, Resend } from "resend";
|
|
23
25
|
import { z } from "zod";
|
|
@@ -25,12 +27,15 @@ import { z } from "zod";
|
|
|
25
27
|
const ResendMailConfigSchema = z.object({
|
|
26
28
|
API_KEY: z.string().min(1),
|
|
27
29
|
FROM: z.string().min(1),
|
|
28
|
-
})
|
|
30
|
+
}) satisfies z.ZodType<ResendMailConfig>;
|
|
29
31
|
|
|
30
32
|
/**
|
|
31
33
|
* Resend provider config loaded from `RESEND_API_KEY` and `RESEND_FROM`.
|
|
32
34
|
*/
|
|
33
|
-
export
|
|
35
|
+
export interface ResendMailConfig {
|
|
36
|
+
API_KEY: string;
|
|
37
|
+
FROM: string;
|
|
38
|
+
}
|
|
34
39
|
|
|
35
40
|
/**
|
|
36
41
|
* Escape hatch for apps that need the raw Resend client.
|
|
@@ -56,6 +61,15 @@ export interface ResendMailProviderPorts {
|
|
|
56
61
|
resend: ResendMailEscapeHatch;
|
|
57
62
|
}
|
|
58
63
|
|
|
64
|
+
/**
|
|
65
|
+
* Resend mail lifecycle provider with stable contributed-port typing.
|
|
66
|
+
*/
|
|
67
|
+
export type ResendMailProvider = ServiceProvider<
|
|
68
|
+
unknown,
|
|
69
|
+
AnyProviderConfigSchema<ResendMailConfig>,
|
|
70
|
+
Pick<ResendMailProviderPorts, keyof ResendMailProviderPorts>
|
|
71
|
+
>;
|
|
72
|
+
|
|
59
73
|
/**
|
|
60
74
|
* Options for creating a Resend-backed mailer directly.
|
|
61
75
|
*/
|
|
@@ -253,7 +267,7 @@ export interface CreateResendMailProviderOptions {
|
|
|
253
267
|
*/
|
|
254
268
|
export function createResendMailProvider(
|
|
255
269
|
options: CreateResendMailProviderOptions = {},
|
|
256
|
-
) {
|
|
270
|
+
): ResendMailProvider {
|
|
257
271
|
return createProvider({
|
|
258
272
|
name: "mail-resend",
|
|
259
273
|
|