ts / dist / cjs / registrations.js
1,365 words
  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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.cancelAction = exports.getAction = exports.listAllActions = exports.listActions = exports.adopt = exports.tradeIn = exports.transferIn = exports.trade = exports.quoteTrade = exports.adoptRegistrantEmail = exports.confirmRegistrantEmail = exports.startRegistrantEmailVerification = exports.updateRegistrant = exports.transferOut = exports.withdrawDsData = exports.publishDsData = exports.listDsData = exports.deleteHost = exports.setHostIps = exports.createHost = exports.listHosts = exports.setNameservers = exports.setSensitive = exports.setAutoRenew = exports.renew = exports.get = exports.register = exports.listAll = exports.list = void 0;
const gate_js_1 = require("./gate.js");
const http = __importStar(require("./http.js"));
/** GET /domains/registrations — List your domains (cursor-paginated). */
const list = (client, query) => http.get(client, '/domains/registrations', { query });
exports.list = list;
/** Every registration, following cursor pagination. */
const listAll = (client, query) => http.paginate(client, '/domains/registrations', 'registrations', { query });
exports.listAll = listAll;
/** POST /domains/registrations — Register a .ro domain (202; charges credits). */
const register = async (client, body) => {
    await (0, gate_js_1.checkGate)(client, 'POST /domains/registrations', { domain: body.domain });
    return http.post(client, '/domains/registrations', { body });
};
exports.register = register;
/** GET /domains/registrations/{id} — Get a domain. */
const get = (client, id) => http.get(client, '/domains/registrations/{id}', { params: { id } });
exports.get = get;
/** POST /domains/registrations/{id}/renew — Renew a domain (202; charges credits). */
const renew = async (client, id, body) => {
    await (0, gate_js_1.checkGate)(client, 'POST /domains/registrations/{id}/renew', { registrationId: id });
    return http.post(client, '/domains/registrations/{id}/renew', { params: { id }, body });
};
exports.renew = renew;
/** PUT /domains/registrations/{id}/auto-renew — Toggle auto-renew. */
const setAutoRenew = async (client, id, body) => {
    await (0, gate_js_1.checkGate)(client, 'PUT /domains/registrations/{id}/auto-renew', { registrationId: id });
    return http.put(client, '/domains/registrations/{id}/auto-renew', { params: { id }, body });
};
exports.setAutoRenew = setAutoRenew;
/** PUT /domains/registrations/{id}/sensitive — Toggle the sensitive-domain protection. */
const setSensitive = async (client, id, body) => {
    await (0, gate_js_1.checkGate)(client, 'PUT /domains/registrations/{id}/sensitive', { registrationId: id });
    return http.put(client, '/domains/registrations/{id}/sensitive', { params: { id }, body });
};
exports.setSensitive = setSensitive;
/** PUT /domains/registrations/{id}/nameservers — Replace nameservers (202). */
const setNameservers = async (client, id, body) => {
    await (0, gate_js_1.checkGate)(client, 'PUT /domains/registrations/{id}/nameservers', { registrationId: id });
    return http.put(client, '/domains/registrations/{id}/nameservers', { params: { id }, body });
};
exports.setNameservers = setNameservers;
/** GET /domains/registrations/{id}/hosts — List the domain's hosts (glue records). */
const listHosts = (client, id, query) => http.get(client, '/domains/registrations/{id}/hosts', { params: { id }, query });
exports.listHosts = listHosts;
/** POST /domains/registrations/{id}/hosts — Create a host (glue record, 202). */
const createHost = async (client, id, body) => {
    await (0, gate_js_1.checkGate)(client, 'POST /domains/registrations/{id}/hosts', { registrationId: id });
    return http.post(client, '/domains/registrations/{id}/hosts', { params: { id }, body });
};
exports.createHost = createHost;
/** PUT /domains/registrations/{id}/hosts/{host} — Replace a host's IPs (202). */
const setHostIps = async (client, id, host, body) => {
    await (0, gate_js_1.checkGate)(client, 'PUT /domains/registrations/{id}/hosts/{host}', { registrationId: id });
    return http.put(client, '/domains/registrations/{id}/hosts/{host}', { params: { id, host }, body });
};
exports.setHostIps = setHostIps;
/** DELETE /domains/registrations/{id}/hosts/{host} — Delete a host (glue record, 202). */
const deleteHost = async (client, id, host, body) => {
    await (0, gate_js_1.checkGate)(client, 'DELETE /domains/registrations/{id}/hosts/{host}', { registrationId: id });
    return http.del(client, '/domains/registrations/{id}/hosts/{host}', { params: { id, host }, body });
};
exports.deleteHost = deleteHost;
/** GET /domains/registrations/{id}/dsdata — List the domain's DS records. */
const listDsData = (client, id, query) => http.get(client, '/domains/registrations/{id}/dsdata', { params: { id }, query });
exports.listDsData = listDsData;
/** POST /domains/registrations/{id}/dsdata — Publish a DS record (202). */
const publishDsData = async (client, id, body) => {
    await (0, gate_js_1.checkGate)(client, 'POST /domains/registrations/{id}/dsdata', { registrationId: id });
    return http.post(client, '/domains/registrations/{id}/dsdata', { params: { id }, body });
};
exports.publishDsData = publishDsData;
/** DELETE /domains/registrations/{id}/dsdata — Withdraw a DS record (202; carries a JSON body). */
const withdrawDsData = async (client, id, body) => {
    await (0, gate_js_1.checkGate)(client, 'DELETE /domains/registrations/{id}/dsdata', { registrationId: id });
    return http.del(client, '/domains/registrations/{id}/dsdata', { params: { id }, body });
};
exports.withdrawDsData = withdrawDsData;
/** POST /domains/registrations/{id}/transfer-out — Start moving a domain away. */
const transferOut = async (client, id, body) => {
    await (0, gate_js_1.checkGate)(client, 'POST /domains/registrations/{id}/transfer-out', { registrationId: id });
    return http.post(client, '/domains/registrations/{id}/transfer-out', { params: { id }, body });
};
exports.transferOut = transferOut;
/** PUT /domains/registrations/{id}/registrant — Update the registrant's contact details (202). */
const updateRegistrant = async (client, id, body) => {
    await (0, gate_js_1.checkGate)(client, 'PUT /domains/registrations/{id}/registrant', { registrationId: id });
    return http.put(client, '/domains/registrations/{id}/registrant', { params: { id }, body });
};
exports.updateRegistrant = updateRegistrant;
/** POST /domains/registrations/{id}/registrant-email/start — Start registrant-email ownership verification. */
const startRegistrantEmailVerification = async (client, id) => {
    await (0, gate_js_1.checkGate)(client, 'POST /domains/registrations/{id}/registrant-email/start', { registrationId: id });
    return http.post(client, '/domains/registrations/{id}/registrant-email/start', { params: { id } });
};
exports.startRegistrantEmailVerification = startRegistrantEmailVerification;
/** POST /domains/registrations/{id}/registrant-email/confirm — Confirm the registrant-email code. */
const confirmRegistrantEmail = async (client, id, body) => {
    await (0, gate_js_1.checkGate)(client, 'POST /domains/registrations/{id}/registrant-email/confirm', { registrationId: id });
    return http.post(client, '/domains/registrations/{id}/registrant-email/confirm', { params: { id }, body });
};
exports.confirmRegistrantEmail = confirmRegistrantEmail;
/** POST /domains/registrations/{id}/registrant-email/adopt — Adopt the registrant contact email (202). */
const adoptRegistrantEmail = async (client, id, body) => {
    await (0, gate_js_1.checkGate)(client, 'POST /domains/registrations/{id}/registrant-email/adopt', { registrationId: id });
    return http.post(client, '/domains/registrations/{id}/registrant-email/adopt', { params: { id }, body });
};
exports.adoptRegistrantEmail = adoptRegistrantEmail;
/** GET /domains/registrations/{id}/trade — Quote a registrant change (trade). */
const quoteTrade = (client, id) => http.get(client, '/domains/registrations/{id}/trade', { params: { id } });
exports.quoteTrade = quoteTrade;
/** POST /domains/registrations/{id}/trade — Change a domain's registrant (trade, 202; charges credits). */
const trade = async (client, id, body) => {
    await (0, gate_js_1.checkGate)(client, 'POST /domains/registrations/{id}/trade', { registrationId: id });
    return http.post(client, '/domains/registrations/{id}/trade', { params: { id }, body });
};
exports.trade = trade;
/** POST /domains/transfers-in — Transfer a .ro domain to ird (202). */
const transferIn = async (client, body) => {
    await (0, gate_js_1.checkGate)(client, 'POST /domains/transfers-in', { domain: body.domain });
    return http.post(client, '/domains/transfers-in', { body });
};
exports.transferIn = transferIn;
/** POST /domains/trades-in — Trade a .ro domain into ird (become the holder, 202; charges credits). */
const tradeIn = async (client, body) => {
    await (0, gate_js_1.checkGate)(client, 'POST /domains/trades-in', { domain: body.domain });
    return http.post(client, '/domains/trades-in', { body });
};
exports.tradeIn = tradeIn;
/** POST /domains/adoptions — Adopt an ird-sponsored domain you already own. */
const adopt = async (client, body) => {
    await (0, gate_js_1.checkGate)(client, 'POST /domains/adoptions', { domain: body.domain });
    return http.post(client, '/domains/adoptions', { body });
};
exports.adopt = adopt;
/** GET /domains/actions — List your registry actions (cursor-paginated). */
const listActions = (client, query) => http.get(client, '/domains/actions', { query });
exports.listActions = listActions;
/** Every registry action, following cursor pagination. */
const listAllActions = (client, query) => http.paginate(client, '/domains/actions', 'actions', { query });
exports.listAllActions = listAllActions;
/** GET /domains/actions/{id} — Poll a registry action. */
const getAction = (client, id) => http.get(client, '/domains/actions/{id}', { params: { id } });
exports.getAction = getAction;
/**
 * 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).
 */
const cancelAction = async (client, id, body) => {
    if (client.gate) {
        const { action } = await (0, exports.getAction)(client, id);
        await (0, gate_js_1.checkGate)(client, 'POST /domains/actions/{id}/cancel', { registrationId: action?.registration_id });
    }
    return http.post(client, '/domains/actions/{id}/cancel', { params: { id }, body });
};
exports.cancelAction = cancelAction;

static mirror of HEAD · about · clone: git clone https://ird.cod-sursa.ro/ts.git