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 CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

### Removed

- Removed deprecated `getDomainPremiumPrice`. Use `getDomainPrices` instead. (dnsimple/dnsimple-developer#916)
- Removed `ZoneRecordType` and `TemplateRecordType` type enumerations
- Removed deprecated `getWhoisPrivacy` (dnsimple/dnsimple-developer#919)
- Removed deprecated `renewWhoisPrivacy` (dnsimple/dnsimple-developer#919)
Expand Down
31 changes: 0 additions & 31 deletions lib/registrar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,37 +31,6 @@ export class Registrar {
return method;
})();

/**
* Deprecated in favor of getDomainPrices.
*
* Retrieves the premium price for a premium domain.
*
* Please note that a premium price can be different for registration, renewal, transfer. By default this endpoint returns the premium price for registration. If you need to check a different price, you should specify it with the action param.
*
* GET /{account}/registrar/domains/{domain}/premium_price
*
* @see https://developer.dnsimple.com/v2/registrar/#getDomainPremiumPrice
*
* @param account The account id
* @param domain The domain name or id
* @param params Query parameters
* @param params.action Optional action between "registration", "renewal", and "transfer". If omitted, it defaults to "registration".
*/
getDomainPremiumPrice = (() => {
const method = (
account: number,
domain: string,
params: QueryParams & { action?: string } = {}
): Promise<{ data: types.DomainPremiumPrice }> =>
this._client.request(
"GET",
`/${account}/registrar/domains/${domain}/premium_price`,
null,
params
);
return method;
})();

/**
* Retrieve domain prices.
*
Expand Down
2 changes: 0 additions & 2 deletions lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,6 @@ export type DomainCheckResult = {
premium: boolean;
};

export type DomainPremiumPrice = { premium_price: string; action: string };

export type DomainPrices = {
domain: string;
premium: boolean;
Expand Down

This file was deleted.

This file was deleted.

20 changes: 0 additions & 20 deletions test/fixtures.http/checkDomainPremiumPrice/success.http

This file was deleted.

15 changes: 0 additions & 15 deletions test/fixtures.http/getDomainPremiumPrice/failure.http

This file was deleted.

20 changes: 0 additions & 20 deletions test/fixtures.http/getDomainPremiumPrice/success.http

This file was deleted.

42 changes: 0 additions & 42 deletions test/registrar.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,48 +29,6 @@ describe("registrar", () => {
});
});

describe("#getDomainPremiumPrice", () => {
describe("when the domain has a premium price", () => {
const domainId = "ruby.codes";

it("produces a premium price result", async () => {
fetchMock.get(
"https://api.dnsimple.com/v2/1010/registrar/domains/ruby.codes/premium_price",
responseFromFixture("getDomainPremiumPrice/success.http")
);

const response = await dnsimple.registrar.getDomainPremiumPrice(
accountId,
domainId
);

const premiumPriceResult = response.data;
expect(premiumPriceResult.premium_price).toEqual("109.00");
expect(premiumPriceResult.action).toEqual("registration");
});
});

describe("when the domain is not a premium domain", () => {
const domainId = "example.com";

it("produces an error", async () => {
fetchMock.get(
"https://api.dnsimple.com/v2/1010/registrar/domains/example.com/premium_price",
responseFromFixture("getDomainPremiumPrice/failure.http")
);

try {
await dnsimple.registrar.getDomainPremiumPrice(accountId, domainId);
} catch (error) {
expect(error).toBeInstanceOf(ClientError);
expect(error.data.message).toBe(
"`example.com` is not a premium domain for registration"
);
}
});
});
});

describe("#getDomainPrices", () => {
describe("when the TLD is supported", () => {
it("produces a domain prices result", async () => {
Expand Down