@beignet/provider-mail-resend 0.0.1 → 0.0.2
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 +11 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -0
- package/package.json +1 -1
- package/src/index.ts +42 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @beignet/provider-mail-resend
|
|
2
2
|
|
|
3
|
+
## 0.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [90b29ad]
|
|
8
|
+
- Updated dependencies [07fa19c]
|
|
9
|
+
- Updated dependencies [08bae67]
|
|
10
|
+
- Updated dependencies [730a818]
|
|
11
|
+
- Updated dependencies [a79f60c]
|
|
12
|
+
- @beignet/core@0.0.2
|
|
13
|
+
|
|
3
14
|
## 0.0.1
|
|
4
15
|
|
|
5
16
|
- Initial Beignet release under the `@beignet` npm scope.
|
package/dist/index.d.ts
CHANGED
|
@@ -11,20 +11,62 @@ declare const ResendMailConfigSchema: z.ZodObject<{
|
|
|
11
11
|
API_KEY: z.ZodString;
|
|
12
12
|
FROM: z.ZodString;
|
|
13
13
|
}, z.core.$strip>;
|
|
14
|
+
/**
|
|
15
|
+
* Resend provider config loaded from `RESEND_API_KEY` and `RESEND_FROM`.
|
|
16
|
+
*/
|
|
14
17
|
export type ResendMailConfig = z.infer<typeof ResendMailConfigSchema>;
|
|
18
|
+
/**
|
|
19
|
+
* Escape hatch for apps that need the raw Resend client.
|
|
20
|
+
*/
|
|
15
21
|
export interface ResendMailEscapeHatch {
|
|
22
|
+
/**
|
|
23
|
+
* Raw Resend SDK client.
|
|
24
|
+
*/
|
|
16
25
|
client: Resend;
|
|
17
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Ports contributed by `mailResendProvider`.
|
|
29
|
+
*/
|
|
18
30
|
export interface ResendMailProviderPorts {
|
|
31
|
+
/**
|
|
32
|
+
* Beignet mailer port backed by Resend.
|
|
33
|
+
*/
|
|
19
34
|
mailer: MailerPort;
|
|
35
|
+
/**
|
|
36
|
+
* Raw Resend client escape hatch.
|
|
37
|
+
*/
|
|
20
38
|
resend: ResendMailEscapeHatch;
|
|
21
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Options for creating a Resend-backed mailer directly.
|
|
42
|
+
*/
|
|
22
43
|
export interface CreateResendMailerOptions {
|
|
44
|
+
/**
|
|
45
|
+
* Raw Resend SDK client.
|
|
46
|
+
*/
|
|
23
47
|
client: Resend;
|
|
48
|
+
/**
|
|
49
|
+
* Default sender address.
|
|
50
|
+
*/
|
|
24
51
|
from: MailAddress;
|
|
52
|
+
/**
|
|
53
|
+
* Optional provider instrumentation target.
|
|
54
|
+
*/
|
|
25
55
|
instrumentation?: ProviderInstrumentationTarget;
|
|
26
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Create a Beignet mailer port backed by Resend.
|
|
59
|
+
*
|
|
60
|
+
* Use this directly for custom wiring, or install `mailResendProvider` to load
|
|
61
|
+
* config from env and contribute ports during server startup.
|
|
62
|
+
*/
|
|
27
63
|
export declare function createResendMailer({ client, from, instrumentation: instrumentationTarget, }: CreateResendMailerOptions): MailerPort;
|
|
64
|
+
/**
|
|
65
|
+
* Env-backed Resend mail provider.
|
|
66
|
+
*
|
|
67
|
+
* Reads `RESEND_API_KEY` and `RESEND_FROM`, contributes `ports.mailer`, and
|
|
68
|
+
* exposes `ports.resend.client` as an escape hatch.
|
|
69
|
+
*/
|
|
28
70
|
export declare const mailResendProvider: import("@beignet/core/providers").ServiceProvider<unknown, z.ZodObject<{
|
|
29
71
|
API_KEY: z.ZodString;
|
|
30
72
|
FROM: z.ZodString;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA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BAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE;;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,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;AAqDD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EACN,IAAI,EACJ,eAAe,EAAE,qBAAqB,GACvC,EAAE,yBAAyB,GAAG,UAAU,CAsFxC;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;EAkC7B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -37,6 +37,12 @@ function createResendPayload(message, defaultFrom) {
|
|
|
37
37
|
addOptional(payload, "headers", normalized.headers);
|
|
38
38
|
return payload;
|
|
39
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Create a Beignet mailer port backed by Resend.
|
|
42
|
+
*
|
|
43
|
+
* Use this directly for custom wiring, or install `mailResendProvider` to load
|
|
44
|
+
* config from env and contribute ports during server startup.
|
|
45
|
+
*/
|
|
40
46
|
export function createResendMailer({ client, from, instrumentation: instrumentationTarget, }) {
|
|
41
47
|
const instrumentation = createProviderInstrumentation(instrumentationTarget, {
|
|
42
48
|
providerName: "mail-resend",
|
|
@@ -117,6 +123,12 @@ export function createResendMailer({ client, from, instrumentation: instrumentat
|
|
|
117
123
|
},
|
|
118
124
|
};
|
|
119
125
|
}
|
|
126
|
+
/**
|
|
127
|
+
* Env-backed Resend mail provider.
|
|
128
|
+
*
|
|
129
|
+
* Reads `RESEND_API_KEY` and `RESEND_FROM`, contributes `ports.mailer`, and
|
|
130
|
+
* exposes `ports.resend.client` as an escape hatch.
|
|
131
|
+
*/
|
|
120
132
|
export const mailResendProvider = createProvider({
|
|
121
133
|
name: "mail-resend",
|
|
122
134
|
config: {
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -27,20 +27,50 @@ const ResendMailConfigSchema = z.object({
|
|
|
27
27
|
FROM: z.string().min(1),
|
|
28
28
|
});
|
|
29
29
|
|
|
30
|
+
/**
|
|
31
|
+
* Resend provider config loaded from `RESEND_API_KEY` and `RESEND_FROM`.
|
|
32
|
+
*/
|
|
30
33
|
export type ResendMailConfig = z.infer<typeof ResendMailConfigSchema>;
|
|
31
34
|
|
|
35
|
+
/**
|
|
36
|
+
* Escape hatch for apps that need the raw Resend client.
|
|
37
|
+
*/
|
|
32
38
|
export interface ResendMailEscapeHatch {
|
|
39
|
+
/**
|
|
40
|
+
* Raw Resend SDK client.
|
|
41
|
+
*/
|
|
33
42
|
client: Resend;
|
|
34
43
|
}
|
|
35
44
|
|
|
45
|
+
/**
|
|
46
|
+
* Ports contributed by `mailResendProvider`.
|
|
47
|
+
*/
|
|
36
48
|
export interface ResendMailProviderPorts {
|
|
49
|
+
/**
|
|
50
|
+
* Beignet mailer port backed by Resend.
|
|
51
|
+
*/
|
|
37
52
|
mailer: MailerPort;
|
|
53
|
+
/**
|
|
54
|
+
* Raw Resend client escape hatch.
|
|
55
|
+
*/
|
|
38
56
|
resend: ResendMailEscapeHatch;
|
|
39
57
|
}
|
|
40
58
|
|
|
59
|
+
/**
|
|
60
|
+
* Options for creating a Resend-backed mailer directly.
|
|
61
|
+
*/
|
|
41
62
|
export interface CreateResendMailerOptions {
|
|
63
|
+
/**
|
|
64
|
+
* Raw Resend SDK client.
|
|
65
|
+
*/
|
|
42
66
|
client: Resend;
|
|
67
|
+
/**
|
|
68
|
+
* Default sender address.
|
|
69
|
+
*/
|
|
43
70
|
from: MailAddress;
|
|
71
|
+
/**
|
|
72
|
+
* Optional provider instrumentation target.
|
|
73
|
+
*/
|
|
44
74
|
instrumentation?: ProviderInstrumentationTarget;
|
|
45
75
|
}
|
|
46
76
|
|
|
@@ -95,6 +125,12 @@ function createResendPayload(
|
|
|
95
125
|
return payload as CreateEmailOptions;
|
|
96
126
|
}
|
|
97
127
|
|
|
128
|
+
/**
|
|
129
|
+
* Create a Beignet mailer port backed by Resend.
|
|
130
|
+
*
|
|
131
|
+
* Use this directly for custom wiring, or install `mailResendProvider` to load
|
|
132
|
+
* config from env and contribute ports during server startup.
|
|
133
|
+
*/
|
|
98
134
|
export function createResendMailer({
|
|
99
135
|
client,
|
|
100
136
|
from,
|
|
@@ -187,6 +223,12 @@ export function createResendMailer({
|
|
|
187
223
|
};
|
|
188
224
|
}
|
|
189
225
|
|
|
226
|
+
/**
|
|
227
|
+
* Env-backed Resend mail provider.
|
|
228
|
+
*
|
|
229
|
+
* Reads `RESEND_API_KEY` and `RESEND_FROM`, contributes `ports.mailer`, and
|
|
230
|
+
* exposes `ports.resend.client` as an escape hatch.
|
|
231
|
+
*/
|
|
190
232
|
export const mailResendProvider = createProvider({
|
|
191
233
|
name: "mail-resend",
|
|
192
234
|
|