resend 0.14.0 → 0.14.1

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "resend",
3
- "version": "0.14.0",
3
+ "version": "0.14.1",
4
4
  "description": "Node.js library for the Resend API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",
@@ -1,13 +1,13 @@
1
1
  import { PostOptions } from '../../common/interfaces';
2
2
  export interface CreateEmailOptions {
3
- id: string;
4
- bcc?: string[];
5
- cc?: string[];
3
+ bcc?: string | string[];
4
+ cc?: string | string[];
6
5
  from: string;
7
6
  html?: string;
8
- text?: string;
9
- to: string[];
7
+ reply_to?: string | string[];
10
8
  subject: string;
9
+ text?: string;
10
+ to: string | string[];
11
11
  }
12
12
  export interface CreateEmailRequestOptions extends PostOptions {
13
13
  }
@@ -28,13 +28,13 @@ describe('Resend', () => {
28
28
  to: 'zeno@resend.com',
29
29
  subject: 'Hello World',
30
30
  };
31
- mock.onPost('/email', payload).replyOnce(200, {
31
+ mock.onPost('/emails', payload).replyOnce(200, {
32
32
  id: '1234',
33
33
  from: 'bu@resend.com',
34
34
  to: 'zeno@resend.com',
35
35
  created_at: '123',
36
36
  });
37
- const data = yield resend.sendEmail(payload);
37
+ const data = yield resend.emails.send(payload);
38
38
  expect(data).toMatchInlineSnapshot(`
39
39
  {
40
40
  "created_at": "123",
@@ -50,13 +50,13 @@ describe('Resend', () => {
50
50
  to: ['bu@resend.com', 'zeno@resend.com'],
51
51
  subject: 'Hello World',
52
52
  };
53
- mock.onPost('/email', payload).replyOnce(200, {
53
+ mock.onPost('/emails', payload).replyOnce(200, {
54
54
  id: '1234',
55
55
  from: 'admin@resend.com',
56
56
  to: ['bu@resend.com', 'zeno@resend.com'],
57
57
  created_at: '123',
58
58
  });
59
- const data = yield resend.sendEmail(payload);
59
+ const data = yield resend.emails.send(payload);
60
60
  expect(data).toMatchInlineSnapshot(`
61
61
  {
62
62
  "created_at": "123",
@@ -76,14 +76,14 @@ describe('Resend', () => {
76
76
  bcc: ['foo@resend.com', 'bar@resend.com'],
77
77
  subject: 'Hello World',
78
78
  };
79
- mock.onPost('/email', payload).replyOnce(200, {
79
+ mock.onPost('/emails', payload).replyOnce(200, {
80
80
  id: '1234',
81
81
  from: 'admin@resend.com',
82
82
  to: 'bu@resend.com',
83
83
  bcc: ['foo@resend.com', 'bar@resend.com'],
84
84
  created_at: '123',
85
85
  });
86
- const data = yield resend.sendEmail(payload);
86
+ const data = yield resend.emails.send(payload);
87
87
  expect(data).toMatchInlineSnapshot(`
88
88
  {
89
89
  "bcc": [
@@ -104,14 +104,14 @@ describe('Resend', () => {
104
104
  cc: ['foo@resend.com', 'bar@resend.com'],
105
105
  subject: 'Hello World',
106
106
  };
107
- mock.onPost('/email', payload).replyOnce(200, {
107
+ mock.onPost('/emails', payload).replyOnce(200, {
108
108
  id: '1234',
109
109
  from: 'admin@resend.com',
110
110
  to: 'bu@resend.com',
111
111
  cc: ['foo@resend.com', 'bar@resend.com'],
112
112
  created_at: '123',
113
113
  });
114
- const data = yield resend.sendEmail(payload);
114
+ const data = yield resend.emails.send(payload);
115
115
  expect(data).toMatchInlineSnapshot(`
116
116
  {
117
117
  "cc": [
@@ -132,7 +132,7 @@ describe('Resend', () => {
132
132
  reply_to: ['foo@resend.com', 'bar@resend.com'],
133
133
  subject: 'Hello World',
134
134
  };
135
- mock.onPost('/email', apiPayload).replyOnce(200, {
135
+ mock.onPost('/emails', apiPayload).replyOnce(200, {
136
136
  id: '1234',
137
137
  from: 'admin@resend.com',
138
138
  to: 'bu@resend.com',
@@ -145,7 +145,7 @@ describe('Resend', () => {
145
145
  reply_to: ['foo@resend.com', 'bar@resend.com'],
146
146
  subject: 'Hello World',
147
147
  };
148
- const data = yield resend.sendEmail(payload);
148
+ const data = yield resend.emails.send(payload);
149
149
  expect(data).toMatchInlineSnapshot(`
150
150
  {
151
151
  "created_at": "123",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "resend",
3
- "version": "0.14.0",
3
+ "version": "0.14.1",
4
4
  "description": "Node.js library for the Resend API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",
package/readme.md CHANGED
@@ -24,7 +24,7 @@ const resend = new Resend('re_123');
24
24
  Send your first email:
25
25
 
26
26
  ```js
27
- await resend.sendEmail({
27
+ await resend.emails.send({
28
28
  from: 'you@example.com',
29
29
  to: 'user@gmail.com',
30
30
  subject: 'hello world',
@@ -37,7 +37,7 @@ await resend.sendEmail({
37
37
  Send an email custom HTML content:
38
38
 
39
39
  ```js
40
- await resend.sendEmail({
40
+ await resend.emails.send({
41
41
  from: 'you@example.com',
42
42
  to: 'user@gmail.com',
43
43
  subject: 'hello world',
@@ -69,7 +69,7 @@ Then import the template component and pass it to the `react` property.
69
69
  ```jsx
70
70
  import EmailTemplate from '../components/EmailTemplate'
71
71
 
72
- await resend.sendEmail({
72
+ await resend.emails.send({
73
73
  from: 'you@example.com',
74
74
  to: 'user@gmail.com',
75
75
  subject: 'hello world',
@@ -79,4 +79,4 @@ await resend.sendEmail({
79
79
 
80
80
  ## License
81
81
 
82
- MIT License
82
+ MIT License