Skip to content
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

Add support for registrant APIs #181

Merged
9 commits merged into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## main

## 7.1.2 (Unreleased)

FEATURES:

- NEW: Added `Registrar.createRegistrantChange` to start a registrant change. (dnsimple/dnsimple-node#181)

## 7.1.1

FEATURES:
Expand Down
30 changes: 30 additions & 0 deletions lib/registrar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -592,4 +592,34 @@ export class Registrar {
);
return method;
})();

/**
* Starts a registrant change.
*
* POST /{account}/registrar/registrant_changes
*
* @see https://developer.dnsimple.com/v2/registrar/#createRegistrantChange
*
* @param account The account id
* @param change The change details
* @param params Query parameters
*/
createRegistrantChange = (() => {
const method = (
account: number,
change: {
domain_id: string;
contact_id: string;
extended_attributes: Record<string, string>;
},
params: QueryParams & {} = {}
): Promise<{ data: types.RegistrantChange }> =>
this._client.request(
"POST",
`/${account}/registrar/registrant_changes`,
change,
params
);
return method;
})();
}
14 changes: 14 additions & 0 deletions lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,20 @@ export type WhoisPrivacyRenewal = {
updated_at: string;
};

export type RegistrantChange = {
id: number;
type: number;
account_id: number;
contact_id: number;
domain_id: number;
state: string;
extended_attributes: Record<string, string>;
registry_owner_change: boolean;
irt_lock_lifted_by: string;
created_at: string;
updated_at: string;
};

export type PrimaryServer = {
id: number;
account_id: number;
Expand Down