resend 0.10.0 → 0.11.0
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/build/package.json +3 -3
- package/build/src/interfaces.d.ts +20 -2
- package/build/src/resend.d.ts +2 -2
- package/build/src/resend.js +1 -1
- package/build/src/resend.spec.js +1 -1
- package/package.json +3 -3
package/build/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "resend",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/src/index.d.ts",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/jest": "28.1.8",
|
|
35
35
|
"@types/node": "18.6.4",
|
|
36
|
-
"@types/react": "18.0.
|
|
36
|
+
"@types/react": "18.0.27",
|
|
37
37
|
"axios-mock-adapter": "1.21.2",
|
|
38
38
|
"jest": "28.1.3",
|
|
39
|
-
"prettier": "2.8.
|
|
39
|
+
"prettier": "2.8.4",
|
|
40
40
|
"supertest": "6.3.3",
|
|
41
41
|
"ts-jest": "28.0.8",
|
|
42
42
|
"tslint": "6.1.3",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
import { ReactElement } from 'react';
|
|
2
3
|
export interface SendEmailData {
|
|
3
4
|
/** Sender email address. */
|
|
@@ -9,7 +10,7 @@ export interface SendEmailData {
|
|
|
9
10
|
/** Cc recipient email address. Max 50. */
|
|
10
11
|
cc?: string | string[];
|
|
11
12
|
/** Reply-to email address. Max 50. */
|
|
12
|
-
|
|
13
|
+
reply_to?: string | string[];
|
|
13
14
|
/** Email subject. */
|
|
14
15
|
subject?: string;
|
|
15
16
|
/** The HTML version of the message. */
|
|
@@ -19,7 +20,11 @@ export interface SendEmailData {
|
|
|
19
20
|
/** The React version of the message. */
|
|
20
21
|
react?: ReactElement;
|
|
21
22
|
/** Attachments */
|
|
22
|
-
attachments?:
|
|
23
|
+
attachments?: Attachment[];
|
|
24
|
+
}
|
|
25
|
+
interface Attachment {
|
|
26
|
+
content?: string | Buffer;
|
|
27
|
+
filename?: string | false | undefined;
|
|
23
28
|
}
|
|
24
29
|
export interface SendEmailRequest {
|
|
25
30
|
/** Sender email address. */
|
|
@@ -41,3 +46,16 @@ export interface SendEmailRequest {
|
|
|
41
46
|
/** Attachments */
|
|
42
47
|
attachments?: any[];
|
|
43
48
|
}
|
|
49
|
+
interface EmailResponse extends Pick<SendEmailRequest, 'to' | 'from'> {
|
|
50
|
+
id: string;
|
|
51
|
+
created_at: string;
|
|
52
|
+
}
|
|
53
|
+
interface ErrorResponse {
|
|
54
|
+
error: {
|
|
55
|
+
message: string;
|
|
56
|
+
status: number;
|
|
57
|
+
type: string;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export declare type SendEmailResponse = EmailResponse | ErrorResponse;
|
|
61
|
+
export {};
|
package/build/src/resend.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { SendEmailData } from './interfaces';
|
|
1
|
+
import { SendEmailData, SendEmailResponse } from './interfaces';
|
|
2
2
|
export declare class Resend {
|
|
3
3
|
readonly apiKey?: string | undefined;
|
|
4
4
|
readonly baseUrl: string;
|
|
5
5
|
private readonly headers;
|
|
6
6
|
private readonly request;
|
|
7
7
|
constructor(apiKey?: string | undefined);
|
|
8
|
-
sendEmail(data: SendEmailData): Promise<
|
|
8
|
+
sendEmail(data: SendEmailData): Promise<SendEmailResponse>;
|
|
9
9
|
}
|
package/build/src/resend.js
CHANGED
package/build/src/resend.spec.js
CHANGED
|
@@ -103,7 +103,7 @@ describe('Resend', () => {
|
|
|
103
103
|
const payload = {
|
|
104
104
|
from: 'admin@resend.com',
|
|
105
105
|
to: 'bu@resend.com',
|
|
106
|
-
|
|
106
|
+
reply_to: ['foo@resend.com', 'bar@resend.com'],
|
|
107
107
|
subject: 'Hello World',
|
|
108
108
|
};
|
|
109
109
|
const data = yield resend.sendEmail(payload);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "resend",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/src/index.d.ts",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/jest": "28.1.8",
|
|
35
35
|
"@types/node": "18.6.4",
|
|
36
|
-
"@types/react": "18.0.
|
|
36
|
+
"@types/react": "18.0.27",
|
|
37
37
|
"axios-mock-adapter": "1.21.2",
|
|
38
38
|
"jest": "28.1.3",
|
|
39
|
-
"prettier": "2.8.
|
|
39
|
+
"prettier": "2.8.4",
|
|
40
40
|
"supertest": "6.3.3",
|
|
41
41
|
"ts-jest": "28.0.8",
|
|
42
42
|
"tslint": "6.1.3",
|