resend 0.17.0 → 0.17.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.17.0",
3
+ "version": "0.17.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",
@@ -28,7 +28,8 @@
28
28
  "homepage": "https://github.com/resend-inc/resend-node#readme",
29
29
  "dependencies": {
30
30
  "@react-email/render": "0.0.7",
31
- "axios": "1.4.0"
31
+ "axios": "1.4.0",
32
+ "type-fest": "3.13.0"
32
33
  },
33
34
  "devDependencies": {
34
35
  "@types/jest": "29.5.3",
@@ -1,6 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  import * as React from 'react';
3
3
  import { PostOptions } from '../../common/interfaces';
4
+ import { RequireAtLeastOne } from 'type-fest';
4
5
  interface CreateEmailBaseOptions {
5
6
  attachments?: Attachment[];
6
7
  bcc?: string | string[];
@@ -8,20 +9,14 @@ interface CreateEmailBaseOptions {
8
9
  from: string;
9
10
  headers?: Record<string, string>;
10
11
  react?: React.ReactElement | React.ReactNode | null;
12
+ html?: string;
13
+ text?: string;
11
14
  reply_to?: string | string[];
12
15
  subject: string;
13
16
  tags?: Tag[];
14
17
  to: string | string[];
15
18
  }
16
- interface CreateEmailWithHtmlOptions extends CreateEmailBaseOptions {
17
- html: string;
18
- text?: string;
19
- }
20
- interface CreateEmailWithTextOptions extends CreateEmailBaseOptions {
21
- html?: string;
22
- text: string;
23
- }
24
- export type CreateEmailOptions = CreateEmailWithHtmlOptions | CreateEmailWithTextOptions;
19
+ export type CreateEmailOptions = RequireAtLeastOne<CreateEmailBaseOptions, 'react' | 'html' | 'text'>;
25
20
  export interface CreateEmailRequestOptions extends PostOptions {
26
21
  }
27
22
  export interface CreateEmailResponse {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "resend",
3
- "version": "0.17.0",
3
+ "version": "0.17.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",
@@ -28,7 +28,8 @@
28
28
  "homepage": "https://github.com/resend-inc/resend-node#readme",
29
29
  "dependencies": {
30
30
  "@react-email/render": "0.0.7",
31
- "axios": "1.4.0"
31
+ "axios": "1.4.0",
32
+ "type-fest": "3.13.0"
32
33
  },
33
34
  "devDependencies": {
34
35
  "@types/jest": "29.5.3",