@sapiom/tools 0.11.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +4 -3
  3. package/dist/cjs/_client/capability-call.d.ts +58 -0
  4. package/dist/cjs/_client/capability-call.d.ts.map +1 -0
  5. package/dist/cjs/_client/capability-call.js +68 -0
  6. package/dist/cjs/_client/capability-call.js.map +1 -0
  7. package/dist/cjs/_client/index.d.ts +1 -0
  8. package/dist/cjs/_client/index.d.ts.map +1 -1
  9. package/dist/cjs/_client/index.js +4 -1
  10. package/dist/cjs/_client/index.js.map +1 -1
  11. package/dist/cjs/client.d.ts +33 -0
  12. package/dist/cjs/client.d.ts.map +1 -1
  13. package/dist/cjs/client.js +16 -0
  14. package/dist/cjs/client.js.map +1 -1
  15. package/dist/cjs/content-generation/index.d.ts +6 -0
  16. package/dist/cjs/content-generation/index.d.ts.map +1 -1
  17. package/dist/cjs/content-generation/index.js +32 -20
  18. package/dist/cjs/content-generation/index.js.map +1 -1
  19. package/dist/cjs/domains/errors.d.ts +16 -0
  20. package/dist/cjs/domains/errors.d.ts.map +1 -0
  21. package/dist/cjs/domains/errors.js +36 -0
  22. package/dist/cjs/domains/errors.js.map +1 -0
  23. package/dist/cjs/domains/index.d.ts +297 -0
  24. package/dist/cjs/domains/index.d.ts.map +1 -0
  25. package/dist/cjs/domains/index.js +348 -0
  26. package/dist/cjs/domains/index.js.map +1 -0
  27. package/dist/cjs/index.d.ts +2 -0
  28. package/dist/cjs/index.d.ts.map +1 -1
  29. package/dist/cjs/index.js +4 -1
  30. package/dist/cjs/index.js.map +1 -1
  31. package/dist/cjs/search/index.d.ts +6 -1
  32. package/dist/cjs/search/index.d.ts.map +1 -1
  33. package/dist/cjs/search/index.js +89 -90
  34. package/dist/cjs/search/index.js.map +1 -1
  35. package/dist/cjs/stub/index.d.ts.map +1 -1
  36. package/dist/cjs/stub/index.js +72 -0
  37. package/dist/cjs/stub/index.js.map +1 -1
  38. package/dist/esm/_client/capability-call.d.ts +58 -0
  39. package/dist/esm/_client/capability-call.d.ts.map +1 -0
  40. package/dist/esm/_client/capability-call.js +64 -0
  41. package/dist/esm/_client/capability-call.js.map +1 -0
  42. package/dist/esm/_client/index.d.ts +1 -0
  43. package/dist/esm/_client/index.d.ts.map +1 -1
  44. package/dist/esm/_client/index.js +1 -0
  45. package/dist/esm/_client/index.js.map +1 -1
  46. package/dist/esm/client.d.ts +33 -0
  47. package/dist/esm/client.d.ts.map +1 -1
  48. package/dist/esm/client.js +16 -0
  49. package/dist/esm/client.js.map +1 -1
  50. package/dist/esm/content-generation/index.d.ts +6 -0
  51. package/dist/esm/content-generation/index.d.ts.map +1 -1
  52. package/dist/esm/content-generation/index.js +33 -21
  53. package/dist/esm/content-generation/index.js.map +1 -1
  54. package/dist/esm/domains/errors.d.ts +16 -0
  55. package/dist/esm/domains/errors.d.ts.map +1 -0
  56. package/dist/esm/domains/errors.js +31 -0
  57. package/dist/esm/domains/errors.js.map +1 -0
  58. package/dist/esm/domains/index.d.ts +297 -0
  59. package/dist/esm/domains/index.d.ts.map +1 -0
  60. package/dist/esm/domains/index.js +335 -0
  61. package/dist/esm/domains/index.js.map +1 -0
  62. package/dist/esm/index.d.ts +2 -0
  63. package/dist/esm/index.d.ts.map +1 -1
  64. package/dist/esm/index.js +2 -0
  65. package/dist/esm/index.js.map +1 -1
  66. package/dist/esm/search/index.d.ts +6 -1
  67. package/dist/esm/search/index.d.ts.map +1 -1
  68. package/dist/esm/search/index.js +91 -92
  69. package/dist/esm/search/index.js.map +1 -1
  70. package/dist/esm/stub/index.d.ts.map +1 -1
  71. package/dist/esm/stub/index.js +72 -0
  72. package/dist/esm/stub/index.js.map +1 -1
  73. package/dist/tsconfig.cjs.tsbuildinfo +1 -1
  74. package/dist/tsconfig.esm.tsbuildinfo +1 -1
  75. package/package.json +6 -1
  76. package/src/domains/README.md +76 -0
@@ -0,0 +1,297 @@
1
+ /**
2
+ * `domains` capability — register domain names and manage their DNS. Check what's
3
+ * available and its price, buy a domain for a year, renew it, list and inspect the
4
+ * domains you own, and start a transfer out. A nested `dns` group creates, reads,
5
+ * updates, and deletes DNS records on a domain you own.
6
+ *
7
+ * import { domains } from "@sapiom/tools"; // ambient auth
8
+ *
9
+ * const [candidate] = await domains.check({ domainNames: ["my-app.dev"] });
10
+ * if (candidate.available) {
11
+ * await domains.register({ domainName: "my-app.dev" }); // charges apply
12
+ * await domains.dns.create({
13
+ * domainName: "my-app.dev",
14
+ * type: "A",
15
+ * host: "", // "" = the root domain
16
+ * value: "203.0.113.10",
17
+ * });
18
+ * }
19
+ *
20
+ * Or via an explicit client: `createClient({ apiKey }).domains.register(...)`.
21
+ *
22
+ * Operations are grouped:
23
+ * - top-level — check / register / renew / list / get / transferOut
24
+ * - `dns` — create / list / get / update / delete DNS records
25
+ *
26
+ * `register` and `renew` charge on success. Failed requests throw
27
+ * {@link DomainsHttpError} (carries `status` + parsed `body`).
28
+ */
29
+ import { Transport } from "../_client/index.js";
30
+ import { DomainsHttpError } from "./errors.js";
31
+ export { DomainsHttpError };
32
+ /** A DNS record type. */
33
+ export type DnsRecordType = "A" | "AAAA" | "ANAME" | "CNAME" | "MX" | "TXT" | "SRV" | "NS";
34
+ export interface CheckInput {
35
+ /** Domain names to check (1–50), e.g. `["my-app.dev", "my-app.io"]`. */
36
+ domainNames: string[];
37
+ }
38
+ /** Availability and pricing for a single domain name. */
39
+ export interface DomainAvailability {
40
+ /** The domain name that was checked. */
41
+ domainName: string;
42
+ /** Whether the domain is available to register. */
43
+ available: boolean;
44
+ /** First-year price as a decimal string (e.g. "12.99"), when available. */
45
+ purchasePrice?: string;
46
+ /** Yearly renewal price as a decimal string, when available. */
47
+ renewalPrice?: string;
48
+ /** Whether this is a premium (higher-priced) domain. */
49
+ premium?: boolean;
50
+ }
51
+ export interface DomainNameInput {
52
+ /** The domain name, e.g. "my-app.dev". */
53
+ domainName: string;
54
+ }
55
+ /** A domain. Which fields are populated depends on the call (see each method). */
56
+ export interface Domain {
57
+ /** The domain name. */
58
+ domainName: string;
59
+ /** Lifecycle status (e.g. "active", "transferring_out"). */
60
+ status?: string;
61
+ /** ISO-8601 timestamp when the registration expires. */
62
+ expiresAt?: string;
63
+ /** ISO-8601 timestamp when the domain was registered. */
64
+ registeredAt?: string;
65
+ /** First-year price paid, as a decimal string. */
66
+ purchasePrice?: string;
67
+ /** Yearly renewal price, as a decimal string. */
68
+ renewalPrice?: string;
69
+ /** The nameservers set on the domain. */
70
+ nameservers?: string[];
71
+ /** Whether the domain is registrar-locked against transfers. */
72
+ locked?: boolean;
73
+ /** Whether this is a premium domain. */
74
+ premium?: boolean;
75
+ /** The top-level domain (e.g. "dev", "com"). */
76
+ tld?: string;
77
+ /** ISO-8601 timestamp from which the domain becomes eligible to transfer out, or `null` if already eligible. */
78
+ transferEligibleAt?: string | null;
79
+ }
80
+ /** The result of starting a transfer out — includes the auth code for the new registrar. */
81
+ export interface DomainTransfer {
82
+ /** The domain name being transferred. */
83
+ domainName: string;
84
+ /** Authorization code to give the receiving registrar to complete the transfer. */
85
+ authCode?: string;
86
+ /** Human-readable instructions for completing the transfer. */
87
+ transferInstructions?: string;
88
+ }
89
+ export interface CreateDnsRecordInput {
90
+ /** The domain to add the record to. */
91
+ domainName: string;
92
+ /** Record type. */
93
+ type: DnsRecordType;
94
+ /** Host — `""` for the root domain (@), or a subdomain like "www" or "api". */
95
+ host: string;
96
+ /** Record value — an IP for A/AAAA, a hostname for CNAME/MX, text for TXT, etc. */
97
+ value: string;
98
+ /** Time-to-live in seconds (minimum 300; defaults to 300). */
99
+ ttl?: number;
100
+ /** Priority — required for MX, optional for others. */
101
+ priority?: number;
102
+ }
103
+ export interface UpdateDnsRecordInput {
104
+ /** The domain the record belongs to. */
105
+ domainName: string;
106
+ /** The record to update. */
107
+ recordId: string;
108
+ /** New record type. */
109
+ type?: DnsRecordType;
110
+ /** New host. */
111
+ host?: string;
112
+ /** New value. */
113
+ value?: string;
114
+ /** New TTL in seconds (minimum 300). */
115
+ ttl?: number;
116
+ /** New priority. */
117
+ priority?: number;
118
+ }
119
+ export interface DnsRecordRef {
120
+ /** The domain the record belongs to. */
121
+ domainName: string;
122
+ /** The record identifier. */
123
+ recordId: string;
124
+ }
125
+ /** A DNS record on a domain you own. */
126
+ export interface DnsRecord {
127
+ /** The record identifier — pass to `dns.get` / `dns.update` / `dns.delete`. */
128
+ recordId: string;
129
+ /** The domain the record belongs to. */
130
+ domainName: string;
131
+ /** Record type. */
132
+ type: DnsRecordType;
133
+ /** Host — `""` for the root domain. */
134
+ host: string;
135
+ /** Fully-qualified name of the record (host + domain). */
136
+ fqdn?: string;
137
+ /** Record value. */
138
+ value: string;
139
+ /** Time-to-live in seconds. */
140
+ ttl: number;
141
+ /** Priority, when set (MX/SRV). */
142
+ priority?: number;
143
+ /** ISO-8601 timestamp when the record was created. */
144
+ createdAt?: string;
145
+ }
146
+ /**
147
+ * Check whether one or more domain names are available and get their price. Free.
148
+ * Use this first, in a workflow step that turns an idea into candidate names,
149
+ * before deciding what to `register`.
150
+ *
151
+ * @param input - `{ domainNames }` — 1 to 50 names to check.
152
+ * @returns One availability result per name (with pricing when available).
153
+ * @throws {DomainsHttpError} on a non-2xx response.
154
+ *
155
+ * @example
156
+ * const results = await domains.check({ domainNames: ["my-app.dev", "my-app.io"] });
157
+ * const buyable = results.filter((r) => r.available);
158
+ */
159
+ export declare function check(input: CheckInput, transport?: Transport, baseUrl?: string): Promise<DomainAvailability[]>;
160
+ /**
161
+ * Register (buy) a domain for one year. Charges apply on success and the purchase
162
+ * is not reversible. Use in a workflow step to acquire a brand's domain before
163
+ * configuring DNS or email for it; confirm availability and price with `check`
164
+ * first.
165
+ *
166
+ * @param input - `{ domainName }` — the domain to register.
167
+ * @returns The newly registered domain.
168
+ * @throws {DomainsHttpError} on a non-2xx response (e.g. already registered, or a price change).
169
+ *
170
+ * @example
171
+ * const domain = await domains.register({ domainName: "my-app.dev" });
172
+ */
173
+ export declare function register(input: DomainNameInput, transport?: Transport, baseUrl?: string): Promise<Domain>;
174
+ /**
175
+ * Renew a domain you own for one more year. Charges apply on success. Use in a
176
+ * workflow step that keeps a domain from expiring; read the renewal price from
177
+ * `get` first if you want to check it.
178
+ *
179
+ * @param input - `{ domainName }` — the domain to renew.
180
+ * @returns The domain with its updated expiry.
181
+ * @throws {DomainsHttpError} on a non-2xx response (e.g. not owned, or a price change).
182
+ *
183
+ * @example
184
+ * const domain = await domains.renew({ domainName: "my-app.dev" });
185
+ */
186
+ export declare function renew(input: DomainNameInput, transport?: Transport, baseUrl?: string): Promise<Domain>;
187
+ /**
188
+ * List the domains you own. Free. Use in a workflow step to discover or iterate
189
+ * over the domains available to configure.
190
+ *
191
+ * @returns Your domains, each with status, expiry, and renewal price.
192
+ * @throws {DomainsHttpError} on a non-2xx response.
193
+ *
194
+ * @example
195
+ * const owned = await domains.list();
196
+ */
197
+ export declare function list(transport?: Transport, baseUrl?: string): Promise<Domain[]>;
198
+ /**
199
+ * Get full details for a domain you own — nameservers, lock status, renewal price,
200
+ * and transfer eligibility. Free. Use in a workflow step before changing DNS or
201
+ * starting a transfer, when you need the domain's current state.
202
+ *
203
+ * @param input - `{ domainName }` — the domain to look up.
204
+ * @returns The domain's details.
205
+ * @throws {DomainsHttpError} on a non-2xx response (e.g. not owned).
206
+ *
207
+ * @example
208
+ * const detail = await domains.get({ domainName: "my-app.dev" });
209
+ */
210
+ export declare function get(input: DomainNameInput, transport?: Transport, baseUrl?: string): Promise<Domain>;
211
+ /**
212
+ * Start transferring a domain you own out to another registrar. Returns an auth
213
+ * code to hand the receiving registrar. Disruptive — this unlocks the domain and
214
+ * begins the transfer; use in a workflow step only when you intend to move the
215
+ * domain away.
216
+ *
217
+ * @param input - `{ domainName }` — the domain to transfer out.
218
+ * @returns The auth code and transfer instructions.
219
+ * @throws {DomainsHttpError} on a non-2xx response (e.g. not owned, or still transfer-locked).
220
+ *
221
+ * @example
222
+ * const { authCode } = await domains.transferOut({ domainName: "my-app.dev" });
223
+ */
224
+ export declare function transferOut(input: DomainNameInput, transport?: Transport, baseUrl?: string): Promise<DomainTransfer>;
225
+ /**
226
+ * Create a DNS record on a domain you own. Free. Use in a workflow step to point a
227
+ * domain at a host (A/AAAA/CNAME), route its email (MX), or add verification text
228
+ * (TXT). Use `host: ""` for the root domain, or a subdomain like "www".
229
+ *
230
+ * @param input - `{ domainName, type, host, value, ttl?, priority? }`.
231
+ * @returns The created record (with its `recordId`).
232
+ * @throws {DomainsHttpError} on a non-2xx response.
233
+ *
234
+ * @example
235
+ * const record = await domains.dns.create({
236
+ * domainName: "my-app.dev",
237
+ * type: "A",
238
+ * host: "",
239
+ * value: "203.0.113.10",
240
+ * });
241
+ */
242
+ export declare function createDnsRecord(input: CreateDnsRecordInput, transport?: Transport, baseUrl?: string): Promise<DnsRecord>;
243
+ /**
244
+ * List the DNS records on a domain you own. Free. Use in a workflow step to read
245
+ * the current records (e.g. to find a `recordId` to update or delete).
246
+ *
247
+ * @param input - `{ domainName }` — the domain whose records to list.
248
+ * @returns The domain's DNS records.
249
+ * @throws {DomainsHttpError} on a non-2xx response.
250
+ *
251
+ * @example
252
+ * const records = await domains.dns.list({ domainName: "my-app.dev" });
253
+ */
254
+ export declare function listDnsRecords(input: DomainNameInput, transport?: Transport, baseUrl?: string): Promise<DnsRecord[]>;
255
+ /**
256
+ * Get a single DNS record on a domain you own. Free. Use in a workflow step when
257
+ * you have a `recordId` and need the record's current values.
258
+ *
259
+ * @param input - `{ domainName, recordId }`.
260
+ * @returns The DNS record.
261
+ * @throws {DomainsHttpError} on a non-2xx response (e.g. record not found).
262
+ *
263
+ * @example
264
+ * const record = await domains.dns.get({ domainName: "my-app.dev", recordId });
265
+ */
266
+ export declare function getDnsRecord(input: DnsRecordRef, transport?: Transport, baseUrl?: string): Promise<DnsRecord>;
267
+ /**
268
+ * Update a DNS record on a domain you own. Free. Provide only the fields you want
269
+ * to change. Use in a workflow step to repoint a record (e.g. change an A record's
270
+ * IP) without recreating it.
271
+ *
272
+ * @param input - `{ domainName, recordId, type?, host?, value?, ttl?, priority? }`.
273
+ * @returns The updated record.
274
+ * @throws {DomainsHttpError} on a non-2xx response.
275
+ *
276
+ * @example
277
+ * const updated = await domains.dns.update({
278
+ * domainName: "my-app.dev",
279
+ * recordId,
280
+ * value: "198.51.100.7",
281
+ * });
282
+ */
283
+ export declare function updateDnsRecord(input: UpdateDnsRecordInput, transport?: Transport, baseUrl?: string): Promise<DnsRecord>;
284
+ /**
285
+ * Delete a DNS record from a domain you own. Free. Use in a workflow step to
286
+ * remove a record you no longer need.
287
+ *
288
+ * @param input - `{ domainName, recordId }`.
289
+ * @returns Nothing.
290
+ * @throws {DomainsHttpError} on a non-2xx response.
291
+ *
292
+ * @example
293
+ * await domains.dns.delete({ domainName: "my-app.dev", recordId });
294
+ */
295
+ declare function deleteDnsRecord(input: DnsRecordRef, transport?: Transport, baseUrl?: string): Promise<void>;
296
+ export { deleteDnsRecord };
297
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/domains/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EAAE,SAAS,EAAoB,MAAM,qBAAqB,CAAC;AAElE,OAAO,EAAY,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAW5B,yBAAyB;AACzB,MAAM,MAAM,aAAa,GACvB,GAAG,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,IAAI,GAAG,KAAK,GAAG,KAAK,GAAG,IAAI,CAAC;AAEjE,MAAM,WAAW,UAAU;IACzB,wEAAwE;IACxE,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,yDAAyD;AACzD,MAAM,WAAW,kBAAkB;IACjC,wCAAwC;IACxC,UAAU,E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,CAAC,SAAS,CAAC,CAUpB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,eAAe,CACnC,KAAK,EAAE,oBAAoB,EAC3B,SAAS,GAAE,SAA8B,EACzC,OAAO,SAAmB,GACzB,OAAO,CAAC,SAAS,CAAC,CAkBpB;AAED;;;;;;;;;;GAUG;AACH,iBAAe,eAAe,CAC5B,KAAK,EAAE,YAAY,EACnB,SAAS,GAAE,SAA8B,EACzC,OAAO,SAAmB,GACzB,OAAO,CAAC,IAAI,CAAC,CAUf;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -0,0 +1,348 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DomainsHttpError = void 0;
4
+ exports.check = check;
5
+ exports.register = register;
6
+ exports.renew = renew;
7
+ exports.list = list;
8
+ exports.get = get;
9
+ exports.transferOut = transferOut;
10
+ exports.createDnsRecord = createDnsRecord;
11
+ exports.listDnsRecords = listDnsRecords;
12
+ exports.getDnsRecord = getDnsRecord;
13
+ exports.updateDnsRecord = updateDnsRecord;
14
+ exports.deleteDnsRecord = deleteDnsRecord;
15
+ /**
16
+ * `domains` capability — register domain names and manage their DNS. Check what's
17
+ * available and its price, buy a domain for a year, renew it, list and inspect the
18
+ * domains you own, and start a transfer out. A nested `dns` group creates, reads,
19
+ * updates, and deletes DNS records on a domain you own.
20
+ *
21
+ * import { domains } from "@sapiom/tools"; // ambient auth
22
+ *
23
+ * const [candidate] = await domains.check({ domainNames: ["my-app.dev"] });
24
+ * if (candidate.available) {
25
+ * await domains.register({ domainName: "my-app.dev" }); // charges apply
26
+ * await domains.dns.create({
27
+ * domainName: "my-app.dev",
28
+ * type: "A",
29
+ * host: "", // "" = the root domain
30
+ * value: "203.0.113.10",
31
+ * });
32
+ * }
33
+ *
34
+ * Or via an explicit client: `createClient({ apiKey }).domains.register(...)`.
35
+ *
36
+ * Operations are grouped:
37
+ * - top-level — check / register / renew / list / get / transferOut
38
+ * - `dns` — create / list / get / update / delete DNS records
39
+ *
40
+ * `register` and `renew` charge on success. Failed requests throw
41
+ * {@link DomainsHttpError} (carries `status` + parsed `body`).
42
+ */
43
+ const index_js_1 = require("../_client/index.js");
44
+ const service_url_js_1 = require("../_client/service-url.js");
45
+ const errors_js_1 = require("./errors.js");
46
+ Object.defineProperty(exports, "DomainsHttpError", { enumerable: true, get: function () { return errors_js_1.DomainsHttpError; } });
47
+ const DEFAULT_BASE_URL = (0, service_url_js_1.resolveServiceUrl)("namecom", process.env.SAPIOM_DOMAINS_URL);
48
+ function mapAvailability(raw) {
49
+ return {
50
+ domainName: raw.domainName,
51
+ available: raw.available,
52
+ ...(raw.purchasePrice != null && { purchasePrice: raw.purchasePrice }),
53
+ ...(raw.renewalPrice != null && { renewalPrice: raw.renewalPrice }),
54
+ ...(raw.premium !== undefined && { premium: raw.premium }),
55
+ };
56
+ }
57
+ function mapDomain(raw) {
58
+ return {
59
+ domainName: raw.domainName,
60
+ ...(raw.status !== undefined && { status: raw.status }),
61
+ ...(raw.expiresAt !== undefined && { expiresAt: raw.expiresAt }),
62
+ ...(raw.registeredAt !== undefined && { registeredAt: raw.registeredAt }),
63
+ ...(raw.purchasePrice != null && { purchasePrice: raw.purchasePrice }),
64
+ ...(raw.renewalPrice != null && { renewalPrice: raw.renewalPrice }),
65
+ ...(raw.nameservers !== undefined && { nameservers: raw.nameservers }),
66
+ ...(raw.locked !== undefined && { locked: raw.locked }),
67
+ ...(raw.premium !== undefined && { premium: raw.premium }),
68
+ ...(raw.tld !== undefined && { tld: raw.tld }),
69
+ ...(raw.transferEligibleAt !== undefined && {
70
+ transferEligibleAt: raw.transferEligibleAt,
71
+ }),
72
+ };
73
+ }
74
+ function mapDomainTransfer(raw) {
75
+ return {
76
+ domainName: raw.domainName,
77
+ ...(raw.authCode != null && { authCode: raw.authCode }),
78
+ ...(raw.transferInstructions != null && {
79
+ transferInstructions: raw.transferInstructions,
80
+ }),
81
+ };
82
+ }
83
+ function mapDnsRecord(raw) {
84
+ return {
85
+ recordId: raw.id,
86
+ domainName: raw.domainName,
87
+ type: raw.type,
88
+ host: raw.host,
89
+ ...(raw.fqdn != null && { fqdn: raw.fqdn }),
90
+ value: raw.value,
91
+ ttl: raw.ttl,
92
+ ...(raw.priority != null && { priority: raw.priority }),
93
+ ...(raw.createdAt != null && { createdAt: raw.createdAt }),
94
+ };
95
+ }
96
+ // ===========================================================================
97
+ // Guards & request shaping
98
+ // ===========================================================================
99
+ /**
100
+ * Guard a required string (a domain name / record id) client-side, so a JS caller
101
+ * passing null / undefined / "" gets a clear error instead of a confusing request
102
+ * to a malformed path.
103
+ */
104
+ function assertString(value, label) {
105
+ if (typeof value !== "string" || value.trim() === "") {
106
+ throw new errors_js_1.DomainsHttpError(`${label} is required and must be a non-empty string`, 400, undefined);
107
+ }
108
+ return value;
109
+ }
110
+ /** Percent-encode a single path segment (a domain name is one segment; dots are preserved). */
111
+ function encodeSegment(value) {
112
+ return encodeURIComponent(value);
113
+ }
114
+ /** Copy a value onto `body` only when it is neither undefined nor null. */
115
+ function set(body, key, value) {
116
+ if (value !== undefined && value !== null)
117
+ body[key] = value;
118
+ }
119
+ const JSON_HEADERS = { "content-type": "application/json" };
120
+ // ===========================================================================
121
+ // Domains — operations
122
+ // ===========================================================================
123
+ /**
124
+ * Check whether one or more domain names are available and get their price. Free.
125
+ * Use this first, in a workflow step that turns an idea into candidate names,
126
+ * before deciding what to `register`.
127
+ *
128
+ * @param input - `{ domainNames }` — 1 to 50 names to check.
129
+ * @returns One availability result per name (with pricing when available).
130
+ * @throws {DomainsHttpError} on a non-2xx response.
131
+ *
132
+ * @example
133
+ * const results = await domains.check({ domainNames: ["my-app.dev", "my-app.io"] });
134
+ * const buyable = results.filter((r) => r.available);
135
+ */
136
+ async function check(input, transport = (0, index_js_1.defaultTransport)(), baseUrl = DEFAULT_BASE_URL) {
137
+ const domainNames = input?.domainNames;
138
+ if (!Array.isArray(domainNames) || domainNames.length === 0) {
139
+ throw new errors_js_1.DomainsHttpError("domainNames is required and must be a non-empty array", 400, undefined);
140
+ }
141
+ const res = await (0, errors_js_1.ensureOk)(await transport.fetch(`${baseUrl}/v1/domains/check`, {
142
+ method: "POST",
143
+ headers: JSON_HEADERS,
144
+ body: JSON.stringify({ domainNames }),
145
+ }), "Failed to check domain availability");
146
+ const raw = (await res.json());
147
+ return raw.results.map(mapAvailability);
148
+ }
149
+ /**
150
+ * Register (buy) a domain for one year. Charges apply on success and the purchase
151
+ * is not reversible. Use in a workflow step to acquire a brand's domain before
152
+ * configuring DNS or email for it; confirm availability and price with `check`
153
+ * first.
154
+ *
155
+ * @param input - `{ domainName }` — the domain to register.
156
+ * @returns The newly registered domain.
157
+ * @throws {DomainsHttpError} on a non-2xx response (e.g. already registered, or a price change).
158
+ *
159
+ * @example
160
+ * const domain = await domains.register({ domainName: "my-app.dev" });
161
+ */
162
+ async function register(input, transport = (0, index_js_1.defaultTransport)(), baseUrl = DEFAULT_BASE_URL) {
163
+ const domainName = assertString(input?.domainName, "domainName");
164
+ const res = await (0, errors_js_1.ensureOk)(await transport.fetch(`${baseUrl}/v1/domains`, {
165
+ method: "POST",
166
+ headers: JSON_HEADERS,
167
+ body: JSON.stringify({ domainName }),
168
+ }), `Failed to register domain '${domainName}'`);
169
+ return mapDomain((await res.json()));
170
+ }
171
+ /**
172
+ * Renew a domain you own for one more year. Charges apply on success. Use in a
173
+ * workflow step that keeps a domain from expiring; read the renewal price from
174
+ * `get` first if you want to check it.
175
+ *
176
+ * @param input - `{ domainName }` — the domain to renew.
177
+ * @returns The domain with its updated expiry.
178
+ * @throws {DomainsHttpError} on a non-2xx response (e.g. not owned, or a price change).
179
+ *
180
+ * @example
181
+ * const domain = await domains.renew({ domainName: "my-app.dev" });
182
+ */
183
+ async function renew(input, transport = (0, index_js_1.defaultTransport)(), baseUrl = DEFAULT_BASE_URL) {
184
+ const domainName = assertString(input?.domainName, "domainName");
185
+ const res = await (0, errors_js_1.ensureOk)(await transport.fetch(`${baseUrl}/v1/domains/${encodeSegment(domainName)}/renew`, { method: "POST", headers: JSON_HEADERS, body: "{}" }), `Failed to renew domain '${domainName}'`);
186
+ return mapDomain((await res.json()));
187
+ }
188
+ /**
189
+ * List the domains you own. Free. Use in a workflow step to discover or iterate
190
+ * over the domains available to configure.
191
+ *
192
+ * @returns Your domains, each with status, expiry, and renewal price.
193
+ * @throws {DomainsHttpError} on a non-2xx response.
194
+ *
195
+ * @example
196
+ * const owned = await domains.list();
197
+ */
198
+ async function list(transport = (0, index_js_1.defaultTransport)(), baseUrl = DEFAULT_BASE_URL) {
199
+ const res = await (0, errors_js_1.ensureOk)(await transport.fetch(`${baseUrl}/v1/domains`), "Failed to list domains");
200
+ const raw = (await res.json());
201
+ return raw.map(mapDomain);
202
+ }
203
+ /**
204
+ * Get full details for a domain you own — nameservers, lock status, renewal price,
205
+ * and transfer eligibility. Free. Use in a workflow step before changing DNS or
206
+ * starting a transfer, when you need the domain's current state.
207
+ *
208
+ * @param input - `{ domainName }` — the domain to look up.
209
+ * @returns The domain's details.
210
+ * @throws {DomainsHttpError} on a non-2xx response (e.g. not owned).
211
+ *
212
+ * @example
213
+ * const detail = await domains.get({ domainName: "my-app.dev" });
214
+ */
215
+ async function get(input, transport = (0, index_js_1.defaultTransport)(), baseUrl = DEFAULT_BASE_URL) {
216
+ const domainName = assertString(input?.domainName, "domainName");
217
+ const res = await (0, errors_js_1.ensureOk)(await transport.fetch(`${baseUrl}/v1/domains/${encodeSegment(domainName)}`), `Failed to get domain '${domainName}'`);
218
+ return mapDomain((await res.json()));
219
+ }
220
+ /**
221
+ * Start transferring a domain you own out to another registrar. Returns an auth
222
+ * code to hand the receiving registrar. Disruptive — this unlocks the domain and
223
+ * begins the transfer; use in a workflow step only when you intend to move the
224
+ * domain away.
225
+ *
226
+ * @param input - `{ domainName }` — the domain to transfer out.
227
+ * @returns The auth code and transfer instructions.
228
+ * @throws {DomainsHttpError} on a non-2xx response (e.g. not owned, or still transfer-locked).
229
+ *
230
+ * @example
231
+ * const { authCode } = await domains.transferOut({ domainName: "my-app.dev" });
232
+ */
233
+ async function transferOut(input, transport = (0, index_js_1.defaultTransport)(), baseUrl = DEFAULT_BASE_URL) {
234
+ const domainName = assertString(input?.domainName, "domainName");
235
+ const res = await (0, errors_js_1.ensureOk)(await transport.fetch(`${baseUrl}/v1/domains/${encodeSegment(domainName)}`, { method: "DELETE" }), `Failed to transfer out domain '${domainName}'`);
236
+ return mapDomainTransfer((await res.json()));
237
+ }
238
+ // ===========================================================================
239
+ // DNS records — operations
240
+ // ===========================================================================
241
+ /**
242
+ * Create a DNS record on a domain you own. Free. Use in a workflow step to point a
243
+ * domain at a host (A/AAAA/CNAME), route its email (MX), or add verification text
244
+ * (TXT). Use `host: ""` for the root domain, or a subdomain like "www".
245
+ *
246
+ * @param input - `{ domainName, type, host, value, ttl?, priority? }`.
247
+ * @returns The created record (with its `recordId`).
248
+ * @throws {DomainsHttpError} on a non-2xx response.
249
+ *
250
+ * @example
251
+ * const record = await domains.dns.create({
252
+ * domainName: "my-app.dev",
253
+ * type: "A",
254
+ * host: "",
255
+ * value: "203.0.113.10",
256
+ * });
257
+ */
258
+ async function createDnsRecord(input, transport = (0, index_js_1.defaultTransport)(), baseUrl = DEFAULT_BASE_URL) {
259
+ const domainName = assertString(input?.domainName, "domainName");
260
+ const body = {
261
+ type: input.type,
262
+ host: input.host,
263
+ value: input.value,
264
+ };
265
+ set(body, "ttl", input.ttl);
266
+ set(body, "priority", input.priority);
267
+ const res = await (0, errors_js_1.ensureOk)(await transport.fetch(`${baseUrl}/v1/domains/${encodeSegment(domainName)}/records`, { method: "POST", headers: JSON_HEADERS, body: JSON.stringify(body) }), `Failed to create DNS record on '${domainName}'`);
268
+ return mapDnsRecord((await res.json()));
269
+ }
270
+ /**
271
+ * List the DNS records on a domain you own. Free. Use in a workflow step to read
272
+ * the current records (e.g. to find a `recordId` to update or delete).
273
+ *
274
+ * @param input - `{ domainName }` — the domain whose records to list.
275
+ * @returns The domain's DNS records.
276
+ * @throws {DomainsHttpError} on a non-2xx response.
277
+ *
278
+ * @example
279
+ * const records = await domains.dns.list({ domainName: "my-app.dev" });
280
+ */
281
+ async function listDnsRecords(input, transport = (0, index_js_1.defaultTransport)(), baseUrl = DEFAULT_BASE_URL) {
282
+ const domainName = assertString(input?.domainName, "domainName");
283
+ const res = await (0, errors_js_1.ensureOk)(await transport.fetch(`${baseUrl}/v1/domains/${encodeSegment(domainName)}/records`), `Failed to list DNS records on '${domainName}'`);
284
+ const raw = (await res.json());
285
+ return raw.map(mapDnsRecord);
286
+ }
287
+ /**
288
+ * Get a single DNS record on a domain you own. Free. Use in a workflow step when
289
+ * you have a `recordId` and need the record's current values.
290
+ *
291
+ * @param input - `{ domainName, recordId }`.
292
+ * @returns The DNS record.
293
+ * @throws {DomainsHttpError} on a non-2xx response (e.g. record not found).
294
+ *
295
+ * @example
296
+ * const record = await domains.dns.get({ domainName: "my-app.dev", recordId });
297
+ */
298
+ async function getDnsRecord(input, transport = (0, index_js_1.defaultTransport)(), baseUrl = DEFAULT_BASE_URL) {
299
+ const domainName = assertString(input?.domainName, "domainName");
300
+ const recordId = assertString(input?.recordId, "recordId");
301
+ const res = await (0, errors_js_1.ensureOk)(await transport.fetch(`${baseUrl}/v1/domains/${encodeSegment(domainName)}/records/${encodeSegment(recordId)}`), `Failed to get DNS record '${recordId}'`);
302
+ return mapDnsRecord((await res.json()));
303
+ }
304
+ /**
305
+ * Update a DNS record on a domain you own. Free. Provide only the fields you want
306
+ * to change. Use in a workflow step to repoint a record (e.g. change an A record's
307
+ * IP) without recreating it.
308
+ *
309
+ * @param input - `{ domainName, recordId, type?, host?, value?, ttl?, priority? }`.
310
+ * @returns The updated record.
311
+ * @throws {DomainsHttpError} on a non-2xx response.
312
+ *
313
+ * @example
314
+ * const updated = await domains.dns.update({
315
+ * domainName: "my-app.dev",
316
+ * recordId,
317
+ * value: "198.51.100.7",
318
+ * });
319
+ */
320
+ async function updateDnsRecord(input, transport = (0, index_js_1.defaultTransport)(), baseUrl = DEFAULT_BASE_URL) {
321
+ const domainName = assertString(input?.domainName, "domainName");
322
+ const recordId = assertString(input?.recordId, "recordId");
323
+ const body = {};
324
+ set(body, "type", input.type);
325
+ set(body, "host", input.host);
326
+ set(body, "value", input.value);
327
+ set(body, "ttl", input.ttl);
328
+ set(body, "priority", input.priority);
329
+ const res = await (0, errors_js_1.ensureOk)(await transport.fetch(`${baseUrl}/v1/domains/${encodeSegment(domainName)}/records/${encodeSegment(recordId)}`, { method: "PUT", headers: JSON_HEADERS, body: JSON.stringify(body) }), `Failed to update DNS record '${recordId}'`);
330
+ return mapDnsRecord((await res.json()));
331
+ }
332
+ /**
333
+ * Delete a DNS record from a domain you own. Free. Use in a workflow step to
334
+ * remove a record you no longer need.
335
+ *
336
+ * @param input - `{ domainName, recordId }`.
337
+ * @returns Nothing.
338
+ * @throws {DomainsHttpError} on a non-2xx response.
339
+ *
340
+ * @example
341
+ * await domains.dns.delete({ domainName: "my-app.dev", recordId });
342
+ */
343
+ async function deleteDnsRecord(input, transport = (0, index_js_1.defaultTransport)(), baseUrl = DEFAULT_BASE_URL) {
344
+ const domainName = assertString(input?.domainName, "domainName");
345
+ const recordId = assertString(input?.recordId, "recordId");
346
+ await (0, errors_js_1.ensureOk)(await transport.fetch(`${baseUrl}/v1/domains/${encodeSegment(domainName)}/records/${encodeSegment(recordId)}`, { method: "DELETE" }), `Failed to delete DNS record '${recordId}'`);
347
+ }
348
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domains/index.ts"],"names":[],"mappings":";;;AAiUA,sBAuBC;AAeD,4BAeC;AAcD,sBAcC;AAYD,oBAUC;AAcD,kBAWC;AAeD,kCAcC;AAuBD,0CAsBC;AAaD,wCAcC;AAaD,oCAcC;AAkBD,0CAsBC;AA6BQ,0CAAe;AAtoBxB;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,kDAAkE;AA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