-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Types #296
fix: Types #296
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { enableFetchMocks } from 'jest-fetch-mock'; | ||
import { Resend } from '../resend'; | ||
import { GetContactResponseSuccess } from './interfaces'; | ||
import { ErrorResponse } from '../interfaces'; | ||
import { GetContactResponseSuccess } from './interfaces/get-contact.interface'; | ||
|
||
enableFetchMocks(); | ||
|
||
|
@@ -29,7 +29,7 @@ describe('Contacts', () => { | |
await expect( | ||
resend.contacts.create({ | ||
email: '[email protected]', | ||
audience_id: '3d4a472d-bc6d-4dd2-aa9d-d3d50ce87222', | ||
audienceId: '3d4a472d-bc6d-4dd2-aa9d-d3d50ce87222', | ||
}), | ||
).resolves.toMatchInlineSnapshot(` | ||
{ | ||
|
@@ -59,7 +59,7 @@ describe('Contacts', () => { | |
|
||
const resend = new Resend('re_zKa4RCko_Lhm9ost2YjNCctnPjbLw8Nop'); | ||
|
||
const result = resend.contacts.create({ email: '', audience_id: '' }); | ||
const result = resend.contacts.create({ email: '', audienceId: '' }); | ||
|
||
await expect(result).resolves.toMatchInlineSnapshot(` | ||
{ | ||
|
@@ -103,7 +103,7 @@ describe('Contacts', () => { | |
|
||
await expect( | ||
resend.contacts.list({ | ||
audience_id: 'b6d24b8e-af0b-4c3c-be0c-359bbd97381a', | ||
audienceId: 'b6d24b8e-af0b-4c3c-be0c-359bbd97381a', | ||
}), | ||
).resolves.toMatchInlineSnapshot(` | ||
{ | ||
|
@@ -147,7 +147,7 @@ describe('Contacts', () => { | |
|
||
const result = resend.contacts.get({ | ||
id: '3d4a472d-bc6d-4dd2-aa9d-d3d50ce87223', | ||
audience_id: '3d4a472d-bc6d-4dd2-aa9d-d3d50ce87222', | ||
audienceId: '3d4a472d-bc6d-4dd2-aa9d-d3d50ce87222', | ||
}); | ||
|
||
await expect(result).resolves.toMatchInlineSnapshot(` | ||
|
@@ -183,7 +183,7 @@ describe('Contacts', () => { | |
await expect( | ||
resend.contacts.get({ | ||
id: '3d4a472d-bc6d-4dd2-aa9d-d3d50ce87223', | ||
audience_id: '3d4a472d-bc6d-4dd2-aa9d-d3d50ce87222', | ||
audienceId: '3d4a472d-bc6d-4dd2-aa9d-d3d50ce87222', | ||
}), | ||
).resolves.toMatchInlineSnapshot(` | ||
{ | ||
|
@@ -219,8 +219,8 @@ describe('Contacts', () => { | |
await expect( | ||
resend.contacts.update({ | ||
id: '3d4a472d-bc6d-4dd2-aa9d-d3d50ce87223', | ||
audience_id: '3d4a472d-bc6d-4dd2-aa9d-d3d50ce87222', | ||
first_name: 'Bu', | ||
audienceId: '3d4a472d-bc6d-4dd2-aa9d-d3d50ce87222', | ||
fistName: 'Bu', | ||
}), | ||
).resolves.toMatchInlineSnapshot(` | ||
{ | ||
|
@@ -255,7 +255,7 @@ describe('Contacts', () => { | |
await expect( | ||
resend.contacts.remove({ | ||
id: '3d4a472d-bc6d-4dd2-aa9d-d3d50ce87223', | ||
audience_id: '3d4a472d-bc6d-4dd2-aa9d-d3d50ce87222', | ||
audienceId: '3d4a472d-bc6d-4dd2-aa9d-d3d50ce87222', | ||
}), | ||
).resolves.toMatchInlineSnapshot(` | ||
{ | ||
|
@@ -291,7 +291,7 @@ describe('Contacts', () => { | |
await expect( | ||
resend.contacts.remove({ | ||
email: '[email protected]', | ||
audience_id: '3d4a472d-bc6d-4dd2-aa9d-d3d50ce87222', | ||
audienceId: '3d4a472d-bc6d-4dd2-aa9d-d3d50ce87222', | ||
}), | ||
).resolves.toMatchInlineSnapshot(` | ||
{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,11 +3,11 @@ import { ErrorResponse } from '../../interfaces'; | |
import { Contact } from './contact'; | ||
|
||
export interface CreateContactOptions { | ||
audience_id: string; | ||
audienceId: string; | ||
email: string; | ||
unsubscribed?: boolean; | ||
first_name?: string; | ||
last_name?: string; | ||
firstName?: string; | ||
lastName?: string; | ||
Comment on lines
+6
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are breaking changes |
||
} | ||
|
||
export interface CreateContactRequestOptions extends PostOptions {} | ||
|
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5388,11 +5388,11 @@ __metadata: | |
|
||
"typescript@patch:[email protected]#~builtin<compat/typescript>": | ||
version: 5.3.3 | ||
resolution: "typescript@patch:typescript@npm%3A5.3.3#~builtin<compat/typescript>::version=5.3.3&hash=29ae49" | ||
resolution: "typescript@patch:typescript@npm%3A5.3.3#~builtin<compat/typescript>::version=5.3.3&hash=e012d7" | ||
bin: | ||
tsc: bin/tsc | ||
tsserver: bin/tsserver | ||
checksum: f61375590b3162599f0f0d5b8737877ac0a7bc52761dbb585d67e7b8753a3a4c42d9a554c4cc929f591ffcf3a2b0602f65ae3ce74714fd5652623a816862b610 | ||
checksum: 4e604a9e107ce0c23b16a2f8d79d0531d4d8fe9ebbb7a8c395c66998c39892f0e0a071ef0b0d4e66420a8ec2b8d6cfd9cdb29ba24f25b37cba072e9282376df9 | ||
languageName: node | ||
linkType: hard | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we destruct
audienceId
in here? I don't think it's used in the API's body, but the way we have now will send extra keys in the body.an even better option would be to explicitly send what we want (since we only care about 3 keys)