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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,4 @@ Everyone interacting in the Mailtrap project's codebases, issue trackers, chat r
## Compatibility with previous releases

Versions of this package up to 2.0.2 were an [unofficial client](https://github.com/vchin/mailtrap-client) developed by [@vchin](https://github.com/vchin). Package version 3 is a completely new package.

4 changes: 2 additions & 2 deletions src/__tests__/lib/api/resources/ContactLists.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import AxiosMockAdapter from "axios-mock-adapter";
import ContactListsApi from "../../../../lib/api/resources/ContactLists";
import handleSendingError from "../../../../lib/axios-logger";
import MailtrapError from "../../../../lib/MailtrapError";
import { ContactList, ContactLists } from "../../../../types/api/contactlist";
import { ContactList } from "../../../../types/api/contactlist";

import CONFIG from "../../../../config";

Expand Down Expand Up @@ -61,7 +61,7 @@ describe("lib/api/resources/ContactLists: ", () => {
describe("getAll(): ", () => {
it("successfully gets all contact lists.", async () => {
const endpoint = `${GENERAL_ENDPOINT}/api/accounts/${accountId}/contacts/lists`;
const expectedResponseData: ContactLists = [
const expectedResponseData: ContactList[] = [
{ id: 1, name: "Test List 1" },
{ id: 2, name: "Test List 2" },
];
Expand Down
3 changes: 1 addition & 2 deletions src/lib/api/resources/ContactLists.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import CONFIG from "../../../config";
import {
ContactList,
ContactListOptions,
ContactLists,
} from "../../../types/api/contactlist";

const { CLIENT_SETTINGS } = CONFIG;
Expand All @@ -26,7 +25,7 @@ export default class ContactListsApi {
public async getList() {
const url = `${this.contactListsURL}`;

return this.client.get<ContactLists, ContactLists>(url);
return this.client.get<ContactList[], ContactList[]>(url);
}

/**
Expand Down
2 changes: 0 additions & 2 deletions src/types/api/contactlist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ export interface ContactList {
name: string;
}

export type ContactLists = ContactList[];

export interface ContactListOptions {
name: string;
}
2 changes: 0 additions & 2 deletions src/types/api/templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,3 @@ export interface TemplateUpdateParams {
body_html?: string;
body_text?: string;
}

export type TemplateList = Template[];