Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
node_modules
dist
.yarn/*
!.yarn/releases
build
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "resend",
"version": "4.6.0",
"version": "4.7.0-canary.0",
"description": "Node.js library for the Resend API",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
Expand Down
13 changes: 9 additions & 4 deletions src/api-keys/interfaces/create-api-key-options.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ export interface CreateApiKeyResponseSuccess {
id: string;
}

export interface CreateApiKeyResponse {
data: CreateApiKeyResponseSuccess | null;
error: ErrorResponse | null;
}
export type CreateApiKeyResponse =
| {
data: CreateApiKeyResponseSuccess;
error: null;
}
| {
data: null;
error: ErrorResponse;
};
13 changes: 9 additions & 4 deletions src/api-keys/interfaces/list-api-keys.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ export type ListApiKeysResponseSuccess = Pick<
'name' | 'id' | 'created_at'
>[];

export interface ListApiKeysResponse {
data: ListApiKeysResponseSuccess | null;
error: ErrorResponse | null;
}
export type ListApiKeysResponse =
| {
data: ListApiKeysResponseSuccess;
error: null;
}
| {
data: null;
error: ErrorResponse;
};
13 changes: 9 additions & 4 deletions src/api-keys/interfaces/remove-api-keys.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ import type { ErrorResponse } from '../../interfaces';
// biome-ignore lint/complexity/noBannedTypes: <explanation>
export type RemoveApiKeyResponseSuccess = {};

export interface RemoveApiKeyResponse {
data: RemoveApiKeyResponseSuccess | null;
error: ErrorResponse | null;
}
export type RemoveApiKeyResponse =
| {
data: RemoveApiKeyResponseSuccess;
error: null;
}
| {
data: null;
error: ErrorResponse;
};
13 changes: 9 additions & 4 deletions src/audiences/interfaces/create-audience-options.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ export interface CreateAudienceResponseSuccess
object: 'audience';
}

export interface CreateAudienceResponse {
data: CreateAudienceResponseSuccess | null;
error: ErrorResponse | null;
}
export type CreateAudienceResponse =
| {
data: CreateAudienceResponseSuccess;
error: null;
}
| {
data: null;
error: ErrorResponse;
};
13 changes: 9 additions & 4 deletions src/audiences/interfaces/get-audience.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ export interface GetAudienceResponseSuccess
object: 'audience';
}

export interface GetAudienceResponse {
data: GetAudienceResponseSuccess | null;
error: ErrorResponse | null;
}
export type GetAudienceResponse =
| {
data: GetAudienceResponseSuccess;
error: null;
}
| {
data: null;
error: ErrorResponse;
};
13 changes: 9 additions & 4 deletions src/audiences/interfaces/list-audiences.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ export type ListAudiencesResponseSuccess = {
data: Audience[];
};

export interface ListAudiencesResponse {
data: ListAudiencesResponseSuccess | null;
error: ErrorResponse | null;
}
export type ListAudiencesResponse =
| {
data: ListAudiencesResponseSuccess;
error: null;
}
| {
data: null;
error: ErrorResponse;
};
13 changes: 9 additions & 4 deletions src/audiences/interfaces/remove-audience.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ export interface RemoveAudiencesResponseSuccess extends Pick<Audience, 'id'> {
deleted: boolean;
}

export interface RemoveAudiencesResponse {
data: RemoveAudiencesResponseSuccess | null;
error: ErrorResponse | null;
}
export type RemoveAudiencesResponse =
| {
data: RemoveAudiencesResponseSuccess;
error: null;
}
| {
data: null;
error: ErrorResponse;
};
13 changes: 9 additions & 4 deletions src/batch/interfaces/create-batch-options.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ export interface CreateBatchSuccessResponse {
}[];
}

export interface CreateBatchResponse {
data: CreateBatchSuccessResponse | null;
error: ErrorResponse | null;
}
export type CreateBatchResponse =
| {
data: CreateBatchSuccessResponse;
error: null;
}
| {
data: null;
error: ErrorResponse;
};
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,12 @@ export interface CreateBroadcastResponseSuccess {
id: string;
}

export interface CreateBroadcastResponse {
data: CreateBroadcastResponseSuccess | null;
error: ErrorResponse | null;
}
export type CreateBroadcastResponse =
| {
data: CreateBroadcastResponseSuccess;
error: null;
}
| {
data: null;
error: ErrorResponse;
};
13 changes: 9 additions & 4 deletions src/broadcasts/interfaces/get-broadcast.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ export interface GetBroadcastResponseSuccess extends Broadcast {
object: 'broadcast';
}

export interface GetBroadcastResponse {
data: GetBroadcastResponseSuccess | null;
error: ErrorResponse | null;
}
export type GetBroadcastResponse =
| {
data: GetBroadcastResponseSuccess;
error: null;
}
| {
data: null;
error: ErrorResponse;
};
13 changes: 9 additions & 4 deletions src/broadcasts/interfaces/list-broadcasts.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ export type ListBroadcastsResponseSuccess = {
>[];
};

export interface ListBroadcastsResponse {
data: ListBroadcastsResponseSuccess | null;
error: ErrorResponse | null;
}
export type ListBroadcastsResponse =
| {
data: ListBroadcastsResponseSuccess;
error: null;
}
| {
data: null;
error: ErrorResponse;
};
13 changes: 9 additions & 4 deletions src/broadcasts/interfaces/remove-broadcast.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ export interface RemoveBroadcastResponseSuccess extends Pick<Broadcast, 'id'> {
deleted: boolean;
}

export interface RemoveBroadcastResponse {
data: RemoveBroadcastResponseSuccess | null;
error: ErrorResponse | null;
}
export type RemoveBroadcastResponse =
| {
data: RemoveBroadcastResponseSuccess;
error: null;
}
| {
data: null;
error: ErrorResponse;
};
13 changes: 9 additions & 4 deletions src/broadcasts/interfaces/send-broadcast-options.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ export interface SendBroadcastResponseSuccess {
id: string;
}

export interface SendBroadcastResponse {
data: SendBroadcastResponseSuccess | null;
error: ErrorResponse | null;
}
export type SendBroadcastResponse =
| {
data: SendBroadcastResponseSuccess;
error: null;
}
| {
data: null;
error: ErrorResponse;
};
13 changes: 9 additions & 4 deletions src/broadcasts/interfaces/update-broadcast.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ export interface UpdateBroadcastOptions {
previewText?: string;
}

export interface UpdateBroadcastResponse {
data: UpdateBroadcastResponseSuccess | null;
error: ErrorResponse | null;
}
export type UpdateBroadcastResponse =
| {
data: UpdateBroadcastResponseSuccess;
error: null;
}
| {
data: null;
error: ErrorResponse;
};
13 changes: 9 additions & 4 deletions src/contacts/interfaces/create-contact-options.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ export interface CreateContactResponseSuccess extends Pick<Contact, 'id'> {
object: 'contact';
}

export interface CreateContactResponse {
data: CreateContactResponseSuccess | null;
error: ErrorResponse | null;
}
export type CreateContactResponse =
| {
data: CreateContactResponseSuccess;
error: null;
}
| {
data: null;
error: ErrorResponse;
};
13 changes: 9 additions & 4 deletions src/contacts/interfaces/get-contact.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ export interface GetContactResponseSuccess
object: 'contact';
}

export interface GetContactResponse {
data: GetContactResponseSuccess | null;
error: ErrorResponse | null;
}
export type GetContactResponse =
| {
data: GetContactResponseSuccess;
error: null;
}
| {
data: null;
error: ErrorResponse;
};
13 changes: 9 additions & 4 deletions src/contacts/interfaces/list-contacts.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ export interface ListContactsResponseSuccess {
data: Contact[];
}

export interface ListContactsResponse {
data: ListContactsResponseSuccess | null;
error: ErrorResponse | null;
}
export type ListContactsResponse =
| {
data: ListContactsResponseSuccess;
error: null;
}
| {
data: null;
error: ErrorResponse;
};
13 changes: 9 additions & 4 deletions src/contacts/interfaces/remove-contact.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ export interface RemoveContactOptions extends RemoveByOptions {
audienceId: string;
}

export interface RemoveContactsResponse {
data: RemoveContactsResponseSuccess | null;
error: ErrorResponse | null;
}
export type RemoveContactsResponse =
| {
data: RemoveContactsResponseSuccess;
error: null;
}
| {
data: null;
error: ErrorResponse;
};
13 changes: 9 additions & 4 deletions src/contacts/interfaces/update-contact.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ export type UpdateContactResponseSuccess = Pick<Contact, 'id'> & {
object: 'contact';
};

export interface UpdateContactResponse {
data: UpdateContactResponseSuccess | null;
error: ErrorResponse | null;
}
export type UpdateContactResponse =
| {
data: UpdateContactResponseSuccess;
error: null;
}
| {
data: null;
error: ErrorResponse;
};
13 changes: 9 additions & 4 deletions src/domains/interfaces/create-domain-options.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ export interface CreateDomainResponseSuccess
records: DomainRecords[];
}

export interface CreateDomainResponse {
data: CreateDomainResponseSuccess | null;
error: ErrorResponse | null;
}
export type CreateDomainResponse =
| {
data: CreateDomainResponseSuccess;
error: null;
}
| {
data: null;
error: ErrorResponse;
};
13 changes: 9 additions & 4 deletions src/domains/interfaces/get-domain.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ export interface GetDomainResponseSuccess
records: DomainRecords[];
}

export interface GetDomainResponse {
data: GetDomainResponseSuccess | null;
error: ErrorResponse | null;
}
export type GetDomainResponse =
| {
data: GetDomainResponseSuccess;
error: null;
}
| {
data: null;
error: ErrorResponse;
};
13 changes: 9 additions & 4 deletions src/domains/interfaces/list-domains.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ import type { Domain } from './domain';

export type ListDomainsResponseSuccess = { data: Domain[] };

export interface ListDomainsResponse {
data: ListDomainsResponseSuccess | null;
error: ErrorResponse | null;
}
export type ListDomainsResponse =
| {
data: ListDomainsResponseSuccess;
error: null;
}
| {
data: null;
error: ErrorResponse;
};
Loading