1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127 | import { checkGate } from './gate.js';
import * as http from './http.js';
/** GET /domains/registrations — List your domains (cursor-paginated). */
export const list = (client, query) => http.get(client, '/domains/registrations', { query });
/** Every registration, following cursor pagination. */
export const listAll = (client, query) => http.paginate(client, '/domains/registrations', 'registrations', { query });
/** POST /domains/registrations — Register a .ro domain (202; charges credits). */
export const register = async (client, body) => {
await checkGate(client, 'POST /domains/registrations', { domain: body.domain });
return http.post(client, '/domains/registrations', { body });
};
/** GET /domains/registrations/{id} — Get a domain. */
export const get = (client, id) => http.get(client, '/domains/registrations/{id}', { params: { id } });
/** POST /domains/registrations/{id}/renew — Renew a domain (202; charges credits). */
export const renew = async (client, id, body) => {
await checkGate(client, 'POST /domains/registrations/{id}/renew', { registrationId: id });
return http.post(client, '/domains/registrations/{id}/renew', { params: { id }, body });
};
/** PUT /domains/registrations/{id}/auto-renew — Toggle auto-renew. */
export const setAutoRenew = async (client, id, body) => {
await checkGate(client, 'PUT /domains/registrations/{id}/auto-renew', { registrationId: id });
return http.put(client, '/domains/registrations/{id}/auto-renew', { params: { id }, body });
};
/** PUT /domains/registrations/{id}/sensitive — Toggle the sensitive-domain protection. */
export const setSensitive = async (client, id, body) => {
await checkGate(client, 'PUT /domains/registrations/{id}/sensitive', { registrationId: id });
return http.put(client, '/domains/registrations/{id}/sensitive', { params: { id }, body });
};
/** PUT /domains/registrations/{id}/nameservers — Replace nameservers (202). */
export const setNameservers = async (client, id, body) => {
await checkGate(client, 'PUT /domains/registrations/{id}/nameservers', { registrationId: id });
return http.put(client, '/domains/registrations/{id}/nameservers', { params: { id }, body });
};
/** GET /domains/registrations/{id}/hosts — List the domain's hosts (glue records). */
export const listHosts = (client, id, query) => http.get(client, '/domains/registrations/{id}/hosts', { params: { id }, query });
/** POST /domains/registrations/{id}/hosts — Create a host (glue record, 202). */
export const createHost = async (client, id, body) => {
await checkGate(client, 'POST /domains/registrations/{id}/hosts', { registrationId: id });
return http.post(client, '/domains/registrations/{id}/hosts', { params: { id }, body });
};
/** PUT /domains/registrations/{id}/hosts/{host} — Replace a host's IPs (202). */
export const setHostIps = async (client, id, host, body) => {
await checkGate(client, 'PUT /domains/registrations/{id}/hosts/{host}', { registrationId: id });
return http.put(client, '/domains/registrations/{id}/hosts/{host}', { params: { id, host }, body });
};
/** DELETE /domains/registrations/{id}/hosts/{host} — Delete a host (glue record, 202). */
export const deleteHost = async (client, id, host, body) => {
await checkGate(client, 'DELETE /domains/registrations/{id}/hosts/{host}', { registrationId: id });
return http.del(client, '/domains/registrations/{id}/hosts/{host}', { params: { id, host }, body });
};
/** GET /domains/registrations/{id}/dsdata — List the domain's DS records. */
export const listDsData = (client, id, query) => http.get(client, '/domains/registrations/{id}/dsdata', { params: { id }, query });
/** POST /domains/registrations/{id}/dsdata — Publish a DS record (202). */
export const publishDsData = async (client, id, body) => {
await checkGate(client, 'POST /domains/registrations/{id}/dsdata', { registrationId: id });
return http.post(client, '/domains/registrations/{id}/dsdata', { params: { id }, body });
};
/** DELETE /domains/registrations/{id}/dsdata — Withdraw a DS record (202; carries a JSON body). */
export const withdrawDsData = async (client, id, body) => {
await checkGate(client, 'DELETE /domains/registrations/{id}/dsdata', { registrationId: id });
return http.del(client, '/domains/registrations/{id}/dsdata', { params: { id }, body });
};
/** POST /domains/registrations/{id}/transfer-out — Start moving a domain away. */
export const transferOut = async (client, id, body) => {
await checkGate(client, 'POST /domains/registrations/{id}/transfer-out', { registrationId: id });
return http.post(client, '/domains/registrations/{id}/transfer-out', { params: { id }, body });
};
/** PUT /domains/registrations/{id}/registrant — Update the registrant's contact details (202). */
export const updateRegistrant = async (client, id, body) => {
await checkGate(client, 'PUT /domains/registrations/{id}/registrant', { registrationId: id });
return http.put(client, '/domains/registrations/{id}/registrant', { params: { id }, body });
};
/** POST /domains/registrations/{id}/registrant-email/start — Start registrant-email ownership verification. */
export const startRegistrantEmailVerification = async (client, id) => {
await checkGate(client, 'POST /domains/registrations/{id}/registrant-email/start', { registrationId: id });
return http.post(client, '/domains/registrations/{id}/registrant-email/start', { params: { id } });
};
/** POST /domains/registrations/{id}/registrant-email/confirm — Confirm the registrant-email code. */
export const confirmRegistrantEmail = async (client, id, body) => {
await checkGate(client, 'POST /domains/registrations/{id}/registrant-email/confirm', { registrationId: id });
return http.post(client, '/domains/registrations/{id}/registrant-email/confirm', { params: { id }, body });
};
/** POST /domains/registrations/{id}/registrant-email/adopt — Adopt the registrant contact email (202). */
export const adoptRegistrantEmail = async (client, id, body) => {
await checkGate(client, 'POST /domains/registrations/{id}/registrant-email/adopt', { registrationId: id });
return http.post(client, '/domains/registrations/{id}/registrant-email/adopt', { params: { id }, body });
};
/** GET /domains/registrations/{id}/trade — Quote a registrant change (trade). */
export const quoteTrade = (client, id) => http.get(client, '/domains/registrations/{id}/trade', { params: { id } });
/** POST /domains/registrations/{id}/trade — Change a domain's registrant (trade, 202; charges credits). */
export const trade = async (client, id, body) => {
await checkGate(client, 'POST /domains/registrations/{id}/trade', { registrationId: id });
return http.post(client, '/domains/registrations/{id}/trade', { params: { id }, body });
};
/** POST /domains/transfers-in — Transfer a .ro domain to ird (202). */
export const transferIn = async (client, body) => {
await checkGate(client, 'POST /domains/transfers-in', { domain: body.domain });
return http.post(client, '/domains/transfers-in', { body });
};
/** POST /domains/trades-in — Trade a .ro domain into ird (become the holder, 202; charges credits). */
export const tradeIn = async (client, body) => {
await checkGate(client, 'POST /domains/trades-in', { domain: body.domain });
return http.post(client, '/domains/trades-in', { body });
};
/** POST /domains/adoptions — Adopt an ird-sponsored domain you already own. */
export const adopt = async (client, body) => {
await checkGate(client, 'POST /domains/adoptions', { domain: body.domain });
return http.post(client, '/domains/adoptions', { body });
};
/** GET /domains/actions — List your registry actions (cursor-paginated). */
export const listActions = (client, query) => http.get(client, '/domains/actions', { query });
/** Every registry action, following cursor pagination. */
export const listAllActions = (client, query) => http.paginate(client, '/domains/actions', 'actions', { query });
/** GET /domains/actions/{id} — Poll a registry action. */
export const getAction = (client, id) => http.get(client, '/domains/actions/{id}', { params: { id } });
/**
* POST /domains/actions/{id}/cancel — Cancel a queued action. Subject to the
* client's domain gate on the action's registration (resolved via
* `getAction` when a gate is set).
*/
export const cancelAction = async (client, id, body) => {
if (client.gate) {
const { action } = await getAction(client, id);
await checkGate(client, 'POST /domains/actions/{id}/cancel', { registrationId: action?.registration_id });
}
return http.post(client, '/domains/actions/{id}/cancel', { params: { id }, body });
};
|