domani 0.4.14 → 1.0.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.
package/dist/index.js ADDED
@@ -0,0 +1,580 @@
1
+ /* eslint-disable */
2
+ // AUTO-GENERATED from the domani OpenAPI spec by scripts/generate-sdk.ts.
3
+ // Do not edit by hand - re-run `npx tsx scripts/generate-sdk.ts`.
4
+ /** Structured API error - mirrors the `apiError()` shape returned by the API. */
5
+ export class DomaniError extends Error {
6
+ status;
7
+ code;
8
+ hint;
9
+ documentation_url;
10
+ constructor(status, body) {
11
+ super(body?.error || body?.message || `Request failed with status ${status}`);
12
+ this.name = "DomaniError";
13
+ this.status = status;
14
+ this.code = body?.code || "ERROR";
15
+ this.hint = body?.hint;
16
+ this.documentation_url = body?.documentation_url;
17
+ }
18
+ }
19
+ const enc = encodeURIComponent;
20
+ // ─── Client ─────────────────────────────────────────
21
+ export class Domani {
22
+ apiKey;
23
+ baseUrl;
24
+ fetchImpl;
25
+ constructor(opts) {
26
+ if (!opts?.apiKey)
27
+ throw new Error("Domani: apiKey is required");
28
+ this.apiKey = opts.apiKey;
29
+ this.baseUrl = (opts.baseUrl || "https://domani.run").replace(/\/$/, "");
30
+ this.fetchImpl = opts.fetch || globalThis.fetch;
31
+ if (!this.fetchImpl)
32
+ throw new Error("Domani: no fetch implementation available (pass opts.fetch on older runtimes)");
33
+ }
34
+ async request(method, path, opts) {
35
+ let url = this.baseUrl + path;
36
+ if (opts?.query) {
37
+ const qs = new URLSearchParams();
38
+ for (const [k, v] of Object.entries(opts.query)) {
39
+ if (v === undefined || v === null)
40
+ continue;
41
+ if (Array.isArray(v))
42
+ v.forEach((item) => qs.append(k, String(item)));
43
+ else
44
+ qs.append(k, String(v));
45
+ }
46
+ const s = qs.toString();
47
+ if (s)
48
+ url += (url.includes("?") ? "&" : "?") + s;
49
+ }
50
+ const headers = { Authorization: `Bearer ${this.apiKey}` };
51
+ let bodyInit;
52
+ if (opts?.body !== undefined) {
53
+ headers["Content-Type"] = "application/json";
54
+ bodyInit = JSON.stringify(opts.body);
55
+ }
56
+ const res = await this.fetchImpl(url, { method, headers, body: bodyInit });
57
+ const text = await res.text();
58
+ let data = undefined;
59
+ if (text) {
60
+ try {
61
+ data = JSON.parse(text);
62
+ }
63
+ catch {
64
+ data = text;
65
+ }
66
+ }
67
+ if (!res.ok)
68
+ throw new DomaniError(res.status, data);
69
+ return data;
70
+ }
71
+ /** Add a mailbox alias (POST /api/emails/{address}/aliases) */
72
+ addMailboxAlias(address, body) {
73
+ return this.request("POST", `/api/emails/${enc(address)}/aliases`, { body });
74
+ }
75
+ /** Add a suppression (POST /api/suppressions) */
76
+ addSuppression(body) {
77
+ return this.request("POST", `/api/suppressions`, { body });
78
+ }
79
+ /** Purchase one or more domains (POST /api/domains/buy) */
80
+ buyDomain(body) {
81
+ return this.request("POST", `/api/domains/buy`, { body });
82
+ }
83
+ /** Cancel a backorder (DELETE /api/backorders/{id}) */
84
+ cancelBackorder(id) {
85
+ return this.request("DELETE", `/api/backorders/${enc(id)}`, undefined);
86
+ }
87
+ /** Cancel a broker request (DELETE /api/broker/{id}) */
88
+ cancelBrokerRequest(id) {
89
+ return this.request("DELETE", `/api/broker/${enc(id)}`, undefined);
90
+ }
91
+ /** Cancel a domain listing (DELETE /api/domains/{domain}/for-sale) */
92
+ cancelListing(domain) {
93
+ return this.request("DELETE", `/api/domains/${enc(domain)}/for-sale`, undefined);
94
+ }
95
+ /** Withdraw a negotiation (DELETE /api/negotiations/{id}) */
96
+ cancelNegotiation(id) {
97
+ return this.request("DELETE", `/api/negotiations/${enc(id)}`, undefined);
98
+ }
99
+ /** Check email DNS health (MX, SPF, DMARC, DKIM) (GET /api/domains/{domain}/email/check) */
100
+ checkEmail(domain) {
101
+ return this.request("GET", `/api/domains/${enc(domain)}/email/check`, undefined);
102
+ }
103
+ /** Pre-check transfer eligibility (GET /api/domains/transfer-check) */
104
+ checkTransferEligibility(query) {
105
+ return this.request("GET", `/api/domains/transfer-check`, { query });
106
+ }
107
+ /** Check inbound transfer status (GET /api/domains/{domain}/transfer-status) */
108
+ checkTransferStatus(domain) {
109
+ return this.request("GET", `/api/domains/${enc(domain)}/transfer-status`, undefined);
110
+ }
111
+ /** Clear domain catch-all (DELETE /api/domains/{domain}/email/catch-all) */
112
+ clearCatchAll(domain) {
113
+ return this.request("DELETE", `/api/domains/${enc(domain)}/email/catch-all`, undefined);
114
+ }
115
+ /** Stop forwarding a domain (DELETE /api/domains/{domain}/redirect) */
116
+ clearDomainRedirect(domain) {
117
+ return this.request("DELETE", `/api/domains/${enc(domain)}/redirect`, undefined);
118
+ }
119
+ /** Connect a domain to a hosting or email provider (POST /api/domains/{domain}/connect) */
120
+ connectDomain(domain, body) {
121
+ return this.request("POST", `/api/domains/${enc(domain)}/connect`, { body });
122
+ }
123
+ /** Place a backorder on a taken domain (POST /api/backorders) */
124
+ createBackorder(body) {
125
+ return this.request("POST", `/api/backorders`, { body });
126
+ }
127
+ /** Request acquisition of a taken domain (POST /api/broker) */
128
+ createBrokerRequest(body) {
129
+ return this.request("POST", `/api/broker`, { body });
130
+ }
131
+ /** Purchase an external domain (create deal) (POST /api/deals) */
132
+ createDeal(body) {
133
+ return this.request("POST", `/api/deals`, { body });
134
+ }
135
+ /** List a domain for sale (PUT /api/domains/{domain}/for-sale) */
136
+ createListing(domain, body) {
137
+ return this.request("PUT", `/api/domains/${enc(domain)}/for-sale`, { body });
138
+ }
139
+ /** Create a mailbox on domani.run (POST /api/email) */
140
+ createMailbox(body) {
141
+ return this.request("POST", `/api/email`, { body });
142
+ }
143
+ /** Create a mailbox (POST /api/emails) */
144
+ createMailboxByAddress(body) {
145
+ return this.request("POST", `/api/emails`, { body });
146
+ }
147
+ /** Create a new API token (POST /api/tokens) */
148
+ createToken(body) {
149
+ return this.request("POST", `/api/tokens`, { body });
150
+ }
151
+ /** Create webhook (POST /api/webhooks) */
152
+ createWebhook(body) {
153
+ return this.request("POST", `/api/webhooks`, { body });
154
+ }
155
+ /** Delete account and all associated data (DELETE /api/me) */
156
+ deleteAccount() {
157
+ return this.request("DELETE", `/api/me`, undefined);
158
+ }
159
+ /** Delete a mailbox (DELETE /api/emails/{address}) */
160
+ deleteMailboxByAddress(address, body) {
161
+ return this.request("DELETE", `/api/emails/${enc(address)}`, { body });
162
+ }
163
+ /** Delete a message (DELETE /api/emails/{address}/messages/{id}) */
164
+ deleteMessageByAddress(address, id) {
165
+ return this.request("DELETE", `/api/emails/${enc(address)}/messages/${enc(id)}`, undefined);
166
+ }
167
+ /** Bulk delete messages (POST /api/emails/{address}/messages/delete) */
168
+ deleteMessagesByAddress(address, body) {
169
+ return this.request("POST", `/api/emails/${enc(address)}/messages/delete`, { body });
170
+ }
171
+ /** Delete webhook (DELETE /api/webhooks/{id}) */
172
+ deleteWebhook(id) {
173
+ return this.request("DELETE", `/api/webhooks/${enc(id)}`, undefined);
174
+ }
175
+ /** Fast DNS-based domain existence check (GET /api/domains/dns-check) */
176
+ dnsCheck(query) {
177
+ return this.request("GET", `/api/domains/dns-check`, { query });
178
+ }
179
+ /** Finalize an agreed negotiation (pay) (POST /api/negotiations/{id}/finalize) */
180
+ finalizeNegotiation(id, body) {
181
+ return this.request("POST", `/api/negotiations/${enc(id)}/finalize`, { body });
182
+ }
183
+ /** Forward a message (POST /api/emails/{address}/messages/{id}/forward) */
184
+ forwardMessageByAddress(address, id, body) {
185
+ return this.request("POST", `/api/emails/${enc(address)}/messages/${enc(id)}/forward`, { body });
186
+ }
187
+ /** Get current account details (GET /api/me) */
188
+ getAccount() {
189
+ return this.request("GET", `/api/me`, undefined);
190
+ }
191
+ /** Get EPP auth code (GET /api/domains/{domain}/auth-code) */
192
+ getAuthCode(domain) {
193
+ return this.request("GET", `/api/domains/${enc(domain)}/auth-code`, undefined);
194
+ }
195
+ /** Get a backorder (GET /api/backorders/{id}) */
196
+ getBackorder(id) {
197
+ return this.request("GET", `/api/backorders/${enc(id)}`, undefined);
198
+ }
199
+ /** Read a broker inquiry's state (owner side) (GET /api/broker/respond) */
200
+ getBrokerInquiryState(query) {
201
+ return this.request("GET", `/api/broker/respond`, { query });
202
+ }
203
+ /** Get a broker request (GET /api/broker/{id}) */
204
+ getBrokerRequest(id) {
205
+ return this.request("GET", `/api/broker/${enc(id)}`, undefined);
206
+ }
207
+ /** Get registrant contact info (GET /api/me/contact) */
208
+ getContact() {
209
+ return this.request("GET", `/api/me/contact`, undefined);
210
+ }
211
+ /** Get deal detail with timeline (GET /api/deals/{id}) */
212
+ getDeal(id) {
213
+ return this.request("GET", `/api/deals/${enc(id)}`, undefined);
214
+ }
215
+ /** Get a deal receipt / statement (GET /api/deals/{id}/invoice) */
216
+ getDealInvoice(id) {
217
+ return this.request("GET", `/api/deals/${enc(id)}/invoice`, undefined);
218
+ }
219
+ /** Get DNS records for a domain you own (GET /api/domains/{domain}/dns) */
220
+ getDnsRecords(domain) {
221
+ return this.request("GET", `/api/domains/${enc(domain)}/dns`, undefined);
222
+ }
223
+ /** Check email DNS status (GET /api/domains/{domain}/email/status) */
224
+ getDomainEmailStatus(domain) {
225
+ return this.request("GET", `/api/domains/${enc(domain)}/email/status`, undefined);
226
+ }
227
+ /** Get detailed information about a domain you own (GET /api/domains/{domain}) */
228
+ getDomainInfo(domain) {
229
+ return this.request("GET", `/api/domains/${enc(domain)}`, undefined);
230
+ }
231
+ /** Get website preview metadata for a domain (GET /api/domains/{domain}/og) */
232
+ getDomainOg(domain) {
233
+ return this.request("GET", `/api/domains/${enc(domain)}/og`, undefined);
234
+ }
235
+ /** Check domain health: DNS, SSL, email, expiry (GET /api/domains/{domain}/status) */
236
+ getDomainStatus(domain) {
237
+ return this.request("GET", `/api/domains/${enc(domain)}/status`, undefined);
238
+ }
239
+ /** Get mailbox avatar info (GET /api/emails/{address}/avatar) */
240
+ getMailboxAvatarByAddress(address) {
241
+ return this.request("GET", `/api/emails/${enc(address)}/avatar`, undefined);
242
+ }
243
+ /** Get mailbox details (GET /api/emails/{address}) */
244
+ getMailboxByAddress(address) {
245
+ return this.request("GET", `/api/emails/${enc(address)}`, undefined);
246
+ }
247
+ /** Get mailbox webhook config (GET /api/emails/{address}/webhook) */
248
+ getMailboxWebhook(address) {
249
+ return this.request("GET", `/api/emails/${enc(address)}/webhook`, undefined);
250
+ }
251
+ /** Get a message (GET /api/emails/{address}/messages/{id}) */
252
+ getMessageByAddress(address, id) {
253
+ return this.request("GET", `/api/emails/${enc(address)}/messages/${enc(id)}`, undefined);
254
+ }
255
+ /** Get nameservers for a domain (GET /api/domains/{domain}/nameservers) */
256
+ getNameservers(domain) {
257
+ return this.request("GET", `/api/domains/${enc(domain)}/nameservers`, undefined);
258
+ }
259
+ /** Get a negotiation thread (GET /api/negotiations/{id}) */
260
+ getNegotiation(id) {
261
+ return this.request("GET", `/api/negotiations/${enc(id)}`, undefined);
262
+ }
263
+ /** Get notification preferences (GET /api/notifications/preferences) */
264
+ getNotificationPreferences() {
265
+ return this.request("GET", `/api/notifications/preferences`, undefined);
266
+ }
267
+ /** Get parking analytics (GET /api/domains/{domain}/analytics) */
268
+ getParkingAnalytics(domain) {
269
+ return this.request("GET", `/api/domains/${enc(domain)}/analytics`, undefined);
270
+ }
271
+ /** Get marketplace payout status (GET /api/billing/connect) */
272
+ getPayoutStatus() {
273
+ return this.request("GET", `/api/billing/connect`, undefined);
274
+ }
275
+ /** Get referral earnings and history (GET /api/referrals) */
276
+ getReferrals() {
277
+ return this.request("GET", `/api/referrals`, undefined);
278
+ }
279
+ /** Check listing and deal status (GET /api/domains/sell/status) */
280
+ getSellStatus(query) {
281
+ return this.request("GET", `/api/domains/sell/status`, { query });
282
+ }
283
+ /** Get outbound transfer status (GET /api/domains/{domain}/transfer-away) */
284
+ getTransferAway(domain) {
285
+ return this.request("GET", `/api/domains/${enc(domain)}/transfer-away`, undefined);
286
+ }
287
+ /** Get unread notification count (GET /api/notifications/count) */
288
+ getUnreadCount() {
289
+ return this.request("GET", `/api/notifications/count`, undefined);
290
+ }
291
+ /** List webhook deliveries (GET /api/webhooks/{id}/deliveries) */
292
+ getWebhookDeliveries(id, query) {
293
+ return this.request("GET", `/api/webhooks/${enc(id)}/deliveries`, { query });
294
+ }
295
+ /** Import an external domain (POST /api/domains/import) */
296
+ importDomain(body) {
297
+ return this.request("POST", `/api/domains/import`, { body });
298
+ }
299
+ /** List your backorders (GET /api/backorders) */
300
+ listBackorders(query) {
301
+ return this.request("GET", `/api/backorders`, { query });
302
+ }
303
+ /** List your broker requests (GET /api/broker) */
304
+ listBrokerRequests(query) {
305
+ return this.request("GET", `/api/broker`, { query });
306
+ }
307
+ /** List available providers for connecting a domain (GET /api/domains/{domain}/connect) */
308
+ listConnectProviders(domain) {
309
+ return this.request("GET", `/api/domains/${enc(domain)}/connect`, undefined);
310
+ }
311
+ /** List your deals (GET /api/deals) */
312
+ listDeals(query) {
313
+ return this.request("GET", `/api/deals`, { query });
314
+ }
315
+ /** List all your registered domains (GET /api/domains) */
316
+ listDomains() {
317
+ return this.request("GET", `/api/domains`, undefined);
318
+ }
319
+ /** List emails (GET /api/emails/{address}/messages) */
320
+ listEmailMessagesByAddress(address, query) {
321
+ return this.request("GET", `/api/emails/${enc(address)}/messages`, { query });
322
+ }
323
+ /** List payment invoices (GET /api/billing/invoices) */
324
+ listInvoices(query) {
325
+ return this.request("GET", `/api/billing/invoices`, { query });
326
+ }
327
+ /** List mailbox aliases (GET /api/emails/{address}/aliases) */
328
+ listMailboxAliases(address) {
329
+ return this.request("GET", `/api/emails/${enc(address)}/aliases`, undefined);
330
+ }
331
+ /** List all mailboxes (GET /api/email) */
332
+ listMailboxes(query) {
333
+ return this.request("GET", `/api/email`, { query });
334
+ }
335
+ /** List all mailboxes (GET /api/emails) */
336
+ listMailboxesByAddress(query) {
337
+ return this.request("GET", `/api/emails`, { query });
338
+ }
339
+ /** List your negotiations (GET /api/negotiations) */
340
+ listNegotiations(query) {
341
+ return this.request("GET", `/api/negotiations`, { query });
342
+ }
343
+ /** List notifications (GET /api/notifications) */
344
+ listNotifications(query) {
345
+ return this.request("GET", `/api/notifications`, { query });
346
+ }
347
+ /** List suppressed addresses (GET /api/suppressions) */
348
+ listSuppressions(query) {
349
+ return this.request("GET", `/api/suppressions`, { query });
350
+ }
351
+ /** List all available TLDs with pricing (GET /api/tlds) */
352
+ listTlds(query) {
353
+ return this.request("GET", `/api/tlds`, { query });
354
+ }
355
+ /** List your API tokens (GET /api/tokens) */
356
+ listTokens() {
357
+ return this.request("GET", `/api/tokens`, undefined);
358
+ }
359
+ /** List supported services for domain verification (GET /api/domains/{domain}/verify-service) */
360
+ listVerifyServices(domain) {
361
+ return this.request("GET", `/api/domains/${enc(domain)}/verify-service`, undefined);
362
+ }
363
+ /** List webhook event types (GET /api/webhooks/events) */
364
+ listWebhookEvents() {
365
+ return this.request("GET", `/api/webhooks/events`, undefined);
366
+ }
367
+ /** List webhooks (GET /api/webhooks) */
368
+ listWebhooks() {
369
+ return this.request("GET", `/api/webhooks`, undefined);
370
+ }
371
+ /** Send a magic link sign-in email (POST /api/auth/login) */
372
+ loginUser(body) {
373
+ return this.request("POST", `/api/auth/login`, { body });
374
+ }
375
+ /** Make an offer on a listing (POST /api/negotiations) */
376
+ makeOffer(body) {
377
+ return this.request("POST", `/api/negotiations`, { body });
378
+ }
379
+ /** Mark all notifications as read (POST /api/notifications/read-all) */
380
+ markAllNotificationsRead() {
381
+ return this.request("POST", `/api/notifications/read-all`, undefined);
382
+ }
383
+ /** Mark messages as read or unread (PATCH /api/emails/{address}/messages/read) */
384
+ markMessagesReadByAddress(address, body) {
385
+ return this.request("PATCH", `/api/emails/${enc(address)}/messages/read`, { body });
386
+ }
387
+ /** Mark notification as read (PATCH /api/notifications/{id}) */
388
+ markNotificationRead(id, body) {
389
+ return this.request("PATCH", `/api/notifications/${enc(id)}`, { body });
390
+ }
391
+ /** Provide EPP/auth code (seller) (PATCH /api/deals/{id}) */
392
+ provideEppCode(id, body) {
393
+ return this.request("PATCH", `/api/deals/${enc(id)}`, { body });
394
+ }
395
+ /** Provision a complete agent identity in one call (POST /api/agents/provision) */
396
+ provisionAgent(body) {
397
+ return this.request("POST", `/api/agents/provision`, { body });
398
+ }
399
+ /** Create a new account (POST /api/auth/register) */
400
+ registerUser(body) {
401
+ return this.request("POST", `/api/auth/register`, { body });
402
+ }
403
+ /** Remove saved payment method (DELETE /api/billing/card) */
404
+ removeCard() {
405
+ return this.request("DELETE", `/api/billing/card`, undefined);
406
+ }
407
+ /** Remove email from a domain (DELETE /api/domains/{domain}/email/setup) */
408
+ removeDomainEmail(domain) {
409
+ return this.request("DELETE", `/api/domains/${enc(domain)}/email/setup`, undefined);
410
+ }
411
+ /** Remove a mailbox alias (DELETE /api/emails/{address}/aliases/{alias}) */
412
+ removeMailboxAlias(address, alias) {
413
+ return this.request("DELETE", `/api/emails/${enc(address)}/aliases/${enc(alias)}`, undefined);
414
+ }
415
+ /** Remove mailbox webhook (DELETE /api/emails/{address}/webhook) */
416
+ removeMailboxWebhook(address) {
417
+ return this.request("DELETE", `/api/emails/${enc(address)}/webhook`, undefined);
418
+ }
419
+ /** Remove a suppression (DELETE /api/suppressions/{address}) */
420
+ removeSuppression(address) {
421
+ return this.request("DELETE", `/api/suppressions/${enc(address)}`, undefined);
422
+ }
423
+ /** Renew a domain (POST /api/domains/{domain}/renew) */
424
+ renewDomain(domain, body) {
425
+ return this.request("POST", `/api/domains/${enc(domain)}/renew`, { body });
426
+ }
427
+ /** Reply to a message (POST /api/emails/{address}/messages/{id}/reply) */
428
+ replyToMessageByAddress(address, id, body) {
429
+ return this.request("POST", `/api/emails/${enc(address)}/messages/${enc(id)}/reply`, { body });
430
+ }
431
+ /** Resend contact email verification (POST /api/me/resend-verification) */
432
+ resendEmailVerification(body) {
433
+ return this.request("POST", `/api/me/resend-verification`, { body });
434
+ }
435
+ /** Respond to a broker inquiry (owner side) (POST /api/broker/respond) */
436
+ respondToBrokerInquiry(body) {
437
+ return this.request("POST", `/api/broker/respond`, { body });
438
+ }
439
+ /** Counter, accept, or decline (POST /api/negotiations/{id}) */
440
+ respondToNegotiation(id, body) {
441
+ return this.request("POST", `/api/negotiations/${enc(id)}`, { body });
442
+ }
443
+ /** Restore DNS from a snapshot (POST /api/domains/{domain}/dns/restore) */
444
+ restoreDns(domain, body) {
445
+ return this.request("POST", `/api/domains/${enc(domain)}/dns/restore`, { body });
446
+ }
447
+ /** Revoke an API token (DELETE /api/tokens/{id}) */
448
+ revokeToken(id) {
449
+ return this.request("DELETE", `/api/tokens/${enc(id)}`, undefined);
450
+ }
451
+ /** Rotate webhook signing secret (POST /api/emails/{address}/webhook/rotate) */
452
+ rotateMailboxWebhookSecret(address) {
453
+ return this.request("POST", `/api/emails/${enc(address)}/webhook/rotate`, undefined);
454
+ }
455
+ /** Check availability and pricing for domains (GET /api/domains/search) */
456
+ search(query) {
457
+ return this.request("GET", `/api/domains/search`, { query });
458
+ }
459
+ /** List a domain for sale (open marketplace) (POST /api/domains/sell) */
460
+ sellDomain(body) {
461
+ return this.request("POST", `/api/domains/sell`, { body });
462
+ }
463
+ /** Send an email (POST /api/emails/{address}/send) */
464
+ sendEmailByAddress(address, body) {
465
+ return this.request("POST", `/api/emails/${enc(address)}/send`, { body });
466
+ }
467
+ /** Set domain catch-all (PUT /api/domains/{domain}/email/catch-all) */
468
+ setCatchAll(domain, body) {
469
+ return this.request("PUT", `/api/domains/${enc(domain)}/email/catch-all`, { body });
470
+ }
471
+ /** Set registrant contact info (PUT /api/me/contact) */
472
+ setContact(body) {
473
+ return this.request("PUT", `/api/me/contact`, { body });
474
+ }
475
+ /** Set DNS records for a domain you own (PUT /api/domains/{domain}/dns) */
476
+ setDnsRecords(domain, body) {
477
+ return this.request("PUT", `/api/domains/${enc(domain)}/dns`, { body });
478
+ }
479
+ /** Forward a domain to a URL (PUT /api/domains/{domain}/redirect) */
480
+ setDomainRedirect(domain, body) {
481
+ return this.request("PUT", `/api/domains/${enc(domain)}/redirect`, { body });
482
+ }
483
+ /** Set mailbox webhook (PUT /api/emails/{address}/webhook) */
484
+ setMailboxWebhook(address, body) {
485
+ return this.request("PUT", `/api/emails/${enc(address)}/webhook`, { body });
486
+ }
487
+ /** Set nameservers for a domain (PUT /api/domains/{domain}/nameservers) */
488
+ setNameservers(domain, body) {
489
+ return this.request("PUT", `/api/domains/${enc(domain)}/nameservers`, { body });
490
+ }
491
+ /** Get checkout URL for adding a payment method (POST /api/billing/setup) */
492
+ setupBilling(body) {
493
+ return this.request("POST", `/api/billing/setup`, { body });
494
+ }
495
+ /** Set up email on a domain (POST /api/domains/{domain}/email/setup) */
496
+ setupDomainEmail(domain, body) {
497
+ return this.request("POST", `/api/domains/${enc(domain)}/email/setup`, { body });
498
+ }
499
+ /** Capture a DNS snapshot (POST /api/domains/{domain}/dns/snapshot) */
500
+ snapshotDns(domain, body) {
501
+ return this.request("POST", `/api/domains/${enc(domain)}/dns/snapshot`, { body });
502
+ }
503
+ /** Start bank payout onboarding (POST /api/billing/connect) */
504
+ startPayoutOnboarding() {
505
+ return this.request("POST", `/api/billing/connect`, undefined);
506
+ }
507
+ /** AI-powered domain suggestions with availability (GET /api/domains/suggest) */
508
+ suggestDomains(query) {
509
+ return this.request("GET", `/api/domains/suggest`, { query });
510
+ }
511
+ /** Test mailbox webhook (POST /api/emails/{address}/webhook/test) */
512
+ testMailboxWebhook(address) {
513
+ return this.request("POST", `/api/emails/${enc(address)}/webhook/test`, undefined);
514
+ }
515
+ /** Transfer domain from another provider (POST /api/domains/transfer) */
516
+ transferDomain(body) {
517
+ return this.request("POST", `/api/domains/transfer`, { body });
518
+ }
519
+ /** Update account preferences (PUT /api/me) */
520
+ updateAccount(body) {
521
+ return this.request("PUT", `/api/me`, { body });
522
+ }
523
+ /** Update domain settings (PUT /api/domains/{domain}/settings) */
524
+ updateDomainSettings(domain, body) {
525
+ return this.request("PUT", `/api/domains/${enc(domain)}/settings`, { body });
526
+ }
527
+ /** Update a domain listing (PATCH /api/domains/{domain}/for-sale) */
528
+ updateListing(domain, body) {
529
+ return this.request("PATCH", `/api/domains/${enc(domain)}/for-sale`, { body });
530
+ }
531
+ /** Update mailbox (PATCH /api/emails/{address}) */
532
+ updateMailboxByAddress(address, body) {
533
+ return this.request("PATCH", `/api/emails/${enc(address)}`, { body });
534
+ }
535
+ /** Update notification preferences (PUT /api/notifications/preferences) */
536
+ updateNotificationPreferences(body) {
537
+ return this.request("PUT", `/api/notifications/preferences`, { body });
538
+ }
539
+ /** Update parking settings (PUT /api/domains/{domain}/parking) */
540
+ updateParking(domain, body) {
541
+ return this.request("PUT", `/api/domains/${enc(domain)}/parking`, { body });
542
+ }
543
+ /** Update webhook (PATCH /api/webhooks/{id}) */
544
+ updateWebhook(id, body) {
545
+ return this.request("PATCH", `/api/webhooks/${enc(id)}`, { body });
546
+ }
547
+ /** Verify that a provider connection is working (POST /api/domains/{domain}/verify) */
548
+ verifyConnection(domain, body) {
549
+ return this.request("POST", `/api/domains/${enc(domain)}/verify`, { body });
550
+ }
551
+ /** Verify and complete domain import (POST /api/domains/import/verify) */
552
+ verifyImport(body) {
553
+ return this.request("POST", `/api/domains/import/verify`, { body });
554
+ }
555
+ /** Verify a magic link token (GET /api/auth/verify) */
556
+ verifyMagicLink(query) {
557
+ return this.request("GET", `/api/auth/verify`, { query });
558
+ }
559
+ /** Verify TXT ownership for external listing (POST /api/domains/sell/verify) */
560
+ verifySellListing(body) {
561
+ return this.request("POST", `/api/domains/sell/verify`, { body });
562
+ }
563
+ /** Add DNS records to verify domain ownership for a third-party service (POST /api/domains/{domain}/verify-service) */
564
+ verifyService(domain, body) {
565
+ return this.request("POST", `/api/domains/${enc(domain)}/verify-service`, { body });
566
+ }
567
+ /** Watch a domain for transfer eligibility (POST /api/domains/transfer-watch) */
568
+ watchTransfer(body) {
569
+ return this.request("POST", `/api/domains/transfer-watch`, { body });
570
+ }
571
+ /** Look up domain registration data via RDAP (GET /api/domains/whois) */
572
+ whoisLookup(query) {
573
+ return this.request("GET", `/api/domains/whois`, { query });
574
+ }
575
+ /** Withdraw marketplace balance to bank (POST /api/billing/connect/payout) */
576
+ withdrawBalance() {
577
+ return this.request("POST", `/api/billing/connect/payout`, undefined);
578
+ }
579
+ }
580
+ export default Domani;
package/package.json CHANGED
@@ -1,64 +1,44 @@
1
1
  {
2
2
  "name": "domani",
3
- "version": "0.4.14",
3
+ "version": "1.0.0",
4
+ "description": "Official TypeScript SDK for the domani API - domains, email, and identity for AI agents.",
4
5
  "type": "module",
5
- "description": "Domain infrastructure for AI agents. Search, register, DNS, email, connect - all from your terminal.",
6
- "license": "MIT",
7
- "author": "domani.run",
8
- "homepage": "https://domani.run",
9
- "repository": {
10
- "type": "git",
11
- "url": "git+https://github.com/gwendall/domani.git"
12
- },
13
- "bin": {
14
- "domani": "./dist/domani.cjs"
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js"
13
+ }
15
14
  },
16
15
  "files": [
17
- "dist/domani.cjs",
18
- "LICENSE",
19
- "README.md"
16
+ "dist"
20
17
  ],
21
- "engines": {
22
- "node": ">=18"
23
- },
24
18
  "scripts": {
25
- "build": "node build.mjs",
26
- "install:local": "node build.mjs && cp dist/domani.cjs $(which domani)",
27
- "typecheck": "tsc --noEmit",
28
- "test": "npx tsx --test src/__tests__/*.test.ts",
29
- "test:e2e": "npx tsx --test src/__tests__/e2e/*.test.ts",
30
- "test:e2e:full": "E2E_MUTATE=1 npx tsx --test src/__tests__/e2e/*.test.ts",
31
- "test:all": "npx tsx --test src/__tests__/*.test.ts src/__tests__/e2e/*.test.ts",
32
- "dev": "tsc --watch",
33
- "publish:npm": "node build.mjs && npm publish --access public"
19
+ "build": "tsc -p tsconfig.json",
20
+ "prepublishOnly": "npm run build"
21
+ },
22
+ "devDependencies": {
23
+ "typescript": "^5.9.0"
34
24
  },
35
25
  "keywords": [
36
- "domain",
26
+ "domani",
37
27
  "domains",
38
- "dns",
39
- "registrar",
40
- "cli",
41
28
  "email",
42
- "mcp",
43
- "ai-agent",
44
- "whois",
45
- "nameserver",
46
- "transfer",
47
- "ssl",
48
- "parking",
49
- "webhooks",
50
- "x402",
51
- "usdc"
29
+ "api",
30
+ "sdk",
31
+ "agents",
32
+ "mcp"
52
33
  ],
53
- "dependencies": {
54
- "@clack/prompts": "^1.0.1",
55
- "commander": "^13.1.0",
56
- "picocolors": "^1.1.1",
57
- "yocto-spinner": "^1.1.0"
34
+ "license": "MIT",
35
+ "repository": {
36
+ "type": "git",
37
+ "url": "git+https://github.com/gwendall/domani.git",
38
+ "directory": "sdk/ts"
58
39
  },
59
- "devDependencies": {
60
- "@types/node": "^20.0.0",
61
- "esbuild": "^0.27.3",
62
- "typescript": "^5.0.0"
40
+ "homepage": "https://domani.run",
41
+ "engines": {
42
+ "node": ">=18"
63
43
  }
64
44
  }