Skip to content

Commit

Permalink
feat: Camel case types (#418)
Browse files Browse the repository at this point in the history
  • Loading branch information
bukinoshita authored Aug 16, 2024
1 parent 942ebe1 commit 0d5c2ab
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/domains/domains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export class Domains {
const data = await this.resend.get<GetDomainResponseSuccess>(
`/domains/${id}`,
);

return data;
}

Expand Down
4 changes: 2 additions & 2 deletions src/emails/emails.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ describe('Emails', () => {
const payload: CreateEmailOptions = {
from: 'admin@resend.com',
to: 'bu@resend.com',
reply_to: ['foo@resend.com', 'bar@resend.com'],
replyTo: ['foo@resend.com', 'bar@resend.com'],
subject: 'Hello World',
text: 'Hello world',
};
Expand Down Expand Up @@ -252,7 +252,7 @@ describe('Emails', () => {
const payload: CreateEmailOptions = {
from: 'resend.com', // Invalid from address
to: 'bu@resend.com',
reply_to: ['foo@resend.com', 'bar@resend.com'],
replyTo: ['foo@resend.com', 'bar@resend.com'],
subject: 'Hello World',
text: 'Hello world',
};
Expand Down
3 changes: 2 additions & 1 deletion src/emails/emails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class Emails {
from: payload.from,
headers: payload.headers,
html: payload.html,
reply_to: payload.reply_to,
reply_to: payload.replyTo,
scheduled_at: payload.scheduledAt,
subject: payload.subject,
tags: payload.tags,
Expand All @@ -67,6 +67,7 @@ export class Emails {
const data = await this.resend.get<GetEmailResponseSuccess>(
`/emails/${id}`,
);

return data;
}

Expand Down
4 changes: 2 additions & 2 deletions src/emails/interfaces/create-email-options.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ interface CreateEmailBaseOptions {
*
* @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
*/
reply_to?: string | string[];
replyTo?: string | string[];
/**
* Email subject.
*
Expand Down Expand Up @@ -111,7 +111,7 @@ interface Attachment {
/** Path where the attachment file is hosted */
path?: string;
/** Optional content type for the attachment, if not set will be derived from the filename property */
content_type?: string;
contentType?: string;
}

export type Tag = {
Expand Down

0 comments on commit 0d5c2ab

Please sign in to comment.